Implement zipper for attachment trees

This commit is contained in:
2024-10-05 14:39:34 +01:00
parent 71d4802a4a
commit 164beeea6d
23 changed files with 391 additions and 277 deletions
+17 -7
View File
@@ -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