Move launcher homing to module, add double launcher
This commit is contained in:
@@ -55,7 +55,7 @@ itemCombinations =
|
|||||||
, po [BANGROD,PLATE,DRUM,MOTOR] machineGun
|
, po [BANGROD,PLATE,DRUM,MOTOR] machineGun
|
||||||
|
|
||||||
, p [p 2 TUBE,o HARDWARE] launcher
|
, p [p 2 TUBE,o HARDWARE] launcher
|
||||||
, po [MICROCHIP,TRANSMITTER,LAUNCHER] trackingLauncher
|
, p [p 2 TUBE,o LAUNCHER] doubleLauncher
|
||||||
, po [TRANSMITTER,MINIDISPLAY,LAUNCHER] remoteLauncher
|
, po [TRANSMITTER,MINIDISPLAY,LAUNCHER] remoteLauncher
|
||||||
|
|
||||||
, po [LIGHTER,PIPE,CAN] flameStick
|
, po [LIGHTER,PIPE,CAN] flameStick
|
||||||
@@ -112,7 +112,7 @@ moduleCombinations =
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
, ( ModTarget
|
, ( ModTarget
|
||||||
, trackingLauncher : launcher : bulletWeapons
|
, homingLaunchers ++ bulletWeapons
|
||||||
, [amod [MICROCHIP,CREATURESENSOR] "+CREATURETARGETING" (itTargeting .~ targetRBCreature)
|
, [amod [MICROCHIP,CREATURESENSOR] "+CREATURETARGETING" (itTargeting .~ targetRBCreature)
|
||||||
,amod [MICROCHIP,PRISM] "+LASERTARGETING" (itTargeting .~ targetLaser)
|
,amod [MICROCHIP,PRISM] "+LASERTARGETING" (itTargeting .~ targetLaser)
|
||||||
,amod [MICROCHIP,TIN] "+POSTIONALTARGETING" (itTargeting .~ targetRBPress)
|
,amod [MICROCHIP,TIN] "+POSTIONALTARGETING" (itTargeting .~ targetRBPress)
|
||||||
@@ -131,6 +131,12 @@ moduleCombinations =
|
|||||||
(itConsumption . aoType . amBulTraj .~ BezierTrajectory)
|
(itConsumption . aoType . amBulTraj .~ BezierTrajectory)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
, ( ModLauncherHoming
|
||||||
|
, homingLaunchers
|
||||||
|
, [ amod [MICROCHIP,TRANSMITTER] "+TARGET HOMING"
|
||||||
|
(itConsumption . aoType . amPjCreation .~ fireTrackingShell)
|
||||||
|
]
|
||||||
|
)
|
||||||
]
|
]
|
||||||
where
|
where
|
||||||
makeDirectedTele it = it
|
makeDirectedTele it = it
|
||||||
@@ -148,6 +154,12 @@ moduleCombinations =
|
|||||||
f ameff = itConsumption . aoType . amBulEff .~ ameff
|
f ameff = itConsumption . aoType . amBulEff .~ ameff
|
||||||
amod cts str func = (cts,ItemModule [str] 1 func)
|
amod cts str func = (cts,ItemModule [str] 1 func)
|
||||||
|
|
||||||
|
homingLaunchers :: [Item]
|
||||||
|
homingLaunchers =
|
||||||
|
[ launcher
|
||||||
|
, doubleLauncher
|
||||||
|
]
|
||||||
|
|
||||||
bulletWeapons :: [Item]
|
bulletWeapons :: [Item]
|
||||||
bulletWeapons = [bangStick i | i <- [1..9] ]
|
bulletWeapons = [bangStick i | i <- [1..9] ]
|
||||||
++ [bangCaneX i | i <- [1..6] ]
|
++ [bangCaneX i | i <- [1..6] ]
|
||||||
|
|||||||
@@ -50,7 +50,8 @@ data CombineType
|
|||||||
| SONICGUN
|
| SONICGUN
|
||||||
| TRACTORGUN
|
| TRACTORGUN
|
||||||
| LAUNCHER
|
| LAUNCHER
|
||||||
| TRACKINGLAUNCHER
|
| DOUBLELAUNCHER
|
||||||
|
-- | TRACKINGLAUNCHER
|
||||||
| REMOTELAUNCHER
|
| REMOTELAUNCHER
|
||||||
| SPRAYER
|
| SPRAYER
|
||||||
| DRONELAUNCHER
|
| DRONELAUNCHER
|
||||||
|
|||||||
@@ -393,6 +393,7 @@ data ModuleSlot
|
|||||||
| ModAutoMag
|
| ModAutoMag
|
||||||
| ModTarget
|
| ModTarget
|
||||||
| ModBulletTrajectory
|
| ModBulletTrajectory
|
||||||
|
| ModLauncherHoming
|
||||||
deriving (Eq,Ord)
|
deriving (Eq,Ord)
|
||||||
|
|
||||||
data ItemModule
|
data ItemModule
|
||||||
@@ -522,6 +523,7 @@ data AmmoType
|
|||||||
{ _amPayload :: Point2 -> World -> World
|
{ _amPayload :: Point2 -> World -> World
|
||||||
, _amString :: String
|
, _amString :: String
|
||||||
, _amPjDraw :: Prop -> SPic
|
, _amPjDraw :: Prop -> SPic
|
||||||
|
, _amPjCreation :: Item -> Creature -> World -> World
|
||||||
-- , _aProjectile :: Ammo -> Prop
|
-- , _aProjectile :: Ammo -> Prop
|
||||||
}
|
}
|
||||||
| BulletAmmo
|
| BulletAmmo
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
module Dodge.Item.Weapon.Launcher
|
module Dodge.Item.Weapon.Launcher
|
||||||
( launcher
|
( launcher
|
||||||
, trackingLauncher
|
, doubleLauncher
|
||||||
, remoteLauncher
|
, remoteLauncher
|
||||||
|
, fireTrackingShell
|
||||||
) where
|
) where
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
import Dodge.Default
|
import Dodge.Default
|
||||||
@@ -43,12 +44,13 @@ launcher = defaultGun
|
|||||||
{ _amPayload = makeExplosionAt
|
{ _amPayload = makeExplosionAt
|
||||||
, _amString = "EXPLOSIVE SHELL"
|
, _amString = "EXPLOSIVE SHELL"
|
||||||
, _amPjDraw = drawShell
|
, _amPjDraw = drawShell
|
||||||
|
, _amPjCreation = fireShell
|
||||||
}
|
}
|
||||||
, _ammoBaseMax = 1
|
, _ammoBaseMax = 1
|
||||||
, _ammoLoaded = 1
|
, _ammoLoaded = 1
|
||||||
, _reloadTime = 80
|
, _reloadTime = 80
|
||||||
}
|
}
|
||||||
, _itUse = ruseRate 20 fireLauncher upHammer
|
, _itUse = ruseRate 20 usePjCreation upHammer
|
||||||
[ hammerCheckI
|
[ hammerCheckI
|
||||||
, ammoCheckI
|
, ammoCheckI
|
||||||
, useTimeCheck
|
, useTimeCheck
|
||||||
@@ -58,7 +60,6 @@ launcher = defaultGun
|
|||||||
& useAim . aimSpeed .~ 0.2
|
& useAim . aimSpeed .~ 0.2
|
||||||
& useAim . aimRange .~ 0.5
|
& useAim . aimRange .~ 0.5
|
||||||
& useAim . aimStance .~ TwoHandTwist
|
& useAim . aimStance .~ TwoHandTwist
|
||||||
, _itEffect = NoItEffect
|
|
||||||
, _itParams = ShellLauncher
|
, _itParams = ShellLauncher
|
||||||
{ _shellSpinDrag = 1
|
{ _shellSpinDrag = 1
|
||||||
, _shellSpinAmount = 2
|
, _shellSpinAmount = 2
|
||||||
@@ -80,6 +81,28 @@ launcher = defaultGun
|
|||||||
, _dimSPic = launcherPic
|
, _dimSPic = launcherPic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
& itModules . at ModLauncherHoming ?~ DefaultModule
|
||||||
|
|
||||||
|
doubleLauncher :: Item
|
||||||
|
doubleLauncher = launcher
|
||||||
|
& itName .~ "DOUBLEROCKO"
|
||||||
|
& itType .~ DOUBLELAUNCHER
|
||||||
|
& itUse . rUse .~ usePjCreationDouble
|
||||||
|
& itUse . useMods .~
|
||||||
|
[ hammerCheckI
|
||||||
|
, ammoCheckI
|
||||||
|
, useTimeCheck
|
||||||
|
, withSoundStart tap4S
|
||||||
|
, useAmmoAmount 1
|
||||||
|
]
|
||||||
|
|
||||||
|
usePjCreation :: Item -> Creature -> World -> World
|
||||||
|
usePjCreation it = _amPjCreation (_aoType (_itConsumption it)) it
|
||||||
|
|
||||||
|
usePjCreationDouble :: Item -> Creature -> World -> World
|
||||||
|
usePjCreationDouble it cr = _amPjCreation (_aoType (_itConsumption it)) it cr
|
||||||
|
. _amPjCreation (_aoType (_itConsumption it)) it (cr & crDir +~ pi)
|
||||||
|
|
||||||
launcherPic :: Item -> SPic
|
launcherPic :: Item -> SPic
|
||||||
launcherPic _ =
|
launcherPic _ =
|
||||||
( colorSH cyan $ prismPoly
|
( colorSH cyan $ prismPoly
|
||||||
@@ -155,8 +178,8 @@ doThrust pj w = w
|
|||||||
(sparkD,_) = randomR (-0.2,0.2) $ _randGen w
|
(sparkD,_) = randomR (-0.2,0.2) $ _randGen w
|
||||||
r1 = randInCirc 10 & evalState $ _randGen w
|
r1 = randInCirc 10 & evalState $ _randGen w
|
||||||
|
|
||||||
fireLauncher :: Item -> Creature -> World -> World
|
fireShell :: Item -> Creature -> World -> World
|
||||||
fireLauncher it cr = makeShell it cr $ \pj -> pjEffAtTime 35 (trySpinByCID (_crID cr) spinamount) pj
|
fireShell it cr = makeShell it cr $ \pj -> pjEffAtTime 35 (trySpinByCID (_crID cr) spinamount) pj
|
||||||
. pjThrust thrustdelay pj
|
. pjThrust thrustdelay pj
|
||||||
. reduceSpinBy (1-fromIntegral spindrag*2 / 200) pj
|
. reduceSpinBy (1-fromIntegral spindrag*2 / 200) pj
|
||||||
. decTimMvVel pj
|
. decTimMvVel pj
|
||||||
@@ -253,12 +276,6 @@ trySpinByCID cid i pj w = w & props . ix pjid . pjSpin .~ newSpin
|
|||||||
_ -> 0
|
_ -> 0
|
||||||
spinFactor = 5 * (6 - fromIntegral i)
|
spinFactor = 5 * (6 - fromIntegral i)
|
||||||
|
|
||||||
trackingLauncher :: Item
|
|
||||||
trackingLauncher = launcher
|
|
||||||
& itName .~ "ROCKO-TRACK"
|
|
||||||
& itType .~ TRACKINGLAUNCHER
|
|
||||||
& itUse . rUse .~ fireTrackingLauncher
|
|
||||||
|
|
||||||
remoteLauncherName :: String
|
remoteLauncherName :: String
|
||||||
remoteLauncherName = "ROCKO-REMOTE"
|
remoteLauncherName = "ROCKO-REMOTE"
|
||||||
|
|
||||||
@@ -266,13 +283,13 @@ remoteLauncher :: Item
|
|||||||
remoteLauncher = launcher
|
remoteLauncher = launcher
|
||||||
& itName .~ remoteLauncherName
|
& itName .~ remoteLauncherName
|
||||||
& itType .~ REMOTELAUNCHER
|
& itType .~ REMOTELAUNCHER
|
||||||
& itUse . rUse .~ fireRemoteLauncher
|
& itUse . rUse .~ fireRemoteShell
|
||||||
& itScope .~ RemoteScope (V2 0 0) 1 True
|
& itScope .~ RemoteScope (V2 0 0) 1 True
|
||||||
& itConsumption . aoType . amPjDraw .~ drawRemoteShell
|
& itConsumption . aoType . amPjDraw .~ drawRemoteShell
|
||||||
-- TODO consider allowing tweaking rocket speed
|
-- TODO consider allowing tweaking rocket speed
|
||||||
|
|
||||||
fireRemoteLauncher :: Item -> Creature -> World -> World
|
fireRemoteShell :: Item -> Creature -> World -> World
|
||||||
fireRemoteLauncher it cr w = setLocation
|
fireRemoteShell it cr w = setLocation
|
||||||
$ set (creatures . ix cid . crInv . ix j . itUse . rUse)
|
$ set (creatures . ix cid . crInv . ix j . itUse . rUse)
|
||||||
(\_ _ -> explodeRemoteRocket itid i)
|
(\_ _ -> explodeRemoteRocket itid i)
|
||||||
$ set (creatures . ix cid . crInv . ix j . itName) remoteLauncherName
|
$ set (creatures . ix cid . crInv . ix j . itName) remoteLauncherName
|
||||||
@@ -340,7 +357,7 @@ explodeRemoteRocket
|
|||||||
-> World
|
-> World
|
||||||
-> World
|
-> World
|
||||||
explodeRemoteRocket itid pjid w = w
|
explodeRemoteRocket itid pjid w = w
|
||||||
& props . ix pjid . pjUpdate .~ (\_ -> retireRemoteProj fireRemoteLauncher itid 30 pjid)
|
& props . ix pjid . pjUpdate .~ (\_ -> retireRemoteProj fireRemoteShell itid 30 pjid)
|
||||||
& props . ix pjid . prDraw .~ const mempty
|
& props . ix pjid . prDraw .~ const mempty
|
||||||
& itPoint . itUse . rUse .~ (\_ _ -> id)
|
& itPoint . itUse . rUse .~ (\_ _ -> id)
|
||||||
& itPoint . itName .~ "REMOTELAUNCHER"
|
& itPoint . itName .~ "REMOTELAUNCHER"
|
||||||
@@ -349,8 +366,8 @@ explodeRemoteRocket itid pjid w = w
|
|||||||
itPoint = pointToItem $ _itemPositions w IM.! itid
|
itPoint = pointToItem $ _itemPositions w IM.! itid
|
||||||
thepj = _props w IM.! pjid
|
thepj = _props w IM.! pjid
|
||||||
|
|
||||||
fireTrackingLauncher :: Item -> Creature -> World -> World
|
fireTrackingShell :: Item -> Creature -> World -> World
|
||||||
fireTrackingLauncher it cr w = setLocation
|
fireTrackingShell it cr w = setLocation
|
||||||
$ addTrackRocket w
|
$ addTrackRocket w
|
||||||
where
|
where
|
||||||
cid = _crID cr
|
cid = _crID cr
|
||||||
|
|||||||
Reference in New Issue
Block a user