This commit is contained in:
2022-07-13 22:22:24 +01:00
parent 33e9b5b1f0
commit 35a1eb9732
18 changed files with 89 additions and 69 deletions
+7 -6
View File
@@ -35,25 +35,26 @@ equipItemSPic et _ = case et of
,color yellow $ thickArc (3*pi/2) (2*pi) 10 5
])
WRISTARMOUR -> defSPic
INVISIBILITYEQUIPMENT _ -> (noPic (colorSH chartreuse $ upperPrismPoly 3 $ rectWH 2 2))
INVISIBILITYEQUIPMENT _ -> noPic (colorSH chartreuse $ upperPrismPoly 3 $ rectWH 2 2)
BRAINHAT -> noPic (colorSH yellow $ upperPrismPoly 3 $ rectWH 4 4)
HAT -> noPic (colorSH yellow $ upperPrismPoly 3 $ rectWH 4 4)
HEADLAMP -> noPic headLampShape
HEADLAMP1 -> noPic headLampShape
POWERLEGS -> legsSPic yellow
SPEEDLEGS -> legsSPic green
JUMPLEGS -> legsSPic red
FLATSHIELD -> flatShieldEquipSPic
JETPACK -> ((,) emptySH $ setDepth 20
JETPACK -> (,) emptySH $ setDepth 20
$ pictures [color yellow $ polygon $ reverse $ rectNSWE 5 (-5) (-11) (-3) ]
)
AUTODETECTOR dt -> (noPic (colorSH (detectorColor dt) $ upperPrismPoly 3 $ rectWH 2 2))
AUTODETECTOR dt -> noPic (colorSH (detectorColor dt) $ upperPrismPoly 3 $ rectWH 2 2)
leftItemSPic :: LeftItemType -> Item -> SPic
leftItemSPic lt _ = case lt of
BLINKER -> defSPic
_ -> defSPic
heldItemSPic :: HeldItemType -> Item -> SPic
heldItemSPic ht it = case ht of
FLATSHIELD -> flatShieldEquipSPic
FORCEFIELDGUN -> defSPic
TORCH -> defSPic
BANGSTICK i -> noPic $ baseStickShapeX it i <> stickClip it
PISTOL -> noPic $ baseStickShape <> makeTinClipAt pi (V3 5 2 0) it
REVOLVER -> noPic $ baseStickShape <> revolverClip it
@@ -314,4 +315,4 @@ latchkeyPic = color yellow $
,thickLine 2 $ map toV2 [(4,0),(4,-4)]
]
legsSPic :: Color -> SPic
legsSPic col = (noPic $ translateSH (V3 0 4 0) $ colorSH col $ upperPrismPoly 3 $ rectWH 2 2)
legsSPic col = noPic $ translateSH (V3 0 4 0) $ colorSH col $ upperPrismPoly 3 $ rectWH 2 2
+25 -9
View File
@@ -1,10 +1,12 @@
module Dodge.Item.Equipment
( module Dodge.Item.Equipment.Booster
, torch
, magShield
, powerLegs
, flatShield
, wristInvisibility
, wristArmour
, hat
, brainHat
, frontArmour
, headLamp
@@ -19,7 +21,6 @@ import Dodge.Item.Draw
import Dodge.Item.Equipment.Booster
import Dodge.LightSource
import Dodge.Default
import Dodge.Default.Wall
import Dodge.Creature.Test
import Dodge.Creature.HandPos
import Dodge.Wall
@@ -105,13 +106,22 @@ setWristShieldPos itm cr w = w
| otherwise = id
f = (+.+ _crPos cr) . stripZ . rotate3 (_crDir cr) . handtrans cr
torch :: Item
torch = defaultWeapon
& itEffect .~ effectOnOffHeld createHeldLight (const $ const id)
createHeldLight :: Creature -> Int -> World -> World
createHeldLight cr i w = w
removeHeldLight :: Creature -> Int -> World -> World
removeHeldLight cr i w = w
flatShield :: Item
flatShield = defaultEquipment
{ _itEffect = effectOnOffHeld createShieldWall removeShieldWall
flatShield = defaultWeapon
& itEffect .~ effectOnOffHeld createShieldWall removeShieldWall
-- the above seems to work, but I am not sure why: it may break on edge
-- cases
, _itUse = RightUse
& itUse .~ defaultrUse
{ _rUse = \_ _ -> id
, _useDelay = NoDelay
, _useMods = []
@@ -126,9 +136,8 @@ flatShield = defaultEquipment
}
, _heldScroll = \_ _ -> id
}
, _itInvSize = 3
}
& itType . iyBase .~ EQUIP FLATSHIELD
& itInvSize .~ 3
& itType . iyBase .~ HELD FLATSHIELD
shieldWall :: Int -> Wall
shieldWall crid = defaultWall
@@ -184,9 +193,9 @@ effectOnOffHeld f f' = ItInvEffectID
, _ieMID = Nothing
}
where
g itm cr w
g itm cr w
| crSel cr == invid = f cr invid w
| otherwise = f' cr invid w
| otherwise = f' cr invid w
where
invid = _ipInvID $ _itPos itm
@@ -205,6 +214,13 @@ brainHat = defaultEquipment
}
& itUse . eqEq . eqSite .~ GoesOnHead
& itType . iyBase .~ EQUIP BRAINHAT
hat :: Item
hat = defaultEquipment
{ _itEffect = NoItEffect
, _itID = Nothing
}
& itUse . eqEq . eqSite .~ GoesOnHead
& itType . iyBase .~ EQUIP HAT
headLamp1 :: Item
headLamp1 = defaultEquipment
+1 -21
View File
@@ -1,6 +1,5 @@
module Dodge.Item.Weapon.AmmoParams
( ruseAmmoParams
, useAmmoParams
( useAmmoParams
, fractionLoadedAmmo
, fractionLoadedAmmo2
) where
@@ -16,25 +15,6 @@ import LensHelp
import Data.Maybe
--import Control.Lens
ruseAmmoParams :: ItemUse
ruseAmmoParams = RightUse
{ _rUse = useAmmoParams Nothing
, _useDelay = FixedRate {_rateMax = 10, _rateTime = 0}
, _useMods = []
, _useHammer = HammerUp
, _useAim = defaultAimParams
, _heldScroll = \_ _ -> id
}
--defaultAimParams :: AimParams
--defaultAimParams = AimParams
-- { _aimWeight = 0
-- , _aimRange = 0
-- , _aimZoom = ItZoom 20 0.2 1
-- , _aimStance = OneHand
-- , _aimHandlePos = 10
-- , _aimMuzPos = 20
-- }
useAmmoParams :: Maybe Float -> Item -> Creature -> World -> World
useAmmoParams vfact it cr w = w & instantParticles .:~ aBulAt
vfact
+1 -1
View File
@@ -191,7 +191,7 @@ burstRifle = repeater
-- , withRecoil
-- ]
miniGunUse :: Int -> ItemUse
miniGunUse i = ruseAmmoParams
miniGunUse i = defaultrUse
& rUse .~ useAmmoParams (Just 1)
& useDelay .~ NoDelay
& useMods .~
+1 -8
View File
@@ -11,13 +11,6 @@ import Dodge.Reloading.Action
import Dodge.Data
import Dodge.ChainEffect
import Dodge.Default.Weapon
--import Dodge.Item.Weapon.InventoryDisplay
--import Dodge.Default
--import Dodge.Item.Attachment
--import Dodge.Item.Weapon.ExtraEffect
--import Dodge.Item.Weapon.InventoryDisplay
import Dodge.Item.Weapon.AmmoParams
--import Dodge.Item.Draw
import Dodge.Item.Weapon.TriggerType
import Dodge.SoundLogic.LoadSound
import Geometry
@@ -37,7 +30,7 @@ bangStickSoundChoice it
bangStick :: Int -> Item
bangStick i = defaultBulletWeapon
{ _itUse = ruseAmmoParams
{ _itUse = defaultrUse
& useDelay . rateMax .~ 8
& useMods .~
[ ammoHammerCheck
-1
View File
@@ -6,7 +6,6 @@ import Dodge.Item.Weapon.TriggerType
import Dodge.Item.Weapon.ExtraEffect
import Dodge.Item.Weapon.UseEffect
--import Dodge.Item.Weapon.Remote
import Dodge.Default.Weapon
import Dodge.SoundLogic
import Control.Lens
-1
View File
@@ -21,7 +21,6 @@ import Dodge.Default
--import Dodge.Item.Weapon.BulletGuns
--import Dodge.Item.Weapon.InventoryDisplay
import Dodge.Item.Weapon.TriggerType
import Dodge.Default.Weapon
--import Dodge.Item.Attachment
import Geometry
import LensHelp
-1
View File
@@ -6,7 +6,6 @@ import Dodge.Default
import Dodge.Creature.Action
import Dodge.Item.Weapon.TriggerType
import Dodge.Item.Weapon.ExtraEffect
import Dodge.Default.Weapon
import Dodge.Wall.ForceField
import Dodge.Wall.Move
--import Sound.Data