Work on minigun
This commit is contained in:
@@ -75,7 +75,7 @@ miniGunCrit = defaultCreature
|
|||||||
, _crGoal = []
|
, _crGoal = []
|
||||||
}
|
}
|
||||||
-- , _crInv = IM.fromList [(0,autoRifle & itConsumption . ammoLoaded .~ 1000)]
|
-- , _crInv = IM.fromList [(0,autoRifle & itConsumption . ammoLoaded .~ 1000)]
|
||||||
, _crInv = IM.fromList [(0,miniGun)]
|
, _crInv = IM.fromList [(0,miniGunX 3)]
|
||||||
-- , _crInv = IM.fromList [(0,autoRifle)]
|
-- , _crInv = IM.fromList [(0,autoRifle)]
|
||||||
, _crInvSel = 0
|
, _crInvSel = 0
|
||||||
, _crRad = 10
|
, _crRad = 10
|
||||||
@@ -190,7 +190,7 @@ stackedInventory = IM.fromList $ zip [0..]
|
|||||||
,pistol
|
,pistol
|
||||||
,teslaGun
|
,teslaGun
|
||||||
,blinkGun
|
,blinkGun
|
||||||
,miniGun
|
,miniGunX 3
|
||||||
,bezierGun
|
,bezierGun
|
||||||
-- ,multGun
|
-- ,multGun
|
||||||
,boosterGun
|
,boosterGun
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ module Dodge.Item.Weapon.BulletGun.Cane
|
|||||||
, burstRifle
|
, burstRifle
|
||||||
, completeBurstRifle
|
, completeBurstRifle
|
||||||
, fastBurstRifle
|
, fastBurstRifle
|
||||||
, miniGun
|
|
||||||
, miniGunX
|
, miniGunX
|
||||||
) where
|
) where
|
||||||
import Dodge.Item.Weapon.BulletGun.Clip
|
import Dodge.Item.Weapon.BulletGun.Clip
|
||||||
@@ -162,12 +161,11 @@ repeater = rifle
|
|||||||
)
|
)
|
||||||
|
|
||||||
baseCaneShape :: Shape
|
baseCaneShape :: Shape
|
||||||
baseCaneShape = colorSH red $ upperPrismPoly 3 $ rectXH 15 2
|
baseCaneShape = colorSH red $ upperPrismPoly 3 $ rectXH 15 1.5
|
||||||
|
|
||||||
baseRifleShape :: Shape
|
baseRifleShape :: Shape
|
||||||
baseRifleShape = colorSH red $ upperPrismPoly 3 $ rectXH 25 2
|
baseRifleShape = colorSH red $ upperPrismPoly 3 $ rectXH 25 2
|
||||||
|
|
||||||
|
|
||||||
autoRifle :: Item
|
autoRifle :: Item
|
||||||
autoRifle = repeater
|
autoRifle = repeater
|
||||||
& itName .~ "AUTORIFLE"
|
& itName .~ "AUTORIFLE"
|
||||||
@@ -282,125 +280,43 @@ miniGunX i = defaultAutoGun
|
|||||||
,_brlInaccuracy = 0
|
,_brlInaccuracy = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
, _itEquipPict = pictureWeaponAim miniGunPictItem
|
, _itEquipPict = pictureWeaponAim (miniGunXPictItem i)
|
||||||
, _itTweaks = defaultBulletSelTweak
|
, _itTweaks = defaultBulletSelTweak
|
||||||
, _itInvSize = 4
|
, _itInvSize = 4
|
||||||
, _itInvDisplay = \it -> head (basicItemDisplay it) :
|
, _itInvDisplay = \it -> head (basicItemDisplay it) :
|
||||||
["*" ++ replicate 13 ' ' ++ "*"
|
["*" ++ replicate 13 ' ' ++ "*"
|
||||||
,"* " ++ fromMaybe " " (maybeWarmupStatus it) ++ " *"
|
,"* " ++ fromMaybe " " (maybeWarmupStatus it) ++ " *"
|
||||||
,"*" ++ replicate 13 ' ' ++ "*" ]
|
,"*" ++ replicate 13 ' ' ++ "*" ]
|
||||||
-- [" " ++ replicate 8 ch
|
, _itDimension = ItemDimension
|
||||||
-- ," " ++ replicate 2 ch ++ fromMaybe " " (maybeWarmupStatus it) ++ replicate 2 ch
|
{ _dimRad = 20
|
||||||
-- ," " ++ replicate 8 ch]
|
, _dimCenter = V3 5 0 0
|
||||||
}
|
, _dimPortage = HeldItem
|
||||||
|
{_handlePos = 5
|
||||||
miniGun :: Item
|
,_muzPos = 20
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
, _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
|
& itDimension . dimPortage . muzPos .~ 40
|
||||||
--ch = '*'
|
|
||||||
recoilAmount = 5
|
miniGunXPictItem :: Int -> Item -> SPic
|
||||||
[vm1,vm2,vm3,vm4] =
|
miniGunXPictItem i it = miniGunXPict i spin (_ammoLoaded $ _itConsumption it)
|
||||||
[ 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)
|
|
||||||
where
|
where
|
||||||
spin = (-10) * _ammoLoaded (_itConsumption it) + _warmTime (_useDelay $ _itUse it)
|
spin = (-10) * _ammoLoaded (_itConsumption it) + _warmTime (_useDelay $ _itUse it)
|
||||||
|
|
||||||
miniGunPict :: Int -> Int -> SPic
|
miniGunXPict :: Int -> Int -> Int -> SPic
|
||||||
miniGunPict spin am =
|
miniGunXPict i spin _ =
|
||||||
( colorSH red (rotateSHx a barrels)
|
( colorSH red (rotateSHx a barrels)
|
||||||
-- <> colorSH red (upperPrismPoly 5 $ rectNESW 8 8 (-8) 4)
|
<> baseRifleShape
|
||||||
-- <> colorSH red (prismPoly
|
-- <> clip (-1) 0
|
||||||
-- (map (addZ 5) $ rectNESW 2 12 (-2) (-12))
|
-- <> clip (-7) 0
|
||||||
-- (map (addZ 0) $ rectNESW 4 12 (-4) (-16))
|
|
||||||
-- )
|
|
||||||
<> clip (-1) 0
|
|
||||||
<> clip (-7) 0
|
|
||||||
, mempty
|
, mempty
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
--aBarrel = translateSH (V3 7 0 9) $ prismPoly
|
aBarrel = translateSH (V3 15 0 2) baseCaneShape
|
||||||
aBarrel = translateSH (V3 7 0 2) $ prismPoly
|
barrels = concatMap (\an -> aBarrel & rotateSHx (2*pi * fromIntegral an / fromIntegral i)) [1..i]
|
||||||
(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]
|
|
||||||
a = fromIntegral spin / 100
|
a = fromIntegral spin / 100
|
||||||
x = fromIntegral am / 10
|
--x = fromIntegral am / 10
|
||||||
clip y z = translateSH (V3 0 (-1) z) (rotateSHx (negate $ pi/4)
|
-- clip y z = translateSH (V3 0 (-1) z) (rotateSHx (negate $ pi/4)
|
||||||
. upperPrismPoly 2
|
-- . upperPrismPoly 2
|
||||||
$ rectNESW (negate $ 3 + 0.25 * x) y 3 (y-5))
|
-- $ rectNESW (negate $ 3 + 0.25 * x) y 3 (y-5))
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ minigunFakeout = do
|
|||||||
rcol <- rezColor
|
rcol <- rezColor
|
||||||
ncor <- state $ randomR (0,2)
|
ncor <- state $ randomR (0,2)
|
||||||
roomwithmini <- randomiseAllLinks $ roomRectAutoLinks 150 150
|
roomwithmini <- randomiseAllLinks $ roomRectAutoLinks 150 150
|
||||||
& rmPmnts %~ (plRRpt 0 (PutFlIt miniGun):)
|
& rmPmnts %~ (plRRpt 0 (PutFlIt $ miniGunX 6):)
|
||||||
randcors <- replicateM ncor $ (fmap PassDown . randomiseOutLinks) corridor
|
randcors <- replicateM ncor $ (fmap PassDown . randomiseOutLinks) corridor
|
||||||
return $ ([PassDown $ rezBox rcol
|
return $ ([PassDown $ rezBox rcol
|
||||||
,PassDown door
|
,PassDown door
|
||||||
|
|||||||
Reference in New Issue
Block a user