Return to project, unsure about changes

This commit is contained in:
2024-05-25 13:10:50 +01:00
parent 08716e8ade
commit c862c862df
63 changed files with 1137641 additions and 52 deletions
-5
View File
@@ -14,8 +14,3 @@ drumMag = tinMag & itType . iyBase .~ ATTACH (AMMOATTACH DRUMMAG)
beltMag :: Item
beltMag = tinMag & itType . iyBase .~ ATTACH (AMMOATTACH BULLETBELT)
zoomScope :: Item
zoomScope = tinMag
& itType . iyBase .~ ATTACH (SCROLLATTACH ZOOMSCOPE)
& itUse .~ AttachUse (ScrollAttachParams (ZoomScrollParams {_opticPos = 0, _opticZoom = 1, _opticDefaultZoom = 0.5}))
+19 -24
View File
@@ -1,7 +1,7 @@
module Dodge.Item.Display (
--itemDisplay,
itemDisplayOffset,
canAttachTargetingBelow,
canAttachTargeting,
-- selectedItemDisplay,
itemString,
itemBaseName,
@@ -20,34 +20,29 @@ import Padding
itemDisplayOffset :: Creature -> Item -> (Int, [String])
itemDisplayOffset cr itm = case itm ^. itType . iyBase of
EQUIP (TARGETINGHAT tt)
| targetItemCanAttachAbove cr itm ->
( -1
, leftPad 15 ' ' (targetingTypeString tt) :
(itemDisplay cr itm & ix 0 %~ (\s -> itemDisplayPad s (replicate (length (targetingTypeString tt)) '^')))
)
EQUIP (TARGETINGHAT tt) ->
(0, itemDisplay cr itm & ix 0 %~ (\s -> itemDisplayPad s (targetingTypeString tt)))
-- EQUIP (TARGETINGHAT tt)
-- | targetItemCanAttachAbove cr itm ->
-- ( -1
-- , leftPad 15 ' ' (targetingTypeString tt) :
-- (itemDisplay cr itm & ix 0 %~ (\s -> itemDisplayPad s (replicate (length (targetingTypeString tt)) '^')))
-- )
-- EQUIP (TARGETINGHAT tt) ->
-- (0, itemDisplay cr itm & ix 0 %~ (\s -> itemDisplayPad s (targetingTypeString tt)))
_ -> (0, itemDisplay cr itm)
targetItemCanAttachAbove :: Creature -> Item -> Bool
targetItemCanAttachAbove cr itm = fromMaybe False $ do
i <- itm ^? itLocation . ipInvID
itm' <- cr ^? crInv . ix (i - 1)
return $ canAttachTargetingBelow itm'
canAttachTargetingBelow :: Item -> Bool
canAttachTargetingBelow itm =
canAttachTargeting :: TargetType -> Item -> Bool
canAttachTargeting TARGETLASER _ = True
canAttachTargeting _ itm =
isJust (itm ^? itType . iyModules . ix ModBulletTrajectory . imtBulletTrajectoryType)
|| Just LAUNCHHOME == (itm ^? itType . iyModules . ix ModLauncherHoming)
targetingTypeString :: TargetType -> String
targetingTypeString tt = case tt of
TargetLaser -> "LASER"
TargetRBPress -> "POS"
TargetRBLine -> ""
TargetRBCreature -> "LIFEFORM"
TargetCursor -> "CURSOR"
--targetingTypeString :: TargetType -> String
--targetingTypeString tt = case tt of
-- TARGETLASER -> "LASER"
-- TargetRBPress -> "POS"
-- TargetRBLine -> ""
-- TargetRBCreature -> "LIFEFORM"
-- TargetCursor -> "CURSOR"
itemDisplay :: Creature -> Item -> [String]
itemDisplay cr itm =
-3
View File
@@ -68,9 +68,6 @@ sniperRifle =
& itType . iyBase .~ HELD SNIPERRIFLE
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 0.5, _izMin = 0.5,_izFac = 1}
-- & itUse . heldScroll .~ HeldScrollZoom -- zoomLongGun
-- & itType . iyModules . at ModTarget ?~ TARGET TargetLaser
-- & itUse . useTargeting ?~ TargetLaser
machineGun :: Item
machineGun =
+1 -1
View File
@@ -142,7 +142,7 @@ equipInfo eit = case eit of
targetingInfo :: TargetType -> String
targetingInfo tt = case tt of
TargetLaser -> "creates a laser, the end of which becomes the target."
TARGETLASER -> "creates a laser, the end of which becomes the target."
TargetRBPress -> "creates a fixed target."
TargetRBLine -> "creates a line target."
TargetRBCreature -> "targets a creature."
+20
View File
@@ -0,0 +1,20 @@
module Dodge.Item.Scope (
zoomScope,
targetingScope,
) where
import Control.Lens
import Dodge.Data.Item
import Dodge.Default.Item
zoomScope :: Item
zoomScope =
defaultHeldItem
& itType . iyBase .~ ATTACH (SCROLLATTACH ZOOMSCOPE)
& itUse .~ AttachUse (ScrollAttachParams (ZoomScrollParams{_opticPos = 0, _opticZoom = 1, _opticDefaultZoom = 0.5}))
targetingScope :: TargetType -> Item
targetingScope tt =
defaultHeldItem
& itType . iyBase .~ ATTACH (TARGETATTACH tt)
& itUse .~ AttachUse TargetAttachParams