Move item inv size and item dimensions from records to external function

This commit is contained in:
2024-11-26 23:36:08 +00:00
parent 9534698a24
commit b21513c4dd
22 changed files with 187 additions and 176 deletions
-6
View File
@@ -22,8 +22,6 @@ teslaGun :: Item
teslaGun =
defaultHeldItem
& itUse . heldParams .~ BeamShooterParams (Just (elecCrackleS,2))
& itDimension . dimRad .~ 9
& itDimension . dimCenter .~ V3 4 0 0
& itParams .~ teslaParams
& itUse . heldDelay .~ NoDelay
& itUse . heldAim . aimWeight .~ 6
@@ -53,8 +51,6 @@ laser =
, _itTgID = Nothing
, _itTgActive = False
}
& itDimension . dimRad .~ 10
& itDimension . dimCenter .~ V3 15 0 0
& itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimStance .~ TwoHandFlat
@@ -74,8 +70,6 @@ tractorGun =
, _itTgID = Nothing
, _itTgActive = False
}
& itDimension . dimRad .~ 10
& itDimension . dimCenter .~ V3 15 0 0
& itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimStance .~ TwoHandUnder
-7
View File
@@ -22,8 +22,6 @@ defaultBangCane =
& itUse . heldParams . rifling .~ ConstFloat 0.9
& itUse . heldParams . recoil .~ 50
& itUse . heldParams . torqueAfter .~ 0.1
& itDimension . dimRad .~ 8
& itDimension . dimCenter .~ V3 5 0 0
& itUse . heldDelay . rateMax .~ 6
-- & itUse . heldMods .~ BangCaneMod
& itUse . heldAim . aimStance .~ OneHand
@@ -57,7 +55,6 @@ rifle =
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 25 0
-- & itType . iyModules . at ModHeldAttach ?~ EMPTYMODULE
--repeater :: Item
--repeater =
@@ -97,8 +94,4 @@ miniGunX i =
& itUse . heldParams . sidePush .~ 10 * fromIntegral i
& itUse . heldParams . randomOffset .~ 10
& itUse . heldParams . rifling .~ UniRandFloat 0.8 0.9
& itInvSize .~ (i + 3) `div` 2
& itDimension . dimRad .~ 20
& itDimension . dimCenter .~ V3 5 0 0
& itDimension . dimAttachPos .~ V3 5 (-5) 0
& itType .~ HELD (MINIGUNX i)
-4
View File
@@ -11,11 +11,7 @@ import Linear
bangCone :: Item
bangCone =
defaultBulletWeapon
& itDimension . dimRad .~ 8
& itDimension . dimCenter .~ V3 5 0 0
& itUse . heldDelay . rateMax .~ 20
-- & itUse . heldMods .~ PistolMod
-- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles
.~ replicate 15 (Muzzle (V2 15 0) 0 0.5 0 DefaultFlareType MuzzleShootBullet)
& itUse . heldParams . muzVel .~ UniRandFloat 0.5 0.8
-3
View File
@@ -12,9 +12,6 @@ import Geometry.Data
launcher :: Item
launcher =
defaultHeldItem
& itInvSize .~ 3
& itDimension . dimRad .~ 9
& itDimension . dimCenter .~ V3 10 0 0
& itUse . heldDelay . rateMax .~ 20
& itUse . heldAim . aimWeight .~ 8
& itUse . heldAim . aimRange .~ 0.5
-2
View File
@@ -23,8 +23,6 @@ bangRod =
& itUse . heldParams . torqueAfter .~ 0.3
& itUse . heldParams . bulGunSound ?~ (bangEchoS,0)
& itUse . heldDelay . rateMax .~ 12
& itDimension . dimRad .~ 12
& itDimension . dimCenter .~ V3 5 0 0
& itType .~ HELD BANGROD
& itUse . heldAim . aimWeight .~ 8
& itUse . heldAim . aimRange .~ 1
-5
View File
@@ -73,12 +73,7 @@ flameThrower :: Item
flameThrower =
defaultHeldItem
& itParams .~ NoParams
& itDimension . dimRad .~ 7
& itDimension . dimCenter .~ V3 9 0 0
-- & itUse . heldUse .~ HeldOverNozzlesUseGasParams -- overNozzles useGasParams
& itUse . heldDelay .~ NoDelay
-- & itUse . heldMods .~ FlameThrowerMod
-- & itUse . heldMods .~ PistolMod
& itUse . heldAim . aimWeight .~ 5
& itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 5, _izMin = 1.5}
& itUse . heldAim . aimStance .~ TwoHandUnder
-5
View File
@@ -20,12 +20,7 @@ bangStick i =
& itUse . heldParams . recoil .~ 25
& itUse . heldParams . torqueAfter .~ 0.18 + 0.02 * fromIntegral i
& itType .~ HELD (BANGSTICK i)
& itInvSize .~ max 1 (i `div` 2)
& itDimension . dimRad .~ 5
& itDimension . dimCenter .~ V3 5 0 0
& itUse . heldDelay . rateMax .~ 8
-- & itUse . heldMods .~ BangStickMod
-- & itUse . heldMods .~ PistolMod
& itUse . heldAim . aimMuzzles
.~ [Muzzle (V2 10 0) a 0.01 0 DefaultFlareType MuzzleShootBullet | a <- spreadAroundCenter i baseStickSpread]
-1
View File
@@ -14,7 +14,6 @@ flatShield =
& itUse . heldAim . aimTurnSpeed .~ 0.5
& itUse . heldAim . aimStance .~ TwoHandFlat
-- & itUse . heldAim . aimHandlePos .~ 0
& itInvSize .~ 3
& itType .~ HELD FLATSHIELD
keyCard :: Int -> Item