Refactor, try to limit dependencies
This commit is contained in:
+208
-164
@@ -1,119 +1,138 @@
|
||||
module Dodge.Item.Draw.SPic where
|
||||
import Dodge.Data
|
||||
import Dodge.Item.Weapon.FractionLoaded
|
||||
import ShapePicture
|
||||
import Shape
|
||||
import LensHelp
|
||||
import Color
|
||||
import Picture
|
||||
import Geometry
|
||||
|
||||
import Color
|
||||
import Data.Maybe
|
||||
import Dodge.Data.Item
|
||||
import Dodge.Item.Weapon.FractionLoaded
|
||||
import Geometry
|
||||
import LensHelp
|
||||
import Picture
|
||||
import Shape
|
||||
import ShapePicture
|
||||
|
||||
itemSPic :: Item -> SPic
|
||||
itemSPic it = foldMap (modulesSPic it) (_iyModules $ _itType it) <> case it ^. itType . iyBase of
|
||||
CRAFT _ -> defSPic
|
||||
HELD ht -> heldItemSPic ht it
|
||||
LEFT lt -> leftItemSPic lt it
|
||||
EQUIP et -> equipItemSPic et it
|
||||
Consumable {} -> defSPic
|
||||
itemSPic it =
|
||||
foldMap (modulesSPic it) (_iyModules $ _itType it) <> case it ^. itType . iyBase of
|
||||
NoItemType -> over _1 (colorSH magenta) defSPic
|
||||
CRAFT _ -> defSPic
|
||||
HELD ht -> heldItemSPic ht it
|
||||
LEFT lt -> leftItemSPic lt it
|
||||
EQUIP et -> equipItemSPic et it
|
||||
Consumable{} -> defSPic
|
||||
|
||||
equipItemSPic :: EquipItemType -> Item -> SPic
|
||||
equipItemSPic et _ = case et of
|
||||
MAGSHIELD -> defSPic
|
||||
FLAMESHIELD -> defSPic
|
||||
FRONTARMOUR -> (emptySH , setDepth 20 $ pictures
|
||||
[color yellow $ thickArc 0 (pi/2) 10 5
|
||||
,color yellow $ thickArc (3*pi/2) (2*pi) 10 5
|
||||
])
|
||||
WRISTARMOUR -> defSPic
|
||||
MAGSHIELD -> defSPic
|
||||
FLAMESHIELD -> defSPic
|
||||
FRONTARMOUR ->
|
||||
( emptySH
|
||||
, setDepth 20 $
|
||||
pictures
|
||||
[ color yellow $ thickArc 0 (pi / 2) 10 5
|
||||
, color yellow $ thickArc (3 * pi / 2) (2 * pi) 10 5
|
||||
]
|
||||
)
|
||||
WRISTARMOUR -> defSPic
|
||||
INVISIBILITYEQUIPMENT _ -> noPic (colorSH chartreuse $ upperPrismPoly 3 $ rectWH 2 2)
|
||||
BRAINHAT -> noPic (colorSH yellow $ upperPrismPoly 3 $ rectWH 4 4)
|
||||
HAT -> noPic (colorSH yellow $ upperPrismPoly 3 $ rectWH 4 4)
|
||||
HEADLAMP -> noPic headLampShape
|
||||
BRAINHAT -> noPic (colorSH yellow $ upperPrismPoly 3 $ rectWH 4 4)
|
||||
HAT -> noPic (colorSH yellow $ upperPrismPoly 3 $ rectWH 4 4)
|
||||
HEADLAMP -> noPic headLampShape
|
||||
POWERLEGS -> legsSPic yellow
|
||||
SPEEDLEGS -> legsSPic green
|
||||
JUMPLEGS -> legsSPic red
|
||||
JETPACK -> (,) emptySH $ setDepth 20
|
||||
$ pictures [color yellow $ polygon $ reverse $ rectNSWE 5 (-5) (-11) (-3) ]
|
||||
JUMPLEGS -> legsSPic red
|
||||
JETPACK ->
|
||||
(,) emptySH $
|
||||
setDepth 20 $
|
||||
pictures [color yellow $ polygon $ reverse $ rectNSWE 5 (-5) (-11) (-3)]
|
||||
AUTODETECTOR dt -> noPic (colorSH (detectorColor dt) $ upperPrismPoly 3 $ rectWH 2 2)
|
||||
|
||||
leftItemSPic :: LeftItemType -> Item -> SPic
|
||||
leftItemSPic lt _ = case lt of
|
||||
BLINKER -> defSPic
|
||||
_ -> defSPic
|
||||
_ -> defSPic
|
||||
|
||||
heldItemSPic :: HeldItemType -> Item -> SPic
|
||||
heldItemSPic ht it = case ht of
|
||||
FLATSHIELD -> flatShieldEquipSPic
|
||||
FORCEFIELDGUN -> defSPic
|
||||
TORCH -> noPic torchShape
|
||||
BANGSTICK i -> noPic $ baseStickShapeX it i <> stickClip it
|
||||
PISTOL -> noPic $ baseStickShape <> makeTinClipAt pi (V3 5 2 0) it
|
||||
REVOLVER -> noPic $ baseStickShape <> revolverClip it
|
||||
REVOLVERX _ -> noPic $ baseStickShape <> revolverClip it
|
||||
MACHINEPISTOL -> noPic $ baseStickShape <> makeTinClipAt pi (V3 5 2 0) it
|
||||
AUTOPISTOL -> noPic $ baseStickShape <> makeTinClipAt pi (V3 5 2 0) it
|
||||
SMG -> noPic (baseSMGShape <> makeTinClipAt 0 (V3 7 (-2) 0) it)
|
||||
BANGCONE -> noPic $ colorSH cyan $ upperPrismPoly 3 (rectXH 5 2)
|
||||
<> upperPrismPoly 6 (reverse $ rectNSWE 4 (-4) 5 15)
|
||||
BLUNDERBUSS -> noPic $ colorSH cyan $ upperPrismPoly 3 (rectXH 20 2)
|
||||
<> upperPrismPoly 6 (reverse $ rectNSWE 4 (-4) 20 30)
|
||||
GRAPECANNON _ -> noPic $ colorSH cyan $ upperPrismPoly 3 (rectXH 20 2)
|
||||
<> upperPrismPoly 6 (reverse $ rectNSWE 4 (-4) 20 30)
|
||||
MINIGUNX i -> miniGunXPictItem i it
|
||||
VOLLEYGUN i -> volleyGunSPic i it
|
||||
RIFLE -> noPic $ baseRifleShape <> makeSingleClipAt (V3 5 0 3) it
|
||||
REPEATER -> noPic $ baseRifleShape <> makeTinClipAt 0 (V3 10 (-2) 0) it
|
||||
AUTORIFLE -> noPic $ baseRifleShape <> makeTinClipAt 0 (V3 10 (-2) 0) it
|
||||
BURSTRIFLE -> noPic $ baseRifleShape <> makeTinClipAt 0 (V3 10 (-2) 0) it
|
||||
BANGROD -> noPic $ baseRodShape <> makeSingleClipAt (V3 5 0 3) it
|
||||
ELEPHANTGUN -> noPic $ baseAMRShape <> makeSingleClipAt (V3 5 0 3) it
|
||||
AMR -> noPic $ baseAMRShape <> makeTinClipAt 0 (V3 10 (-2) 0) it
|
||||
AUTOAMR -> noPic $ baseAMRShape <> makeTinClipAt 0 (V3 10 (-2) 0) it
|
||||
SNIPERRIFLE -> noPic $ baseAMRShape <> makeSingleClipAt (V3 5 0 3) it
|
||||
MACHINEGUN -> noPic $ baseAMRShape <> makeTinClipAt 0 (V3 10 (-2) 0) it
|
||||
FLAMESPITTER -> flamerPic it
|
||||
FLAMETHROWER -> flamerPic it
|
||||
FLAMETORRENT -> flamerPic it
|
||||
FLAMEWALL -> flamerPic it
|
||||
BLOWTORCH -> flamerPic it
|
||||
SPARKGUN -> teslaGunPic
|
||||
TESLAGUN -> teslaGunPic
|
||||
LASGUN -> lasGunPic it
|
||||
LASCIRCLE -> lasGunPic it
|
||||
DUALBEAM -> dualBeamPic it
|
||||
LASWIDE _ -> lasGunPic it
|
||||
FORCEFIELDGUN -> defSPic
|
||||
TORCH -> noPic torchShape
|
||||
BANGSTICK i -> noPic $ baseStickShapeX it i <> stickClip it
|
||||
PISTOL -> noPic $ baseStickShape <> makeTinClipAt pi (V3 5 2 0) it
|
||||
REVOLVER -> noPic $ baseStickShape <> revolverClip it
|
||||
REVOLVERX _ -> noPic $ baseStickShape <> revolverClip it
|
||||
MACHINEPISTOL -> noPic $ baseStickShape <> makeTinClipAt pi (V3 5 2 0) it
|
||||
AUTOPISTOL -> noPic $ baseStickShape <> makeTinClipAt pi (V3 5 2 0) it
|
||||
SMG -> noPic (baseSMGShape <> makeTinClipAt 0 (V3 7 (-2) 0) it)
|
||||
BANGCONE ->
|
||||
noPic $
|
||||
colorSH cyan $
|
||||
upperPrismPoly 3 (rectXH 5 2)
|
||||
<> upperPrismPoly 6 (reverse $ rectNSWE 4 (-4) 5 15)
|
||||
BLUNDERBUSS ->
|
||||
noPic $
|
||||
colorSH cyan $
|
||||
upperPrismPoly 3 (rectXH 20 2)
|
||||
<> upperPrismPoly 6 (reverse $ rectNSWE 4 (-4) 20 30)
|
||||
GRAPECANNON _ ->
|
||||
noPic $
|
||||
colorSH cyan $
|
||||
upperPrismPoly 3 (rectXH 20 2)
|
||||
<> upperPrismPoly 6 (reverse $ rectNSWE 4 (-4) 20 30)
|
||||
MINIGUNX i -> miniGunXPictItem i it
|
||||
VOLLEYGUN i -> volleyGunSPic i it
|
||||
RIFLE -> noPic $ baseRifleShape <> makeSingleClipAt (V3 5 0 3) it
|
||||
REPEATER -> noPic $ baseRifleShape <> makeTinClipAt 0 (V3 10 (-2) 0) it
|
||||
AUTORIFLE -> noPic $ baseRifleShape <> makeTinClipAt 0 (V3 10 (-2) 0) it
|
||||
BURSTRIFLE -> noPic $ baseRifleShape <> makeTinClipAt 0 (V3 10 (-2) 0) it
|
||||
BANGROD -> noPic $ baseRodShape <> makeSingleClipAt (V3 5 0 3) it
|
||||
ELEPHANTGUN -> noPic $ baseAMRShape <> makeSingleClipAt (V3 5 0 3) it
|
||||
AMR -> noPic $ baseAMRShape <> makeTinClipAt 0 (V3 10 (-2) 0) it
|
||||
AUTOAMR -> noPic $ baseAMRShape <> makeTinClipAt 0 (V3 10 (-2) 0) it
|
||||
SNIPERRIFLE -> noPic $ baseAMRShape <> makeSingleClipAt (V3 5 0 3) it
|
||||
MACHINEGUN -> noPic $ baseAMRShape <> makeTinClipAt 0 (V3 10 (-2) 0) it
|
||||
FLAMESPITTER -> flamerPic it
|
||||
FLAMETHROWER -> flamerPic it
|
||||
FLAMETORRENT -> flamerPic it
|
||||
FLAMEWALL -> flamerPic it
|
||||
BLOWTORCH -> flamerPic it
|
||||
SPARKGUN -> teslaGunPic
|
||||
TESLAGUN -> teslaGunPic
|
||||
LASGUN -> lasGunPic it
|
||||
LASCIRCLE -> lasGunPic it
|
||||
DUALBEAM -> dualBeamPic it
|
||||
LASWIDE _ -> lasGunPic it
|
||||
--SONICGUN -> noPic baseSonicShape
|
||||
TRACTORGUN -> tractorGunPic it
|
||||
LAUNCHER -> launcherPic it
|
||||
LAUNCHERX _ -> launcherPic it
|
||||
REMOTELAUNCHER -> launcherPic it
|
||||
POISONSPRAYER -> flamerPic it
|
||||
DRONELAUNCHER -> defSPic
|
||||
SHATTERGUN -> shatterGunSPic
|
||||
TRACTORGUN -> tractorGunPic it
|
||||
LAUNCHER -> launcherPic it
|
||||
LAUNCHERX _ -> launcherPic it
|
||||
REMOTELAUNCHER -> launcherPic it
|
||||
POISONSPRAYER -> flamerPic it
|
||||
DRONELAUNCHER -> defSPic
|
||||
SHATTERGUN -> shatterGunSPic
|
||||
HELDDETECTOR dt -> noPic (colorSH (detectorColor dt) $ upperPrismPoly 3 $ rectWH 2 2)
|
||||
KEYCARD _ -> noShape (setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) keyPic)
|
||||
KEYCARD _ -> noShape (setDepth 0 $ translate (-5) (-5) $ rotate (pi / 2.5) keyPic)
|
||||
|
||||
torchShape :: Shape
|
||||
torchShape = colorSH blue
|
||||
$ translateSHf 0 1.5 side
|
||||
<> translateSHf 0 (-1.5) side
|
||||
<> translateSHz 2.5 top
|
||||
<> translateSHz (-0.5) bot
|
||||
<> back
|
||||
torchShape =
|
||||
colorSH blue $
|
||||
translateSHf 0 1.5 side
|
||||
<> translateSHf 0 (-1.5) side
|
||||
<> translateSHz 2.5 top
|
||||
<> translateSHz (-0.5) bot
|
||||
<> back
|
||||
where
|
||||
side = upperPrismPoly 3 $ rectXH 10 0.5
|
||||
top = upperPrismPoly 0.5 $ rectXH 10 2
|
||||
bot = upperPrismPoly 0.5 $ rectXH 9 2
|
||||
top = upperPrismPoly 0.5 $ rectXH 10 2
|
||||
bot = upperPrismPoly 0.5 $ rectXH 9 2
|
||||
back = upperPrismPoly 3 $ rectXH 1 2
|
||||
|
||||
|
||||
modulesSPic :: Item -> ItemModuleType -> SPic
|
||||
modulesSPic it imt = case imt of
|
||||
ATTACHTORCH -> noPic (overPosSH (+.+.+ _dimAttachPos (_itDimension it)) torchShape)
|
||||
_ -> mempty
|
||||
|
||||
baseStickShapeX :: Item -> Int -> Shape
|
||||
baseStickShapeX it i = foldMap f [0..i-1]
|
||||
baseStickShapeX it i = foldMap f [0 .. i -1]
|
||||
where
|
||||
f j = rotateSH ang baseStickShape
|
||||
where
|
||||
@@ -125,22 +144,25 @@ baseStickShape = colorSH green $ upperPrismPoly 3 $ rectXH 10 2
|
||||
|
||||
stickClip :: Item -> Shape
|
||||
stickClip it = case it ^? itUse . heldConsumption . laLoaded of
|
||||
Just x | x > 0 -> foldMap f [0..x-1]
|
||||
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 = barrelspread * fromIntegral i
|
||||
- 0.5 * barrelspread * fromIntegral (_brlNum (_gunBarrels (_itParams it))-1)
|
||||
ang =
|
||||
barrelspread * fromIntegral i
|
||||
- 0.5 * barrelspread * fromIntegral (_brlNum (_gunBarrels (_itParams it)) -1)
|
||||
barrelspread = it ^?! itParams . gunBarrels . brlSpread . spreadAngle
|
||||
|
||||
defSPic :: SPic
|
||||
defSPic = noPic $ colorSH green $ upperPrismPoly 3 $ square 4
|
||||
|
||||
shatterGunSPic :: SPic
|
||||
shatterGunSPic = noPic $ colorSH blue $
|
||||
upperPrismPoly 5 (rectNESW xb 8 xa 0)
|
||||
<> upperPrismPoly 5 (rectNESW (-xa) 8 (-xb) 0)
|
||||
shatterGunSPic =
|
||||
noPic $
|
||||
colorSH blue $
|
||||
upperPrismPoly 5 (rectNESW xb 8 xa 0)
|
||||
<> upperPrismPoly 5 (rectNESW (- xa) 8 (- xb) 0)
|
||||
where
|
||||
xa = 1
|
||||
xb = 9
|
||||
@@ -160,48 +182,60 @@ makeSingleClipAt p it = case it ^? itUse . heldConsumption . laLoaded of
|
||||
_ -> translateSH p $ upperPrismPoly 1 $ square 1.5
|
||||
|
||||
makeTinClipAt :: Float -> Point3 -> Item -> Shape
|
||||
makeTinClipAt r p it = translateSH p . overPosSH (rotate3z r) $ upperPrismPoly 1 $ reverse
|
||||
$ rectNSWE 0 (-y) (-2) 2
|
||||
makeTinClipAt r p it =
|
||||
translateSH p . overPosSH (rotate3z r) $
|
||||
upperPrismPoly 1 $
|
||||
reverse $
|
||||
rectNSWE 0 (- y) (-2) 2
|
||||
where
|
||||
y = fromIntegral y' * 0.3
|
||||
y' = fromMaybe 0 $ it ^? itUse . heldConsumption . laLoaded
|
||||
|
||||
volleyGunSPic :: Int -> Item -> SPic
|
||||
volleyGunSPic i it = noPic $
|
||||
colorSH red (foldMap
|
||||
((\y -> upperPrismPoly 3 $ map (+.+ V2 0 y) $ rectXH 15 2)
|
||||
. (\k -> fromIntegral k * 5 - ((fromIntegral i - 1) * 2.5))) [0..i-1]
|
||||
) <> caneClipX i it
|
||||
|
||||
volleyGunSPic i it =
|
||||
noPic $
|
||||
colorSH
|
||||
red
|
||||
( foldMap
|
||||
( (\y -> upperPrismPoly 3 $ map (+.+ V2 0 y) $ rectXH 15 2)
|
||||
. (\k -> fromIntegral k * 5 - ((fromIntegral i - 1) * 2.5))
|
||||
)
|
||||
[0 .. i -1]
|
||||
)
|
||||
<> caneClipX i it
|
||||
|
||||
caneClipX :: Int -> Item -> Shape
|
||||
caneClipX i it = case it ^? itUse . heldConsumption . laLoaded of
|
||||
Just la | la > 0 -> foldMap
|
||||
( (\y -> translateSH (V3 5 0 3) . upperPrismPoly 1 $ map (+.+ V2 0 y) $ square 1.5)
|
||||
. (\k -> fromIntegral k * 5 - ((fromIntegral i - 1) * 2.5)))
|
||||
[0..la-1]
|
||||
caneClipX i it = case it ^? itUse . heldConsumption . laLoaded of
|
||||
Just la
|
||||
| la > 0 ->
|
||||
foldMap
|
||||
( (\y -> translateSH (V3 5 0 3) . upperPrismPoly 1 $ map (+.+ V2 0 y) $ square 1.5)
|
||||
. (\k -> fromIntegral k * 5 - ((fromIntegral i - 1) * 2.5))
|
||||
)
|
||||
[0 .. la -1]
|
||||
_ -> mempty
|
||||
|
||||
miniGunXPictItem :: Int -> Item -> SPic
|
||||
miniGunXPictItem i it = miniGunXPict i spin (_laLoaded $ _heldConsumption (_itUse it))
|
||||
where
|
||||
spin = (-10) * _laLoaded (_heldConsumption (_itUse it)) + _warmTime (_useDelay $ _itUse it)
|
||||
spin = (-10) * _laLoaded (_heldConsumption (_itUse it)) + _warmTime (_heldDelay $ _itUse it)
|
||||
|
||||
miniGunXPict :: Int -> Int -> Int -> SPic
|
||||
miniGunXPict i spin _ =
|
||||
( colorSH red (rotateSHx a barrels)
|
||||
miniGunXPict i spin _ =
|
||||
( colorSH red (rotateSHx a barrels)
|
||||
<> baseRifleShape
|
||||
-- <> clip (-1) 0
|
||||
-- <> clip (-7) 0
|
||||
, mempty
|
||||
, -- <> clip (-1) 0
|
||||
-- <> clip (-7) 0
|
||||
mempty
|
||||
)
|
||||
where
|
||||
aBarrel = translateSH (V3 15 2 2) baseCaneShape
|
||||
barrels = foldMap (\an -> aBarrel & rotateSHx (2*pi * fromIntegral an / fromIntegral i)) [1..i]
|
||||
barrels = foldMap (\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
|
||||
|
||||
--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))
|
||||
|
||||
baseSonicShape :: Shape
|
||||
@@ -209,20 +243,20 @@ baseSonicShape = colorSH rose $ upperPrismPoly 3 $ rectXH 25 2
|
||||
|
||||
revolverClip :: Item -> Shape
|
||||
revolverClip it = case it ^? itUse . heldConsumption . laLoaded of
|
||||
Just al | al > 0 -> translateSH (V3 5 0 1) $ foldMap f [1..al]
|
||||
Just al | al > 0 -> translateSH (V3 5 0 1) $ foldMap f [1 .. al]
|
||||
_ -> mempty
|
||||
where
|
||||
f i = rotateSHx (fromIntegral i * pi / 3 + pi/6) . translateSH (V3 0 0 2) $ upperPrismPoly 1 $ square 1
|
||||
f i = rotateSHx (fromIntegral i * pi / 3 + pi / 6) . translateSH (V3 0 0 2) $ upperPrismPoly 1 $ square 1
|
||||
|
||||
baseSMGShape :: Shape
|
||||
baseSMGShape = colorSH green $ upperPrismPoly 3 $ rectXH 20 2
|
||||
|
||||
flamerPic :: Item -> SPic
|
||||
flamerPic it =
|
||||
( colorSH yellow $
|
||||
flamerPic it =
|
||||
( colorSH yellow $
|
||||
translateSHf tx ty (upperPrismPoly tz $ polyCirc 3 r)
|
||||
<> upperPrismPoly 5 (rectNESW 2 18 (-2) 0)
|
||||
, color black $ translate3 (V3 tx ty (tz+0.01)) $ circleSolid (r * am)
|
||||
<> upperPrismPoly 5 (rectNESW 2 18 (-2) 0)
|
||||
, color black $ translate3 (V3 tx ty (tz + 0.01)) $ circleSolid (r * am)
|
||||
)
|
||||
where
|
||||
tx = 4
|
||||
@@ -232,94 +266,104 @@ flamerPic it =
|
||||
am = fractionLoadedAmmo2 it
|
||||
|
||||
launcherPic :: Item -> SPic
|
||||
launcherPic _ =
|
||||
( colorSH cyan $ prismPoly
|
||||
(map (+.+.+ V3 20 0 5) $ polyCircx 4 5)
|
||||
(map (+.+.+ V3 0 0 5) $ polyCircx 4 5)
|
||||
launcherPic _ =
|
||||
( colorSH cyan $
|
||||
prismPoly
|
||||
(map (+.+.+ V3 20 0 5) $ polyCircx 4 5)
|
||||
(map (+.+.+ V3 0 0 5) $ polyCircx 4 5)
|
||||
, mempty
|
||||
)
|
||||
|
||||
baseRodShape :: Shape
|
||||
baseRodShape = colorSH orange $ upperPrismPoly 3 $ rectXH 20 2
|
||||
|
||||
baseAMRShape :: Shape
|
||||
baseAMRShape = colorSH orange $ upperPrismPoly 3 $ rectXH 30 2
|
||||
|
||||
teslaGunPic :: SPic
|
||||
teslaGunPic = noPic $ colorSH blue $
|
||||
upperPrismPoly 5 (rectNESW xb 8 xa 0)
|
||||
<> upperPrismPoly 5 (rectNESW (-xa) 8 (-xb) 0)
|
||||
teslaGunPic =
|
||||
noPic $
|
||||
colorSH blue $
|
||||
upperPrismPoly 5 (rectNESW xb 8 xa 0)
|
||||
<> upperPrismPoly 5 (rectNESW (- xa) 8 (- xb) 0)
|
||||
where
|
||||
xa = 1
|
||||
xb = 9
|
||||
|
||||
lasGunPic :: Item -> SPic
|
||||
lasGunPic it =
|
||||
( colorSH blue $
|
||||
upperPrismPoly 4 (rectNESW 3 30 1 0)
|
||||
<> upperPrismPoly 4 (rectNESW (-1) 30 (-3) 0)
|
||||
<> upperPrismPoly 1 (rectNESW 3 30 (-3) 0)
|
||||
lasGunPic it =
|
||||
( colorSH blue $
|
||||
upperPrismPoly 4 (rectNESW 3 30 1 0)
|
||||
<> upperPrismPoly 4 (rectNESW (-1) 30 (-3) 0)
|
||||
<> upperPrismPoly 1 (rectNESW 3 30 (-3) 0)
|
||||
, setLayer BloomNoZWrite . color col . setDepth 1.1 . polygon $ rectNESW 1 30 (-1) 0
|
||||
)
|
||||
where
|
||||
amFrac = fractionLoadedAmmo it
|
||||
col = brightX 2 1.5 $ mixColors amFrac (1-amFrac) green red
|
||||
col = brightX 2 1.5 $ mixColors amFrac (1 - amFrac) green red
|
||||
|
||||
dualBeamPic :: Item -> SPic
|
||||
dualBeamPic it =
|
||||
( colorSH blue $
|
||||
upperPrismPoly 4 (rectNESW gap 3 (-gap) 1)
|
||||
<> upperPrismPoly 4 (rectNESW gap (-1) (-gap) (-3))
|
||||
<> upperPrismPoly 1 (rectNESW gap 3 (-gap) (-3))
|
||||
, setLayer BloomNoZWrite . color col . setDepth 1.1 . polygon $ rectNESW gap 1 (-gap) (-1)
|
||||
dualBeamPic it =
|
||||
( colorSH blue $
|
||||
upperPrismPoly 4 (rectNESW gap 3 (- gap) 1)
|
||||
<> upperPrismPoly 4 (rectNESW gap (-1) (- gap) (-3))
|
||||
<> upperPrismPoly 1 (rectNESW gap 3 (- gap) (-3))
|
||||
, setLayer BloomNoZWrite . color col . setDepth 1.1 . polygon $ rectNESW gap 1 (- gap) (-1)
|
||||
)
|
||||
where
|
||||
amFrac = fractionLoadedAmmo it
|
||||
col = brightX 2 1.5 $ mixColors amFrac (1-amFrac) green red
|
||||
col = brightX 2 1.5 $ mixColors amFrac (1 - amFrac) green red
|
||||
gap = _dbGap (_itParams it) - 3
|
||||
|
||||
tractorGunPic :: Item -> SPic
|
||||
tractorGunPic it =
|
||||
( colorSH red $
|
||||
upperPrismPoly 4 (rectNESW 3 30 1 0)
|
||||
<> upperPrismPoly 4 (rectNESW (-1) 30 (-3) 0)
|
||||
<> upperPrismPoly 1 (rectNESW 3 30 (-3) 0)
|
||||
tractorGunPic it =
|
||||
( colorSH red $
|
||||
upperPrismPoly 4 (rectNESW 3 30 1 0)
|
||||
<> upperPrismPoly 4 (rectNESW (-1) 30 (-3) 0)
|
||||
<> upperPrismPoly 1 (rectNESW 3 30 (-3) 0)
|
||||
, setLayer BloomNoZWrite . color col . setDepth 1.1 . polygon $ rectNESW 1 30 (-1) 0
|
||||
)
|
||||
where
|
||||
amFrac = fractionLoadedAmmo it
|
||||
col = brightX 2 1.5 $ mixColors amFrac (1-amFrac) green red
|
||||
col = brightX 2 1.5 $ mixColors amFrac (1 - amFrac) green red
|
||||
|
||||
flatShieldEquipSPic :: SPic
|
||||
flatShieldEquipSPic =
|
||||
flatShieldEquipSPic =
|
||||
( colorSH yellow $ upperPrismPoly 10 (rectWH 2 10)
|
||||
, mempty
|
||||
)
|
||||
|
||||
headLampShape :: Shape
|
||||
headLampShape = colorSH yellow $
|
||||
translateSH (V3 5 2 4) (upperPrismPoly 4 $ rectWH 4 1)
|
||||
<> translateSH (V3 5 2 0) (upperPrismPoly 4 $ rectWH 4 1)
|
||||
<> translateSH (V3 5 (-2) 4) (upperPrismPoly 4 $ rectWH 4 1)
|
||||
<> translateSH (V3 5 (-2) 0) (upperPrismPoly 4 $ rectWH 4 1)
|
||||
headLampShape =
|
||||
colorSH yellow $
|
||||
translateSH (V3 5 2 4) (upperPrismPoly 4 $ rectWH 4 1)
|
||||
<> translateSH (V3 5 2 0) (upperPrismPoly 4 $ rectWH 4 1)
|
||||
<> translateSH (V3 5 (-2) 4) (upperPrismPoly 4 $ rectWH 4 1)
|
||||
<> translateSH (V3 5 (-2) 0) (upperPrismPoly 4 $ rectWH 4 1)
|
||||
|
||||
detectorColor :: Detector -> Color
|
||||
detectorColor dt = case dt of
|
||||
ITEMDETECTOR -> blue
|
||||
CREATUREDETECTOR -> green
|
||||
WALLDETECTOR -> red
|
||||
ITEMDETECTOR -> blue
|
||||
CREATUREDETECTOR -> green
|
||||
WALLDETECTOR -> red
|
||||
|
||||
keyPic :: Picture
|
||||
keyPic = color green $
|
||||
pictures [translate (-4) 0 $ thickCircle 4 2
|
||||
,thickLine 2 $ map toV2 [(0,0),(8,0),(8,-4)]
|
||||
,thickLine 2 $ map toV2 [(4,0),(4,-4)]
|
||||
]
|
||||
keyPic =
|
||||
color green $
|
||||
pictures
|
||||
[ translate (-4) 0 $ thickCircle 4 2
|
||||
, thickLine 2 $ map toV2 [(0, 0), (8, 0), (8, -4)]
|
||||
, thickLine 2 $ map toV2 [(4, 0), (4, -4)]
|
||||
]
|
||||
|
||||
latchkeyPic :: Picture
|
||||
latchkeyPic = color yellow $
|
||||
pictures [translate (-4) 0 $ thickCircle 4 2
|
||||
,thickLine 2 $ map toV2 [(0,0),(8,0),(8,-4)]
|
||||
,thickLine 2 $ map toV2 [(4,0),(4,-4)]
|
||||
]
|
||||
latchkeyPic =
|
||||
color yellow $
|
||||
pictures
|
||||
[ translate (-4) 0 $ thickCircle 4 2
|
||||
, thickLine 2 $ map toV2 [(0, 0), (8, 0), (8, -4)]
|
||||
, thickLine 2 $ map toV2 [(4, 0), (4, -4)]
|
||||
]
|
||||
|
||||
legsSPic :: Color -> SPic
|
||||
legsSPic col = noPic $ translateSH (V3 0 4 0) $ colorSH col $ upperPrismPoly 3 $ rectWH 2 2
|
||||
|
||||
Reference in New Issue
Block a user