Work on cleaning up item effects/attachments etc
This commit is contained in:
@@ -1,18 +1,16 @@
|
||||
module Dodge.Item.Weapon.Remote
|
||||
( pointerToItem
|
||||
, setRemoteScope
|
||||
( setRemoteScope
|
||||
, setRemoteBombScope
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Dodge.Default
|
||||
import Geometry
|
||||
import Dodge.Item.Location
|
||||
|
||||
import qualified IntMapHelp as IM
|
||||
import Control.Lens
|
||||
|
||||
setRemoteBombScope :: Int -> Prop -> World -> World
|
||||
setRemoteBombScope itid pj w' = case _itemPositions (_cWorld w') IM.! itid of
|
||||
setRemoteBombScope itid pj w' = case _itemLocations (_cWorld w') IM.! itid of
|
||||
InInv cid invid
|
||||
-> w' & cWorld . creatures . ix cid . crInv . ix invid . itScope
|
||||
. scopePos .~ (_prPos pj -.- _crPos (_creatures (_cWorld w') IM.! cid))
|
||||
@@ -21,7 +19,7 @@ setRemoteBombScope itid pj w' = case _itemPositions (_cWorld w') IM.! itid of
|
||||
_ -> w'
|
||||
|
||||
setRemoteScope :: Int -> Point2 -> World -> World
|
||||
setRemoteScope itid pos w' = case w' ^? cWorld . itemPositions . ix itid of
|
||||
setRemoteScope itid pos w' = case w' ^? cWorld . itemLocations . ix itid of
|
||||
Just (InInv cid' invid )
|
||||
-> w' & cWorld . creatures . ix cid' . crInv . ix invid . itScope
|
||||
. scopePos .~ (pos -.- _crPos (_creatures (_cWorld w') IM.! cid'))
|
||||
|
||||
Reference in New Issue
Block a user