Fix combination bug

This commit is contained in:
2021-12-06 02:33:36 +00:00
parent 22e3256da3
commit 40195d033c
12 changed files with 122 additions and 100 deletions
+2 -4
View File
@@ -5,7 +5,7 @@ import Dodge.Data
import Dodge.Base
import Dodge.Default.Weapon
import Dodge.Item.Weapon.Targeting
import Dodge.Item.Weapon.BulletGuns
--import Dodge.Item.Weapon.BulletGuns
import Dodge.Item.Weapon.TriggerType
import Dodge.Item.Weapon.ExtraEffect
--import Dodge.Default
@@ -15,7 +15,7 @@ import Dodge.WorldEvent.HitEffect
import Dodge.RandomHelp
import Dodge.SoundLogic.LoadSound
import Geometry
import ShapePicture
--import ShapePicture
import Data.Maybe
import Control.Lens
@@ -46,8 +46,6 @@ bezierGun = defaultGun
{ _ammoMax = 50
}
}
bezierGunSPic :: Item -> SPic
bezierGunSPic = autoGunPic
shootBezier :: Point2 -> Creature -> World -> World
shootBezier targetp cr w = w & particles %~ (theBullet :)
+9 -63
View File
@@ -252,7 +252,8 @@ rifle = bangCane
{_handlePos = 5
,_muzPos = 25
}
, _dimSPic = const $ noPic $ colorSH red $ upperPrismPoly 3 $ rectXH 25 2
, _dimSPic = \it -> noPic $ (colorSH red $ upperPrismPoly 3 $ rectXH 25 2)
<> makeClipAt (V3 10 (-2) 0) it
}
}
& itUse . useAim . aimStance .~ TwoHandTwist
@@ -262,6 +263,12 @@ rifle = bangCane
& itConsumption . reloadType .~ ActiveClear
& itConsumption . reloadTime .~ 80
makeClipAt :: Point3 -> Item -> Shape
makeClipAt p it = translateSH p $ upperPrismPoly 1 $ rectNSEW 0 (-y) (-2) 2
where
y = fromIntegral y' * 0.3
y' = fromMaybe 0 $ it ^? itConsumption . ammoLoaded
autoRifle :: Item
autoRifle = rifle
& itName .~ "AUTORIFLE"
@@ -557,19 +564,7 @@ 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
bulletClip :: Int -> Shape
bulletClip x = rotateSHx (negate $ pi/4) . upperPrismPoly 2 $ rectNESW 3 0 (3 - 0.25 * am) (-5)
where
am = fromIntegral x
hvAutoGun :: Item
hvAutoGun = defaultAutoGun
@@ -600,17 +595,6 @@ hvAutoGun = defaultAutoGun
,"* " ++ fromMaybe " " (maybeRateStatus it) ++ " *"
]
}
hvAutoGunPic :: Item -> SPic
hvAutoGunPic it =
( colorSH orange (prismPoly
(map (addZ 5) $ rectNESW 3 12 (-3) (-8))
(map (addZ 0) $ rectNESW 5 12 (-5) (-12))
)
<> bulletClip am
, mempty
)
where
am = _ammoLoaded $ _itConsumption it
autoPistol :: Item
autoPistol = pistol
& itUse . useMods .~ (ammoCheckI : pistolAfterHamMods)
@@ -657,19 +641,9 @@ ltAutoGun = defaultAutoGun
}
, _itTweaks = defaultBulletSelTweak
}
ltAutoGunPic :: Item -> SPic
ltAutoGunPic it =
( colorSH green $ prismPoly
(map (addZ 5) $ mirrorXAxis [V2 (-2) 3, V2 5 3, V2 10 0])
(map (addZ 0) $ mirrorXAxis [V2 (-5) 5, V2 5 5, V2 10 0])
<> bulletClip am
, mempty
)
where
am = _ammoLoaded $ _itConsumption it
miniGun :: Item
miniGun = defaultAutoGun
{ _itName = "MINI-G"
{ _itName = "MINIGUN"
, _itType = MINIGUN
, _itConsumption = defaultAmmo
{ _aoType = basicBullet
@@ -809,14 +783,6 @@ spreadGun = defaultGun
-- , _itFloorPict = spreadGunPic
, _itTweaks = defaultBulletSelTweak
}
spreadGunPic :: Item -> SPic
spreadGunPic it =
( colorSH green (upperPrismPoly 5 $ map toV2[(-3,0),(3,6),(3,-6)])
<> bulletClip am
, mempty
)
where
am = _ammoLoaded $ _itConsumption it
multGun :: Item
multGun = defaultGun
{ _itName = "MULTGUN"
@@ -855,21 +821,6 @@ multGun = defaultGun
}
, _itTweaks = defaultBulletSelTweak
}
multGunSPic :: Item -> SPic
multGunSPic it =
( colorSH red (
upperPrismPoly 2 (rectNESW 4 8 (-4) (-12)) <>
translateSHf 8 0 (concatMap barrel [12,7,2,-3,-8] <>
upperPrismPoly 2 (map toV2 [(-1.5,12),(-2,12),(-2,-12),(-1.5,-12)])
)
) <> bulletClip am
, mempty
)
where
barrel y = prismPoly
(map (addZ 5) $ rectNSEW y (y-4) 2 0 )
(map (addZ 0) $ rectNSEW y (y-4) 2 (-2))
am = _ammoLoaded $ _itConsumption it
longGun :: Item
longGun = defaultGun
{ _itName = "LONGGUN"
@@ -901,11 +852,6 @@ longGun = defaultGun
, _itAttachment = ItScope (V2 0 0) 0 1 False
, _itEffect = itemLaserScopeEffect
}
longGunSPic :: Item -> SPic
longGunSPic _ =
( colorSH orange $ upperPrismPoly 5 $ rectXH 25 2
, mempty
)
zoomLongGun :: Float -> Creature -> Item -> Item
zoomLongGun x _
+1 -1
View File
@@ -53,7 +53,7 @@ import Dodge.Reloading
import Dodge.WorldEvent
import Dodge.RandomHelp
import Dodge.Inventory.Lock
import Dodge.Creature.HandPos
--import Dodge.Creature.HandPos
--import Dodge.Default
import Sound.Data
import Geometry