Work towards duct taping torch

This commit is contained in:
2022-07-14 10:50:12 +01:00
parent bfe9073808
commit 2cfa3ca3a7
8 changed files with 40 additions and 11 deletions
+5 -3
View File
@@ -11,7 +11,7 @@ import Geometry
import Data.Maybe
itemSPic :: Item -> SPic
itemSPic it = modulesSPic it <> case it ^. itType . iyBase of
itemSPic it = foldMap (modulesSPic it) (_iyModules $ _itType it) $ case it ^. itType . iyBase of
HELD ht -> heldItemSPic ht it
LEFT lt -> leftItemSPic lt it
EQUIP et -> equipItemSPic et it
@@ -116,8 +116,10 @@ torchShape = colorSH blue
back = upperPrismPoly 3 $ rectXH 1 2
modulesSPic :: Item -> SPic
modulesSPic _ = mempty
modulesSPic :: Item -> ItemModuleType -> SPic -> SPic
modulesSPic it imt = case imt of
ATTACHTORCH -> (<> noPic (overPosSH (+.+.+ _heldAttachPos (_itUse it)) torchShape))
_ -> id
baseStickShapeX :: Item -> Int -> Shape
baseStickShapeX it i = foldMap f [0..i-1]
+5 -4
View File
@@ -17,6 +17,7 @@ module Dodge.Item.Equipment
, flameShield
) where
import Dodge.Data
import Dodge.LightSource.Torch
import Dodge.Item.Draw
import Dodge.Item.Equipment.Booster
import Dodge.LightSource
@@ -114,11 +115,11 @@ torch = defaultWeapon
& itUse . useAim . aimMuzPos .~ 10
createHeldLight :: Creature -> Int -> World -> World
createHeldLight cr i w = w
& tempLightSources .:~ tlsTimeRadColPos 1 250 0.7
(p +.+.+ rotate3 (_crDir cr) (heldItemOffset itm cr (V3 8 0 1.5)))
createHeldLight cr i = createTorchLightOffset cr itm 0
-- tempLightSources .:~ tlsTimeRadColPos 1 250 0.7
-- (p +.+.+ rotate3 (_crDir cr) (heldItemOffset itm cr (V3 8 0 1.5)))
where
p = addZ 0 $ _crPos cr
-- p = addZ 0 $ _crPos cr
itm = cr ^?! crInv . ix i
flatShield :: Item
+1
View File
@@ -124,6 +124,7 @@ rifle = defaultBangCane
& itUse . useAim . aimRange .~ 1
-- & itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 2}
& itType . iyModules . at ModHeldAttach ?~ EMPTYMODULE
repeater :: Item
repeater = rifle
& itType . iyModules . at ModRifleMag ?~ EMPTYMODULE