Remove unnecessary item held/worn field type
This commit is contained in:
@@ -18,10 +18,10 @@ aimingWeaponHandlePos cr it = case it ^? itUse. useAim . aimStance of
|
|||||||
Nothing -> 0
|
Nothing -> 0
|
||||||
aimingWeaponZeroPos :: Creature -> Item -> Float
|
aimingWeaponZeroPos :: Creature -> Item -> Float
|
||||||
aimingWeaponZeroPos cr it = aimingWeaponHandlePos cr it
|
aimingWeaponZeroPos cr it = aimingWeaponHandlePos cr it
|
||||||
- fromMaybe 0 (it ^? itDimension . dimPortage . handlePos)
|
- fromMaybe 0 (it ^? itUse . useAim . aimHandlePos)
|
||||||
aimingMuzzlePos :: Creature -> Item -> Float
|
aimingMuzzlePos :: Creature -> Item -> Float
|
||||||
aimingMuzzlePos cr it = aimingWeaponZeroPos cr it
|
aimingMuzzlePos cr it = aimingWeaponZeroPos cr it
|
||||||
+ fromMaybe 0 (it ^? itDimension . dimPortage . muzPos)
|
+ fromMaybe 0 (it ^? itUse . useAim . aimMuzPos)
|
||||||
|
|
||||||
translatePointToRightHand :: Creature -> Point3 -> Point3
|
translatePointToRightHand :: Creature -> Point3 -> Point3
|
||||||
translatePointToRightHand cr = translatePointToRightHand' cr . mirrorV3xz
|
translatePointToRightHand cr = translatePointToRightHand' cr . mirrorV3xz
|
||||||
|
|||||||
+1
-1
@@ -569,7 +569,7 @@ data Targeting
|
|||||||
data ItemDimension = ItemDimension
|
data ItemDimension = ItemDimension
|
||||||
{ _dimRad :: Float
|
{ _dimRad :: Float
|
||||||
, _dimCenter :: Point3
|
, _dimCenter :: Point3
|
||||||
, _dimPortage :: ItemPortage
|
-- , _dimPortage :: ItemPortage
|
||||||
, _dimSPic :: Item -> SPic
|
, _dimSPic :: Item -> SPic
|
||||||
}
|
}
|
||||||
data ItemPortage
|
data ItemPortage
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
module Dodge.Default.AimParams where
|
||||||
|
import Dodge.Item.Data
|
||||||
|
|
||||||
|
defaultAimParams :: AimParams
|
||||||
|
defaultAimParams = AimParams
|
||||||
|
{ _aimWeight = 0
|
||||||
|
, _aimRange = 0
|
||||||
|
, _aimZoom = ItZoom 20 0.2 1
|
||||||
|
, _aimStance = OneHand
|
||||||
|
, _aimHandlePos = 10
|
||||||
|
, _aimMuzPos = 20
|
||||||
|
}
|
||||||
@@ -16,7 +16,7 @@ defaultItem = Item
|
|||||||
, _itInvColor = yellow
|
, _itInvColor = yellow
|
||||||
, _itInvSize = 1
|
, _itInvSize = 1
|
||||||
, _itPos = VoidItm
|
, _itPos = VoidItm
|
||||||
, _itDimension = ItemDimension 0 0 NoPortage (const mempty)
|
, _itDimension = ItemDimension 0 0 (const mempty)
|
||||||
, _itConsumption = NoConsumption
|
, _itConsumption = NoConsumption
|
||||||
, _itUse = NoUse
|
, _itUse = NoUse
|
||||||
, _itAttachment = NoItAttachment
|
, _itAttachment = NoItAttachment
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import Dodge.Item.Weapon.AmmoParams
|
|||||||
import Dodge.Reloading.Action
|
import Dodge.Reloading.Action
|
||||||
import Dodge.Item.Weapon.Bullet
|
import Dodge.Item.Weapon.Bullet
|
||||||
import Dodge.Default.Item
|
import Dodge.Default.Item
|
||||||
|
import Dodge.Default.AimParams
|
||||||
--import Dodge.Item.Draw
|
--import Dodge.Item.Draw
|
||||||
import Picture
|
import Picture
|
||||||
import ShapePicture
|
import ShapePicture
|
||||||
@@ -92,13 +93,6 @@ luseInstantNoH :: (Item -> Creature -> World -> World) -> ItemUse
|
|||||||
luseInstantNoH f = defaultlUse
|
luseInstantNoH f = defaultlUse
|
||||||
& lUse .~ f
|
& lUse .~ f
|
||||||
& useDelay .~ NoDelay
|
& useDelay .~ NoDelay
|
||||||
defaultAimParams :: AimParams
|
|
||||||
defaultAimParams = AimParams
|
|
||||||
{ _aimWeight = 0
|
|
||||||
, _aimRange = 0
|
|
||||||
, _aimZoom = ItZoom 20 0.2 1
|
|
||||||
, _aimStance = OneHand
|
|
||||||
}
|
|
||||||
|
|
||||||
-- TODO change this
|
-- TODO change this
|
||||||
defaultLeftItem :: Item
|
defaultLeftItem :: Item
|
||||||
@@ -134,20 +128,12 @@ defItDim :: ItemDimension
|
|||||||
defItDim = ItemDimension
|
defItDim = ItemDimension
|
||||||
{ _dimRad = 2
|
{ _dimRad = 2
|
||||||
, _dimCenter = V3 0 0 0
|
, _dimCenter = V3 0 0 0
|
||||||
, _dimPortage = HeldItem
|
|
||||||
{ _handlePos = 0
|
|
||||||
, _muzPos = 0
|
|
||||||
}
|
|
||||||
, _dimSPic = const $ noPic $ colorSH green $ upperPrismPoly 3 $ square 4
|
, _dimSPic = const $ noPic $ colorSH green $ upperPrismPoly 3 $ square 4
|
||||||
}
|
}
|
||||||
defItDimCol :: Color -> ItemDimension
|
defItDimCol :: Color -> ItemDimension
|
||||||
defItDimCol col = ItemDimension
|
defItDimCol col = ItemDimension
|
||||||
{ _dimRad = 2
|
{ _dimRad = 2
|
||||||
, _dimCenter = V3 0 0 0
|
, _dimCenter = V3 0 0 0
|
||||||
, _dimPortage = HeldItem
|
|
||||||
{ _handlePos = 0
|
|
||||||
, _muzPos = 0
|
|
||||||
}
|
|
||||||
, _dimSPic = const $ noPic $ colorSH col $ upperPrismPoly 3 $ square 4
|
, _dimSPic = const $ noPic $ colorSH col $ upperPrismPoly 3 $ square 4
|
||||||
}
|
}
|
||||||
defBulletShooter :: ItemParams
|
defBulletShooter :: ItemParams
|
||||||
|
|||||||
@@ -69,6 +69,8 @@ data AimParams = AimParams
|
|||||||
, _aimRange :: Float
|
, _aimRange :: Float
|
||||||
, _aimZoom :: ItZoom
|
, _aimZoom :: ItZoom
|
||||||
, _aimStance :: AimStance
|
, _aimStance :: AimStance
|
||||||
|
, _aimHandlePos :: Float
|
||||||
|
, _aimMuzPos :: Float
|
||||||
}
|
}
|
||||||
data UseDelay -- should just be Delay
|
data UseDelay -- should just be Delay
|
||||||
= NoDelay
|
= NoDelay
|
||||||
|
|||||||
@@ -18,10 +18,11 @@ import Control.Lens
|
|||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
|
|
||||||
itemEquipPict :: Creature -> Item -> SPic
|
itemEquipPict :: Creature -> Item -> SPic
|
||||||
itemEquipPict cr it = case _dimPortage (_itDimension it) of
|
itemEquipPict cr it = case it ^?! itUse of
|
||||||
HeldItem {} -> pictureWeaponOnAim cr it
|
RightUse {} -> pictureWeaponOnAim cr it
|
||||||
WornItem -> pictureOnEquip (itSPic it) cr it
|
ituse -> case ituse ^? eqEq of
|
||||||
NoPortage -> mempty
|
Just _ -> pictureOnEquip (itSPic it) cr it
|
||||||
|
Nothing -> mempty
|
||||||
|
|
||||||
pictureWeaponOnAim
|
pictureWeaponOnAim
|
||||||
:: Creature
|
:: Creature
|
||||||
@@ -72,7 +73,7 @@ pictureWeaponOnAimItem p' cr posInInv
|
|||||||
_ -> 0
|
_ -> 0
|
||||||
theIt = _crInv cr IM.! posInInv
|
theIt = _crInv cr IM.! posInInv
|
||||||
p = fromMaybe p' $ do
|
p = fromMaybe p' $ do
|
||||||
x <- theIt ^? itDimension . dimPortage . handlePos
|
x <- theIt ^? itUse . useAim . aimHandlePos
|
||||||
return $translateSPf (-x) 0 p'
|
return $translateSPf (-x) 0 p'
|
||||||
isOneHand = theIt ^? itUseAimStance == Just OneHand
|
isOneHand = theIt ^? itUseAimStance == Just OneHand
|
||||||
|| isNothing (theIt ^? itUseAimStance)
|
|| isNothing (theIt ^? itUseAimStance)
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ frontArmour = defaultEquipment
|
|||||||
}
|
}
|
||||||
& itUse . eqEq . eqSite .~ GoesOnChest
|
& itUse . eqEq . eqSite .~ GoesOnChest
|
||||||
& itType . iyBase .~ FRONTARMOUR
|
& itType . iyBase .~ FRONTARMOUR
|
||||||
& itDimension . dimPortage .~ WornItem
|
|
||||||
& itDimension . dimSPic .~ const (emptySH , setDepth 20 $ pictures
|
& itDimension . dimSPic .~ const (emptySH , setDepth 20 $ pictures
|
||||||
[color thecol $ thickArc 0 (pi/2) 10 5
|
[color thecol $ thickArc 0 (pi/2) 10 5
|
||||||
,color thecol $ thickArc (3*pi/2) (2*pi) 10 5
|
,color thecol $ thickArc (3*pi/2) (2*pi) 10 5
|
||||||
@@ -84,7 +83,6 @@ wristArmour = defaultEquipment
|
|||||||
& itUse . eqEq . eqUse .~ setWristShieldPos
|
& itUse . eqEq . eqUse .~ setWristShieldPos
|
||||||
& itUse . eqEq . eqOnRemove .~ onRemoveWristShield
|
& itUse . eqEq . eqOnRemove .~ onRemoveWristShield
|
||||||
& itType . iyBase .~ WRISTARMOUR
|
& itType . iyBase .~ WRISTARMOUR
|
||||||
& itDimension . dimPortage .~ WornItem
|
|
||||||
& itDimension . dimSPic .~ const mempty
|
& itDimension . dimSPic .~ const mempty
|
||||||
|
|
||||||
onEquipWristShield :: Item -> Creature -> World -> World
|
onEquipWristShield :: Item -> Creature -> World -> World
|
||||||
@@ -132,6 +130,8 @@ flatShield = defaultEquipment
|
|||||||
, _aimRange = 0
|
, _aimRange = 0
|
||||||
, _aimZoom = ItZoom 20 0.2 1
|
, _aimZoom = ItZoom 20 0.2 1
|
||||||
, _aimStance = TwoHandFlat
|
, _aimStance = TwoHandFlat
|
||||||
|
, _aimHandlePos = 10
|
||||||
|
, _aimMuzPos = 10
|
||||||
}
|
}
|
||||||
, _heldScroll = \_ _ -> id
|
, _heldScroll = \_ _ -> id
|
||||||
}
|
}
|
||||||
@@ -212,7 +212,6 @@ jetPack = defaultEquipment
|
|||||||
, _itID = Nothing
|
, _itID = Nothing
|
||||||
} & itUse . eqEq . eqSite .~ GoesOnBack
|
} & itUse . eqEq . eqSite .~ GoesOnBack
|
||||||
& itType . iyBase .~ JETPACK
|
& itType . iyBase .~ JETPACK
|
||||||
& itDimension . dimPortage .~ WornItem
|
|
||||||
& itDimension . dimSPic .~ ( \_ -> (,) emptySH $ setDepth 20
|
& itDimension . dimSPic .~ ( \_ -> (,) emptySH $ setDepth 20
|
||||||
$ pictures [color yellow $ polygon $ reverse $ rectNSWE 5 (-5) (-11) (-3) ]
|
$ pictures [color yellow $ polygon $ reverse $ rectNSWE 5 (-5) (-11) (-3) ]
|
||||||
)
|
)
|
||||||
@@ -224,7 +223,6 @@ brainHat = defaultEquipment
|
|||||||
}
|
}
|
||||||
& itUse . eqEq . eqSite .~ GoesOnHead
|
& itUse . eqEq . eqSite .~ GoesOnHead
|
||||||
& itType . iyBase .~ BRAINHAT
|
& itType . iyBase .~ BRAINHAT
|
||||||
& itDimension . dimPortage .~ WornItem
|
|
||||||
& itDimension . dimSPic .~
|
& itDimension . dimSPic .~
|
||||||
const (noPic $ colorSH yellow $ upperPrismPoly 3 $ rectWH 4 4)
|
const (noPic $ colorSH yellow $ upperPrismPoly 3 $ rectWH 4 4)
|
||||||
|
|
||||||
@@ -236,7 +234,6 @@ headLamp1 = defaultEquipment
|
|||||||
& itUse . eqEq . eqUse .~ createHeadLamp
|
& itUse . eqEq . eqUse .~ createHeadLamp
|
||||||
& itUse . eqEq . eqSite .~ GoesOnHead
|
& itUse . eqEq . eqSite .~ GoesOnHead
|
||||||
& itType . iyBase .~ HEADLAMP1
|
& itType . iyBase .~ HEADLAMP1
|
||||||
& itDimension . dimPortage .~ WornItem
|
|
||||||
& itDimension . dimSPic .~
|
& itDimension . dimSPic .~
|
||||||
const (noPic $ colorSH yellow $
|
const (noPic $ colorSH yellow $
|
||||||
translateSHf 5 2 (upperPrismPoly 8 $ rectWH 4 1)
|
translateSHf 5 2 (upperPrismPoly 8 $ rectWH 4 1)
|
||||||
@@ -249,7 +246,6 @@ headLamp = defaultEquipment
|
|||||||
& itUse . eqEq . eqUse .~ createHeadLamp
|
& itUse . eqEq . eqUse .~ createHeadLamp
|
||||||
& itUse . eqEq . eqSite .~ GoesOnHead
|
& itUse . eqEq . eqSite .~ GoesOnHead
|
||||||
& itType . iyBase .~ HEADLAMP
|
& itType . iyBase .~ HEADLAMP
|
||||||
& itDimension . dimPortage .~ WornItem
|
|
||||||
& itDimension . dimSPic .~ const (noPic headLampShape)
|
& itDimension . dimSPic .~ const (noPic headLampShape)
|
||||||
|
|
||||||
headLampShape :: Shape
|
headLampShape :: Shape
|
||||||
@@ -270,7 +266,6 @@ powerLegs = defaultEquipment
|
|||||||
}
|
}
|
||||||
& itUse . eqEq . eqSite .~ GoesOnLegs
|
& itUse . eqEq . eqSite .~ GoesOnLegs
|
||||||
& itType . iyBase .~ POWERLEGS
|
& itType . iyBase .~ POWERLEGS
|
||||||
& itDimension . dimPortage .~ WornItem
|
|
||||||
& itDimension . dimSPic .~ const
|
& itDimension . dimSPic .~ const
|
||||||
(noPic $ translateSH (V3 0 4 0) $ colorSH yellow $ upperPrismPoly 3 $ rectWH 2 2)
|
(noPic $ translateSH (V3 0 4 0) $ colorSH yellow $ upperPrismPoly 3 $ rectWH 2 2)
|
||||||
speedLegs :: Item
|
speedLegs :: Item
|
||||||
@@ -288,7 +283,6 @@ wristInvisibility = defaultEquipment
|
|||||||
& itUse . eqEq . eqOnEquip .~ overCID (crCamouflage .~ Invisible)
|
& itUse . eqEq . eqOnEquip .~ overCID (crCamouflage .~ Invisible)
|
||||||
& itUse . eqEq . eqOnRemove .~ overCID (crCamouflage .~ FullyVisible)
|
& itUse . eqEq . eqOnRemove .~ overCID (crCamouflage .~ FullyVisible)
|
||||||
& itType . iyBase .~ INVISIBILITYEQUIPMENT GoesOnWrist
|
& itType . iyBase .~ INVISIBILITYEQUIPMENT GoesOnWrist
|
||||||
& itDimension . dimPortage .~ WornItem
|
|
||||||
& itDimension . dimSPic .~ const (noPic (colorSH chartreuse $ upperPrismPoly 3 $ rectWH 2 2))
|
& itDimension . dimSPic .~ const (noPic (colorSH chartreuse $ upperPrismPoly 3 $ rectWH 2 2))
|
||||||
|
|
||||||
overCID :: (Creature -> Creature) -> Item -> Creature -> World -> World
|
overCID :: (Creature -> Creature) -> Item -> Creature -> World -> World
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ keyCard n = defaultEquipment
|
|||||||
, _itInvColor = aquamarine
|
, _itInvColor = aquamarine
|
||||||
}
|
}
|
||||||
& itType . iyBase .~ KEYCARD n
|
& itType . iyBase .~ KEYCARD n
|
||||||
& itDimension . dimPortage .~ WornItem
|
|
||||||
& itDimension . dimSPic .~ (const . noShape)
|
& itDimension . dimSPic .~ (const . noShape)
|
||||||
(setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) keyPic)
|
(setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) keyPic)
|
||||||
|
|
||||||
@@ -32,7 +31,6 @@ latchkey _ = defaultEquipment
|
|||||||
-- , _itZoom = defaultItZoom
|
-- , _itZoom = defaultItZoom
|
||||||
, _itInvColor = yellow
|
, _itInvColor = yellow
|
||||||
}
|
}
|
||||||
& itDimension . dimPortage .~ WornItem
|
|
||||||
& itDimension . dimSPic .~ ( \_ -> (,) emptySH $ setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) latchkeyPic
|
& itDimension . dimSPic .~ ( \_ -> (,) emptySH $ setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) latchkeyPic
|
||||||
)
|
)
|
||||||
latchkeyPic :: Picture
|
latchkeyPic :: Picture
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import Dodge.Base
|
|||||||
import Dodge.Particle.Bullet.Spawn
|
import Dodge.Particle.Bullet.Spawn
|
||||||
import Dodge.Creature.HandPos
|
import Dodge.Creature.HandPos
|
||||||
import Dodge.Movement.Turn
|
import Dodge.Movement.Turn
|
||||||
|
import Dodge.Default.AimParams
|
||||||
import Geometry
|
import Geometry
|
||||||
import LensHelp
|
import LensHelp
|
||||||
|
|
||||||
@@ -25,13 +26,15 @@ ruseAmmoParams = RightUse
|
|||||||
, _heldScroll = \_ _ -> id
|
, _heldScroll = \_ _ -> id
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultAimParams :: AimParams
|
--defaultAimParams :: AimParams
|
||||||
defaultAimParams = AimParams
|
--defaultAimParams = AimParams
|
||||||
{ _aimWeight = 0
|
-- { _aimWeight = 0
|
||||||
, _aimRange = 0
|
-- , _aimRange = 0
|
||||||
, _aimZoom = ItZoom 20 0.2 1
|
-- , _aimZoom = ItZoom 20 0.2 1
|
||||||
, _aimStance = OneHand
|
-- , _aimStance = OneHand
|
||||||
}
|
-- , _aimHandlePos = 10
|
||||||
|
-- , _aimMuzPos = 20
|
||||||
|
-- }
|
||||||
useAmmoParams :: Maybe Float -> Item -> Creature -> World -> World
|
useAmmoParams :: Maybe Float -> Item -> Creature -> World -> World
|
||||||
useAmmoParams vfact it cr w = w & instantParticles .:~ aBulAt
|
useAmmoParams vfact it cr w = w & instantParticles .:~ aBulAt
|
||||||
vfact
|
vfact
|
||||||
|
|||||||
@@ -80,10 +80,6 @@ teslaGun = defaultBatteryGun
|
|||||||
, _itDimension = ItemDimension
|
, _itDimension = ItemDimension
|
||||||
{ _dimRad = 9
|
{ _dimRad = 9
|
||||||
, _dimCenter = V3 4 0 0
|
, _dimCenter = V3 4 0 0
|
||||||
, _dimPortage = HeldItem
|
|
||||||
{_handlePos = 4
|
|
||||||
,_muzPos = 4
|
|
||||||
}
|
|
||||||
, _dimSPic = teslaGunPic
|
, _dimSPic = teslaGunPic
|
||||||
}
|
}
|
||||||
, _itParams = teslaParams
|
, _itParams = teslaParams
|
||||||
@@ -98,6 +94,8 @@ teslaGun = defaultBatteryGun
|
|||||||
]
|
]
|
||||||
& itUse . useAim . aimWeight .~ 6
|
& itUse . useAim . aimWeight .~ 6
|
||||||
& itUse . useAim . aimStance .~ TwoHandFlat
|
& itUse . useAim . aimStance .~ TwoHandFlat
|
||||||
|
& itUse . useAim . aimHandlePos .~ 4
|
||||||
|
& itUse . useAim . aimMuzPos .~ 4
|
||||||
& itType . iyBase .~ TESLAGUN
|
& itType . iyBase .~ TESLAGUN
|
||||||
teslaGunPic :: Item -> SPic
|
teslaGunPic :: Item -> SPic
|
||||||
teslaGunPic _ = noPic $ colorSH blue $
|
teslaGunPic _ = noPic $ colorSH blue $
|
||||||
@@ -241,7 +239,7 @@ lasWide n = lasGun
|
|||||||
dualBeam :: Item
|
dualBeam :: Item
|
||||||
dualBeam = lasGun
|
dualBeam = lasGun
|
||||||
& itType . iyBase .~ DUALBEAM
|
& itType . iyBase .~ DUALBEAM
|
||||||
& itDimension . dimPortage . muzPos .~ 0
|
& itUse . useAim . aimMuzPos .~ 0
|
||||||
& itDimension .dimSPic .~ dualBeamPic
|
& itDimension .dimSPic .~ dualBeamPic
|
||||||
& itParams .~ DualBeam
|
& itParams .~ DualBeam
|
||||||
{ _phaseV = 1
|
{ _phaseV = 1
|
||||||
@@ -306,7 +304,6 @@ lasGun = defaultAutoBatteryGun
|
|||||||
& itDimension .~ ItemDimension
|
& itDimension .~ ItemDimension
|
||||||
{ _dimRad = 10
|
{ _dimRad = 10
|
||||||
, _dimCenter = V3 15 0 0
|
, _dimCenter = V3 15 0 0
|
||||||
, _dimPortage = HeldItem 5 30
|
|
||||||
, _dimSPic = lasGunPic
|
, _dimSPic = lasGunPic
|
||||||
}
|
}
|
||||||
& itUse . rUse .~ shootLaser
|
& itUse . rUse .~ shootLaser
|
||||||
@@ -322,6 +319,8 @@ lasGun = defaultAutoBatteryGun
|
|||||||
& itUse . useAim . aimWeight .~ 6
|
& itUse . useAim . aimWeight .~ 6
|
||||||
& itUse . useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
|
& itUse . useAim . aimHandlePos .~ 5
|
||||||
|
& itUse . useAim . aimMuzPos .~ 30
|
||||||
& itType . iyBase .~ LASGUN
|
& itType . iyBase .~ LASGUN
|
||||||
|
|
||||||
lasGunPic :: Item -> SPic
|
lasGunPic :: Item -> SPic
|
||||||
@@ -375,7 +374,6 @@ tractorGun = lasGun
|
|||||||
, _itDimension = ItemDimension
|
, _itDimension = ItemDimension
|
||||||
{ _dimRad = 10
|
{ _dimRad = 10
|
||||||
, _dimCenter = V3 15 0 0
|
, _dimCenter = V3 15 0 0
|
||||||
, _dimPortage = HeldItem 5 30
|
|
||||||
, _dimSPic = tractorGunPic
|
, _dimSPic = tractorGunPic
|
||||||
}
|
}
|
||||||
, _itParams = Attracting {_attractionPower = 1}
|
, _itParams = Attracting {_attractionPower = 1}
|
||||||
@@ -392,6 +390,8 @@ tractorGun = lasGun
|
|||||||
& itUse . useAim . aimWeight .~ 6
|
& itUse . useAim . aimWeight .~ 6
|
||||||
& itUse . useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
|
& itUse . useAim . aimHandlePos .~ 5
|
||||||
|
& itUse . useAim . aimMuzPos .~ 30
|
||||||
& itType . iyBase .~ TRACTORGUN
|
& itType . iyBase .~ TRACTORGUN
|
||||||
|
|
||||||
tractorGunTweak :: TweakParam
|
tractorGunTweak :: TweakParam
|
||||||
|
|||||||
@@ -46,10 +46,6 @@ defaultBangCane = defaultBulletWeapon
|
|||||||
, _itDimension = ItemDimension
|
, _itDimension = ItemDimension
|
||||||
{ _dimRad = 8
|
{ _dimRad = 8
|
||||||
, _dimCenter = V3 5 0 0
|
, _dimCenter = V3 5 0 0
|
||||||
, _dimPortage = HeldItem
|
|
||||||
{_handlePos = 5
|
|
||||||
,_muzPos = 15
|
|
||||||
}
|
|
||||||
, _dimSPic = \it -> noPic $ baseCaneShape
|
, _dimSPic = \it -> noPic $ baseCaneShape
|
||||||
<> makeSingleClipAt (V3 5 0 3) it
|
<> makeSingleClipAt (V3 5 0 3) it
|
||||||
}
|
}
|
||||||
@@ -67,6 +63,8 @@ defaultBangCane = defaultBulletWeapon
|
|||||||
, withMuzFlareI
|
, withMuzFlareI
|
||||||
]
|
]
|
||||||
& itUse . useAim . aimStance .~ OneHand
|
& itUse . useAim . aimStance .~ OneHand
|
||||||
|
& itUse . useAim . aimHandlePos .~ 5
|
||||||
|
& itUse . useAim . aimMuzPos .~ 15
|
||||||
& itType . iyBase .~ error "undefined bangCane baseitemtype"
|
& itType . iyBase .~ error "undefined bangCane baseitemtype"
|
||||||
& itConsumption . laMax .~ 1
|
& itConsumption . laMax .~ 1
|
||||||
& itConsumption . laCycle .~ [loadPartialInsert 10 1]
|
& itConsumption . laCycle .~ [loadPartialInsert 10 1]
|
||||||
@@ -87,10 +85,6 @@ volleyGun i = defaultBulletWeapon
|
|||||||
& itDimension .~ ItemDimension
|
& itDimension .~ ItemDimension
|
||||||
{ _dimRad = 8
|
{ _dimRad = 8
|
||||||
, _dimCenter = V3 5 0 0
|
, _dimCenter = V3 5 0 0
|
||||||
, _dimPortage = HeldItem
|
|
||||||
{_handlePos = 5
|
|
||||||
,_muzPos = 15
|
|
||||||
}
|
|
||||||
, _dimSPic = \it -> noPic $
|
, _dimSPic = \it -> noPic $
|
||||||
colorSH red (foldMap
|
colorSH red (foldMap
|
||||||
((\y -> upperPrismPoly 3 $ map (+.+ V2 0 y) $ rectXH 15 2)
|
((\y -> upperPrismPoly 3 $ map (+.+ V2 0 y) $ rectXH 15 2)
|
||||||
@@ -101,6 +95,8 @@ volleyGun i = defaultBulletWeapon
|
|||||||
& itUse . useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& itUse . useAim . aimStance .~ TwoHandFlat
|
& itUse . useAim . aimStance .~ TwoHandFlat
|
||||||
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
||||||
|
& itUse . useAim . aimHandlePos .~ 5
|
||||||
|
& itUse . useAim . aimMuzPos .~ 15
|
||||||
& itConsumption . laMax .~ i
|
& itConsumption . laMax .~ i
|
||||||
& itParams .~ BulletShooter
|
& itParams .~ BulletShooter
|
||||||
{ _muzVel = 0.8
|
{ _muzVel = 0.8
|
||||||
@@ -136,10 +132,6 @@ rifle = defaultBangCane
|
|||||||
{ _itDimension = ItemDimension
|
{ _itDimension = ItemDimension
|
||||||
{ _dimRad = 8
|
{ _dimRad = 8
|
||||||
, _dimCenter = V3 5 0 0
|
, _dimCenter = V3 5 0 0
|
||||||
, _dimPortage = HeldItem
|
|
||||||
{_handlePos = 5
|
|
||||||
,_muzPos = 15
|
|
||||||
}
|
|
||||||
, _dimSPic = \it -> noPic $ baseRifleShape
|
, _dimSPic = \it -> noPic $ baseRifleShape
|
||||||
<> makeSingleClipAt (V3 5 0 3) it
|
<> makeSingleClipAt (V3 5 0 3) it
|
||||||
}
|
}
|
||||||
@@ -287,15 +279,11 @@ miniGunX i = defaultAutoGun
|
|||||||
, _itDimension = ItemDimension
|
, _itDimension = ItemDimension
|
||||||
{ _dimRad = 20
|
{ _dimRad = 20
|
||||||
, _dimCenter = V3 5 0 0
|
, _dimCenter = V3 5 0 0
|
||||||
, _dimPortage = HeldItem
|
|
||||||
{_handlePos = 5
|
|
||||||
,_muzPos = 20
|
|
||||||
}
|
|
||||||
, _dimSPic = miniGunXPictItem i
|
, _dimSPic = miniGunXPictItem i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
& itDimension . dimPortage . muzPos .~ 40
|
|
||||||
& itType . iyBase .~ MINIGUNX i
|
& itType . iyBase .~ MINIGUNX i
|
||||||
|
& itUse . useAim . aimMuzPos .~ 40
|
||||||
miniGunXPictItem :: Int -> Item -> SPic
|
miniGunXPictItem :: Int -> Item -> SPic
|
||||||
miniGunXPictItem i it = miniGunXPict i spin (_laLoaded $ _itConsumption it)
|
miniGunXPictItem i it = miniGunXPict i spin (_laLoaded $ _itConsumption it)
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -60,10 +60,6 @@ bangRod = defaultBulletWeapon
|
|||||||
& itDimension .~ ItemDimension
|
& itDimension .~ ItemDimension
|
||||||
{ _dimRad = 12
|
{ _dimRad = 12
|
||||||
, _dimCenter = V3 5 0 0
|
, _dimCenter = V3 5 0 0
|
||||||
, _dimPortage = HeldItem
|
|
||||||
{_handlePos = 5
|
|
||||||
,_muzPos = 30
|
|
||||||
}
|
|
||||||
, _dimSPic = \it -> noPic $ baseRodShape
|
, _dimSPic = \it -> noPic $ baseRodShape
|
||||||
<> makeSingleClipAt (V3 5 0 3) it
|
<> makeSingleClipAt (V3 5 0 3) it
|
||||||
}
|
}
|
||||||
@@ -74,6 +70,8 @@ bangRod = defaultBulletWeapon
|
|||||||
& itUse . useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& itUse . useAim . aimStance .~ OneHand
|
& itUse . useAim . aimStance .~ OneHand
|
||||||
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
||||||
|
& itUse . useAim . aimHandlePos .~ 5
|
||||||
|
& itUse . useAim . aimMuzPos .~ 30
|
||||||
& itConsumption . laAmmoType . amBulEff .~ expireAndDamage heavyBulDams
|
& itConsumption . laAmmoType . amBulEff .~ expireAndDamage heavyBulDams
|
||||||
baseRodShape :: Shape
|
baseRodShape :: Shape
|
||||||
baseRodShape = colorSH orange $ upperPrismPoly 3 $ rectXH 20 2
|
baseRodShape = colorSH orange $ upperPrismPoly 3 $ rectXH 20 2
|
||||||
|
|||||||
@@ -71,15 +71,13 @@ bangStick i = defaultBulletWeapon
|
|||||||
, _itDimension = ItemDimension
|
, _itDimension = ItemDimension
|
||||||
{ _dimRad = 5
|
{ _dimRad = 5
|
||||||
, _dimCenter = V3 5 0 0
|
, _dimCenter = V3 5 0 0
|
||||||
, _dimPortage = HeldItem
|
|
||||||
{_handlePos = 5
|
|
||||||
,_muzPos = 10
|
|
||||||
}
|
|
||||||
, _dimSPic = \it -> noPic $ baseStickShapeX i
|
, _dimSPic = \it -> noPic $ baseStickShapeX i
|
||||||
<> stickClip it
|
<> stickClip it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
& itType . iyBase .~ BANGSTICK i
|
& itType . iyBase .~ BANGSTICK i
|
||||||
|
& itUse . useAim . aimHandlePos .~ 5
|
||||||
|
& itUse . useAim . aimMuzPos .~ 10
|
||||||
& itConsumption . laMax .~ i
|
& itConsumption . laMax .~ i
|
||||||
& itConsumption . laCycle .~ [loadPartialInsert 10 1]
|
& itConsumption . laCycle .~ [loadPartialInsert 10 1]
|
||||||
baseStickShapeX :: Int -> Shape
|
baseStickShapeX :: Int -> Shape
|
||||||
@@ -190,7 +188,7 @@ smg = autoPistol -- & some parameter affecting stability
|
|||||||
& itUse . useMods .~ (ammoCheckI : smgAfterHamMods)
|
& itUse . useMods .~ (ammoCheckI : smgAfterHamMods)
|
||||||
& itType . iyBase .~ SMG
|
& itType . iyBase .~ SMG
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
& itDimension . dimPortage . handlePos .~ 2
|
& itUse . useAim . aimHandlePos .~ 2
|
||||||
& itParams . torqueAfter .~ 0.05
|
& itParams . torqueAfter .~ 0.05
|
||||||
& itDimension . dimSPic .~ \it -> noPic (baseSMGShape
|
& itDimension . dimSPic .~ \it -> noPic (baseSMGShape
|
||||||
<> makeTinClipAt 0 (V3 7 (-2) 0) it)
|
<> makeTinClipAt 0 (V3 7 (-2) 0) it)
|
||||||
|
|||||||
@@ -103,10 +103,6 @@ bangCone = defaultBulletWeapon
|
|||||||
, _itDimension = ItemDimension
|
, _itDimension = ItemDimension
|
||||||
{ _dimRad = 8
|
{ _dimRad = 8
|
||||||
, _dimCenter = V3 5 0 0
|
, _dimCenter = V3 5 0 0
|
||||||
, _dimPortage = HeldItem
|
|
||||||
{_handlePos = 5
|
|
||||||
,_muzPos = 15
|
|
||||||
}
|
|
||||||
, _dimSPic = const $ noPic $ colorSH cyan $ upperPrismPoly 3 (rectXH 5 2)
|
, _dimSPic = const $ noPic $ colorSH cyan $ upperPrismPoly 3 (rectXH 5 2)
|
||||||
<> upperPrismPoly 6 (reverse $ rectNSWE 4 (-4) 5 15)
|
<> upperPrismPoly 6 (reverse $ rectNSWE 4 (-4) 5 15)
|
||||||
}
|
}
|
||||||
@@ -127,6 +123,8 @@ bangCone = defaultBulletWeapon
|
|||||||
, withRandomItemUpdate coneRandItemUpdate
|
, withRandomItemUpdate coneRandItemUpdate
|
||||||
, withRandomItemParams coneRandItemParams
|
, withRandomItemParams coneRandItemParams
|
||||||
]
|
]
|
||||||
|
& itUse . useAim . aimHandlePos .~ 5
|
||||||
|
& itUse . useAim . aimMuzPos .~ 15
|
||||||
& itType . iyBase .~ BANGCONE
|
& itType . iyBase .~ BANGCONE
|
||||||
& itConsumption . laMax .~ 5
|
& itConsumption . laMax .~ 5
|
||||||
& itConsumption . laCycle .~ [loadEject 5, loadInsert 20 , loadPrime 5]
|
& itConsumption . laCycle .~ [loadEject 5, loadInsert 20 , loadPrime 5]
|
||||||
@@ -148,10 +146,6 @@ blunderbuss = bangCone
|
|||||||
{_itDimension = ItemDimension
|
{_itDimension = ItemDimension
|
||||||
{ _dimRad = 8
|
{ _dimRad = 8
|
||||||
, _dimCenter = V3 5 0 0
|
, _dimCenter = V3 5 0 0
|
||||||
, _dimPortage = HeldItem
|
|
||||||
{_handlePos = 5
|
|
||||||
,_muzPos = 30
|
|
||||||
}
|
|
||||||
, _dimSPic = const $ noPic $ colorSH cyan $ upperPrismPoly 3 (rectXH 20 2)
|
, _dimSPic = const $ noPic $ colorSH cyan $ upperPrismPoly 3 (rectXH 20 2)
|
||||||
<> upperPrismPoly 6 (reverse $ rectNSWE 4 (-4) 20 30)
|
<> upperPrismPoly 6 (reverse $ rectNSWE 4 (-4) 20 30)
|
||||||
}
|
}
|
||||||
@@ -160,6 +154,8 @@ blunderbuss = bangCone
|
|||||||
& itConsumption . laCycle .~ [loadEject 5, loadInsert 30 , loadPrime 5]
|
& itConsumption . laCycle .~ [loadEject 5, loadInsert 30 , loadPrime 5]
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
& itUse . useAim . aimWeight .~ 6
|
& itUse . useAim . aimWeight .~ 6
|
||||||
|
& itUse . useAim . aimHandlePos .~ 5
|
||||||
|
& itUse . useAim . aimMuzPos .~ 30
|
||||||
& itType . iyBase .~ BLUNDERBUSS
|
& itType . iyBase .~ BLUNDERBUSS
|
||||||
grapeCannon :: Int -> Item
|
grapeCannon :: Int -> Item
|
||||||
grapeCannon i = blunderbuss
|
grapeCannon i = blunderbuss
|
||||||
|
|||||||
@@ -60,10 +60,6 @@ launcher = defaultWeapon
|
|||||||
, _itDimension = ItemDimension
|
, _itDimension = ItemDimension
|
||||||
{ _dimRad = 9
|
{ _dimRad = 9
|
||||||
, _dimCenter = V3 10 0 0
|
, _dimCenter = V3 10 0 0
|
||||||
, _dimPortage = HeldItem
|
|
||||||
{_handlePos = 5
|
|
||||||
,_muzPos = 20
|
|
||||||
}
|
|
||||||
, _dimSPic = launcherPic
|
, _dimSPic = launcherPic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -79,6 +75,8 @@ launcher = defaultWeapon
|
|||||||
& itUse . useAim . aimWeight .~ 8
|
& itUse . useAim . aimWeight .~ 8
|
||||||
& itUse . useAim . aimRange .~ 0.5
|
& itUse . useAim . aimRange .~ 0.5
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
|
& itUse . useAim . aimHandlePos .~ 5
|
||||||
|
& itUse . useAim . aimMuzPos .~ 20
|
||||||
& itType . iyBase .~ LAUNCHER
|
& itType . iyBase .~ LAUNCHER
|
||||||
& itType . iyModules . at ModLauncherHoming ?~ EMPTYMODULE
|
& itType . iyModules . at ModLauncherHoming ?~ EMPTYMODULE
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,6 @@ autoDetector dt = defaultEquipment
|
|||||||
& itUse . eqEq . eqParams .~ EquipCounter 0
|
& itUse . eqEq . eqParams .~ EquipCounter 0
|
||||||
& itUse . eqEq . eqViewDist ?~ 350
|
& itUse . eqEq . eqViewDist ?~ 350
|
||||||
& itType . iyBase .~ AUTODETECTOR dt
|
& itType . iyBase .~ AUTODETECTOR dt
|
||||||
& itDimension . dimPortage
|
|
||||||
.~ WornItem
|
|
||||||
& itDimension . dimSPic .~ const
|
& itDimension . dimSPic .~ const
|
||||||
(noPic (colorSH (detectorColor dt) $ upperPrismPoly 3 $ rectWH 2 2))
|
(noPic (colorSH (detectorColor dt) $ upperPrismPoly 3 $ rectWH 2 2))
|
||||||
-- , _itEffect = autoRadarEffect
|
-- , _itEffect = autoRadarEffect
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ sonicGun = defaultAutoGun
|
|||||||
, _itDimension = ItemDimension
|
, _itDimension = ItemDimension
|
||||||
{ _dimRad = 10
|
{ _dimRad = 10
|
||||||
, _dimCenter = V3 15 0 0
|
, _dimCenter = V3 15 0 0
|
||||||
, _dimPortage = HeldItem 5 25
|
|
||||||
, _dimSPic = const $ noPic baseSonicShape
|
, _dimSPic = const $ noPic baseSonicShape
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -53,6 +52,7 @@ sonicGun = defaultAutoGun
|
|||||||
& itUse . useAim . aimWeight .~ 6
|
& itUse . useAim . aimWeight .~ 6
|
||||||
& itUse . useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
|
& itUse . useAim . aimMuzPos .~ 25
|
||||||
& itType . iyBase .~ SONICGUN
|
& itType . iyBase .~ SONICGUN
|
||||||
baseSonicShape :: Shape
|
baseSonicShape :: Shape
|
||||||
baseSonicShape = colorSH rose $ upperPrismPoly 3 $ rectXH 25 2
|
baseSonicShape = colorSH rose $ upperPrismPoly 3 $ rectXH 25 2
|
||||||
|
|||||||
@@ -139,10 +139,6 @@ flameThrower = defaultAutoGun
|
|||||||
, _itDimension = ItemDimension
|
, _itDimension = ItemDimension
|
||||||
{ _dimRad = 7
|
{ _dimRad = 7
|
||||||
, _dimCenter = V3 9 0 0
|
, _dimCenter = V3 9 0 0
|
||||||
, _dimPortage = HeldItem
|
|
||||||
{ _handlePos = 0
|
|
||||||
, _muzPos = 18
|
|
||||||
}
|
|
||||||
, _dimSPic = flamerPic
|
, _dimSPic = flamerPic
|
||||||
}
|
}
|
||||||
-- , _itFloorPict = flamerPic
|
-- , _itFloorPict = flamerPic
|
||||||
@@ -159,6 +155,8 @@ flameThrower = defaultAutoGun
|
|||||||
& itUse . useAim . aimWeight .~ 5
|
& itUse . useAim . aimWeight .~ 5
|
||||||
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomMax = 5, _itZoomMin = 1.5}
|
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomMax = 5, _itZoomMin = 1.5}
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
|
& itUse . useAim . aimHandlePos .~ 0
|
||||||
|
& itUse . useAim . aimMuzPos .~ 18
|
||||||
& itType . iyBase .~ FLAMETHROWER
|
& itType . iyBase .~ FLAMETHROWER
|
||||||
|
|
||||||
aGasCloud :: Float -> Point2 -> Float -> Creature -> World -> World
|
aGasCloud :: Float -> Point2 -> Float -> Creature -> World -> World
|
||||||
|
|||||||
@@ -391,9 +391,9 @@ withMuzFlareI f it cr w = makeTlsTimeRadColPos 2 100 (V3 1 1 0.5) flashPos
|
|||||||
cdir = _crDir cr
|
cdir = _crDir cr
|
||||||
|
|
||||||
muzzleOffset :: Creature -> Item -> Point3
|
muzzleOffset :: Creature -> Item -> Point3
|
||||||
muzzleOffset cr it = V3 (holdOffset + 5 + _muzPos dimPort - _handlePos dimPort) 0 0
|
muzzleOffset cr it = V3 (holdOffset + 5 + _aimMuzPos dimPort - _aimHandlePos dimPort) 0 0
|
||||||
where
|
where
|
||||||
dimPort = _dimPortage $ _itDimension it
|
dimPort = _useAim $ _itUse it
|
||||||
holdOffset
|
holdOffset
|
||||||
| crInAimStance OneHand cr = 10
|
| crInAimStance OneHand cr = 10
|
||||||
| otherwise = 0
|
| otherwise = 0
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ updateTurret rotSpeed mc w
|
|||||||
cid = IM.newKey (_creatures w')
|
cid = IM.newKey (_creatures w')
|
||||||
thecreature = defaultCreature
|
thecreature = defaultCreature
|
||||||
& crID .~ cid
|
& crID .~ cid
|
||||||
& crInv . at 0 ?~ (_tuWeapon (_mcType mc) & itDimension . dimPortage . handlePos -~ 10
|
& crInv . at 0 ?~ (_tuWeapon (_mcType mc) & itUse . useAim . aimHandlePos -~ 10
|
||||||
& itConsumption . laLoaded .~ 1
|
& itConsumption . laLoaded .~ 1
|
||||||
)
|
)
|
||||||
& crPos .~ mcpos
|
& crPos .~ mcpos
|
||||||
|
|||||||
Reference in New Issue
Block a user