Move toward adding multiple equipable items that are not directly usable
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
module Dodge.Item.Weapon.BulletGun.Cane
|
||||
( bangCane
|
||||
, bangCaneX
|
||||
, repeater
|
||||
, rifle
|
||||
, autoRifle
|
||||
, assaultRifle
|
||||
@@ -69,16 +70,12 @@ bangCane = defaultGun
|
||||
,_muzPos = 20
|
||||
}
|
||||
, _dimSPic = \it -> noPic $ baseCaneShape
|
||||
<> caneClip it
|
||||
<> makeSingleClipAt (V3 5 0 3) it
|
||||
}
|
||||
} & itUse . useAim . aimSpeed .~ 0.4
|
||||
& itUse . useAim . aimRange .~ 1
|
||||
& itUse . useAim . aimStance .~ OneHand
|
||||
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
||||
caneClip :: Item -> Shape
|
||||
caneClip it = case it ^? itConsumption . ammoLoaded of
|
||||
Just 0 -> mempty
|
||||
_ -> translateSH (V3 5 0 3) $ upperPrismPoly 1 $ square 1.5
|
||||
bangCaneX :: Int -> Item
|
||||
bangCaneX i = bangCane
|
||||
{ _itName = "BANGCANEx"++show i
|
||||
@@ -129,7 +126,6 @@ caneClipX i it = case it ^? itConsumption . ammoLoaded of
|
||||
[0..la-1]
|
||||
_ -> mempty
|
||||
|
||||
|
||||
rifle :: Item
|
||||
rifle = bangCane
|
||||
{ _itDimension = ItemDimension
|
||||
@@ -139,20 +135,32 @@ rifle = bangCane
|
||||
{_handlePos = 5
|
||||
,_muzPos = 25
|
||||
}
|
||||
, _dimSPic = \it -> noPic $ baseCaneShape
|
||||
<> makeClipAt 0 (V3 10 (-2) 0) it
|
||||
, _dimSPic = \it -> noPic $ baseRifleShape
|
||||
<> makeSingleClipAt (V3 5 0 3) it
|
||||
}
|
||||
}
|
||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||
& itName .~ "RIFLE"
|
||||
& itType .~ RIFLE
|
||||
& itConsumption . ammoMax .~ 15
|
||||
& itConsumption . ammoMax .~ 1
|
||||
|
||||
repeater :: Item
|
||||
repeater = rifle
|
||||
& itName .~ "REPEATER"
|
||||
& itType .~ REPEATER
|
||||
& itConsumption . reloadType .~ ActiveClear
|
||||
& itConsumption . reloadTime .~ 80
|
||||
& itConsumption . ammoMax .~ 15
|
||||
& itDimension . dimSPic .~ (\it -> noPic $ baseRifleShape
|
||||
<> makeTinClipAt 0 (V3 10 (-2) 0) it
|
||||
)
|
||||
|
||||
baseCaneShape :: Shape
|
||||
baseCaneShape = colorSH red $ upperPrismPoly 3 $ rectXH 15 2
|
||||
|
||||
baseRifleShape :: Shape
|
||||
baseRifleShape = colorSH red $ upperPrismPoly 3 $ rectXH 25 2
|
||||
|
||||
|
||||
autoRifle :: Item
|
||||
autoRifle = rifle
|
||||
|
||||
@@ -5,8 +5,13 @@ import Geometry
|
||||
import Data.Maybe
|
||||
import Control.Lens
|
||||
|
||||
makeClipAt :: Float -> Point3 -> Item -> Shape
|
||||
makeClipAt r p it = translateSH p . overPosSH (rotate3z r) $ upperPrismPoly 1 $ rectNSEW 0 (-y) (-2) 2
|
||||
makeSingleClipAt :: Point3 -> Item -> Shape
|
||||
makeSingleClipAt p it = case it ^? itConsumption . ammoLoaded of
|
||||
Just 0 -> mempty
|
||||
_ -> translateSH p $ upperPrismPoly 1 $ square 1.5
|
||||
|
||||
makeTinClipAt :: Float -> Point3 -> Item -> Shape
|
||||
makeTinClipAt r p it = translateSH p . overPosSH (rotate3z r) $ upperPrismPoly 1 $ rectNSEW 0 (-y) (-2) 2
|
||||
where
|
||||
y = fromIntegral y' * 0.3
|
||||
y' = fromMaybe 0 $ it ^? itConsumption . ammoLoaded
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
module Dodge.Item.Weapon.BulletGun.Rod
|
||||
( bangRod
|
||||
, elephantGun
|
||||
, amr
|
||||
, sniperRifle
|
||||
, machineGun
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Dodge.Item.Weapon.BulletGun.Clip
|
||||
--import Dodge.ChainEffect
|
||||
--import Dodge.TweakBullet
|
||||
import Dodge.Default.Weapon
|
||||
--import Dodge.Item.Weapon.InventoryDisplay
|
||||
import Dodge.Default
|
||||
--import Dodge.Item.Attachment
|
||||
--import Dodge.Item.Weapon.ExtraEffect
|
||||
--import Dodge.Item.Weapon.InventoryDisplay
|
||||
import Dodge.Item.Weapon.AmmoParams
|
||||
--import Dodge.Item.Draw
|
||||
import Dodge.Item.Weapon.Bullet
|
||||
import Dodge.Item.Weapon.TriggerType
|
||||
import Dodge.SoundLogic.LoadSound
|
||||
import Picture
|
||||
import Geometry
|
||||
import ShapePicture
|
||||
import Shape
|
||||
--import Sound.Data
|
||||
import LensHelp
|
||||
|
||||
--import Data.Maybe
|
||||
--import qualified Data.Sequence as Seq
|
||||
--import Control.Lens
|
||||
--import Control.Monad.State
|
||||
--import System.Random
|
||||
|
||||
bangRod :: Item
|
||||
bangRod = defaultGun
|
||||
{ _itName = "BANGROD"
|
||||
, _itType = BANGROD
|
||||
, _itParams = BulletShooter
|
||||
{ _muzVel = 0.8
|
||||
, _rifling = 1
|
||||
, _bore = 2
|
||||
, _gunBarrels = SingleBarrel 0.1
|
||||
}
|
||||
, _itUse = useAmmoParamsRate 6 upHammer
|
||||
[ ammoHammerCheck
|
||||
, useTimeCheck
|
||||
, withSoundStart autoGunS
|
||||
, useAmmoAmount 1
|
||||
, torqueAfterI 0.3
|
||||
, applyInaccuracy
|
||||
, withMuzFlareI
|
||||
, withRecoilI 50
|
||||
]
|
||||
, _itDimension = ItemDimension
|
||||
{ _dimRad = 12
|
||||
, _dimCenter = V3 5 0 0
|
||||
, _dimPortage = HeldItem
|
||||
{_handlePos = 5
|
||||
,_muzPos = 30
|
||||
}
|
||||
, _dimSPic = \it -> noPic $ baseRodShape
|
||||
<> makeSingleClipAt (V3 5 0 3) it
|
||||
}
|
||||
, _itConsumption = defaultAmmo
|
||||
{ _aoType = basicBullet
|
||||
, _ammoMax = 1
|
||||
, _reloadTime = 20
|
||||
, _reloadType = ActiveClear
|
||||
}
|
||||
}
|
||||
& itUse . useAim . aimSpeed .~ 0.2
|
||||
& itUse . useAim . aimRange .~ 1
|
||||
& itUse . useAim . aimStance .~ OneHand
|
||||
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
||||
baseRodShape :: Shape
|
||||
baseRodShape = colorSH orange $ upperPrismPoly 3 $ rectXH 20 2
|
||||
baseAMRShape :: Shape
|
||||
baseAMRShape = colorSH orange $ upperPrismPoly 3 $ rectXH 30 2
|
||||
elephantGun :: Item
|
||||
elephantGun = bangRod
|
||||
& itName .~ "ELEPHANTGUN"
|
||||
& itType .~ ELEPHANTGUN
|
||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||
& itParams . gunBarrels .~ SingleBarrel 0.05
|
||||
& itDimension . dimSPic .~ (\it -> noPic $ baseAMRShape
|
||||
<> makeSingleClipAt (V3 5 0 3) it
|
||||
)
|
||||
& itUse . useMods .~
|
||||
[ ammoHammerCheck
|
||||
, useTimeCheck
|
||||
, withSoundStart autoGunS
|
||||
, useAmmoAmount 1
|
||||
, torqueAfterI 0.1
|
||||
, applyInaccuracy
|
||||
, withMuzFlareI
|
||||
, withRecoilI 50
|
||||
]
|
||||
amr :: Item
|
||||
amr = elephantGun
|
||||
& itName .~ "AMR"
|
||||
& itType .~ AMR
|
||||
& itConsumption . ammoMax .~ 15
|
||||
& itDimension . dimSPic .~ (\it -> noPic $ baseAMRShape
|
||||
<> makeTinClipAt 0 (V3 10 (-2) 0) it
|
||||
)
|
||||
sniperRifle :: Item
|
||||
sniperRifle = elephantGun
|
||||
& itName .~ "SNIPERRIFLE"
|
||||
& itType .~ SNIPERRIFLE
|
||||
& itParams . gunBarrels .~ SingleBarrel 0
|
||||
machineGun :: Item
|
||||
machineGun = bangRod
|
||||
& itName .~ "MACHINEGUN"
|
||||
& itType .~ MACHINEGUN
|
||||
@@ -57,9 +57,10 @@ bangStick i = defaultGun
|
||||
, useTimeCheck
|
||||
, withSoundItemChoiceStart bangStickSoundChoice
|
||||
, useAllAmmo
|
||||
-- , applyInaccuracy
|
||||
, withMuzFlareI
|
||||
, torqueAfterI (0.18 + 0.02 * fromIntegral i)
|
||||
, spreadLoaded
|
||||
, applyInaccuracy
|
||||
, withRecoilI 25
|
||||
]
|
||||
, _itID = Nothing
|
||||
@@ -71,8 +72,8 @@ bangStick i = defaultGun
|
||||
, _bore = 2
|
||||
, _gunBarrels = MultiBarrel
|
||||
{_brlNum = i
|
||||
,_brlSpread = SpreadBarrels 0.2
|
||||
,_brlInaccuracy = 0
|
||||
,_brlSpread = SpreadBarrels baseStickSpread
|
||||
,_brlInaccuracy = 0.05
|
||||
}
|
||||
}
|
||||
, _itTweaks = defaultBulletSelTweak
|
||||
@@ -84,16 +85,33 @@ bangStick i = defaultGun
|
||||
{_handlePos = 5
|
||||
,_muzPos = 10
|
||||
}
|
||||
, _dimSPic = \it -> noPic $ baseStickShape
|
||||
, _dimSPic = \it -> noPic $ baseStickShapeX i
|
||||
<> stickClip it
|
||||
}
|
||||
}
|
||||
baseStickShapeX :: Int -> Shape
|
||||
baseStickShapeX i = foldMap f [0..i-1]
|
||||
where
|
||||
f j = rotateSH ang baseStickShape
|
||||
where
|
||||
ang = fromIntegral j * baseStickSpread - (fromIntegral i - 1) * baseStickSpread * 0.5
|
||||
baseStickSpread :: Float
|
||||
baseStickSpread = 0.2
|
||||
|
||||
baseSMGShape :: Shape
|
||||
baseSMGShape = colorSH green $ upperPrismPoly 3 $ rectXH 20 2
|
||||
|
||||
baseStickShape :: Shape
|
||||
baseStickShape = colorSH green $ upperPrismPoly 3 $ rectXH 10 2
|
||||
stickClip :: Item -> Shape
|
||||
stickClip it = case it ^? itConsumption . ammoLoaded of
|
||||
Just 0 -> mempty
|
||||
_ -> translateSH (V3 5 0 3) $ upperPrismPoly 1 $ square 1.5
|
||||
Just x | x > 0 -> foldMap f [0..x-1]
|
||||
_ -> mempty
|
||||
where
|
||||
f i = rotateSH ang $ translateSH (V3 5 0 3) $ upperPrismPoly 2 $ square 1.5
|
||||
where
|
||||
ang = baseStickSpread * fromIntegral i
|
||||
- 0.5 * baseStickSpread * fromIntegral (_brlNum (_gunBarrels (_itParams it))-1)
|
||||
|
||||
revolver :: Item
|
||||
revolver = pistol
|
||||
@@ -133,7 +151,7 @@ machinePistolAfterHamMods =
|
||||
, useAmmoAmount 1
|
||||
, withSoundStart tap1S
|
||||
, applyInaccuracy
|
||||
, torqueAfterI 0.3
|
||||
, torqueAfterI 0.2
|
||||
, withSidePushI 50
|
||||
, withRecoilI 20
|
||||
, withMuzFlareI
|
||||
@@ -175,7 +193,7 @@ pistol = (bangStick 1)
|
||||
, _gunBarrels = SingleBarrel 0.05
|
||||
}
|
||||
, _itTweaks = defaultBulletSelTweak
|
||||
} & itDimension . dimSPic .~ (\it -> noPic $ baseStickShape <> makeClipAt pi (V3 5 2 0) it)
|
||||
} & itDimension . dimSPic .~ (\it -> noPic $ baseStickShape <> makeTinClipAt pi (V3 5 2 0) it)
|
||||
autoPistol :: Item
|
||||
autoPistol = pistol
|
||||
& itUse . useMods .~ (ammoCheckI : pistolAfterHamMods)
|
||||
@@ -193,6 +211,9 @@ smg = autoPistol -- & some parameter affecting stability
|
||||
& itName .~ "SMG"
|
||||
& itType .~ SMG
|
||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||
& itDimension . dimPortage . handlePos .~ 2
|
||||
& itDimension . dimSPic .~ \it -> noPic (baseSMGShape
|
||||
<> makeTinClipAt 0 (V3 7 (-2) 0) it)
|
||||
revolverX :: Int -> Item
|
||||
revolverX i = revolver
|
||||
{ _itName = "REVx"++show i
|
||||
|
||||
Reference in New Issue
Block a user