Implement reloading of single external magazines

This commit is contained in:
2024-06-21 14:50:08 +01:00
parent 872e60438e
commit ecefba21d6
19 changed files with 157 additions and 340 deletions
+1 -188
View File
@@ -1,188 +1 @@
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:68:1-12: warning: [-Wunused-top-binds]
Defined but not used: ammoPosition
|
68 | ammoPosition itm hit = case hit of
| ^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:119:1-16: warning: [-Wunused-top-binds]
Defined but not used: bangStickAmmoPos
|
119 | bangStickAmmoPos _ itm =
| ^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:125:1-16: warning: [-Wunused-top-binds]
Defined but not used: volleygunAmmoPos
|
125 | volleygunAmmoPos i =
| ^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:132:1-15: warning: [-Wunused-top-binds]
Defined but not used: multigunAmmoPos
|
132 | multigunAmmoPos i =
| ^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:259:1-10: warning: [-Wunused-top-binds]
Defined but not used: drawBullet
|
259 | drawBullet itm p q =
| ^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:337:1-17: warning: [-Wunused-top-binds]
Defined but not used: bulletEffectColor
|
337 | bulletEffectColor x = case x of
| ^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:343:1-15: warning: [-Wunused-top-binds]
Defined but not used: bulletTrajColor
|
343 | bulletTrajColor x = case x of
| ^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:350:1-18: warning: [-Wunused-top-binds]
Defined but not used: bulletPayloadColor
|
350 | bulletPayloadColor x = case x of
| ^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:358:1-15: warning: [-Wunused-top-binds]
Defined but not used: energyBallColor
|
358 | energyBallColor ebt = case ebt of
| ^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:407:11-12: warning: [-Wunused-matches]
Defined but not used: it
|
407 | flamerPic it =
| ^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:448:11-12: warning: [-Wunused-matches]
Defined but not used: it
|
448 | lasGunPic it =
| ^^
/home/justin/Haskell/loop/src/Dodge/Item/Held/SprayGuns.hs:12:1-29: warning: [-Wunused-imports]
The import of Dodge.Reloading.Action is redundant
|
12 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Held/Launcher.hs:4:1-29: warning: [-Wunused-imports]
The import of Dodge.Reloading.Action is redundant
|
4 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Held/Cone.hs:6:1-29: warning: [-Wunused-imports]
The import of Dodge.Reloading.Action is redundant
|
6 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Base/You.hs:45:19-20: warning: [-Wunused-matches]
Defined but not used: cr
|
45 | upDownAttachments cr i j s = s
| ^^
/home/justin/Haskell/loop/src/Dodge/Base/You.hs:45:22: warning: [-Wunused-matches]
Defined but not used: i
|
45 | upDownAttachments cr i j s = s
| ^
/home/justin/Haskell/loop/src/Dodge/Base/You.hs:45:24: warning: [-Wunused-matches]
Defined but not used: j
|
45 | upDownAttachments cr i j s = s
| ^
/home/justin/Haskell/loop/src/Dodge/Item/Held/Stick.hs:12:1-29: warning: [-Wunused-imports]
The import of Dodge.Reloading.Action is redundant
|
12 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Held/BatteryGuns.hs:10:1-29: warning: [-Wunused-imports]
The import of Dodge.Reloading.Action is redundant
|
10 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:657:55: warning: [-Wtype-defaults]
• Defaulting the following constraints to type Integer
(Num a0)
arising from the literal 1
at /home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:657:55
(Enum a0)
arising from the arithmetic sequence 1 ..
at /home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:657:54-60
• In the expression: 1
In the second argument of take, namely [1 .. ]
In the third argument of foldr, namely (take numbul [1 .. ])
|
657 | duplicateLoaded eff it cr w = foldr f w (take numbul [1 .. ])
| ^
/home/justin/Haskell/loop/src/Dodge/Euse.hs:4:1-20: warning: [-Wunused-imports]
The import of Control.Monad is redundant
|
4 | import Control.Monad
| ^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Euse.hs:47:15-17: warning: [-Wunused-matches]
Defined but not used: itm
|
47 | trySiphonFuel itm cr = id
| ^^^
/home/justin/Haskell/loop/src/Dodge/Euse.hs:47:19-20: warning: [-Wunused-matches]
Defined but not used: cr
|
47 | trySiphonFuel itm cr = id
| ^^
/home/justin/Haskell/loop/src/Dodge/Item/Held/Rod.hs:13:1-29: warning: [-Wunused-imports]
The import of Dodge.Reloading.Action is redundant
|
13 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Held/Cane.hs:14:1-29: warning: [-Wunused-imports]
The import of Dodge.Reloading.Action is redundant
|
14 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item.hs:(29,25)-(34,40): warning: [-Wincomplete-patterns]
Pattern match(es) are non-exhaustive
In a case alternative: Patterns not matched: AMMOATTACH REVOLVEMAG
|
29 | itemFromAttachType at = case at of
| ^^^^^^^^^^...
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:488:22-23: warning: [-Wunused-matches]
Defined but not used: it
|
488 | caneStickSoundChoice it = tap3S
| ^^
/home/justin/Haskell/loop/src/Dodge/Item/Info.hs:(62,16)-(107,62): warning: [-Wincomplete-patterns]
Pattern match(es) are non-exhaustive
In a case alternative: Patterns not matched: MULTIGUN _
|
62 | heldInfo hit = case hit of
| ^^^^^^^^^^^...
/home/justin/Haskell/loop/src/Dodge/Item/Display.hs:11:1-26: warning: [-Wunused-imports]
The import of Control.Applicative is redundant
|
11 | import Control.Applicative
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Display.hs:12:1-20: warning: [-Wunused-imports]
The import of Control.Monad is redundant
|
12 | import Control.Monad
| ^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Display.hs:15:1-22: warning: [-Wunused-imports]
The import of Dodge.Item.Info is redundant
|
15 | import Dodge.Item.Info
| ^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Display.hs:87:16-17: warning: [-Wname-shadowing]
This binding for at shadows the existing binding
imported from LensHelp at /home/justin/Haskell/loop/src/Dodge/Item/Display.hs:18:1-15
(and originally defined in Control.Lens.At)
|
87 | showAttachItem at = case at of
| ^^
/home/justin/Haskell/loop/src/Dodge/Item/Display.hs:132:21-22: warning: [-Wunused-matches]
Defined but not used: cr
|
132 | showEquipmentNumber cr itm = case _eeUse ee of
| ^^
/home/justin/Haskell/loop/src/Dodge/Item/Display.hs:155:20-21: warning: [-Wunused-matches]
Defined but not used: cr
|
155 | showReloadProgress cr itm = fromMaybe [] $ do
| ^^
/home/justin/Haskell/loop/src/Dodge/Default/Item/Use/Consumption.hs:6:1-29: warning: [-Wunused-imports]
The import of Dodge.Reloading.Action is redundant
|
6 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
All good (615 modules, at 14:45:15)
+1 -1
View File
@@ -22,7 +22,7 @@ digraph {
28 [shape=box
,label="EQUIP {_ibtEquip = TARGETINGHAT TargetCursor}"];
31 [shape=box
,label="ATTACH {_ibtAttach = AMMOATTACH REVOLVEMAG}"];
,label="ATTACH {_ibtAttach = AMMOATTACH TINMAG}"];
35 [shape=box
,label="HELD {_ibtHeld = BANGSTICK {_xNum = 1}}"];
39 [shape=box
+1 -1
View File
@@ -42,7 +42,7 @@ attachmentTree cr = fromMaybe mempty $ do
return $ upDownAttachments cr i i mempty
upDownAttachments :: Creature -> Int -> Int -> M.Map AttachType Int -> M.Map AttachType Int
upDownAttachments cr i j s = s
upDownAttachments _ _ _ s = s
--yourInvSel :: World -> Int
--yourInvSel = crSel . you
+1 -1
View File
@@ -3,7 +3,7 @@ module Dodge.Default.Item.Use.Consumption where
import Control.Lens
import Dodge.Data.Item.Use.Consumption
import Dodge.Item.Weapon.Bullet
import Dodge.Reloading.Action
--import Dodge.Reloading.Action
defaultLoadable :: HeldConsumption
defaultLoadable =
+2 -2
View File
@@ -1,7 +1,7 @@
module Dodge.Euse where
import Color
import Control.Monad
--import Control.Monad
import Data.Maybe
import Dodge.Creature.HandPos
import Dodge.Creature.Test
@@ -44,7 +44,7 @@ tryChargeBattery :: Item -> Creature -> World -> World
tryChargeBattery _ _ w = w
trySiphonFuel :: Item -> Creature -> World -> World
trySiphonFuel itm cr = id
trySiphonFuel _ _ = id
--trySiphonFuel itm cr w = fromMaybe w $ do
-- eix <- itm ^? itLocation . ipInvID
-- hix <- cr ^? crManipulation . manObject . inInventory . ispItem
+1 -1
View File
@@ -485,7 +485,7 @@ fireRemoteShell it cr w =
j = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change
caneStickSoundChoice :: Item -> SoundID
caneStickSoundChoice it = tap3S
caneStickSoundChoice _ = tap3S
-- -- | (it ^?! itUse . heldConsumption . laSource . _InternalSource . iaLoaded) < 2 = tap3S
-- -- | otherwise = shotgunS
+1
View File
@@ -30,6 +30,7 @@ itemFromAttachType at = case at of
SCROLLATTACH ZOOMSCOPE -> zoomScope
AMMOATTACH DRUMMAG -> drumMag
AMMOATTACH TINMAG -> tinMag
AMMOATTACH REVOLVEMAG -> revolveMag
AMMOATTACH BULLETBELT -> beltMag
TARGETATTACH tt -> targetingScope tt
+6 -6
View File
@@ -8,11 +8,11 @@ module Dodge.Item.Display (
basicItemDisplay,
) where
import Control.Applicative
import Control.Monad
--import Control.Applicative
--import Control.Monad
import Data.Maybe
import Dodge.Data.Creature
import Dodge.Item.Info
--import Dodge.Item.Info
import Dodge.Item.SlotsTaken
import Dodge.Module
import LensHelp
@@ -84,7 +84,7 @@ itemBaseName it = case _iyBase $ _itType it of
ATTACH ait -> showAttachItem ait
showAttachItem :: AttachType -> String
showAttachItem at = case at of
showAttachItem t = case t of
SCROLLATTACH x -> show x
AMMOATTACH x -> show x
TARGETATTACH x -> show x
@@ -129,7 +129,7 @@ itemNumberDisplay cr itm = case iu of
iu = itm ^?! itUse
showEquipmentNumber :: Creature -> Item -> [String]
showEquipmentNumber cr itm = case _eeUse ee of
showEquipmentNumber _ itm = case _eeUse ee of
EFuelSource x _ -> [show x]
EAmmoSource{_euseAmmoAmount = x} -> [show x]--showAmmoSource cr itm
EBatterySource{_euseBatteryAmount = x} -> [show x]
@@ -152,7 +152,7 @@ showEquipmentNumber cr itm = case _eeUse ee of
-- <|> Just [x]
showReloadProgress :: Creature -> Item -> String
showReloadProgress cr itm = fromMaybe [] $ do
showReloadProgress _ itm = fromMaybe [] $ do
ia <- itm ^? itUse . attachParams . ammoAttachParams
return $ case ia ^? iaProgress . _Just . ix 0 of
Nothing -> maybe "" show $ ia ^? iaLoaded
+132 -130
View File
@@ -4,13 +4,13 @@ module Dodge.Item.Draw.SPic (
import Color
import qualified Data.Map.Strict as M
import Data.Maybe
--import Data.Maybe
import Dodge.Data.Item
import Dodge.Item.AmmoPosition
--import Dodge.Item.AmmoPosition
--import Dodge.Item.Weapon.FractionLoaded
import Geometry
import LensHelp
import qualified Linear.Quaternion as Q
--import qualified Linear.Quaternion as Q
import Picture
import Shape
import ShapePicture
@@ -64,76 +64,76 @@ leftItemSPic lt _ = case lt of
BLINKER -> defSPic
_ -> defSPic
ammoPosition :: Item -> HeldItemType -> AmmoPosition
ammoPosition itm hit = case hit of
FLATSHIELD -> NoAmmoPosition
FORCEFIELDGUN -> NoAmmoPosition
TORCH -> NoAmmoPosition
BANGSTICK i -> bangStickAmmoPos i itm
PISTOL -> Magazine (V3 5 2 0) lhs
MACHINEPISTOL -> Magazine (V3 5 2 0) lhs
AUTOPISTOL -> Magazine (V3 5 2 0) lhs
SMG -> Magazine (V3 7 (-2) 0) rhs
BANGCONE -> NoAmmoPosition
BLUNDERBUSS -> NoAmmoPosition
GRAPECANNON _ -> NoAmmoPosition
MINIGUNX _ -> NoAmmoPosition
VOLLEYGUN i -> volleygunAmmoPos i
MULTIGUN i -> multigunAmmoPos i
RIFLE -> Bullets [(V3 5 0 3, Q.axisAngle (V3 1 0 0) 0)]
REPEATER -> Magazine (V3 10 (-2) 0) rhs
AUTORIFLE -> Magazine (V3 10 (-2) 0) rhs
BURSTRIFLE -> Magazine (V3 10 (-2) 0) rhs
BANGROD -> Bullets [(V3 5 0 3, Q.axisAngle (V3 1 0 0) 0)]
ELEPHANTGUN -> Bullets [(V3 5 0 3, Q.axisAngle (V3 1 0 0) 0)]
AMR -> Magazine (V3 10 (-2) 0) rhs
AUTOAMR -> Magazine (V3 10 (-2) 0) rhs
SNIPERRIFLE -> Bullets [(V3 5 0 3, Q.axisAngle (V3 1 0 0) 0)]
MACHINEGUN -> Magazine (V3 10 (-2) 0) rhs
FLAMESPITTER -> NoAmmoPosition
FLAMETHROWER -> NoAmmoPosition
FLAMETORRENT -> NoAmmoPosition
FLAMEWALL -> NoAmmoPosition
BLOWTORCH -> NoAmmoPosition
SPARKGUN -> NoAmmoPosition
TESLAGUN -> NoAmmoPosition
LASGUN -> NoAmmoPosition
LASCIRCLE -> NoAmmoPosition
DUALBEAM -> NoAmmoPosition
LASWIDE _ -> NoAmmoPosition
--SONICGUN -> noPic baseSonicShape
TRACTORGUN -> NoAmmoPosition
LAUNCHER -> NoAmmoPosition
LAUNCHERX _ -> NoAmmoPosition
REMOTELAUNCHER -> NoAmmoPosition
POISONSPRAYER -> NoAmmoPosition
DRONELAUNCHER -> NoAmmoPosition
SHATTERGUN -> NoAmmoPosition
HELDDETECTOR _ -> NoAmmoPosition
KEYCARD _ -> NoAmmoPosition
where
lhs = Q.axisAngle (V3 1 0 0) pi
rhs = Q.axisAngle (V3 1 0 0) 0
--ammoPosition :: Item -> HeldItemType -> AmmoPosition
--ammoPosition itm hit = case hit of
-- FLATSHIELD -> NoAmmoPosition
-- FORCEFIELDGUN -> NoAmmoPosition
-- TORCH -> NoAmmoPosition
-- BANGSTICK i -> bangStickAmmoPos i itm
-- PISTOL -> Magazine (V3 5 2 0) lhs
-- MACHINEPISTOL -> Magazine (V3 5 2 0) lhs
-- AUTOPISTOL -> Magazine (V3 5 2 0) lhs
-- SMG -> Magazine (V3 7 (-2) 0) rhs
-- BANGCONE -> NoAmmoPosition
-- BLUNDERBUSS -> NoAmmoPosition
-- GRAPECANNON _ -> NoAmmoPosition
-- MINIGUNX _ -> NoAmmoPosition
-- VOLLEYGUN i -> volleygunAmmoPos i
-- MULTIGUN i -> multigunAmmoPos i
-- RIFLE -> Bullets [(V3 5 0 3, Q.axisAngle (V3 1 0 0) 0)]
-- REPEATER -> Magazine (V3 10 (-2) 0) rhs
-- AUTORIFLE -> Magazine (V3 10 (-2) 0) rhs
-- BURSTRIFLE -> Magazine (V3 10 (-2) 0) rhs
-- BANGROD -> Bullets [(V3 5 0 3, Q.axisAngle (V3 1 0 0) 0)]
-- ELEPHANTGUN -> Bullets [(V3 5 0 3, Q.axisAngle (V3 1 0 0) 0)]
-- AMR -> Magazine (V3 10 (-2) 0) rhs
-- AUTOAMR -> Magazine (V3 10 (-2) 0) rhs
-- SNIPERRIFLE -> Bullets [(V3 5 0 3, Q.axisAngle (V3 1 0 0) 0)]
-- MACHINEGUN -> Magazine (V3 10 (-2) 0) rhs
-- FLAMESPITTER -> NoAmmoPosition
-- FLAMETHROWER -> NoAmmoPosition
-- FLAMETORRENT -> NoAmmoPosition
-- FLAMEWALL -> NoAmmoPosition
-- BLOWTORCH -> NoAmmoPosition
-- SPARKGUN -> NoAmmoPosition
-- TESLAGUN -> NoAmmoPosition
-- LASGUN -> NoAmmoPosition
-- LASCIRCLE -> NoAmmoPosition
-- DUALBEAM -> NoAmmoPosition
-- LASWIDE _ -> NoAmmoPosition
-- --SONICGUN -> noPic baseSonicShape
-- TRACTORGUN -> NoAmmoPosition
-- LAUNCHER -> NoAmmoPosition
-- LAUNCHERX _ -> NoAmmoPosition
-- REMOTELAUNCHER -> NoAmmoPosition
-- POISONSPRAYER -> NoAmmoPosition
-- DRONELAUNCHER -> NoAmmoPosition
-- SHATTERGUN -> NoAmmoPosition
-- HELDDETECTOR _ -> NoAmmoPosition
-- KEYCARD _ -> NoAmmoPosition
-- where
-- lhs = Q.axisAngle (V3 1 0 0) pi
-- rhs = Q.axisAngle (V3 1 0 0) 0
bangStickAmmoPos :: Int -> Item -> AmmoPosition
bangStickAmmoPos _ itm =
Bullets
[(rotate3z a (V3 5 0 3), Q.axisAngle (V3 0 0 1) a)
| a <- map _mzRot (itm ^?! itUse . heldAim . aimMuzzles)]
--bangStickAmmoPos :: Int -> Item -> AmmoPosition
--bangStickAmmoPos _ itm =
-- Bullets
-- [(rotate3z a (V3 5 0 3), Q.axisAngle (V3 0 0 1) a)
-- | a <- map _mzRot (itm ^?! itUse . heldAim . aimMuzzles)]
volleygunAmmoPos :: Int -> AmmoPosition
volleygunAmmoPos i =
Bullets
[(V3 5 (f n) 3, Q.axisAngle (V3 1 0 0) 0) | n <- [0 .. i -1]]
where
f n = fromIntegral n * 5 - ((fromIntegral i - 1) * 2.5)
multigunAmmoPos :: Int -> AmmoPosition
multigunAmmoPos i =
Bullets
[(V3 5 (f n) 3, Q.axisAngle (V3 1 0 0) 0) | n <- [0 .. i -1]]
where
f n = fromIntegral n * 5 - ((fromIntegral i - 1) * 2.5)
--volleygunAmmoPos :: Int -> AmmoPosition
--volleygunAmmoPos i =
-- Bullets
-- [(V3 5 (f n) 3, Q.axisAngle (V3 1 0 0) 0) | n <- [0 .. i -1]]
-- where
-- f n = fromIntegral n * 5 - ((fromIntegral i - 1) * 2.5)
--
--multigunAmmoPos :: Int -> AmmoPosition
--multigunAmmoPos i =
-- Bullets
-- [(V3 5 (f n) 3, Q.axisAngle (V3 1 0 0) 0) | n <- [0 .. i -1]]
-- where
-- f n = fromIntegral n * 5 - ((fromIntegral i - 1) * 2.5)
--revolverAmmoPos :: AmmoPosition
--revolverAmmoPos =
@@ -254,39 +254,39 @@ baseRifleShape = colorSH red $ xCylinderST 3 25
-- ps <- fmap (take x) $ ammoPosition itm hit ^? amPosDirs
-- return $ foldMap (uncurry (drawBullet itm)) ps
-- why is this duplicated?
drawBullet :: Item -> Point3 -> Q.Quaternion Float -> Shape
drawBullet itm p q =
translateSH p $
overPosSH (Q.rotate q) $
colorSH
midcol
( upperPrismPolyTS 0.2 $
reverse
(rectNSWE 0.2 (- 0.2) (-1) 1)
)
<> tip
<> foot
where
midcol =
maybe
black
bulletEffectColor
(itm ^? itUse . heldConsumption . laAmmoType . amBullet . buEffect)
tip = fromMaybe mempty $ do
ebt <- itm ^? itUse . heldConsumption . laAmmoType . amBullet . buSpawn
return $
colorSH (bulletPayloadColor ebt) $
upperPrismPolyTS 0.2 $
reverse $
rectNSWE 0.2 (- 0.2) 1 2
foot = fromMaybe mempty $ do
ebt <- itm ^? itUse . heldConsumption . laAmmoType . amBullet . buTrajectory
return $
colorSH (bulletTrajColor ebt) $
upperPrismPolyTS 0.2 $
reverse $
rectNSWE 0.2 (- 0.2) (-2) (-1)
---- why is this duplicated?
--drawBullet :: Item -> Point3 -> Q.Quaternion Float -> Shape
--drawBullet itm p q =
-- translateSH p $
-- overPosSH (Q.rotate q) $
-- colorSH
-- midcol
-- ( upperPrismPolyTS 0.2 $
-- reverse
-- (rectNSWE 0.2 (- 0.2) (-1) 1)
-- )
-- <> tip
-- <> foot
-- where
-- midcol =
-- maybe
-- black
-- bulletEffectColor
-- (itm ^? itUse . heldConsumption . laAmmoType . amBullet . buEffect)
-- tip = fromMaybe mempty $ do
-- ebt <- itm ^? itUse . heldConsumption . laAmmoType . amBullet . buSpawn
-- return $
-- colorSH (bulletPayloadColor ebt) $
-- upperPrismPolyTS 0.2 $
-- reverse $
-- rectNSWE 0.2 (- 0.2) 1 2
-- foot = fromMaybe mempty $ do
-- ebt <- itm ^? itUse . heldConsumption . laAmmoType . amBullet . buTrajectory
-- return $
-- colorSH (bulletTrajColor ebt) $
-- upperPrismPolyTS 0.2 $
-- reverse $
-- rectNSWE 0.2 (- 0.2) (-2) (-1)
addTinClip :: Item -> Shape
addTinClip _ = mempty
@@ -333,33 +333,33 @@ addTinClip _ = mempty
-- reverse $
-- rectNSWE 0 (- y) (-2) (-1)
bulletEffectColor :: BulletEffect -> Color
bulletEffectColor x = case x of
DestroyBullet -> black
BounceBullet -> mixColors 0.5 0.5 black yellow
PenetrateBullet -> mixColors 0.5 0.5 black blue
--bulletEffectColor :: BulletEffect -> Color
--bulletEffectColor x = case x of
-- DestroyBullet -> black
-- BounceBullet -> mixColors 0.5 0.5 black yellow
-- PenetrateBullet -> mixColors 0.5 0.5 black blue
bulletTrajColor :: BulletTrajectory -> Color
bulletTrajColor x = case x of
BasicBulletTrajectory -> black
BezierTrajectory{} -> chartreuse
FlechetteTrajectory{} -> white
MagnetTrajectory{} -> yellow
--bulletTrajColor :: BulletTrajectory -> Color
--bulletTrajColor x = case x of
-- BasicBulletTrajectory -> black
-- BezierTrajectory{} -> chartreuse
-- FlechetteTrajectory{} -> white
-- MagnetTrajectory{} -> yellow
bulletPayloadColor :: BulletSpawn -> Color
bulletPayloadColor x = case x of
BulBall y -> energyBallColor y
BulSpark -> black
BulFlak -> chartreuse
BulFrag -> magenta
BulGas -> green
--bulletPayloadColor :: BulletSpawn -> Color
--bulletPayloadColor x = case x of
-- BulBall y -> energyBallColor y
-- BulSpark -> black
-- BulFlak -> chartreuse
-- BulFrag -> magenta
-- BulGas -> green
energyBallColor :: EnergyBallType -> Color
energyBallColor ebt = case ebt of
IncBall -> orange
TeslaBall -> cyan
ConcBall -> white
FlashBall -> yellow
--energyBallColor :: EnergyBallType -> Color
--energyBallColor ebt = case ebt of
-- IncBall -> orange
-- TeslaBall -> cyan
-- ConcBall -> white
-- FlashBall -> yellow
volleyGunShape :: Int -> Shape
volleyGunShape i =
@@ -404,7 +404,8 @@ baseSMGShape :: Shape
baseSMGShape = colorSH green $ xCylinderST 3 20
flamerPic :: Item -> SPic
flamerPic it =
--flamerPic it =
flamerPic _ =
( colorSH yellow $
translateSHxy tx ty (upperPrismPolyST tz $ polyCirc 3 r)
<> xCylinderST 5 18
@@ -445,7 +446,8 @@ teslaGunPic =
xb = 9
lasGunPic :: Item -> SPic
lasGunPic it =
--lasGunPic it =
lasGunPic _ =
( colorSH blue $
upperBoxST 4 (rectNESW 3 30 1 0)
<> upperBoxSU 4 (rectNESW (-1) 30 (-3) 0)
+1 -1
View File
@@ -7,7 +7,7 @@ import Color
import Control.Lens
import qualified Data.Map.Strict as M
import Dodge.Data.Item
import Dodge.Reloading.Action
--import Dodge.Reloading.Action
import Dodge.Tesla.ItemParams
import Geometry.Data
import qualified IntMapHelp as IM
+1 -1
View File
@@ -11,7 +11,7 @@ module Dodge.Item.Held.Cane (
import Dodge.Base
import Dodge.Data.Item
import Dodge.Default
import Dodge.Reloading.Action
--import Dodge.Reloading.Action
import Geometry.Data
import LensHelp
+1 -1
View File
@@ -3,7 +3,7 @@ module Dodge.Item.Held.Cone where
import Control.Lens
import Dodge.Data.Item
import Dodge.Default.Item
import Dodge.Reloading.Action
--import Dodge.Reloading.Action
import Geometry.Data
import Linear
+1 -1
View File
@@ -1,7 +1,7 @@
module Dodge.Item.Held.Launcher where
import Dodge.Default.Item
import Dodge.Reloading.Action
--import Dodge.Reloading.Action
import Control.Lens
import Dodge.Data.Item
import qualified IntMapHelp as IM
+1 -1
View File
@@ -10,7 +10,7 @@ module Dodge.Item.Held.Rod (
import Dodge.Data.Item
import Dodge.Default
import Dodge.Item.Weapon.Bullet
import Dodge.Reloading.Action
--import Dodge.Reloading.Action
import Geometry
import LensHelp
+1 -1
View File
@@ -9,7 +9,7 @@ module Dodge.Item.Held.SprayGuns (
import Dodge.Data.Item
import Dodge.Default.Item
import Dodge.Reloading.Action
--import Dodge.Reloading.Action
import Geometry
import LensHelp
+1 -1
View File
@@ -9,7 +9,7 @@ module Dodge.Item.Held.Stick (
import Dodge.Base
import Dodge.Data.Item
import Dodge.Default.Item
import Dodge.Reloading.Action
--import Dodge.Reloading.Action
import Geometry
import LensHelp
+2 -1
View File
@@ -71,7 +71,8 @@ heldInfo hit = case hit of
GRAPECANNON 1 -> "A large container for debris on the end of a stick. Explosive action propels the debris away from the user."
GRAPECANNON i -> "An " ++ replicate (i -1) 'X' ++ "L container for debris on the end of a stick. Explosive action propels the debris away from the user."
MINIGUNX i -> over _head toUpper (showInt i) ++ " gun barrels that revolve rapidly around a central stick. Requires considerable time to warm up, but has an extremely rapid rate of fire. It is also extremely difficult to stabilise."
VOLLEYGUN i -> over _head toUpper (showInt i) ++ " gun barrels lined up to be roughly parallel. Each barrel must be individually loaded, but not all need be loaded for the weapon to fire. All loaded barrels discharge simultaneously."
VOLLEYGUN i -> over _head toUpper (showInt i) ++ " gun barrels lined up to be roughly parallel. Draws bullets from a single magazine. All loaded barrels discharge simultaneously."
MULTIGUN i -> over _head toUpper (showInt i) ++ " gun barrels lined up to be roughly parallel. Each barrel requires a separate magazine. All barrels must be loaded to fire."
RIFLE -> "A firearm with a mid length barrel that requires reloading after each shot."
REPEATER -> "A firearm fed by a magazine. The entire magazine must be replaced when reloading the weapon."
AUTORIFLE -> "A firearm automatically fed by a magazine. The entire magazine must be replaced when reloading the weapon."
+1 -1
View File
@@ -654,7 +654,7 @@ repeatOnFrames is hm f it cr w =
-- return $ f it cr' w'
duplicateLoaded :: ChainEffect
duplicateLoaded eff it cr w = foldr f w (take numbul [1 .. ])
duplicateLoaded eff it cr w = foldr f w (take numbul [1::Int .. ])
where
f _ = eff it cr
numbul = fromMaybe 0 $ do
+1 -1
View File
@@ -34,7 +34,7 @@ stepReloading cr = case cr ^? crManipulation . manObject . inInventory of
tryNextLoadAction :: Creature -> Creature
tryNextLoadAction cr = case cr ^? crManipulation . manObject . inInventory of
Just (SelItem i _) -> case cr ^? crInv . ix i . itUse . attachParams . ammoAttachParams . iaProgress . _Just . ix 0 of
Just (SelItem i _) -> case cr ^? crInv . ix (i + 1) . itUse . attachParams . ammoAttachParams . iaProgress . _Just . ix 0 of
Nothing -> cr & crManipulation . manObject . inInventory . iselAction .~ NoInvSelAction
Just la ->
cr & crManipulation . manObject . inInventory . iselAction . actionProgress .~ _actionTime la