Separate out concrete part of world

This commit is contained in:
2022-07-25 12:10:50 +01:00
parent 3354d108be
commit b2efbd2b3e
134 changed files with 933 additions and 930 deletions
+4 -4
View File
@@ -360,10 +360,10 @@ overNozzles = overNozzles' . overNozzle
overNozzles' :: (Item -> Creature -> World -> Nozzle -> (World,Nozzle))
-> Item -> Creature -> World -> World
overNozzles' eff it cr w = neww & creatures . ix cid . crInv . ix i . itParams . sprayNozzles .~ newNozzles
overNozzles' eff it cr w = neww & cWorld . creatures . ix cid . crInv . ix i . itParams . sprayNozzles .~ newNozzles
where
cid = _crID cr
i = crSel $ _creatures w IM.! cid
i = crSel $ _creatures (_cWorld w) IM.! cid
(neww,newNozzles) = mapAccumR (eff it cr) w $ _sprayNozzles (_itParams it)
overNozzle :: (Nozzle -> Item -> Creature -> World -> World)
@@ -386,12 +386,12 @@ useGasParams nz it cr = createGas (_amCreateGas (_laAmmoType (_itConsumption it)
pos = _crPos cr +.+ (_nzLength nz *.* unitVectorAtAngle (_crDir cr))
fireRemoteShell :: Item -> Creature -> World -> World
fireRemoteShell it cr w = set (creatures . ix cid . crInv . ix j . itUse . rUse)
fireRemoteShell it cr w = set (cWorld . creatures . ix cid . crInv . ix j . itUse . rUse)
(HeldExplodeRemoteShell itid i)
$ addRemRocket w'
where
(w',itid) = getHeldItemLoc cr w
i = IM.newKey $ _props w
i = IM.newKey $ _props (_cWorld w)
cid = _crID cr
addRemRocket = makeShell it cr
[ PJSetScope itid