Implement torch

This commit is contained in:
2022-07-14 01:11:48 +01:00
parent 2a5b512d61
commit bfe9073808
4 changed files with 21 additions and 4 deletions
+4 -2
View File
@@ -110,11 +110,13 @@ torch :: Item
torch = defaultWeapon
& itEffect .~ effectOnOffHeld createHeldLight (const $ const id)
& itType . iyBase .~ HELD TORCH
& itUse . useAim . aimHandlePos .~ 5
& itUse . useAim . aimMuzPos .~ 10
createHeldLight :: Creature -> Int -> World -> World
createHeldLight cr i w = w
& tempLightSources .:~ tlsTimeRadColPos 1 200 0.7
(p +.+.+ heldItemOffset itm cr (V3 0 20 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
itm = cr ^?! crInv . ix i