Tweak walk cycle parameters

This commit is contained in:
2021-06-09 00:01:56 +02:00
parent fb7a90df71
commit 3371e2ae79
16 changed files with 112 additions and 81 deletions
+2 -1
View File
@@ -158,7 +158,8 @@ startCr = defaultCreature
startInventory :: IM.IntMap Item startInventory :: IM.IntMap Item
startInventory = IM.fromList (zip [0..20] startInventory = IM.fromList (zip [0..20]
( (
[autoGun [longGun
,autoGun
,hvAutoGun ,hvAutoGun
,pistol ,pistol
,teslaGun ,teslaGun
+3 -2
View File
@@ -24,7 +24,7 @@ yourControl w (f,g) cr =
, Just . mouseActionsCr (_mouseButtons w) $ wasdWithAiming w speed 0 cr , Just . mouseActionsCr (_mouseButtons w) $ wasdWithAiming w speed 0 cr
) )
where where
speed = 3 speed = 4
{- | Turn key presses into creature movement. -} {- | Turn key presses into creature movement. -}
wasdWithAiming wasdWithAiming
:: World :: World
@@ -35,12 +35,13 @@ wasdWithAiming
wasdWithAiming w speed i cr wasdWithAiming w speed i cr
| isAiming = set crDir mouseDir $ crMvBy (speed *.* mov) cr | isAiming = set crDir mouseDir $ crMvBy (speed *.* mov) cr
| isMoving = crMvAbsolute (speed *.* movAbs) $ turnAction cr | isMoving = crMvAbsolute (speed *.* movAbs) $ turnAction cr
-- | isMoving = crMvAbsolute (speed *.* movAbs) cr
-- | isMoving = crMvForward speed $ over crDir (`fromMaybe` dir) cr -- | isMoving = crMvForward speed $ over crDir (`fromMaybe` dir) cr
| otherwise = cr | otherwise = cr
where where
(mov',dir') = wasdComp (view keys w) w (mov',dir') = wasdComp (view keys w) w
dir = fmap (_cameraRot w +) dir' dir = fmap (_cameraRot w +) dir'
turnAction cr' = maybe cr (\d -> creatureTurnTowardDir d 0.2 cr') dir turnAction cr' = maybe cr' (\d -> creatureTurnTowardDir d 0.2 cr') dir
movAbs = rotateV (_cameraRot w) mov' movAbs = rotateV (_cameraRot w) mov'
mov = rotateV (negate $ _crDir cr - _cameraRot w) mov' mov = rotateV (negate $ _crDir cr - _cameraRot w) mov'
isAiming = _posture (_crStance cr) == Aiming isAiming = _posture (_crStance cr) == Aiming
+1 -2
View File
@@ -222,8 +222,7 @@ data Item
, _itAimingRange :: Float , _itAimingRange :: Float
, _itZoom :: ItZoom , _itZoom :: ItZoom
, _itEquipPict :: Creature -> Int -> Picture , _itEquipPict :: Creature -> Int -> Picture
, _itScrollUp :: Int -> World -> World , _itScroll :: Float -> Creature -> World -> World
, _itScrollDown :: Int -> World -> World
, _itIdentity :: ItemIdentity , _itIdentity :: ItemIdentity
, _itAttachment :: Maybe ItAttachment , _itAttachment :: Maybe ItAttachment
, _itID :: Maybe Int , _itID :: Maybe Int
+1 -1
View File
@@ -112,7 +112,7 @@ defaultCreature = Creature
, _crStance = Stance , _crStance = Stance
{_carriage=Walking 0 WasLeftForward {_carriage=Walking 0 WasLeftForward
,_posture=AtEase ,_posture=AtEase
,_strideLength = 20 ,_strideLength = 40
} }
, _crActionPlan = ActionPlan [] [] WatchAndWait [LiveLongAndProsper] , _crActionPlan = ActionPlan [] [] WatchAndWait [LiveLongAndProsper]
, _crMeleeCooldown = Nothing , _crMeleeCooldown = Nothing
+2 -7
View File
@@ -29,8 +29,7 @@ defaultGun = Weapon
, _itAimingRange = 0 , _itAimingRange = 0
, _itZoom = ItZoom 20 0.2 1 20 0.2 1 , _itZoom = ItZoom 20 0.2 1 20 0.2 1
, _itEquipPict = \_ _ -> blank , _itEquipPict = \_ _ -> blank
, _itScrollUp = const id , _itScroll = \_ _ -> id
, _itScrollDown = const id
, _itAttachment = Nothing , _itAttachment = Nothing
, _itID = Nothing , _itID = Nothing
, _itEffect = wpRecock , _itEffect = wpRecock
@@ -40,15 +39,11 @@ defaultGun = Weapon
, _itWorldTrigger = Nothing , _itWorldTrigger = Nothing
, _itAimStance = OneHand , _itAimStance = OneHand
} }
defaultAutoGun :: Item defaultAutoGun :: Item
defaultAutoGun = defaultGun defaultAutoGun = defaultGun
{ _itScrollUp = const id { _itInvDisplay = basicWeaponDisplay
, _itScrollDown = const id
, _itInvDisplay = basicWeaponDisplay
, _itAimStance = TwoHandTwist , _itAimStance = TwoHandTwist
} }
defaultShellAmmo :: Ammo defaultShellAmmo :: Ammo
defaultShellAmmo = ShellAmmo defaultShellAmmo = ShellAmmo
{ _amPayload = \_ -> id { _amPayload = \_ -> id
+3 -2
View File
@@ -91,8 +91,9 @@ wheelEvent y w = case (_carteDisplay w, _inventoryMode w) of
| rbDown -> w & carteZoom %~ min 0.75 . max 0.05 . ((1+y*0.1) * ) | rbDown -> w & carteZoom %~ min 0.75 . max 0.05 . ((1+y*0.1) * )
| otherwise -> w & selLocation %~ (`mod` numLocs) . (+ yi) | otherwise -> w & selLocation %~ (`mod` numLocs) . (+ yi)
(_, TopInventory) (_, TopInventory)
| rbDown -> fromMaybe (closeObjScrollDir y w) $ (yourItem w ^? itScrollUp) | rbDown -> fromMaybe (closeObjScrollDir y w) $ (yourItem w ^? itScroll)
<*> pure (_crInvSel (you w)) <*> pure y
<*> pure (you w)
<*> pure w <*> pure w
| lbDown -> w & cameraZoom +~ y | lbDown -> w & cameraZoom +~ y
| invKeyDown -> swapInvDir yi $ dirInvPos yi w | invKeyDown -> swapInvDir yi $ dirInvPos yi w
+10
View File
@@ -20,6 +20,16 @@ decCharMode' = itCharMode %~ cycleR
cycleR (xs :|> x) = x <| xs cycleR (xs :|> x) = x <| xs
cycleR xs = xs cycleR xs = xs
scrollCharMode
:: Float -- ^ Amount scrolled
-> Creature
-> World
-> World
scrollCharMode x cr
| x > 0 = incCharMode (_crInvSel cr)
| x < 0 = decCharMode (_crInvSel cr)
| otherwise = id
incCharMode incCharMode
:: Int -- ^ Inventory selection :: Int -- ^ Inventory selection
-> World -> World
+3 -5
View File
@@ -15,11 +15,9 @@ pictureWeaponOnAim
-> Int -- ^ Position of item in inventory -> Int -- ^ Position of item in inventory
-> Picture -> Picture
pictureWeaponOnAim p cr posInInv pictureWeaponOnAim p cr posInInv
| isSelected && _posture (_crStance cr) == Aiming | isSelected && _posture (_crStance cr) == Aiming && isTwisting
&& isTwisting
= onLayer PtLayer twistWep = onLayer PtLayer twistWep
| isSelected && _posture (_crStance cr) == Aiming | isSelected && _posture (_crStance cr) == Aiming && isOneHand
&& isOneHand
= onLayer PtLayer oneHandWep = onLayer PtLayer oneHandWep
| isSelected && _posture (_crStance cr) == Aiming | isSelected && _posture (_crStance cr) == Aiming
= onLayer PtLayer drawnWep = onLayer PtLayer drawnWep
@@ -34,7 +32,7 @@ pictureWeaponOnAim p cr posInInv
twistWep = uncurry translate (0.5 * _crRad cr,0) p twistWep = uncurry translate (0.5 * _crRad cr,0) p
--twistWep = uncurry translate (0.5 * _crRad cr,negate 0.5 * _crRad cr) p --twistWep = uncurry translate (0.5 * _crRad cr,negate 0.5 * _crRad cr) p
oneHandWep = uncurry translate (1.5 * _crRad cr,0) p oneHandWep = uncurry translate (1.5 * _crRad cr,0) p
holsteredWep = uncurry translate (_crRad cr,0) (rotate (sRot + 1) p) holsteredWep = uncurry translate (_crRad cr ,0) (rotate (sRot + 1.2) p)
holsteredOneHandWep = uncurry translate (_crRad cr * 0.7 + handPos,_crRad cr * negate 0.7) p holsteredOneHandWep = uncurry translate (_crRad cr * 0.7 + handPos,_crRad cr * negate 0.7) p
handPos = case cr^? crStance . carriage of handPos = case cr^? crStance . carriage of
Just (Walking x LeftForward) -> f x * 50 Just (Walking x LeftForward) -> f x * 50
+52 -39
View File
@@ -66,15 +66,13 @@ pistol = defaultGun
, _wpSpread = 0.02 , _wpSpread = 0.02
, _wpRange = 20 , _wpRange = 20
, _itHammer = HammerUp , _itHammer = HammerUp
, _itFloorPict = onLayer FlItLayer $ color green $ polygon $ rectNESW 3 3 (-3) (-3) , _itFloorPict = onLayer FlItLayer pistolPic
, _itAmount = 1 , _itAmount = 1
, _itMaxStack = 1 , _itMaxStack = 1
, _itAimingSpeed = 1 , _itAimingSpeed = 1
, _itAimingRange = 0 , _itAimingRange = 0
, _itZoom = defaultItZoom , _itZoom = defaultItZoom
, _itEquipPict = pictureWeaponOnAim $ color green $ polygon $ rectNESW 3 3 (-3) (-3) , _itEquipPict = pictureWeaponOnAim pistolPic
, _itScrollUp = const id
, _itScrollDown = const id
, _itAttachment = Nothing , _itAttachment = Nothing
, _itID = Nothing , _itID = Nothing
, _itEffect = wpRecock , _itEffect = wpRecock
@@ -84,6 +82,8 @@ pistol = defaultGun
, _itWorldTrigger = Nothing , _itWorldTrigger = Nothing
, _wpAmmo = basicBullet , _wpAmmo = basicBullet
} }
pistolPic :: Picture
pistolPic = color green $ polygon $ rectNESW 5 5 (-5) (-5)
useAmmoParams :: Item -> Creature -> World -> World useAmmoParams :: Item -> Creature -> World -> World
useAmmoParams it = withVelWthHiteff (_amBulVel b) (_amBulWth b) (_amBulEff b) useAmmoParams it = withVelWthHiteff (_amBulVel b) (_amBulWth b) (_amBulEff b)
where where
@@ -135,18 +135,21 @@ teslaGun = defaultGun
, _itUse = \_ -> shoot aTeslaArc , _itUse = \_ -> shoot aTeslaArc
, _wpSpread = 0.001 , _wpSpread = 0.001
, _wpRange = 20 , _wpRange = 20
, _itFloorPict = onLayer FlItLayer $ color blue $ pictures , _itFloorPict = onLayer FlItLayer teslaGunPic
[polygon $ rectNESW 7 3 1 (-3)
,polygon $ rectNESW (-1) 3 (-7) (-3)
]
, _itAimingSpeed = 0.4 , _itAimingSpeed = 0.4
, _itZoom = defaultItZoom , _itZoom = defaultItZoom
, _itAimingRange = 0 , _itAimingRange = 0
, _itEquipPict = pictureWeaponOnAim $ color blue $ pictures , _itEquipPict = pictureWeaponOnAim teslaGunPic
[polygon $ rectNESW 7 3 1 (-3)
,polygon $ rectNESW (-1) 3 (-7) (-3)
]
} }
teslaGunPic :: Picture
teslaGunPic = color blue $ pictures
[polygon $ rectNESW xb y xa (-y)
,polygon $ rectNESW (-xa) y (-xb) (-y)
]
where
xa = 1
xb = 9
y = 4
lasGun :: Item lasGun :: Item
lasGun = defaultAutoGun lasGun = defaultAutoGun
{ _itName = "LASGUN ////" { _itName = "LASGUN ////"
@@ -165,8 +168,7 @@ lasGun = defaultAutoGun
, _itAimingRange = 1 , _itAimingRange = 1
, _itEquipPict = pictureWeaponOnAim lasGunPic , _itEquipPict = pictureWeaponOnAim lasGunPic
, _itAttachment = Just $ ItCharMode $ Seq.fromList "/VZ" , _itAttachment = Just $ ItCharMode $ Seq.fromList "/VZ"
, _itScrollUp = incCharMode , _itScroll = scrollCharMode
, _itScrollDown = decCharMode
, _itInvDisplay = basicWeaponDisplay , _itInvDisplay = basicWeaponDisplay
} }
lasGunPic :: Picture lasGunPic :: Picture
@@ -264,22 +266,19 @@ hvAutoGun = defaultAutoGun
, _itUse = \it -> rateIncAB 24 10 (torqueBeforeForced 0.1 (mkHvBul it)) , _itUse = \it -> rateIncAB 24 10 (torqueBeforeForced 0.1 (mkHvBul it))
(torqueAfter 0.2 (mkHvBul it)) (torqueAfter 0.2 (mkHvBul it))
, _wpRange = 20 , _wpRange = 20
, _itFloorPict = onLayer FlItLayer $ color orange $ polygon $ rectNESW 5 5 (-5) (-5) , _itFloorPict = onLayer FlItLayer hvAutoGunPic
, _itAimingSpeed = 0.2 , _itAimingSpeed = 0.2
, _itAimingRange = 1 , _itAimingRange = 1
, _itEquipPict = pictureWeaponOnAim $ color orange $ polygon $ rectNESW 5 5 (-5) (-5) , _itEquipPict = pictureWeaponOnAim hvAutoGunPic
, _wpAmmo = BulletAmmo , _wpAmmo = hvBullet
{_amString = "HVBULLET"
, _amBulEff = penWalls hvBulHitCr' hvBulHitWall' bulHitFF'
, _amBulWth = 6
, _amBulVel = (80,0)
}
} }
where where
mkHvBul it = withSound (fromIntegral longGunSound) mkHvBul it = withSound (fromIntegral longGunSound)
. withThinSmoke . withThinSmoke
. withMuzFlare . withMuzFlare
$ useAmmoParams it $ useAmmoParams it
hvAutoGunPic :: Picture
hvAutoGunPic = color orange $ polygon $ rectNESW 5 12 (-5) (-12)
ltAutoGun :: Item ltAutoGun :: Item
ltAutoGun = defaultAutoGun ltAutoGun = defaultAutoGun
{ _itName = "AUTO-LT" { _itName = "AUTO-LT"
@@ -288,22 +287,24 @@ ltAutoGun = defaultAutoGun
, _wpLoadedAmmo = 25 , _wpLoadedAmmo = 25
, _wpReloadTime = 80 , _wpReloadTime = 80
, _wpReloadState = 0 , _wpReloadState = 0
, _itUseRate = 4 , _itUseRate = 3
, _itUseTime = 0 , _itUseTime = 0
, _itUse = \_ -> shootWithSound 0 . withRandomDir 0.3 . withSidePush 50 , _itUse = \_ -> shootWithSound 0 . withRandomDir 0.3 . withSidePush 50
. withMuzFlare $ withVelWthHiteff (30,0) 2 basicBulletEffect . withMuzFlare $ withVelWthHiteff (30,0) 2 basicBulletEffect
, _wpSpread = 0.5 , _wpSpread = 0.5
, _wpRange = 20 , _wpRange = 20
, _itFloorPict = onLayer FlItLayer $ color green $ pictures [polygon $ rectNSWE 4 (-4) (-4) 0 , _itFloorPict = onLayer FlItLayer ltAutoGunPic
,circleSolid 4
]
, _itAimingSpeed = 1 , _itAimingSpeed = 1
, _itAimingRange = 0 , _itAimingRange = 0
, _itZoom = defaultItZoom , _itZoom = defaultItZoom
, _itEquipPict = pictureWeaponOnAim $ color green $ pictures [polygon $ rectNSWE 4 (-4) (-4) 0 , _itEquipPict = pictureWeaponOnAim ltAutoGunPic
,circleSolid 4 , _itAimStance = OneHand
]
} }
ltAutoGunPic :: Picture
ltAutoGunPic = color green $ pictures
[polygon $ rectNSWE 5 (-5) (-5) 0
,circleSolid 5
]
miniGun :: Item miniGun :: Item
miniGun = defaultAutoGun miniGun = defaultAutoGun
{ _itName = "MINI-G" { _itName = "MINI-G"
@@ -398,23 +399,31 @@ longGun = defaultGun
, _wpReloadState = 0 , _wpReloadState = 0
, _itUseRate = 100 , _itUseRate = 100
, _itUseTime = 0 , _itUseTime = 0
, _itUse = \_ -> shootWithSound (fromIntegral longGunSound) , _itUse = shootWithSound (fromIntegral longGunSound)
. withThickSmoke . withThickSmoke
. torqueAfter 0.05 . torqueAfter 0.05
. withMuzFlare . withMuzFlare
. withVelWthHiteff (60,0) 6 . useAmmoParams
$ penWalls hvBulHitCr' hvBulHitWall' bulHitFF'
, _wpRange = 200 , _wpRange = 200
, _itFloorPict = onLayer FlItLayer $ pictures [color orange $ polygon $ rectNESW 3 6 (-3) (-6) ] , _itFloorPict = onLayer FlItLayer longGunPic
, _itAimingSpeed = 0.2 , _itAimingSpeed = 0.2
, _itAimingRange = 1 , _itAimingRange = 1
, _itZoom = defaultItZoom {_itAimZoomMax = 0.5, _itAimZoomMin = 0.5} , _itZoom = defaultItZoom {_itAimZoomMax = 0.5, _itAimZoomMin = 0.5}
, _itEquipPict = pictureWeaponOnAim $ pictures [color orange $ polygon $ rectNESW 3 6 (-3) (-6) ] , _itEquipPict = pictureWeaponOnAim longGunPic
, _itScrollUp = startZoomInLongGun , _itScroll = zoomLongGun
, _itScrollDown = startZoomOutLongGun
, _itAttachment = Just $ ItScope (0,0) 0 1 False , _itAttachment = Just $ ItScope (0,0) 0 1 False
, _itEffect = itemLaserScopeEffect , _itEffect = itemLaserScopeEffect
, _wpAmmo = hvBullet
, _itAimStance = TwoHandTwist
} }
longGunPic :: Picture
longGunPic = pictures [color orange $ polygon $ rectNESW 2 12 (-2) (-12) ]
zoomLongGun :: Float -> Creature -> World -> World
zoomLongGun x cr
| x > 0 = startZoomInLongGun (_crInvSel cr)
| x < 0 = startZoomOutLongGun (_crInvSel cr)
| otherwise = id
startZoomInLongGun :: Int -> World -> World startZoomInLongGun :: Int -> World -> World
startZoomInLongGun _ w = w & creatures . ix 0 . crInv . ix (_crInvSel (_creatures w IM.! 0)) startZoomInLongGun _ w = w & creatures . ix 0 . crInv . ix (_crInvSel (_creatures w IM.! 0))
@@ -422,7 +431,6 @@ startZoomInLongGun _ w = w & creatures . ix 0 . crInv . ix (_crInvSel (_creatur
startZoomOutLongGun :: Int -> World -> World startZoomOutLongGun :: Int -> World -> World
startZoomOutLongGun _ w = w & creatures . ix 0 . crInv . ix (_crInvSel (_creatures w IM.! 0)) startZoomOutLongGun _ w = w & creatures . ix 0 . crInv . ix (_crInvSel (_creatures w IM.! 0))
. itAttachment . _Just . scopeZoomChange %~ \x -> min (-5) (x-5) . itAttachment . _Just . scopeZoomChange %~ \x -> min (-5) (x-5)
poisonSprayer :: Item poisonSprayer :: Item
poisonSprayer = defaultAutoGun poisonSprayer = defaultAutoGun
{ _itName = "POISON" { _itName = "POISON"
@@ -455,13 +463,18 @@ flamer = defaultAutoGun
, _itUse = \_ -> shoot $ withSidePush 5 $ withSidePushAfter 10 $ randWalkAngle 0.2 0.01 aFlame , _itUse = \_ -> shoot $ withSidePush 5 $ withSidePushAfter 10 $ randWalkAngle 0.2 0.01 aFlame
, _wpSpread = 0 , _wpSpread = 0
, _wpRange = 8 , _wpRange = 8
, _itFloorPict = onLayer FlItLayer $ color yellow $ polygon $ rectNESW 4 4 (-4) (-4) , _itFloorPict = onLayer FlItLayer flamerPic
, _itAimingSpeed = 0.5 , _itAimingSpeed = 0.5
, _itAimingRange = 0 , _itAimingRange = 0
, _itZoom = defaultItZoom {_itAimZoomMax = 5, _itAimZoomMin = 1.5} , _itZoom = defaultItZoom {_itAimZoomMax = 5, _itAimZoomMin = 1.5}
, _itEquipPict = pictureWeaponOnAim $ color yellow $ polygon $ rectNESW 4 4 (-4) (-4) , _itEquipPict = pictureWeaponOnAim flamerPic
, _itAttachment = Nothing , _itAttachment = Nothing
} }
flamerPic :: Picture
flamerPic = color yellow $ pictures
[ translate (negate 5) (negate 7) $ circleSolid 5
, polygon $ rectNESW 2 9 (-2) (-9)
]
blinkGun :: Item blinkGun :: Item
blinkGun = defaultGun blinkGun = defaultGun
{ _itName = "BLINKER" { _itName = "BLINKER"
+6 -7
View File
@@ -28,7 +28,7 @@ autoGun = defaultAutoGun
, _wpLoadedAmmo = 30 , _wpLoadedAmmo = 30
, _wpReloadTime = 80 , _wpReloadTime = 80
, _wpReloadState = 0 , _wpReloadState = 0
, _itUseRate = 6 , _itUseRate = 5
, _itUseTime = 0 , _itUseTime = 0
, _itUse = \_ -> charFiringStrat , _itUse = \_ -> charFiringStrat
[('M',autoFireMode) [('M',autoFireMode)
@@ -37,15 +37,14 @@ autoGun = defaultAutoGun
, _wpSpread = autogunSpread , _wpSpread = autogunSpread
, _wpRange = 20 , _wpRange = 20
, _itHammer = HammerUp , _itHammer = HammerUp
, _itFloorPict = onLayer FlItLayer autoGunPict , _itFloorPict = onLayer FlItLayer autoGunPic
, _itAimingSpeed = 0.4 , _itAimingSpeed = 0.4
, _itAimingRange = 1 , _itAimingRange = 1
, _itZoom = defaultItZoom {_itAimZoomFac = 1.5} , _itZoom = defaultItZoom {_itAimZoomFac = 1.5}
, _itEquipPict = pictureWeaponOnAim autoGunPict , _itEquipPict = pictureWeaponOnAim autoGunPic
, _itEffect = wpRecock , _itEffect = wpRecock
, _itAttachment = Just $ ItCharMode $ Seq.fromList "MS" , _itAttachment = Just $ ItCharMode $ Seq.fromList "MS"
, _itScrollUp = incCharMode , _itScroll = scrollCharMode
, _itScrollDown = decCharMode
, _itInvDisplay = basicWeaponDisplay , _itInvDisplay = basicWeaponDisplay
, _wpAmmo = basicBullet , _wpAmmo = basicBullet
} }
@@ -60,8 +59,8 @@ autoGunNonTwistEff = withRecoil 40
. withVelWthHiteff (50,0) 3 . withVelWthHiteff (50,0) 3
$ destroyOnImpact bulHitCr bulHitWall' bulHitFF' $ destroyOnImpact bulHitCr bulHitWall' bulHitFF'
autoGunPict :: Picture autoGunPic :: Picture
autoGunPict = color red $ polygon $ rectNESW 4 12 (-4) (-12) autoGunPic = color red $ polygon $ rectNESW 4 12 (-4) (-12)
autogunSpread :: Float autogunSpread :: Float
autogunSpread = 0.07 autogunSpread = 0.07
+10 -2
View File
@@ -4,6 +4,7 @@ import Dodge.Data
import Dodge.Base import Dodge.Base
import Dodge.Default.Weapon import Dodge.Default.Weapon
import Dodge.Item.Data import Dodge.Item.Data
import Dodge.Item.Draw
import Dodge.Item.Weapon.Targeting import Dodge.Item.Weapon.Targeting
import Dodge.Item.Weapon.TriggerType import Dodge.Item.Weapon.TriggerType
import Dodge.Item.Weapon.ExtraEffect import Dodge.Item.Weapon.ExtraEffect
@@ -12,6 +13,7 @@ import Dodge.Particle.Bullet.Spawn
import Dodge.Particle.Bullet.HitEffect import Dodge.Particle.Bullet.HitEffect
import Dodge.WorldEvent.HitEffect import Dodge.WorldEvent.HitEffect
import Dodge.RandomHelp import Dodge.RandomHelp
import Dodge.Picture.Layer
import Picture import Picture
import Geometry import Geometry
@@ -28,14 +30,20 @@ bezierGun = defaultGun
. withRecoil 40 . withRecoil 40
. torqueBefore 0.05 -- I believe that this doesn't affect . torqueBefore 0.05 -- I believe that this doesn't affect
$ shootBezier $ fromJust p -- <- the start point $ shootBezier $ fromJust p -- <- the start point
, _itFloorPict = onLayer FlItLayer bezierGunPic
, _itEquipPict = pictureWeaponOnAim bezierGunPic
, _itAttachment = Nothing , _itAttachment = Nothing
, _itScrollUp = removeItTarget 0 , _itScroll = removeItTarget 0
, _itScrollDown = removeItTarget 0
, _itHammer = HammerUp , _itHammer = HammerUp
, _itEffect = rbSetTarget , _itEffect = rbSetTarget
, _itZoom = defaultItZoom , _itZoom = defaultItZoom
, _itAimingRange = 0 , _itAimingRange = 0
, _wpMaxAmmo = 50
, _itUseRate = 6
, _itAimStance = TwoHandTwist
} }
bezierGunPic :: Picture
bezierGunPic = color red $ polygon $ rectNESW 4 12 (-4) (-12)
shootBezier :: Point2 -> Creature -> World -> World shootBezier :: Point2 -> Creature -> World -> World
shootBezier targetp cr w = w & particles %~ (theBullet :) shootBezier targetp cr w = w & particles %~ (theBullet :)
+7
View File
@@ -10,3 +10,10 @@ basicBullet = BulletAmmo
, _amBulWth = 2 , _amBulWth = 2
, _amBulVel = (30,0) , _amBulVel = (30,0)
} }
hvBullet :: Ammo
hvBullet = BulletAmmo
{ _amString = "HVBULLET"
, _amBulEff = penWalls hvBulHitCr hvBulHitWall' bulHitFF'
, _amBulWth = 6
, _amBulVel = (80,0)
}
+2 -1
View File
@@ -13,6 +13,7 @@ import Dodge.Item.Weapon.UseEffect
import Dodge.WorldEvent.Flash import Dodge.WorldEvent.Flash
import Dodge.WorldEvent.ThingsHit import Dodge.WorldEvent.ThingsHit
import Dodge.Picture.Layer import Dodge.Picture.Layer
import Dodge.Creature.Test
import Picture import Picture
import Geometry.Vector import Geometry.Vector
@@ -58,7 +59,7 @@ itemLaserScopeEffect
moveHammerUp !HammerDown = HammerReleased moveHammerUp !HammerDown = HammerReleased
moveHammerUp !_ = HammerUp moveHammerUp !_ = HammerUp
f _ cr invid w f _ cr invid w
| invid == _crInvSel cr = w | invid == _crInvSel cr && crIsAiming' cr = w
& particles %~ (:) (makeLaserScope sp ep reloadFrac) & particles %~ (:) (makeLaserScope sp ep reloadFrac)
& creatures . ix (_crID cr) . crInv . ix invid . itHammer %~ moveHammerUp & creatures . ix (_crID cr) . crInv . ix invid . itHammer %~ moveHammerUp
& laserScopeTargetGlow col glowPoint & laserScopeTargetGlow col glowPoint
+2 -2
View File
@@ -13,8 +13,8 @@ useTargetPos f cr w = case cr ^? crInv . ix (_crInvSel cr) . itTargeting . _Just
Nothing -> w Nothing -> w
Just (g,_) -> f (g w) cr w Just (g,_) -> f (g w) cr w
removeItTarget :: Int -> Int -> World -> World removeItTarget :: Int -> Float -> Creature -> World -> World
removeItTarget i _ w = w & creatures . ix i . crInv . ix itRef . itTargeting .~ Nothing removeItTarget i _ _ w = w & creatures . ix i . crInv . ix itRef . itTargeting .~ Nothing
where where
cr = _creatures w IM.! i cr = _creatures w IM.! i
itRef = _crInvSel cr itRef = _crInvSel cr
+2 -2
View File
@@ -88,8 +88,8 @@ bulPenCr' bt p cr w
) {_btTimer' = _btTimer' bt - 1} ) {_btTimer' = _btTimer' bt - 1}
{- | Heavy bullet effects when hitting creature: {- | Heavy bullet effects when hitting creature:
piercing, blunt, twisting and pushback damage all applied. -} piercing, blunt, twisting and pushback damage all applied. -}
hvBulHitCr' :: Particle -> Point2 -> Creature -> World -> World hvBulHitCr :: Particle -> Point2 -> Creature -> World -> World
hvBulHitCr' bt p cr w hvBulHitCr bt p cr w
= over (creatures . ix cid . crState . crDamage) = over (creatures . ix cid . crState . crDamage)
([Piercing 200 sp p ep ([Piercing 200 sp p ep
,Blunt 100 sp p ep ,Blunt 100 sp p ep
+4 -6
View File
@@ -45,12 +45,10 @@ customMouseCursor w =
$ pictures [ line [(-5,0),(5,0)] , line [(0,-5),(0,5)] ] $ pictures [ line [(-5,0),(5,0)] , line [(0,-5),(0,5)] ]
testPic :: World -> [Picture] testPic :: World -> [Picture]
testPic _ = [] testPic w =
--testPic w = [ setDepth (-1) . translate 0 0.8
-- [ setDepth (-1) . translate 0 0.8 . scale 0.001 0.001 . text . show $ _cameraRot w
-- . scale 0.001 0.001 . text . show . length . IM.elems ]
-- . IM.filter ( (== 3) . _crRad ) $ _creatures w
-- ]
crDraw :: World -> Creature -> Picture crDraw :: World -> Creature -> Picture
crDraw w c = (_crPict c c w) crDraw w c = (_crPict c c w)