Tweak twisting when aiming

This commit is contained in:
2021-12-05 16:54:08 +00:00
parent d9c5cfc26d
commit 22e3256da3
30 changed files with 350 additions and 252 deletions
+29 -23
View File
@@ -37,7 +37,6 @@ teslaGun :: Item
teslaGun = defaultGun
{ _itName = "TESLA"
, _itType = TESLAGUN
-- , _itIdentity = TeslaGun
, _itConsumption = defaultAmmo
{ _ammoMax = 200
, _ammoLoaded = 200
@@ -51,16 +50,23 @@ teslaGun = defaultGun
]
& useAim . aimSpeed .~ 0.4
& useAim . aimStance .~ TwoHandFlat
, _itFloorPict = teslaGunPic
, _itDimension = ItemDimension
{ _dimRad = 9
, _dimCenter = V3 4 0 0
, _dimPortage = HeldItem
{_handlePos = 4
,_muzPos = 4
}
, _dimSPic = teslaGunPic
}
}
teslaGunPic :: Item -> SPic
teslaGunPic _ = noPic $ colorSH blue $
upperPrismPoly 5 (rectNESW xb y xa (-y))
++ upperPrismPoly 5 (rectNESW (-xa) y (-xb) (-y))
upperPrismPoly 5 (rectNESW xb 8 xa 0)
++ upperPrismPoly 5 (rectNESW (-xa) 8 (-xb) 0)
where
xa = 1
xb = 9
y = 4
lasGun :: Item
lasGun = defaultAutoGun
{ _itName = "LASGUN ////"
@@ -79,13 +85,29 @@ lasGun = defaultAutoGun
& useAim . aimSpeed .~ 0.4
& useAim . aimRange .~ 1
& useAim . aimStance .~ TwoHandTwist
, _itFloorPict = lasGunPic
, _itParams = Refracting {_phaseV = 1}
, _itTweaks = Tweakable
{ _tweakParams = IM.fromList [(0,lasGunTweak)]
, _tweakSel = 0
}
, _itDimension = ItemDimension
{ _dimRad = 10
, _dimCenter = V3 15 0 0
, _dimPortage = HeldItem 5 30
, _dimSPic = lasGunPic
}
}
lasGunPic :: Item -> SPic
lasGunPic it =
( colorSH blue $
upperPrismPoly 4 (rectNESW 3 30 1 0)
<> upperPrismPoly 4 (rectNESW (-1) 30 (-3) 0)
<> upperPrismPoly 1 (rectNESW 3 30 (-3) 0)
, setLayer 1 . color col . setDepth 1.1 . polygon $ rectNESW 1 30 (-1) 0
)
where
amFrac = fractionLoadedAmmo it
col = brightX 2 1.5 $ mixColors amFrac (1-amFrac) green red
lasGunTweak :: TweakParam
lasGunTweak = TweakParam
{ _doTweak = thetweak
@@ -104,21 +126,9 @@ lasGunTweak = TweakParam
showPhaseV 2 = "Z"
showPhaseV i = "THIS SHOULD NOT BE POSSIBLE" ++ show i
lasGunPic :: Item -> SPic
lasGunPic it =
( colorSH blue $
upperPrismPoly 4 (rectNESW 3 15 1 (-15))
<> upperPrismPoly 4 (rectNESW (-1) 15 (-3) (-15))
-- <> (upperPrismPoly 4 $ rectNESW (5) l (-5) (l-2))
<> upperPrismPoly 1 (rectNESW 3 15 (-3) (-15))
, setLayer 1 . color col . setDepth 1.1 . polygon $ rectNESW 1 15 (-1) (-15)
)
where
amFrac = fractionLoadedAmmo it
col = brightX 2 1.5 $ mixColors amFrac (1-amFrac) green red
tractorGun :: Item
tractorGun = defaultAutoGun
tractorGun = lasGun
{ _itName = "TRACTORGUN"
, _itType = TRACTORGUN
, _itConsumption = defaultAmmo
@@ -132,11 +142,7 @@ tractorGun = defaultAutoGun
& useAim . aimSpeed .~ 0.4
& useAim . aimRange .~ 1
& useAim . aimStance .~ TwoHandTwist
, _itFloorPict = tractorGunSPic
}
-- TODO own picture for tractor gun
tractorGunSPic :: Item -> SPic
tractorGunSPic = lasGunPic
aTeslaArc :: Creature -> World -> World
aTeslaArc cr w = set randGen g w