Work on minigun

This commit is contained in:
2022-02-16 21:54:12 +00:00
parent acfc24fb9b
commit 60463ea9c0
3 changed files with 27 additions and 111 deletions
+2 -2
View File
@@ -75,7 +75,7 @@ miniGunCrit = defaultCreature
, _crGoal = []
}
-- , _crInv = IM.fromList [(0,autoRifle & itConsumption . ammoLoaded .~ 1000)]
, _crInv = IM.fromList [(0,miniGun)]
, _crInv = IM.fromList [(0,miniGunX 3)]
-- , _crInv = IM.fromList [(0,autoRifle)]
, _crInvSel = 0
, _crRad = 10
@@ -190,7 +190,7 @@ stackedInventory = IM.fromList $ zip [0..]
,pistol
,teslaGun
,blinkGun
,miniGun
,miniGunX 3
,bezierGun
-- ,multGun
,boosterGun
+24 -108
View File
@@ -7,7 +7,6 @@ module Dodge.Item.Weapon.BulletGun.Cane
, burstRifle
, completeBurstRifle
, fastBurstRifle
, miniGun
, miniGunX
) where
import Dodge.Item.Weapon.BulletGun.Clip
@@ -162,12 +161,11 @@ repeater = rifle
)
baseCaneShape :: Shape
baseCaneShape = colorSH red $ upperPrismPoly 3 $ rectXH 15 2
baseCaneShape = colorSH red $ upperPrismPoly 3 $ rectXH 15 1.5
baseRifleShape :: Shape
baseRifleShape = colorSH red $ upperPrismPoly 3 $ rectXH 25 2
autoRifle :: Item
autoRifle = repeater
& itName .~ "AUTORIFLE"
@@ -282,125 +280,43 @@ miniGunX i = defaultAutoGun
,_brlInaccuracy = 0
}
}
, _itEquipPict = pictureWeaponAim miniGunPictItem
, _itEquipPict = pictureWeaponAim (miniGunXPictItem i)
, _itTweaks = defaultBulletSelTweak
, _itInvSize = 4
, _itInvDisplay = \it -> head (basicItemDisplay it) :
["*" ++ replicate 13 ' ' ++ "*"
,"* " ++ fromMaybe " " (maybeWarmupStatus it) ++ " *"
,"*" ++ replicate 13 ' ' ++ "*" ]
-- [" " ++ replicate 8 ch
-- ," " ++ replicate 2 ch ++ fromMaybe " " (maybeWarmupStatus it) ++ replicate 2 ch
-- ," " ++ replicate 8 ch]
}
miniGun :: Item
miniGun = defaultAutoGun
{ _itName = "MINIGUN"
, _itType = MINIGUN
, _itConsumption = defaultAmmo
{ _aoType = basicBullet
, _ammoMax = 1500
, _ammoLoaded = 1500
, _reloadTime = 200
}
, _itUse = ruseInstant (useAmmoParamsVelMod vm4) NoHammer
[ ammoCheckI
, withWarmUp crankSlowS
--, afterRecoil recoilAmount
, withSoundForI mini1S 2
--, withThinSmokeI
, torqueAfterI 0.05
, withSidePushI 53
, afterRecoil recoilAmount
, withRandomOffsetI 12
, trigDoAlso (useAmmoParamsVelMod vm1)
--, torqueBeforeForcedI 0.001
, withSidePushI 52
, afterRecoil recoilAmount
, withRandomOffsetI 11
, withOldDir od1
, trigDoAlso (useAmmoParamsVelMod vm2)
--, torqueBeforeForcedI 0.001
, withSidePushI 51
, afterRecoil recoilAmount
, withRandomOffsetI 10
, withOldDir od2
, trigDoAlso (useAmmoParamsVelMod vm3)
--, torqueBeforeForcedI 0.001
, withSidePushI 50
, afterRecoil recoilAmount
, withRandomOffsetI 9
, withOldDir od3
, useAmmoAmount 4
, withMuzFlareI
, withSmoke 1 black 20 200 5
]
& useDelay .~ WarmUpNoDelay {_warmTime = 0,_warmMax = 200}
& useAim . aimSpeed .~ 0.4
& useAim . aimRange .~ 1
& useAim . aimStance .~ TwoHandTwist
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
-- , _itFloorPict = miniGunPictItem
, _itParams = BulletShooter
{ _muzVel = 1
, _rifling = 0.9
, _bore = 2
, _gunBarrels = MultiBarrel
{_brlSpread = RotatingBarrels 0.01
,_brlNum = 4
,_brlInaccuracy = 0
, _itDimension = ItemDimension
{ _dimRad = 20
, _dimCenter = V3 5 0 0
, _dimPortage = HeldItem
{_handlePos = 5
,_muzPos = 20
}
, _dimSPic = miniGunXPictItem i
}
, _itEquipPict = pictureWeaponAim miniGunPictItem
, _itTweaks = defaultBulletSelTweak
, _itInvSize = 4
, _itInvDisplay = \it -> head (basicItemDisplay it) :
["*" ++ replicate 13 ' ' ++ "*"
,"* " ++ fromMaybe " " (maybeWarmupStatus it) ++ " *"
,"*" ++ replicate 13 ' ' ++ "*" ]
-- [" " ++ replicate 8 ch
-- ," " ++ replicate 2 ch ++ fromMaybe " " (maybeWarmupStatus it) ++ replicate 2 ch
-- ," " ++ replicate 8 ch]
}
where
--ch = '*'
recoilAmount = 5
[vm1,vm2,vm3,vm4] =
[ 0.25
, 0.5
, 0.75
, 1
]
[od1,od2,od3] =
[ 0.25, 0.5, 0.9]
--[ 0.75, 0.5, 0.25]
--[ 0, 0, 0]
miniGunPictItem :: Item -> SPic
miniGunPictItem it = miniGunPict spin (_ammoLoaded $ _itConsumption it)
& itDimension . dimPortage . muzPos .~ 40
miniGunXPictItem :: Int -> Item -> SPic
miniGunXPictItem i it = miniGunXPict i spin (_ammoLoaded $ _itConsumption it)
where
spin = (-10) * _ammoLoaded (_itConsumption it) + _warmTime (_useDelay $ _itUse it)
miniGunPict :: Int -> Int -> SPic
miniGunPict spin am =
miniGunXPict :: Int -> Int -> Int -> SPic
miniGunXPict i spin _ =
( colorSH red (rotateSHx a barrels)
-- <> colorSH red (upperPrismPoly 5 $ rectNESW 8 8 (-8) 4)
-- <> colorSH red (prismPoly
-- (map (addZ 5) $ rectNESW 2 12 (-2) (-12))
-- (map (addZ 0) $ rectNESW 4 12 (-4) (-16))
-- )
<> clip (-1) 0
<> clip (-7) 0
<> baseRifleShape
-- <> clip (-1) 0
-- <> clip (-7) 0
, mempty
)
where
--aBarrel = translateSH (V3 7 0 9) $ prismPoly
aBarrel = translateSH (V3 7 0 2) $ prismPoly
(map (addZ 5) $ rectNESW 2 12 (-2) (-1))
(map (addZ 0) $ rectNESW 4 12 (-4) (-5))
barrels = concatMap (\an -> aBarrel & rotateSHx an) [0,0.5* pi, pi, 1.5*pi]
aBarrel = translateSH (V3 15 0 2) baseCaneShape
barrels = concatMap (\an -> aBarrel & rotateSHx (2*pi * fromIntegral an / fromIntegral i)) [1..i]
a = fromIntegral spin / 100
x = fromIntegral am / 10
clip y z = translateSH (V3 0 (-1) z) (rotateSHx (negate $ pi/4)
. upperPrismPoly 2
$ rectNESW (negate $ 3 + 0.25 * x) y 3 (y-5))
--x = fromIntegral am / 10
-- clip y z = translateSH (V3 0 (-1) z) (rotateSHx (negate $ pi/4)
-- . upperPrismPoly 2
-- $ rectNESW (negate $ 3 + 0.25 * x) y 3 (y-5))
+1 -1
View File
@@ -40,7 +40,7 @@ minigunFakeout = do
rcol <- rezColor
ncor <- state $ randomR (0,2)
roomwithmini <- randomiseAllLinks $ roomRectAutoLinks 150 150
& rmPmnts %~ (plRRpt 0 (PutFlIt miniGun):)
& rmPmnts %~ (plRRpt 0 (PutFlIt $ miniGunX 6):)
randcors <- replicateM ncor $ (fmap PassDown . randomiseOutLinks) corridor
return $ ([PassDown $ rezBox rcol
,PassDown door