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
+1 -1
View File
@@ -37,7 +37,7 @@ bezierGun = defaultGun
& useAim . aimRange .~ 0
& useAim . aimStance .~ TwoHandTwist
-- & useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
, _itFloorPict = bezierGunSPic
-- , _itFloorPict = bezierGunSPic
, _itAttachment = NoItAttachment
, _itScroll = \_ _ -> removeItTarget
, _itEffect = rbSetTarget
-1
View File
@@ -119,7 +119,6 @@ boosterGun = defaultGun
, _reloadTime = 20
}
, _itUse = luseInstantNoH $ boostSelfL 10
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-2,-2),(-2,2),(2,2),(2,0),(0,0),(0,-2)]
, _itEffect = resetAttachmentID
}
resetAttachmentID :: ItEffect
+90 -28
View File
@@ -89,7 +89,7 @@ autoGun = defaultAutoGun
& useAim . aimRange .~ 1
& useAim . aimStance .~ TwoHandTwist
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
, _itFloorPict = autoGunPic
-- , _itFloorPict = autoGunPic
-- , _itZoom = defaultItZoom
, _itEquipPict = pictureWeaponOnAim
, _itAttachment = ItCharMode $ Seq.fromList "MS"
@@ -139,9 +139,8 @@ bangStick i = defaultGun
, spreadLoaded
, withRecoilI 25
]
, _itFloorPict = pistolPic
-- , _itZoom = defaultItZoom
, _itEquipPict = pictureWeaponAim pistolPic
-- , _itEquipPict = pictureWeaponAim pistolPic
, _itID = Nothing
, _itInvColor = white
, _itTargeting = Nothing
@@ -157,6 +156,15 @@ bangStick i = defaultGun
}
, _itTweaks = defaultBulletSelTweak
, _itInvSize = fromIntegral i / 3
, _itDimension = ItemDimension
{ _dimRad = 5
, _dimCenter = V3 5 0 0
, _dimPortage = HeldItem
{_handlePos = 5
,_muzPos = 10
}
, _dimSPic = const $ noPic $ colorSH green $ upperPrismPoly 3 $ rectXH 10 2
}
}
bangCane :: Item
bangCane = defaultGun
@@ -184,8 +192,16 @@ bangCane = defaultGun
, withMuzFlareI
, withRecoilI 50
]
, _itFloorPict = autoGunPic
, _itTweaks = defaultBulletSelTweak
, _itDimension = ItemDimension
{ _dimRad = 8
, _dimCenter = V3 5 0 0
, _dimPortage = HeldItem
{_handlePos = 5
,_muzPos = 20
}
, _dimSPic = const $ noPic $ colorSH red $ upperPrismPoly 3 $ rectXH 15 2
}
} & itUse . useAim . aimSpeed .~ 0.4
& itUse . useAim . aimRange .~ 1
& itUse . useAim . aimStance .~ OneHand
@@ -198,16 +214,27 @@ bangCaneX i = bangCane
[ ammoHammerCheck
, useTimeCheck
, withSoundItemChoiceStart bangStickSoundChoice
, useAmmoAmount 1
, torqueAfterI 0.2
, useAllAmmo
, torqueAfterI 0.5
, duplicateLoadedBarrels
, applyInaccuracy
, withMuzFlareI
, withRecoilI 50
]
, _itDimension = ItemDimension
{ _dimRad = 8
, _dimCenter = V3 5 0 0
, _dimPortage = HeldItem
{_handlePos = 5
,_muzPos = 15
}
, _dimSPic = const $ noPic $ colorSH red $ foldMap
(\y -> upperPrismPoly 3 $ map (+.+ V2 0 y) $ rectXH 15 2)
$ map (\k -> fromIntegral k * 5 - ((fromIntegral i - 1) * 2.5)) [0..i-1]
}
} & itUse . useAim . aimSpeed .~ 0.4
& itUse . useAim . aimRange .~ 1
& itUse . useAim . aimStance .~ TwoHandTwist
& itUse . useAim . aimStance .~ TwoHandFlat
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
& itConsumption . ammoMax .~ i
& itParams . gunBarrels .~ MultiBarrel
@@ -218,6 +245,16 @@ bangCaneX i = bangCane
rifle :: Item
rifle = bangCane
{ _itDimension = ItemDimension
{ _dimRad = 8
, _dimCenter = V3 5 0 0
, _dimPortage = HeldItem
{_handlePos = 5
,_muzPos = 25
}
, _dimSPic = const $ noPic $ colorSH red $ upperPrismPoly 3 $ rectXH 25 2
}
}
& itUse . useAim . aimStance .~ TwoHandTwist
& itName .~ "RIFLE"
& itType .~ RIFLE
@@ -269,12 +306,20 @@ bangRod = bangCane
, withMuzFlareI
, withRecoilI 50
]
, _itFloorPict = longGunSPic
, _itDimension = ItemDimension
{ _dimRad = 12
, _dimCenter = V3 5 0 0
, _dimPortage = HeldItem
{_handlePos = 5
,_muzPos = 30
}
, _dimSPic = const $ noPic $ colorSH orange $ upperPrismPoly 3 $ rectXH 30 2
}
}
& itConsumption . reloadType .~ ActiveClear
& itUse . useAim . aimSpeed .~ 0.2
& itUse . useAim . aimRange .~ 1
& itUse . useAim . aimStance .~ OneHand
& itUse . useAim . aimStance .~ TwoHandTwist
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
elephantGun :: Item
elephantGun = bangRod
@@ -358,7 +403,16 @@ bangCone = defaultGun
, _bore = 5
, _gunBarrels = SingleBarrel 0.5
}
, _itFloorPict = spreadGunPic
, _itDimension = ItemDimension
{ _dimRad = 8
, _dimCenter = V3 5 0 0
, _dimPortage = HeldItem
{_handlePos = 5
,_muzPos = 15
}
, _dimSPic = const $ noPic $ colorSH cyan $ upperPrismPoly 3 (rectXH 5 2)
<> upperPrismPoly 6 (rectNSEW 4 (-4) 15 5)
}
, _itTweaks = defaultBulletSelTweak
}
coneRandItemParams :: State StdGen ItemParams
@@ -392,6 +446,16 @@ blunderbuss = bangCone
]
& useAim . aimStance .~ TwoHandTwist
& useAim . aimSpeed .~ 0.4
, _itDimension = ItemDimension
{ _dimRad = 8
, _dimCenter = V3 5 0 0
, _dimPortage = HeldItem
{_handlePos = 5
,_muzPos = 30
}
, _dimSPic = const $ noPic $ colorSH cyan $ upperPrismPoly 3 (rectXH 20 2)
<> upperPrismPoly 6 (rectNSEW 4 (-4) 30 20)
}
}
grapeShotCannon :: Item
@@ -480,9 +544,8 @@ pistol = defaultGun
}
, _itUse = useAmmoParamsRate 6 upHammer
(ammoHammerCheck : pistolAfterHamMods)
, _itFloorPict = pistolPic
-- , _itZoom = defaultItZoom
, _itEquipPict = pictureWeaponAim pistolPic
-- , _itEquipPict = pictureWeaponAim pistolPic
, _itID = Nothing
, _itInvColor = white
, _itTargeting = Nothing
@@ -494,14 +557,14 @@ pistol = defaultGun
}
, _itTweaks = defaultBulletSelTweak
}
pistolPic :: Item -> SPic
pistolPic it = noPic $ colorSH green (prismPoly
(map (addZ 3) $ rectNESW 3 3 (-3) (-3))
(map (addZ 0) $ rectNESW 5 3 (-5) (-7))
)
<> translateSH (V3 (-4) 5.5 4) (rotateSH pi $ bulletClip am)
where
am = _ammoLoaded $ _itConsumption it
--pistolPic :: Item -> SPic
--pistolPic it = noPic $ colorSH green (prismPoly
-- (map (addZ 3) $ rectNESW 3 3 (-3) (-3))
-- (map (addZ 0) $ rectNESW 5 3 (-5) (-7))
-- )
-- <> translateSH (V3 (-4) 5.5 4) (rotateSH pi $ bulletClip am)
-- where
-- am = _ammoLoaded $ _itConsumption it
bulletClip :: Int -> Shape
bulletClip x = rotateSHx (negate $ pi/4) . upperPrismPoly 2 $ rectNESW 3 0 (3 - 0.25 * am) (-5)
@@ -530,7 +593,7 @@ hvAutoGun = defaultAutoGun
& useAim . aimStance .~ TwoHandTwist
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
& useDelay .~ VariableRate {_rateMax = 25, _rateMaxMax = 24, _rateMinMax = 7, _rateTime = 0}
, _itFloorPict = hvAutoGunPic
-- , _itFloorPict = hvAutoGunPic
, _itInvSize = 3
, _itInvDisplay = \it -> head (basicItemDisplay it) :
["* FIRERATE: *"
@@ -585,7 +648,7 @@ ltAutoGun = defaultAutoGun
, withSidePushI 50
, modClock 2 withMuzFlareI
]
, _itFloorPict = ltAutoGunPic
-- , _itFloorPict = ltAutoGunPic
, _itParams = BulletShooter
{ _muzVel = 1
, _rifling = 0.8
@@ -594,7 +657,6 @@ ltAutoGun = defaultAutoGun
}
, _itTweaks = defaultBulletSelTweak
}
& itDimension . muzzleLength .~ 10
ltAutoGunPic :: Item -> SPic
ltAutoGunPic it =
( colorSH green $ prismPoly
@@ -652,7 +714,7 @@ miniGun = defaultAutoGun
& useAim . aimRange .~ 1
& useAim . aimStance .~ TwoHandTwist
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
, _itFloorPict = miniGunPictItem
-- , _itFloorPict = miniGunPictItem
, _itParams = BulletShooter
{ _muzVel = 1
, _rifling = 0.9
@@ -673,7 +735,7 @@ miniGun = defaultAutoGun
-- [" " ++ replicate 8 ch
-- ," " ++ replicate 2 ch ++ fromMaybe " " (maybeWarmupStatus it) ++ replicate 2 ch
-- ," " ++ replicate 8 ch]
} & itDimension . muzzleLength .~ 15
}
where
--ch = '*'
recoilAmount = 5
@@ -744,7 +806,7 @@ spreadGun = defaultGun
,_brlInaccuracy = 0
}
}
, _itFloorPict = spreadGunPic
-- , _itFloorPict = spreadGunPic
, _itTweaks = defaultBulletSelTweak
}
spreadGunPic :: Item -> SPic
@@ -780,7 +842,7 @@ multGun = defaultGun
& useAim . aimRange .~ 1
& useAim . aimStance .~ TwoHandTwist
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
, _itFloorPict = multGunSPic
-- , _itFloorPict = multGunSPic
, _itParams = BulletShooter
{ _muzVel = 1
, _rifling = 0.9
@@ -833,7 +895,7 @@ longGun = defaultGun
& useAim . aimRange .~ 1
& useAim . aimStance .~ TwoHandTwist
& useAim . aimZoom .~ defaultItZoom {_itZoomMax = 0.5, _itZoomMin = 0.5}
, _itFloorPict = longGunSPic
-- , _itFloorPict = longGunSPic
-- , _itZoom = defaultItZoom
, _itScroll = zoomLongGun
, _itAttachment = ItScope (V2 0 0) 0 1 False
-1
View File
@@ -37,7 +37,6 @@ lasDrones = defaultGun
& useAim . aimSpeed .~ 0.2
& useAim . aimRange .~ 0.5
& useAim . aimStance .~ TwoHandTwist
, _itFloorPict = lasDronesPic
, _itEffect = NoItEffect
}
+49 -48
View File
@@ -3,16 +3,16 @@ module Dodge.Item.Weapon.Grenade
import Dodge.Data
import Dodge.Picture.Layer
import Dodge.WorldEvent.Explosion
import Dodge.Item.Weapon.TriggerType
--import Dodge.Item.Weapon.TriggerType
import Dodge.Item.Weapon.Remote
import Dodge.Default
import Dodge.Default.Weapon
--import Dodge.Default.Weapon
import Dodge.Base
import Dodge.Zone
import Dodge.SoundLogic
import Dodge.Item.Draw
import Dodge.Item.Weapon.InventoryDisplay
import Dodge.Item.Attachment
--import Dodge.Item.Weapon.InventoryDisplay
--import Dodge.Item.Attachment
import Picture
import Geometry
import ShapePicture
@@ -22,33 +22,34 @@ import qualified IntMapHelp as IM
import Data.Maybe
import Control.Lens
grenade :: Item
grenade = Throwable
{ _itName = "GRENADE " ++ show fuseTime
, _itType = GRENADE
, _itInvSize = 1
, _itDimension = defaultItemDimension
, _itCurseStatus = Uncursed
, _itMaxStack = 8
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
, _twMaxRange = 150
, _twAccuracy = 30
, _itUse = ruseRate 25 (\_ -> throwGrenade makeExplosionAt) upHammer
[ useTimeCheck
]
& useAim . aimZoom .~ defaultItZoom {_itZoomMax = f fuseTime, _itZoomMin = f fuseTime}
-- , _itZoom = defaultItZoom
, _itEquipPict = pictureWeaponOnAim' $ \_ -> grenadePic fuseTime
, _itID = Nothing
, _itAttachment = ItFuse fuseTime
, _itInvColor = white
, _itInvDisplay = basicItemDisplay
, _itEffect = NoItEffect
, _itScroll = changeFuse
}
where
fuseTime = 50
f x = 50 / fromIntegral x
--grenade :: Item
--grenade = Item
-- { _itName = "GRENADE " ++ show fuseTime
-- , _itType = GRENADE
-- , _itInvSize = 1
-- , _itDimension = defaultItemDimension
-- , _itCurseStatus = Uncursed
-- , _itConsumption = ItemItselfConsumable 1
---- , _itMaxStack = 8
-- , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
-- , _twMaxRange = 150
-- , _twAccuracy = 30
-- , _itUse = ruseRate 25 (\_ -> throwGrenade makeExplosionAt) upHammer
-- [ useTimeCheck
-- ]
-- & useAim . aimZoom .~ defaultItZoom {_itZoomMax = f fuseTime, _itZoomMin = f fuseTime}
---- , _itZoom = defaultItZoom
-- , _itEquipPict = pictureWeaponOnAim' $ \_ -> grenadePic fuseTime
-- , _itID = Nothing
-- , _itAttachment = ItFuse fuseTime
-- , _itInvColor = white
-- , _itInvDisplay = basicItemDisplay
-- , _itEffect = NoItEffect
-- , _itScroll = changeFuse
-- }
-- where
-- fuseTime = 50
-- f x = 50 / fromIntegral x
moveGrenade :: Prop -> World -> World
moveGrenade pj w
@@ -207,22 +208,22 @@ setRemoteBombScope itid pj w' = case _itemPositions w' IM.! itid of
.~ (defaultItZoom {_itZoomMax = 0.5, _itZoomMin = 0.5})
_ -> w'
defaultThrowable :: Item
defaultThrowable = grenade
remoteBomb :: Item
remoteBomb = defaultThrowable
{ _itName = "REMOTEBOMB"
, _itType = REMOTEBOMB
, _itMaxStack = 1
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2
[(-3,-3),(-3,3),(3,3),(3,-3)]
, _twMaxRange = 150
, _twAccuracy = 30
, _itUse = ruseRate 25 (const throwRemoteBomb) upHammer
[ hammerCheckI ]
, _itAttachment = ItScope (V2 0 0) 0 1 True
, _itEquipPict = pictureWeaponOnAim' $ \_ -> (,) emptySH remoteBombUnarmedPic
}
--defaultThrowable :: Item
--defaultThrowable = grenade
--remoteBomb :: Item
--remoteBomb = defaultThrowable
-- { _itName = "REMOTEBOMB"
-- , _itType = REMOTEBOMB
-- , _itMaxStack = 1
-- , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2
-- [(-3,-3),(-3,3),(3,3),(3,-3)]
-- , _twMaxRange = 150
-- , _twAccuracy = 30
-- , _itUse = ruseRate 25 (const throwRemoteBomb) upHammer
-- [ hammerCheckI ]
-- , _itAttachment = ItScope (V2 0 0) 0 1 True
-- , _itEquipPict = pictureWeaponOnAim' $ \_ -> (,) emptySH remoteBombUnarmedPic
-- }
throwRemoteBomb :: Creature -> World -> World
@@ -293,7 +294,7 @@ retireRemoteBomb :: Int -> Int -> Int -> World -> World
retireRemoteBomb itid 0 pjid w = w
& pointToItem (_itemPositions w IM.! itid) %~
( (itAttachment . scopePos .~ V2 0 0)
. (itZoom .~ defaultItZoom)
-- . (itZoom .~ defaultItZoom)
. (itUse . rUse .~ const throwRemoteBomb)
)
& props %~ IM.delete pjid
+1 -1
View File
@@ -25,7 +25,7 @@ basicItemDisplay it = Prelude.take (itSlotsTaken it) $
Nothing' -> show (_ammoLoaded am)
Just' x -> show x ++ "R" ++ show (_ammoLoaded am)
Just am@ChargeableAmmo{} -> show $ _wpCharge am
Just x@ItemItselfConsumable{} -> "x" ++ show (_itAmount' x)
Just x@ItemItselfConsumable{} -> "x" ++ show (_itAmount x)
Just NoConsumption -> "NOCONSUMPTION"
Nothing -> ""
theparam = fromMaybe []
+17 -10
View File
@@ -57,7 +57,6 @@ launcher = defaultGun
& useAim . aimSpeed .~ 0.2
& useAim . aimRange .~ 0.5
& useAim . aimStance .~ TwoHandTwist
, _itFloorPict = launcherPic
, _itEffect = NoItEffect
, _itParams = ShellLauncher
{ _shellSpinDrag = 1
@@ -70,7 +69,23 @@ launcher = defaultGun
}
, _itInvSize = 3
, _itInvDisplay = basicItemDisplay
, _itDimension = ItemDimension
{ _dimRad = 9
, _dimCenter = V3 10 0 0
, _dimPortage = HeldItem
{_handlePos = 5
,_muzPos = 20
}
, _dimSPic = launcherPic
}
}
launcherPic :: Item -> SPic
launcherPic _ =
( colorSH cyan $ prismPoly
(map (+.+.+ V3 20 0 5) $ polyCircx 4 5)
(map (+.+.+ V3 0 0 5) $ polyCircx 4 5)
, mempty
)
defaultShellAmmo :: AmmoType
defaultShellAmmo = ProjectileAmmo
@@ -79,13 +94,6 @@ defaultShellAmmo = ProjectileAmmo
, _amPjDraw = const mempty
}
launcherPic :: Item -> SPic
launcherPic _ =
( colorSH cyan $ prismPoly
(map (+.+.+ V3 10 0 4.5) $ polyCircx 4 5)
(map (+.+.+ V3 (-10) 0 4.5) $ polyCircx 4 5)
, mempty
)
basicAmPjMoves :: IM.IntMap TweakParam
basicAmPjMoves = IM.fromList . zip [0..] $
@@ -254,7 +262,7 @@ trySpinByCID cid i pj w = w & props . ix pjid . pjSpin .~ newSpin
remoteLauncher :: Item
remoteLauncher = defaultGun
remoteLauncher = launcher
{ _itName = "ROCKO-REM"
, _itType = LAUNCHER
, _itConsumption = defaultAmmo
@@ -274,7 +282,6 @@ remoteLauncher = defaultGun
& useAim . aimSpeed .~ 0.2
& useAim . aimRange .~ 0.5
& useAim . aimStance .~ TwoHandTwist
, _itFloorPict = launcherPic
, _itAttachment = ItScope (V2 0 0) 0 1 True
-- , _itParams = ShellLauncher
-- { _tweakSel = 0
-9
View File
@@ -31,7 +31,6 @@ radar = defaultGun
]
& useAim . aimRange .~ 1
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1}
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ color blue $ polygon $ rectNESW 5 5 (-5) (-5)
-- , _itZoom = defaultItZoom { _itZoomMax = 1}
, _itEquipPict = pictureWeaponOnAim' $ \_ -> (,) emptySH $ color blue $ polygon $ rectNESW 5 5 (-5) (-5)
}
@@ -51,8 +50,6 @@ sonar = defaultGun
]
& useAim . aimRange .~ 1
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1}
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ color blue $ polygon $ rectNESW 5 5 (-5) (-5)
-- , _itZoom = defaultItZoom {_itZoomMax = 1}
, _itEquipPict = pictureWeaponOnAim' $ \_ -> (,) emptySH $ color blue $ polygon $ rectNESW 5 5 (-5) (-5)
}
{- |
@@ -61,12 +58,9 @@ autoSonar :: Item
autoSonar = defaultEquipment
{ _itType = RADAR
, _itName = "AUTOSONAR"
, _itMaxStack = 1
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ color yellow $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
, _itEquipPict = \_ _ -> (,) emptySH blank
, _itEffect = autoSonarEffect
, _itID = Nothing
-- , _itZoom = defaultItZoom {_itZoomMax = 1}
}
{- |
Automatically sends out pulses that display walls. -}
@@ -74,10 +68,7 @@ autoRadar :: Item
autoRadar = defaultEquipment
{ _itType = RADAR
, _itName = "AUTORADAR"
, _itMaxStack = 1
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ color yellow $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
, _itEquipPict = \_ _ -> (,) emptySH blank
, _itEffect = autoRadarEffect
, _itID = Nothing
-- , _itZoom = defaultItZoom {_itZoomMax = 1}
}
+15 -15
View File
@@ -52,8 +52,21 @@ poisonSprayer = defaultAutoGun
{ _nozzleSpread = 0.2
, _nozzleNum = 3
}
, _itFloorPict = flamerPic
-- , _itFloorPict = flamerPic
}
flamerPic :: Item -> SPic
flamerPic it =
( colorSH yellow $
translateSHf tx ty (upperPrismPoly tz $ polyCirc 3 r)
++ upperPrismPoly 5 (rectNESW 2 9 (-2) (-9))
, color black $ translate3 (V3 tx ty (tz+0.01)) $ circleSolid (r * am)
)
where
tx = - 5
ty = - 6
tz = 3
r = 5
am = fractionLoadedAmmo2 it
flamer :: Item
flamer = defaultAutoGun
{ _itName = "FLAMER"
@@ -73,7 +86,7 @@ flamer = defaultAutoGun
& useAim . aimSpeed .~ 0.5
& useAim . aimZoom .~ defaultItZoom {_itZoomMax = 5, _itZoomMin = 1.5}
& useAim . aimStance .~ TwoHandTwist
, _itFloorPict = flamerPic
-- , _itFloorPict = flamerPic
-- , _itZoom = defaultItZoom
, _itAttachment = NoItAttachment
, _itParams = AngleWalk
@@ -82,19 +95,6 @@ flamer = defaultAutoGun
,_currentWalkAngle = 0
}
}
flamerPic :: Item -> SPic
flamerPic it =
( colorSH yellow $
translateSHf tx ty (upperPrismPoly tz $ polyCirc 3 r)
++ upperPrismPoly 5 (rectNESW 2 9 (-2) (-9))
, color black $ translate3 (V3 tx ty (tz+0.01)) $ circleSolid (r * am)
)
where
tx = - 5
ty = - 6
tz = 3
r = 5
am = fractionLoadedAmmo2 it
aGasCloud :: Creature -> World -> World
aGasCloud cr w = insertCloud $ set randGen g w
where
+6 -6
View File
@@ -53,6 +53,7 @@ import Dodge.Reloading
import Dodge.WorldEvent
import Dodge.RandomHelp
import Dodge.Inventory.Lock
import Dodge.Creature.HandPos
--import Dodge.Default
import Sound.Data
import Geometry
@@ -353,14 +354,13 @@ modClock n chainEff eff it cr w
withMuzFlareI :: ChainEffect
withMuzFlareI f it cr w = makeTlsTimeRadColPos 3 100 (V3 1 1 0.5) flashPos
. muzFlareAt (V4 5 5 0 2) flarePos dir
. muzFlareAt (V4 5 5 0 2) flarePos cdir
$ f it cr w
where
--pos = _crPos cr +.+ _crRad cr *.* unitVectorAtAngle (_crDir cr)
flarePos = addZ 20 $ _crPos cr +.+ (_crRad cr + itLength) *.* unitVectorAtAngle dir
flashPos = addZ 35 $ _crPos cr +.+ (2.5 * _crRad cr) *.* unitVectorAtAngle dir
dir = _crDir cr
itLength = _muzzleLength $ _itDimension it
flarePos = addZ 0 (_crPos cr) +.+.+ rotate3z cdir muzzleOffset
flashPos = addZ 0 (_crPos cr) +.+.+ rotate3z cdir (muzzleOffset +.+.+ V3 5 0 5)
muzzleOffset = V3 (_muzPos (_dimPortage (_itDimension it))) 0 0
cdir = _crDir cr
{- | Applies the effect to a randomly rotated creature,
- rotation amount given by inaccuracy in itParams -}
applyInaccuracy :: ChainEffect
+3 -3
View File
@@ -63,7 +63,7 @@ shrinkGun = defaultGun
}
, _itUse = defaultlUse {_lUse = hammerCheckL useShrinkGun}
& useHammer .~ upHammer
, _itFloorPict = shrinkGunPic
-- , _itFloorPict = shrinkGunPic
, _itAttachment = ItBool True
}
@@ -94,7 +94,7 @@ blinkGun = defaultGun
, _itUse = defaultlUse
{_lUse = hammerCheckL $ shootL aSelfL
} & useHammer .~ upHammer
, _itFloorPict = const . noPic . colorSH chartreuse $ upperPrismPoly 2 $ square 2
-- , _itFloorPict = const . noPic . colorSH chartreuse $ upperPrismPoly 2 $ square 2
}
@@ -125,7 +125,7 @@ forceFieldGun = defaultGun
, _reloadState = Nothing'
}
, _itUse = undefined
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-4,-4),(-4,4),(4,4),(4,0),(0,0),(0,-4)]
-- , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-4,-4),(-4,4),(4,4),(4,0),(0,0),(0,-4)]
}
-- grapGun = defaultGun
-- { _itName = "grapGun"