Implement zipper for attachment trees
This commit is contained in:
+17
-7
@@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
module Dodge.Item.Scope (
|
||||
zoomScope,
|
||||
targetingScope,
|
||||
@@ -20,13 +21,22 @@ zoomScope = defaultHeldItem
|
||||
& itUse .~ UseScope OpticScope{_opticPos = 0, _opticZoom = 1, _opticDefaultZoom = 0.5}
|
||||
|
||||
targetingScope :: TargetingType -> Item
|
||||
targetingScope tt = defaultHeldItem
|
||||
& itType .~ TARGETING tt
|
||||
& itUse .~ UseTargeting
|
||||
{ _tgPos = Nothing
|
||||
, _tgID = Nothing
|
||||
, _tgActive = False
|
||||
}
|
||||
targetingScope tt= case tt of
|
||||
TARGETLASER -> defaultHeldItem
|
||||
& itType .~ TARGETING tt
|
||||
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
||||
& itUse .~ UseTargeting
|
||||
{ _tgPos = Nothing
|
||||
, _tgID = Nothing
|
||||
, _tgActive = False
|
||||
}
|
||||
_ -> defaultHeldItem
|
||||
& itType .~ TARGETING tt
|
||||
& itUse .~ UseTargeting
|
||||
{ _tgPos = Nothing
|
||||
, _tgID = Nothing
|
||||
, _tgActive = False
|
||||
}
|
||||
|
||||
homingModule :: Item
|
||||
homingModule = makeAttach HOMINGMODULE
|
||||
|
||||
Reference in New Issue
Block a user