Start unifying heldUse and heldMods

This commit is contained in:
2024-09-15 10:54:24 +01:00
parent cde7bc9aef
commit 6f372109d9
33 changed files with 585 additions and 270 deletions
+88 -83
View File
@@ -1,94 +1,99 @@
/home/justin/Haskell/loop/src/Dodge/Default/Item/Use/AimParams.hs:16:26-45: error:
• Couldn't match expected type Muzzle
with actual type Int -> Muzzle
• Probable cause: Muzzle is applied to too few arguments
In the expression: Muzzle (V2 20 0) 0 0
In the _aimMuzzles field of a record
In the expression:
AimParams
{_aimWeight = 0, _aimTurnSpeed = 1, _aimRange = 0,
_aimZoom = defaultItZoom, _aimStance = OneHand,
_aimHandlePos = V2 3 0, _aimMuzzles = [Muzzle (V2 20 0) 0 0]}
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:(32,25)-(316,68): warning: [-Wincomplete-patterns]
Pattern match(es) are non-exhaustive
In a case alternative:
Patterns not matched:
FireRemoteShellMod
ExplodeRemoteShellMod
DoNothingMod
ForceFieldMod
...
|
16 | , _aimMuzzles = [Muzzle (V2 20 0) 0 0]
| ^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:345:12-14: warning: [-Wunused-matches]
Defined but not used: eff
32 | heldEffect effecttype = case effecttype of
| ^^^^^^^^^^^^^^^^^^...
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:325:5-18: warning: [-Wunused-local-binds]
Defined but not used: directedTelPos
|
345 | useAllAmmo eff item cr w = error "use all ammo"
| ^^^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:345:16-19: warning: [-Wunused-matches]
Defined but not used: item
325 | directedTelPos _ cr w = (p, a)
| ^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:335:1-9: warning: [-Wmissing-signatures]
Top-level binding with no type signature:
gasEffect :: [(LabelDoubleTree ComposeLinkType Item
-> Creature -> World -> World)
-> LabelDoubleTree ComposeLinkType Item
-> Creature
-> World
-> World]
-> LabelDoubleTree ComposeLinkType Item
-> Creature
-> World
-> World
|
345 | useAllAmmo eff item cr w = error "use all ammo"
| ^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:345:21-22: warning: [-Wunused-matches]
335 | gasEffect = foldl' (&) (overNozzles useGasParams)
| ^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:337:1-15: warning: [-Wmissing-signatures]
Top-level binding with no type signature:
bulletGunEffect :: [(LabelDoubleTree ComposeLinkType Item
-> Creature -> World -> World)
-> LabelDoubleTree ComposeLinkType Item
-> Creature
-> World
-> World]
-> LabelDoubleTree ComposeLinkType Item
-> Creature
-> World
-> World
|
337 | bulletGunEffect = foldl' (&) shootBullet
| ^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:(342,13)-(644,9): warning: [-Wincomplete-patterns]
Pattern match(es) are non-exhaustive
In a case alternative:
Patterns not matched:
TractorMod
FireRemoteShellMod
ExplodeRemoteShellMod
DoNothingMod
...
|
342 | useMod hm = case hm of
| ^^^^^^^^^^...
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:649:5-26: warning: [-Wunused-local-binds]
Defined but not used: increasecycleLasCircle
|
649 | increasecycleLasCircle it = it & itParams . lasCycle %~ (flip mod 2000 . (+ 1))
| ^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:651:5-14: warning: [-Wunused-local-binds]
Defined but not used: fLasCircle
|
651 | fLasCircle it = [it & itParams . lasCycle +~ x | x <- [0, 50 .. 1999]]
| ^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:656:5-18: warning: [-Wunused-local-binds]
Defined but not used: directedTelPos
|
656 | directedTelPos _ cr w = (p, a)
| ^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:703:16-18: warning: [-Wunused-matches]
Defined but not used: itm
|
703 | usePjCreationX itm cr = undefined
| ^^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:703:20-21: warning: [-Wunused-matches]
Defined but not used: cr
|
345 | useAllAmmo eff item cr w = error "use all ammo"
| ^^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:345:24: warning: [-Wunused-matches]
Defined but not used: w
|
345 | useAllAmmo eff item cr w = error "use all ammo"
| ^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:671:17-19: warning: [-Wunused-matches]
Defined but not used: eff
|
671 | duplicateLoaded eff it cr w = error "duplicateLoaded"
| ^^^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:671:21-22: warning: [-Wunused-matches]
703 | usePjCreationX itm cr = undefined
| ^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:778:17-18: warning: [-Wunused-matches]
Defined but not used: it
|
671 | duplicateLoaded eff it cr w = error "duplicateLoaded"
| ^^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:671:24-25: warning: [-Wunused-matches]
778 | fireRemoteShell it cr w = undefined
| ^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:778:20-21: warning: [-Wunused-matches]
Defined but not used: cr
|
671 | duplicateLoaded eff it cr w = error "duplicateLoaded"
| ^^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:671:27: warning: [-Wunused-matches]
778 | fireRemoteShell it cr w = undefined
| ^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:778:23: warning: [-Wunused-matches]
Defined but not used: w
|
671 | duplicateLoaded eff it cr w = error "duplicateLoaded"
| ^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:681:21: warning: [-Wunused-matches]
Defined but not used: n
|
681 | duplicateNumBarrels n eff itm cr w = error "duplicateNumBarrels"
| ^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:681:23-25: warning: [-Wunused-matches]
Defined but not used: eff
|
681 | duplicateNumBarrels n eff itm cr w = error "duplicateNumBarrels"
| ^^^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:681:27-29: warning: [-Wunused-matches]
Defined but not used: itm
|
681 | duplicateNumBarrels n eff itm cr w = error "duplicateNumBarrels"
| ^^^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:681:31-32: warning: [-Wunused-matches]
Defined but not used: cr
|
681 | duplicateNumBarrels n eff itm cr w = error "duplicateNumBarrels"
| ^^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:681:34: warning: [-Wunused-matches]
Defined but not used: w
|
681 | duplicateNumBarrels n eff itm cr w = error "duplicateNumBarrels"
| ^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:697:24-26: warning: [-Wunused-matches]
Defined but not used: eff
|
697 | duplicateLoadedBarrels eff itm cr = error "duplicateLoadedBarrels"
| ^^^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:697:28-30: warning: [-Wunused-matches]
Defined but not used: itm
|
697 | duplicateLoadedBarrels eff itm cr = error "duplicateLoadedBarrels"
| ^^^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:697:32-33: warning: [-Wunused-matches]
Defined but not used: cr
|
697 | duplicateLoadedBarrels eff itm cr = error "duplicateLoadedBarrels"
| ^^
778 | fireRemoteShell it cr w = undefined
| ^
+46 -60
View File
@@ -80,34 +80,32 @@ digraph {
101 [shape=box
,label="HELD {_ibtHeld = LASWIDE {_xNum = 2}}"];
103 [shape=box
,label="HELD {_ibtHeld = LASCIRCLE}"];
105 [shape=box
,label="HELD {_ibtHeld = SPARKGUN}"];
107 [shape=box
105 [shape=box
,label="HELD {_ibtHeld = TESLAGUN}"];
109 [shape=box
107 [shape=box
,label="LEFT {_ibtLeft = BLINKER}"];
112 [shape=box
110 [shape=box
,label="LEFT {_ibtLeft = BLINKERUNSAFE}"];
114 [shape=box
112 [shape=box
,label="EQUIP {_ibtEquip = MAGSHIELD}"];
117 [shape=box
115 [shape=box
,label="EQUIP {_ibtEquip = POWERLEGS}"];
123 [shape=box
121 [shape=box
,label="HELD {_ibtHeld = FLATSHIELD}"];
133 [shape=box
131 [shape=box
,label="EQUIP {_ibtEquip = AUTODETECTOR ITEMDETECTOR}"];
136 [shape=box
134 [shape=box
,label="EQUIP {_ibtEquip = AUTODETECTOR WALLDETECTOR}"];
138 [shape=box
136 [shape=box
,label="EQUIP {_ibtEquip = AUTODETECTOR CREATUREDETECTOR}"];
140 [shape=box
138 [shape=box
,label="HELD {_ibtHeld = TORCH}"];
141 [shape=box
139 [shape=box
,label="AMMOMAG {_ibtAmmoMag = BATTERY}"];
144 [shape=box
142 [shape=box
,label="EQUIP {_ibtEquip = HEADLAMP}"];
152 [shape=box
150 [shape=box
,label="HELD {_ibtHeld = BANGSTICK {_xNum = 2}}"];
}
subgraph 2 {
@@ -153,21 +151,21 @@ digraph {
102 [shape=point];
104 [shape=point];
106 [shape=point];
108 [shape=point];
109 [shape=point];
111 [shape=point];
113 [shape=point];
116 [shape=point];
114 [shape=point];
117 [shape=point];
118 [shape=point];
119 [shape=point];
120 [shape=point];
121 [shape=point];
122 [shape=point];
124 [shape=point];
126 [shape=point];
129 [shape=point];
132 [shape=point];
127 [shape=point];
130 [shape=point];
133 [shape=point];
135 [shape=point];
137 [shape=point];
139 [shape=point];
141 [shape=point];
143 [shape=point];
145 [shape=point];
147 [shape=point];
@@ -176,7 +174,6 @@ digraph {
153 [shape=point];
155 [shape=point];
157 [shape=point];
159 [shape=point];
}
0 -> 1 [xlabel="",tailport=e];
2 -> 0 [xlabel=1
@@ -204,7 +201,7 @@ digraph {
16 -> 27 [xlabel=1
,arrowhead=onone
,headport=w];
16 -> 143 [xlabel=1
16 -> 141 [xlabel=1
,arrowhead=onone
,headport=w];
18 -> 19 [xlabel="",tailport=e];
@@ -228,15 +225,15 @@ digraph {
35 -> 56 [xlabel=1
,arrowhead=onone
,headport=w];
35 -> 151 [xlabel=1
35 -> 149 [xlabel=1
,arrowhead=onone
,headport=w];
35 -> 153 [xlabel=1
,arrowhead=onone
,headport=w];
35 -> 155 [xlabel=1
,arrowhead=onone
,headport=w];
35 -> 157 [xlabel=1
,arrowhead=onone
,headport=w];
38 -> 39 [xlabel="",tailport=e];
39 -> 40 [xlabel=1
,arrowhead=onone
@@ -259,7 +256,7 @@ digraph {
,arrowhead=onone
,headport=w];
52 -> 53 [xlabel="",tailport=e];
53 -> 159 [xlabel=1
53 -> 157 [xlabel=1
,arrowhead=onone
,headport=w];
54 -> 55 [xlabel="",tailport=e];
@@ -273,7 +270,7 @@ digraph {
57 -> 64 [xlabel=1
,arrowhead=onone
,headport=w];
57 -> 155 [xlabel=1
57 -> 153 [xlabel=1
,arrowhead=onone
,headport=w];
58 -> 59 [xlabel="",tailport=e];
@@ -286,7 +283,7 @@ digraph {
60 -> 61 [xlabel="",tailport=e];
62 -> 63 [xlabel="",tailport=e];
64 -> 65 [xlabel="",tailport=e];
65 -> 157 [xlabel=1
65 -> 155 [xlabel=1
,arrowhead=onone
,headport=w];
67 -> 68 [xlabel="",tailport=e];
@@ -337,65 +334,54 @@ digraph {
95 -> 100 [xlabel=1
,arrowhead=onone
,headport=w];
95 -> 102 [xlabel=1
,arrowhead=onone
,headport=w];
95 -> 102 [xlabel=1
,arrowhead=onone
,headport=w];
95 -> 102 [xlabel=1
,arrowhead=onone
,headport=w];
98 -> 99 [xlabel="",tailport=e];
100 -> 101 [xlabel=""
,tailport=e];
101 -> 149 [xlabel=1
101 -> 147 [xlabel=1
,arrowhead=onone
,headport=w];
102 -> 103 [xlabel=""
,tailport=e];
103 -> 104 [xlabel=1
,arrowhead=onone
,headport=w];
104 -> 105 [xlabel=""
,tailport=e];
105 -> 106 [xlabel=1
,arrowhead=onone
,headport=w];
106 -> 107 [xlabel=""
,tailport=e];
108 -> 109 [xlabel=""
,tailport=e];
109 -> 111 [xlabel=1
107 -> 109 [xlabel=1
,arrowhead=onone
,headport=w];
109 -> 110 [xlabel=""
,tailport=e];
111 -> 112 [xlabel=""
,tailport=e];
113 -> 114 [xlabel=""
114 -> 115 [xlabel=""
,tailport=e];
116 -> 117 [xlabel=""
120 -> 121 [xlabel=""
,tailport=e];
122 -> 123 [xlabel=""
130 -> 131 [xlabel=""
,tailport=e];
132 -> 133 [xlabel=""
133 -> 134 [xlabel=""
,tailport=e];
135 -> 136 [xlabel=""
,tailport=e];
137 -> 138 [xlabel=""
,tailport=e];
139 -> 140 [xlabel=""
,tailport=e];
140 -> 143 [xlabel=1
138 -> 141 [xlabel=1
,arrowhead=onone
,headport=w];
141 -> 139 [xlabel=1
139 -> 137 [xlabel=1
,arrowhead=onone
,headport=w];
141 -> 147 [xlabel=1
139 -> 145 [xlabel=1
,arrowhead=onone
,headport=w];
143 -> 144 [xlabel=""
141 -> 142 [xlabel=""
,tailport=e];
151 -> 152 [xlabel=""
149 -> 150 [xlabel=""
,tailport=e];
152 -> 153 [xlabel=1
150 -> 151 [xlabel=1
,arrowhead=onone
,headport=w];
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+18 -18
View File
@@ -89,7 +89,7 @@ itemCombinations =
, p [o $ cr PRISM, o $ cr TRANSFORMER, o $ cr PIPE] lasGun
, po [HELD LASGUN, HELD LASGUN, cr HARDWARE] dualBeam
, po [HELD LASGUN, cr TRANSFORMER] (lasWide 2)
, po [HELD LASGUN, HELD LASGUN, HELD LASGUN, cr HARDWARE] lasCircle
-- , po [HELD LASGUN, HELD LASGUN, HELD LASGUN, cr HARDWARE] lasCircle
, p [o $ cr TRANSFORMER, p 2 $ cr CAN] sparkGun
, p [o (HELD SPARKGUN), p 2 $ cr PIPE] teslaGun
, p [o $ cr TELEPORTMODULE, p 2 $ cr MICROCHIP] blinkGun
@@ -201,13 +201,13 @@ moduleCombinations =
, amod [cr (ENERGYBALLCRAFT TeslaBall)] STATICLAS
]
)
,
( ModTeleport
, teleportableWeapons
,
[ amod [cr TELEPORTMODULE, cr MICROCHIP] WEPTELE
]
)
-- ,
-- ( ModTeleport
-- , teleportableWeapons
-- ,
-- [ amod [cr TELEPORTMODULE, cr MICROCHIP] WEPTELE
-- ]
-- )
,
( ModLauncherHoming
, homingLaunchers
@@ -224,17 +224,17 @@ moduleCombinations =
homingLaunchers :: [Item]
homingLaunchers = launcher : [launcherX i | i <- [2 .. 10]]
batteryGuns :: [Item]
batteryGuns =
[ teslaGun
, sparkGun
, lasGun
]
++ [ lasWide i | i <- [2 .. 10]
]
--batteryGuns :: [Item]
--batteryGuns =
-- [ teslaGun
-- , sparkGun
-- , lasGun
-- ]
-- ++ [ lasWide i | i <- [2 .. 10]
-- ]
teleportableWeapons :: [Item]
teleportableWeapons = bulletWeapons ++ batteryGuns ++ homingLaunchers
--teleportableWeapons :: [Item]
--teleportableWeapons = bulletWeapons ++ batteryGuns ++ homingLaunchers
bulletMagazines :: [Item]
bulletMagazines =
+7 -8
View File
@@ -30,18 +30,17 @@ moduleModification imt = case imt of
STATICLAS ->
(itParams . lasBeam .~ BeamCombine TeslaBeamCombine)
. (itParams . subParams ?~ teslaParams)
WEPTELE -> makeDirectedTele
-- WEPTELE -> makeDirectedTele
--LAUNCHHOME -> itUse . heldConsumption . laAmmoType . amPjCreation .~ CreateTrackingShell
LAUNCHHOME -> id
ATTACHTORCH -> id
where
makeDirectedTele it =
it
-- & itUse . useTargeting ?~ TargetRBPress
& itUse . heldMods %~ ModWithDirectedTeleport -- .:~ withPosDirWallCheck directedTelPos
-- for the camera: the simplest option is to remove all zoom/offset
& itUse . heldAim . aimZoom . izFac .~ 1
& itUse . heldAim . aimRange .~ 0
-- makeDirectedTele it =
-- it
-- & itUse . heldMods %~ ModWithDirectedTeleport -- .:~ withPosDirWallCheck directedTelPos
-- -- for the camera: the simplest option is to remove all zoom/offset
-- & itUse . heldAim . aimZoom . izFac .~ 1
-- & itUse . heldAim . aimRange .~ 0
-- a better option would be to involve a "scope" centered on the firing
-- position
+6 -3
View File
@@ -10,7 +10,7 @@ import Dodge.Data.ComposedItem
import Dodge.Data.DoubleTree
import Control.Lens
import Control.Monad
import Data.Foldable
--import Data.Foldable
import Data.Maybe
import Dodge.Cuse
import Dodge.Data.World
@@ -36,8 +36,11 @@ useItemRightClick cr' w = fromMaybe (f w) $ do
itemEffect :: Creature -> LabelDoubleTree ComposeLinkType Item -> World -> World
itemEffect cr it w = case it ^. ldtValue . itUse of
HeldUse{_heldUse = eff, _heldMods = usemods} ->
foldl' (&) (useHeld eff) (useMod usemods) it cr w
-- HeldUse{_heldUse = eff, _heldMods = usemods} ->
-- foldl' (&) (useHeld eff) (useMod usemods) it cr w
-- & pointerToItem itm . itUse . heldHammer .~ HammerDown
HeldUse{ _heldMods = usemods} ->
heldEffect usemods it cr w
& pointerToItem itm . itUse . heldHammer .~ HammerDown
LeftUse{} -> doequipmentchange
EquipUse{} -> doequipmentchange
+2 -2
View File
@@ -187,7 +187,7 @@ data HeldItemType
| SPARKGUN
| TESLAGUN
| LASGUN
| LASCIRCLE
-- | LASCIRCLE
| DUALBEAM
| LASWIDE {_xNum :: Int}
| TRACTORGUN
@@ -214,7 +214,7 @@ data ItemModuleType
| INCENDLAS
| SPLITLAS
| STATICLAS
| WEPTELE
-- | WEPTELE
| LAUNCHHOME
| ATTACHTORCH
deriving (Eq, Ord, Show, Read) --Generic, Flat)
+12 -7
View File
@@ -66,22 +66,21 @@ data Luse
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data HeldMod
= HeldModNothing
| PoisonSprayerMod
= PoisonSprayerMod
| FlameSpitterMod
| FlameSpitterRepeatMod
| FlameThrowerMod
| LauncherMod
| TeslaMod
| CircleLaserMod
-- | CircleLaserMod
| LasWideMod Int
| DualBeamMod
| LasMod
| LauncherXMod Int
| ShatterMod
| AmmoCheckMod
| AmmoUseCheckMod
| AmmoHammerTimeUseOneMod
-- | AmmoCheckMod
-- | AmmoUseCheckMod
-- | AmmoHammerTimeUseOneMod
| BangCaneMod
| VolleyGunMod
| MultiGunMod
@@ -90,7 +89,7 @@ data HeldMod
| ElephantGunMod
| AutoAmrMod
| MachineGunMod
| ModWithDirectedTeleport HeldMod
-- | ModWithDirectedTeleport HeldMod
| BangStickMod
| PistolMod
| AutoPistolMod
@@ -100,6 +99,12 @@ data HeldMod
| MiniGunMod Int
| SmgMod
| BangConeMod
| TractorMod --apply with AmmoCheckMod
| FireRemoteShellMod
| ExplodeRemoteShellMod
| DoNothingMod
| ForceFieldMod
| DetectorMod Detector
deriving (Eq, Ord, Show, Read) --Generic, Flat)
makeLenses ''Euse
+3 -2
View File
@@ -27,8 +27,8 @@ import Dodge.Data.Item.Targeting
data ItemUse
= HeldUse
{ _heldUse :: Huse
, _heldDelay :: UseDelay
{ -- _heldUse :: Huse
_heldDelay :: UseDelay
, _heldMods :: HeldMod
, _heldHammer :: HammerPosition
, _heldAim :: AimParams
@@ -118,6 +118,7 @@ data Muzzle = Muzzle
{ _mzPos :: V2 Float
, _mzRot :: Float
, _mzInaccuracy :: Float
, _mzAmmoSlot :: Int
}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
+1 -1
View File
@@ -45,7 +45,7 @@ defaultBulletWeapon :: Item
defaultBulletWeapon =
defaultWeapon
& itUse . heldAmmoTypes .~ [BulletAmmo]
& itUse . heldUse .~ HeldUseAmmoParams -- useAmmoParams
-- & itUse . heldUse .~ HeldUseAmmoParams -- useAmmoParams
& itType . iyModules . at ModBulletCollision ?~ EMPTYMODULE
-- & itType . iyModules . at ModBulletPayload ?~ EMPTYMODULE
-- & itType . iyModules . at ModBulletTrajectory ?~ EMPTYMODULE
+2 -3
View File
@@ -29,9 +29,8 @@ defaultEquipUse = EquipUse
defaultHeldUse :: ItemUse
defaultHeldUse =
HeldUse
{ _heldUse = HeldDoNothing
, _heldDelay = FixedRate{_rateMax = 8, _rateTime = 0}
, _heldMods = HeldModNothing
{ _heldDelay = FixedRate{_rateMax = 8, _rateTime = 0}
, _heldMods = DoNothingMod
, _heldHammer = HammerUp
, _heldAim = defaultAimParams
, _heldAmmoTypes = []
+1 -1
View File
@@ -13,7 +13,7 @@ defaultAimParams =
, _aimStance = OneHand
, --, _aimHandlePos = 10
_aimHandlePos = V2 3 0
, _aimMuzzles = [Muzzle (V2 20 0) 0 0]
, _aimMuzzles = [Muzzle (V2 20 0) 0 0 0]
-- , _aimMuzPos = 20
}
+329 -20
View File
@@ -26,12 +26,321 @@ import qualified IntMapHelp as IM
import LensHelp
import RandomHelp
import Sound.Data
import Data.Foldable
heldEffect :: HeldMod -> LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World
heldEffect effecttype = case effecttype of
-- HeldModNothing -> const $ const id
PoisonSprayerMod -> gasEffect
[ useAmmoAmount 1
, withSoundForI foamSprayLoopS 5
, ammoCheckI
]
FlameSpitterMod -> gasEffect
[ withSidePushAfterI 20
, withSidePushI 5
, useAmmoAmount 1
, withRandomItemParams f
, repeatOnFrames [1 .. 9] FlameSpitterRepeatMod
, lockInvFor 10
, useTimeCheck
, ammoCheckI
]
FlameSpitterRepeatMod -> gasEffect
[ withSidePushAfterI 20
, withSidePushI 5
, useAmmoAmount 1
, withRandomItemParams f
, ammoCheckI
]
FlameThrowerMod -> gasEffect
[ withSidePushAfterI 20
, --, withTempLight 1 100 (V3 1 0 0)
withSidePushI 5
, useAmmoAmount 1
, ammoCheckI
]
LauncherMod -> foldl' (&) usePjCreation
--[ useAmmoAmount 1
-- , withSoundStart tap4S
[ useTimeCheck
-- , ammoCheckI
, blCheck
]
TeslaMod -> foldl' (&) (shootTeslaArc . _ldtValue)
[ useAmmoAmount 1
, withSoundForI elecCrackleS 1
, withTempLight 1 100 (V3 0 0 1)
, ammoCheckI
]
LasWideMod n -> foldl' (&) (shootLaser . _ldtValue)
[ useAmmoAmount 1
, withItem $ \it ->
duplicateNumBarrels
-- ( min
-- (it ^?! itUse . heldConsumption . laSource . _InternalSource . iaLoaded)
(it ^?! itParams . lasCycle `div` lasWideRate)
-- )
, withItem $ \it -> withCrPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
, withSoundForI tone440sawtoothquietS 2
, withItemUpdateFirst (increasecycleLasWide n)
, ammoCheckI
]
DualBeamMod -> foldl' (&) (shootDualLaser . _ldtValue)
[ useAmmoAmount 1
, withSoundForI tone440sawtoothquietS 2
, withItem $ \it -> withCrPosShift (V2 0 (- thegapDualBeam it)) $ flareCircleAt (_lasColor2 $ _itParams it) 0.8
, withItem $ \it -> withCrPosShift (V2 0 (thegapDualBeam it)) $ flareCircleAt (_lasColor $ _itParams it) 0.8
, ammoCheckI
]
LasMod -> foldl' (&) (shootLaser . _ldtValue)
[ useAmmoAmount 1
, withItem $ \it -> withCrPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
, withSoundForI tone440sawtoothquietS 2
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
, duplicateLoadedBarrels
, ammoCheckI
]
LauncherXMod _ -> foldl' (&) usePjCreationX
--[ useAmmoAmount i
--, withSoundStart tap4S
[ useTimeCheck
--, ammoCheckI
, blCheck
]
ShatterMod -> foldl' (&) (shootShatter . _ldtValue)
[ useAmmoAmount 1
, -- , withSoundStart tap3S
useTimeCheck
, ammoCheckI
, blCheck
]
BangCaneMod -> bulletGunEffect
[ withFlare
, withSmoke 1 black 20 200 5
, withRecoil
, duplicateLoadedBarrels
, withTorqueAfter
, useAmmoAmount 1
, withSoundStart tap3S
, useTimeCheck
, ammoCheckI
, blCheck
]
VolleyGunMod -> bulletGunEffect
[ withRecoil
, withFlare
, duplicateLoadedBarrels
, withTorqueAfter
, useAllAmmo
, withSoundItemChoiceStart caneStickSoundChoice
, useTimeCheck
, ammoCheckI
, blCheck
]
MultiGunMod -> bulletGunEffect
[ withRecoil
, withFlare
, duplicateLoadedBarrels
, withTorqueAfter
, useAllAmmo
, withSoundItemChoiceStart caneStickSoundChoice
, useTimeCheck
, ammoCheckI
, blCheck
]
AutoRifleMod -> bulletGunEffect
-- note this is the same as BangCanemMod with the first changed
[ withFlare
, withSmoke 1 black 20 200 5
, withRecoil
, duplicateLoadedBarrels
, withTorqueAfter
, useAmmoAmount 1
, withSoundStart tap3S
, useTimeCheck
, ammoCheckI
]
BangRodMod -> bulletGunEffect
[ withRecoil
, withFlare
, withThickSmokeI
, duplicateLoadedBarrels
, withTorqueAfter
, useAmmoAmount 1
, withSoundStart bangEchoS
, useTimeCheck
, ammoCheckI
, blCheck
]
ElephantGunMod -> bulletGunEffect
[ withRecoil
, withFlare
, withThickSmokeI
, duplicateLoadedBarrels
, withTorqueAfter
, useAmmoAmount 1
, withSoundStart bangEchoS
, useTimeCheck
, ammoCheckI
, blCheck
]
AutoAmrMod -> bulletGunEffect
[ withRecoil
, withFlare
, withThickSmokeI
, duplicateLoadedBarrels
, withTorqueAfter
, useAmmoAmount 1
, withSoundStart bangEchoS
, useTimeCheck
, ammoCheckI -- cf ElephantGun
]
MachineGunMod -> bulletGunEffect
[ withFlare
, withThinSmokeI
, withSoundStart bangEchoS
, rateIncAB (torqueBeforeAtLeast 0.1 0.1) withTorqueAfter
, ammoCheckI
]
BangStickMod -> bulletGunEffect
[ withRecoil
, useAllAmmo
, withSoundItemChoiceStart bangStickSoundChoice
, duplicateLoadedBarrels
, withTorqueAfter
, withFlare
, useTimeCheck
, ammoCheckI
, blCheck
]
PistolMod -> bulletGunEffect
[ withSidePushI 50
, withRecoil
, withFlare
, withTorqueAfter
, duplicateLoadedBarrels
, withSoundStart tap3S
, useAmmoAmount 1
, useTimeCheck
, ammoCheckI
, blCheck
]
AutoPistolMod -> bulletGunEffect
[ withFlare
, withSidePushI 50
, withRecoil
, withTorqueAfter
, duplicateLoadedBarrels
, withSoundStart tap3S
, useAmmoAmount 1
, useTimeCheck
, ammoCheckI
]
MachinePistolMod -> bulletGunEffect
[ withFlare
, withRecoil
, withSidePushI 50
, withTorqueAfter
, duplicateLoadedBarrels
, withSoundStart tap1S
, useAmmoAmount 1
, useTimeCheck
, ammoCheckI
]
BurstRifleMod -> bulletGunEffect
[ withRecoil
, withFlare
, duplicateLoadedBarrels
, useAmmoAmount 1
, withSoundStart tap3S
, repeatOnFrames [3, 6] BurstRifleRepeatMod
, lockInvFor 7
, sideEffectOnFrame 7 (\_ cr -> TorqueCr 0.2 (_crID cr)) --(torqueSideEffect 0.2)
, useTimeCheck
, ammoCheckI
, blCheck
]
BurstRifleRepeatMod -> bulletGunEffect
[ withRecoil
, withFlare
, duplicateLoadedBarrels
, useAmmoAmount 1
, withSoundStart tap3S
, sideEffectOnFrame 7 (\_ cr -> TorqueCr 0.2 (_crID cr)) --(torqueSideEffect 0.2)
, ammoCheckI
]
MiniGunMod i -> bulletGunEffect
[ duplicateNumBarrels 1
, repeatTransformed
[ (id, modcrpos x)
| x <- map ((/ (fromIntegral i - 1)) . fromIntegral) [0 .. i -1]
]
, afterRecoil (fromIntegral i * 5)
, torqueBefore (fromIntegral i * 0.05)
, withSidePushI (fromIntegral i * 25)
, withMuzFlare
, withSmoke 1 black 20 200 5
, useAmmoAmount i
, withSoundForI mini1S 2
, withWarmUp crankSlowS
, ammoCheckI
]
SmgMod -> bulletGunEffect
[ withFlare
, withSidePushI 30
, withRecoil
, withTorqueAfter
, duplicateLoadedBarrels
, withSoundStart tap3S
, useAmmoAmount 1
, useTimeCheck
, ammoCheckI
]
BangConeMod -> bulletGunEffect
[ withRandomItem coneRandItemParams
, withRandomItemUpdate coneRandItemUpdate
, withRandomOffset
, duplicateLoadedBarrels
, duplicateLoaded
, withMuzFlare
, withRecoil
, withTorqueAfter
, useAllAmmo
, withSoundStart bangEchoS
, useTimeCheck
, ammoCheckI
, blCheck
]
TractorMod -> foldl' (&) (aTractorBeam . _ldtValue) [ammoCheckI]
where
f = do
nzpres <- state $ randomR (3, 4)
return $ sprayNozzles . ix 0 . nzPressure .~ nzpres
increasecycleLasWide n it = case _heldHammer (_itUse it) of
HammerUp -> it & itParams . lasCycle .~ 1
_ -> it & itParams . lasCycle %~ (min (n * lasWideRate) . (+ 1))
thegapDualBeam = _dbGap . _itParams
directedTelPos _ cr w = (p, a)
where
p = fromMaybe (_crPos cr) $ cr ^? crTargeting . ctPos . _Just
a = argV (mouseWorldPos (w ^. input) (w ^. wCam) -.- p)
modcrpos x cr = fromMaybe cr $ do
invid <- cr ^? crManipulation . manObject . inInventory . ispItem
return $ cr & crDir %~ tweenAngles x (_crOldDir cr)
& crPos %~ alongSegBy x (_crOldPos cr)
& crInv . ix (invid + 1) . itUse . amagParams . ampBullet . buDelayFraction .~ x
gasEffect = foldl' (&) (overNozzles useGasParams)
bulletGunEffect = foldl' (&) shootBullet
useMod :: HeldMod ->
[(LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World)
-> LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World]
useMod hm = case hm of
HeldModNothing -> []
-- HeldModNothing -> []
PoisonSprayerMod ->
[ useAmmoAmount 1
, withSoundForI foamSprayLoopS 5
@@ -74,15 +383,15 @@ useMod hm = case hm of
, withTempLight 1 100 (V3 0 0 1)
, ammoCheckI
]
CircleLaserMod ->
[ duplicateItem fLasCircle
, useAmmoAmount 1
, withSoundForI tone440sawtoothquietS 2
, withItem $ \it -> withCrPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
, withItemUpdateFirst increasecycleLasCircle
, ammoCheckI
]
-- CircleLaserMod ->
-- [ duplicateItem fLasCircle
-- , useAmmoAmount 1
-- , withSoundForI tone440sawtoothquietS 2
-- , withItem $ \it -> withCrPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
-- , withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
-- , withItemUpdateFirst increasecycleLasCircle
-- , ammoCheckI
-- ]
LasWideMod n ->
[ useAmmoAmount 1
, withItem $ \it ->
@@ -126,14 +435,14 @@ useMod hm = case hm of
, ammoCheckI
, blCheck
]
AmmoCheckMod -> [ammoCheckI]
AmmoUseCheckMod -> [useAmmoAmount 1, useTimeCheck, ammoCheckI]
AmmoHammerTimeUseOneMod ->
[ useAmmoAmount 1
, useTimeCheck
, ammoCheckI
, blCheck
]
-- AmmoCheckMod -> [ammoCheckI]
-- AmmoUseCheckMod -> [useAmmoAmount 1, useTimeCheck, ammoCheckI]
-- AmmoHammerTimeUseOneMod ->
-- [ useAmmoAmount 1
-- , useTimeCheck
-- , ammoCheckI
-- , blCheck
-- ]
BangCaneMod ->
[ withFlare
, withSmoke 1 black 20 200 5
@@ -222,8 +531,8 @@ useMod hm = case hm of
, rateIncAB (torqueBeforeAtLeast 0.1 0.1) withTorqueAfter
, ammoCheckI
]
ModWithDirectedTeleport hm' ->
reverse $ withPosDirWallCheck directedTelPos : useMod hm'
-- ModWithDirectedTeleport hm' ->
-- reverse $ withPosDirWallCheck directedTelPos : useMod hm'
BangStickMod ->
[ withRecoil
, useAllAmmo
+1 -1
View File
@@ -187,7 +187,7 @@ heldItemSPic ht it = case ht of
SPARKGUN -> teslaGunPic
TESLAGUN -> teslaGunPic
LASGUN -> lasGunPic it
LASCIRCLE -> lasGunPic it
-- LASCIRCLE -> lasGunPic it
DUALBEAM -> dualBeamPic it
LASWIDE _ -> lasGunPic it
--SONICGUN -> noPic baseSonicShape
+1 -1
View File
@@ -56,7 +56,7 @@ itemFromHeldType ht = case ht of
SPARKGUN -> sparkGun
TESLAGUN -> teslaGun
LASGUN -> lasGun
LASCIRCLE -> lasCircle
-- LASCIRCLE -> lasCircle
DUALBEAM -> dualBeam
LASWIDE i -> lasWide i
TRACTORGUN -> tractorGun
+22 -22
View File
@@ -24,13 +24,13 @@ teslaGun =
& itDimension . dimRad .~ 9
& itDimension . dimCenter .~ V3 4 0 0
& itParams .~ teslaParams
& itUse . heldUse .~ HeldTeslaArc --shootTeslaArc
-- & itUse . heldUse .~ HeldTeslaArc --shootTeslaArc
& itUse . heldDelay .~ NoDelay
& itUse . heldMods .~ TeslaMod
& itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimStance .~ TwoHandFlat
-- & itUse . heldAim . aimMuzPos .~ 4
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 4 0) 0 0]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 4 0) 0 0 0]
& itType . iyBase .~ HELD TESLAGUN
lasGun :: Item
@@ -51,7 +51,7 @@ lasGun =
}
& itDimension . dimRad .~ 10
& itDimension . dimCenter .~ V3 15 0 0
& itUse . heldUse .~ HeldLaser --shootLaser
-- & itUse . heldUse .~ HeldLaser --shootLaser
& itUse . heldDelay .~ NoDelay
& itUse . heldMods .~ LasMod
& itUse . heldAim . aimWeight .~ 6
@@ -59,7 +59,7 @@ lasGun =
& itUse . heldAim . aimStance .~ TwoHandUnder
-- & itUse . heldAim . aimHandlePos .~ 5
-- & itUse . heldAim . aimMuzPos .~ 30
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0 0]
& itType . iyBase .~ HELD LASGUN
lasGunTweak :: TweakParam
@@ -78,12 +78,13 @@ tractorGun =
.~ Tweakable
{ _tweakParams = IM.fromList [(0, tractorGunTweak)]
}
& itUse . heldUse .~ HeldTractor --aTractorBeam
-- & itUse . heldUse .~ HeldTractor --aTractorBeam
& itUse . heldDelay .~ NoDelay
& itUse . heldMods .~ AmmoCheckMod
-- & itUse . heldMods .~ AmmoCheckMod
& itUse . heldMods .~ TractorMod
& itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0 0]
& itType . iyBase .~ HELD TRACTORGUN
tractorGunTweak :: TweakParam
@@ -101,7 +102,7 @@ lasWide n =
& itParams . lasColor .~ yellow
& itParams . lasDamage .~ 2
& itUse . heldMods .~ LasWideMod n
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 y) 0 0 | y <- spreadFromCenter n 1]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 y) 0 0 0 | y <- spreadFromCenter n 1]
defaultBatteryGun :: Item
defaultBatteryGun =
@@ -120,24 +121,23 @@ defaultAutoBatteryGun =
defaultHeldItem
& itType . iyModules .~ batteryModules
lasCircle :: Item
lasCircle =
lasGun
& itType . iyBase .~ HELD LASCIRCLE
& itParams . lasColor .~ orange
& itParams . lasDamage .~ 2
& itUse . heldUse .~ HeldLaser --shootLaser
& itUse . heldDelay .~ NoDelay
& itUse . heldUse .~ HeldCircleLaser --circleLaser
& itUse . heldMods .~ CircleLaserMod
& itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1
--lasCircle :: Item
--lasCircle =
-- lasGun
-- & itType . iyBase .~ HELD LASCIRCLE
-- & itParams . lasColor .~ orange
-- & itParams . lasDamage .~ 2
-- & itUse . heldDelay .~ NoDelay
---- & itUse . heldUse .~ HeldCircleLaser --circleLaser
-- & itUse . heldMods .~ CircleLaserMod
-- & itUse . heldAim . aimWeight .~ 6
-- & itUse . heldAim . aimRange .~ 1
dualBeam :: Item
dualBeam =
lasGun
& itType . iyBase .~ HELD DUALBEAM
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0 0]
& itParams
.~ DualBeam
{ _phaseV = 1
@@ -149,7 +149,7 @@ dualBeam =
, _subParams = Nothing
, _dbGap = 20
}
& itUse . heldUse .~ HeldDualLaser --shootDualLaser
-- & itUse . heldUse .~ HeldDualLaser --shootDualLaser
& itUse . heldDelay .~ NoDelay
& itUse . heldMods .~ DualBeamMod
& itUse . heldAim . aimWeight .~ 6
+8 -6
View File
@@ -32,7 +32,7 @@ defaultBangCane =
& itUse . heldMods .~ BangCaneMod
& itUse . heldAim . aimStance .~ OneHand
-- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.01]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.01 0]
volleyGun :: Int -> Item
volleyGun i =
@@ -42,7 +42,8 @@ volleyGun i =
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimStance .~ TwoHandFlat
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3]
& itUse . heldAim . aimMuzzles .~
([Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3] <*> [0..])
& itUse . heldParams . torqueAfter .~ 0.15 + 0.05 * fromIntegral i
& itType . iyBase .~ HELD (VOLLEYGUN i)
@@ -54,7 +55,8 @@ multiGun i =
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimStance .~ TwoHandFlat
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3]
& itUse . heldAim . aimMuzzles .~
([Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3] <*> [0..])
& itUse . heldParams . torqueAfter .~ 0.15 + 0.05 * fromIntegral i
& itType . iyBase .~ HELD (MULTIGUN i)
@@ -66,7 +68,7 @@ rifle =
& itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 25 0) 0 0.01]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 25 0) 0 0.01 0]
& itType . iyModules . at ModHeldAttach ?~ EMPTYMODULE
repeater :: Item
@@ -94,7 +96,7 @@ burstRifle =
miniGunUse :: Int -> ItemUse
miniGunUse i =
defaultHeldUse
& heldUse .~ HeldUseAmmoParams
-- & heldUse .~ HeldUseAmmoParams
& heldMods .~ MiniGunMod i
& heldDelay .~ WarmUpNoDelay{_warmTime = 0, _warmMax = 100}
& heldAim . aimWeight .~ 6
@@ -108,7 +110,7 @@ miniGunX i =
autoRifle
& itUse .~ miniGunUse i
& itUse . heldAim . aimTurnSpeed .~ 0.5
& itUse . heldAim . aimMuzzles .~ replicate i (Muzzle (V2 30 0) 0 0.05)
& itUse . heldAim . aimMuzzles .~ replicate i (Muzzle (V2 30 0) 0 0.05 0)
& itUse . heldParams . recoil .~ 10
& itUse . heldParams . torqueAfter .~ 0.01
& itUse . heldParams . randomOffset .~ 10
+1 -1
View File
@@ -15,7 +15,7 @@ bangCone =
& itUse . heldDelay . rateMax .~ 20
& itUse . heldMods .~ BangConeMod
-- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.5]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.5 0]
& itUse . heldParams .~ BulletShooterParams
{ _muzVel = 0.7
, _rifling = 0.8
+6 -5
View File
@@ -24,14 +24,14 @@ launcher =
& itDimension . dimRad .~ 9
& itDimension . dimCenter .~ V3 10 0 0
& itUse . heldDelay . rateMax .~ 20
& itUse . heldUse .~ HeldPJCreation --usePjCreation
-- & itUse . heldUse .~ HeldPJCreation --usePjCreation
& itUse . heldMods .~ LauncherMod
& itUse . heldAim . aimWeight .~ 8
& itUse . heldAim . aimRange .~ 0.5
& itUse . heldAim . aimStance .~ TwoHandOver
-- & itUse . heldAim . aimHandlePos .~ V2 3 0
-- & itUse . heldAim . aimMuzPos .~ 20
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) 0 0]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) 0 0 0]
& itUse . heldAmmoTypes .~ [ProjectileAmmo]
& itType . iyBase .~ HELD LAUNCHER
& itType . iyModules . at ModLauncherHoming ?~ EMPTYMODULE
@@ -40,9 +40,9 @@ launcherX :: Int -> Item
launcherX i =
launcher
& itType . iyBase .~ HELD (LAUNCHERX i)
& itUse . heldUse .~ HeldPJCreationX i
-- & itUse . heldUse .~ HeldPJCreationX i
& itUse . heldMods .~ LauncherXMod i
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) a 0 | a <- angles]
& itUse . heldAim . aimMuzzles .~ ([Muzzle (V2 20 0) a 0 | a <- angles] <*> [0..])
where
angles = take i [0,2*pi/ fromIntegral i ..]
--angles = take i [1,2 ..]
@@ -51,7 +51,8 @@ remoteLauncher :: Item
remoteLauncher =
launcher
& itType . iyBase .~ HELD REMOTELAUNCHER
& itUse . heldUse .~ HeldFireRemoteShell --fireRemoteShell
-- & itUse . heldUse .~ HeldFireRemoteShell --fireRemoteShell
& itUse . heldMods .~ FireRemoteShellMod
& itScope .~ RemoteScope (V2 0 0) 1
-- & itUse . heldConsumption . laAmmoType . amPjDraw .~ DrawRemoteShell
+1 -1
View File
@@ -35,7 +35,7 @@ bangRod =
& itUse . heldAim . aimStance .~ OneHand
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
-- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0.1]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0.1 0]
-- & itUse . heldConsumption . laAmmoType .~ hvBulletAmmo
elephantGun :: Item
+2 -2
View File
@@ -81,14 +81,14 @@ flameThrower =
}
& itDimension . dimRad .~ 7
& itDimension . dimCenter .~ V3 9 0 0
& itUse . heldUse .~ HeldOverNozzlesUseGasParams -- overNozzles useGasParams
-- & itUse . heldUse .~ HeldOverNozzlesUseGasParams -- overNozzles useGasParams
& itUse . heldDelay .~ NoDelay
& itUse . heldMods .~ FlameThrowerMod
& itUse . heldAim . aimWeight .~ 5
& itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 5, _izMin = 1.5}
& itUse . heldAim . aimStance .~ TwoHandUnder
-- & itUse . heldAim . aimHandlePos .~ 0
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 18 0) 0 0]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 18 0) 0 0 0]
& itUse . heldAmmoTypes .~ [GasAmmo]
& itType . iyBase .~ HELD FLAMETHROWER
& itUse . heldParams .~ GasSprayParams CreateFlame --aGasCloud
+3 -3
View File
@@ -30,7 +30,7 @@ bangStick i =
& itDimension . dimCenter .~ V3 5 0 0
& itUse . heldDelay . rateMax .~ 8
& itUse . heldMods .~ BangStickMod
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 10 0) a 0.01 | a <- spreadAroundCenter i baseStickSpread]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 10 0) a 0.01 0 | a <- spreadAroundCenter i baseStickSpread]
baseStickSpread :: Float
baseStickSpread = 0.2
@@ -41,7 +41,7 @@ pistol =
& itUse . heldAmmoTypes .~ [BulletAmmo]
& itUse . heldDelay . rateMax .~ 6
& itUse . heldMods .~ PistolMod
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 10 0) 0 0.05]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 10 0) 0 0.05 0]
& itUse . heldParams
%~ ( (muzVel .~ 0.8)
. (rifling .~ 0.8)
@@ -72,6 +72,6 @@ smg =
& itUse . heldMods .~ SmgMod --(ammoCheckI : smgAfterHamMods)
& itType . iyBase .~ HELD SMG
& itUse . heldAim . aimStance .~ TwoHandUnder
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) 0 0]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) 0 0 0]
-- & itUse . heldAim . aimHandlePos .~ 2
& itUse . heldParams . torqueAfter .~ 0.05
+6 -4
View File
@@ -37,9 +37,10 @@ forceFieldGun =
-- & itUse . useTargeting ?~ TargetRBLine
& itType . iyModules . at ModTarget ?~ TARGET TargetRBLine
& itParams .~ ParamMID Nothing
& itUse . heldUse .~ HeldForceField --useForceFieldGun
-- & itUse . heldUse .~ HeldForceField --useForceFieldGun
& itUse . heldDelay .~ NoDelay
& itUse . heldMods .~ AmmoHammerTimeUseOneMod -- this is slightly different
-- & itUse . heldMods .~ AmmoHammerTimeUseOneMod -- this is slightly different
& itUse . heldMods .~ ForceFieldMod -- this is slightly different
-- than the list below
--[ hammerCheckI , ammoCheckI , useAmmoAmount 1]
& itType . iyBase .~ HELD FORCEFIELDGUN
@@ -52,8 +53,9 @@ clickDetector :: Detector -> Item
clickDetector dt =
defaultWeapon
& itUse . heldDelay . rateMax .~ 20
& itUse . heldUse .~ HeldDetectorEffect dt --detectorEffect dt
& itUse . heldMods .~ AmmoUseCheckMod
-- & itUse . heldUse .~ HeldDetectorEffect dt --detectorEffect dt
-- & itUse . heldMods .~ AmmoUseCheckMod
& itUse . heldMods .~ DetectorMod dt --detectorEffect dt
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1}
& itType . iyBase .~ HELD (HELDDETECTOR dt)
+1 -1
View File
@@ -9,6 +9,6 @@ shatterGun =
defaultHeldItem
& itType . iyBase .~ HELD SHATTERGUN
& itUse . heldDelay . rateMax .~ 10
& itUse . heldUse .~ HeldShatter --shootShatter
-- & itUse . heldUse .~ HeldShatter --shootShatter
& itUse . heldMods .~ ShatterMod
& itUse . heldAim . aimStance .~ TwoHandFlat
+1 -1
View File
@@ -91,7 +91,7 @@ heldInfo hit = case hit of
SPARKGUN -> "A weapon that produces an arc of electricity. The arc will attempt to discharge at a nearby object."
TESLAGUN -> "A weapon that discharges a sustained arc of electricity. The arc will attempt to discharge at a nearby object."
LASGUN -> "A weapon that continuously emits photons in a narrow beam."
LASCIRCLE -> "A extensive configuration of prisms and mirrors that produces multiple laser beams around its user."
-- LASCIRCLE -> "A extensive configuration of prisms and mirrors that produces multiple laser beams around its user."
DUALBEAM -> "A weapon that emits two beams that converge at a selectable point in front of the user."
LASWIDE _ -> "A weapon that continuously emits photons in a narrow beam. The beam expands as the weapon heats up."
TRACTORGUN -> "An item that produces a beam of gravitons."
+1 -1
View File
@@ -55,7 +55,7 @@ heldBounds hit = case hit of
SPARKGUN -> ts
TESLAGUN -> ts
LASGUN -> ls
LASCIRCLE -> ls
-- LASCIRCLE -> ls
DUALBEAM -> ls
LASWIDE _ -> ls
TRACTORGUN -> ls
+1 -1
View File
@@ -12,7 +12,7 @@ droneLauncher :: Item
droneLauncher =
defaultHeldItem
& itUse . heldDelay . rateMax .~ 20
& itUse . heldMods .~ AmmoUseCheckMod
-- & itUse . heldMods .~ AmmoUseCheckMod
& itUse . heldAim . aimWeight .~ 8
& itUse . heldAim . aimRange .~ 0.5
& itUse . heldAim . aimStance .~ TwoHandOver
+2 -1
View File
@@ -18,7 +18,8 @@ explodeRemoteRocket itid pjid w =
w
& cWorld . lWorld . projectiles . ix pjid . prjUpdates .~ [PJRetireRemote itid 30 pjid]
& cWorld . lWorld . projectiles . ix pjid . prjDraw .~ DrawBlankProjectile
& itPoint . itUse . heldUse .~ HeldDoNothing
-- & itPoint . itUse . heldUse .~ HeldDoNothing
& itPoint . itUse . heldMods .~ DoNothingMod
& usePayload (_prjPayload thepj) (_prjPos thepj)
where
itPoint = pointerToItemLocation $ w ^?! cWorld . lWorld . itemLocations . ix itid-- _itemLocations (_cWorld w) IM.! itid
+2 -2
View File
@@ -13,8 +13,8 @@ spawnGun :: Creature -> Item
spawnGun _ =
defaultHeldItem
& itUse . heldDelay . rateMax .~ 100
& itUse . heldUse .~ HeldDoNothing --(\_ -> spawnCrNextTo cr)
& itUse . heldMods .~ HeldModNothing
-- & itUse . heldUse .~ HeldDoNothing --(\_ -> spawnCrNextTo cr)
-- & itUse . heldMods .~ DoNothingMod
& itType . iyBase .~ LEFT SPAWNER
spawnCrNextTo ::
+4 -4
View File
@@ -342,7 +342,7 @@ withSidePushAfterI maxSide eff item cr w =
(pushAmount, g) = randomR (- maxSide, maxSide) $ _randGen w
useAllAmmo :: ChainEffect
useAllAmmo eff item cr w = error "use all ammo"
useAllAmmo = error "use all ammo"
--useAllAmmo eff ams item cr w = fromMaybe w $ do
-- let invids = ams ^.. traverse . itLocation . ipInvID
-- return . eff ams item cr $ foldl' f w invids
@@ -668,7 +668,7 @@ repeatOnFrames is hm f it cr w =
-- return $ f it cr' w'
duplicateLoaded :: ChainEffect
duplicateLoaded eff it cr w = error "duplicateLoaded"
duplicateLoaded = error "duplicateLoaded"
--duplicateLoaded :: ChainEffect
--duplicateLoaded eff ams it cr w = foldr f w (take numbul [1::Int .. ])
-- where
@@ -678,7 +678,7 @@ duplicateLoaded eff it cr w = error "duplicateLoaded"
-- cr ^? crInv . ix i . itUse . amagLoadStatus . iaLoaded
duplicateNumBarrels :: Int -> ChainEffect
duplicateNumBarrels n eff itm cr w = error "duplicateNumBarrels"
duplicateNumBarrels = error "duplicateNumBarrels"
--duplicateNumBarrels :: Int -> ChainEffect
--duplicateNumBarrels n eff ams itm cr w = foldr f w (take n $ itm ^?! itUse . heldAim . aimMuzzles)
-- where
@@ -694,7 +694,7 @@ duplicateNumBarrels n eff itm cr w = error "duplicateNumBarrels"
-- (a,g) = randomR (-inacc,inacc) $ _randGen w'
duplicateLoadedBarrels :: ChainEffect
duplicateLoadedBarrels eff itm cr = error "duplicateLoadedBarrels"
duplicateLoadedBarrels eff itm cr = eff itm cr
-- = duplicateNumBarrels numbul eff ams itm cr
-- where
-- numbul :: Int
+1 -1
View File
@@ -35,7 +35,7 @@ moduleName imt = case imt of
INCENDLAS -> Just "+INCENDIARY"
SPLITLAS -> Just "+SPLIT"
STATICLAS -> Just "+STATIC"
WEPTELE -> Just "+DIRECTEDTELE"
-- WEPTELE -> Just "+DIRECTEDTELE"
LAUNCHHOME -> Just "+TARGET HOMING"
ATTACHTORCH -> Just "+TORCH"
+2 -1
View File
@@ -82,7 +82,8 @@ retireRemoteProj itid pjid w =
w
& pointerToItemLocation (w ^?! cWorld . lWorld . itemLocations . ix itid)
%~ ( (itScope . remotePos .~ V2 0 0)
. (itUse . heldUse .~ HeldFireRemoteShell)
-- . (itUse . heldUse .~ HeldFireRemoteShell)
. (itUse . heldMods .~ FireRemoteShellMod)
)
& cWorld . lWorld . props %~ IM.delete pjid
+3 -2
View File
@@ -15,7 +15,7 @@ import Dodge.Creature.Impulse.UseItem
import Dodge.Data.World
import Dodge.Default
import Dodge.Inventory.Lock
import Dodge.Item.Location
--import Dodge.Item.Location
import Dodge.SoundLogic
import Dodge.Terminal
import Dodge.WorldEvent.Cloud
@@ -35,7 +35,8 @@ doWdWd we = case we of
TorqueCr x cid -> torqueCr x cid
SoundStart so p sid mi -> soundStart so p sid mi
WdWdNegateTrig trid -> cWorld . lWorld . triggers . ix trid %~ not
WdWdFromItixCrixWdWd itid crid f -> \w -> fromMaybe w $ do
--WdWdFromItixCrixWdWd itid crid f -> \w -> fromMaybe w $ do
WdWdFromItixCrixWdWd _ crid f -> \w -> fromMaybe w $ do
cr <- w ^? cWorld . lWorld . creatures . ix crid
--it <- getItem itid w
itRef <- cr ^? crManipulation . manObject . inInventory . ispItem