This commit is contained in:
2022-07-28 12:35:19 +01:00
parent 160560af5f
commit 8aeabf3f6c
16 changed files with 123 additions and 365 deletions
+14
View File
@@ -355,6 +355,12 @@ useMod hm = case hm of
cr & crDir %~ tweenAngles x (_crOldDir cr)
& crPos %~ tweenPoints x (_crOldPos cr)
mcUseHeld :: HeldItemType -> Item -> Machine -> World -> World
mcUseHeld hit = case hit of
LASGUN -> mcShootLaser
_ -> \_ _ -> id
useHeld :: HeldUse -> Item -> Creature -> World -> World
useHeld hu = case hu of
HeldDoNothing -> const $ const id
@@ -480,3 +486,11 @@ coneRandItemParams = do
{ _muzVel = muzv
, _rifling = rifl
}
mcShootLaser :: Item -> Machine -> World -> World
mcShootLaser it mc = cWorld . lasers .:~ lasRayAt (_lasColor $ _itParams it) dam phasev pos dir
where
pos = _mcPos mc
dir = mc ^?! mcType . _McTurret . tuDir
phasev = _phaseV . _itParams $ it
dam = _lasDamage $ _itParams it