Implement torch
This commit is contained in:
@@ -41,6 +41,7 @@ initialAnoTree :: Annotation
|
||||
initialAnoTree = OnwardList
|
||||
$ intersperse (AnTree corDoor)
|
||||
[ IntAnno $ AnTree . startRoom
|
||||
, AnRoom $ tanksRoom [] [] <&> rmPmnts .~ []
|
||||
, AnRoom $ tanksRoom [] []
|
||||
, AnRoom $ roomCCrits 0
|
||||
, AnRoom $ return airlock0
|
||||
|
||||
@@ -54,7 +54,7 @@ heldItemSPic :: HeldItemType -> Item -> SPic
|
||||
heldItemSPic ht it = case ht of
|
||||
FLATSHIELD -> flatShieldEquipSPic
|
||||
FORCEFIELDGUN -> defSPic
|
||||
TORCH -> 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
|
||||
@@ -102,6 +102,20 @@ heldItemSPic ht it = case ht of
|
||||
SHATTERGUN -> shatterGunSPic
|
||||
HELDDETECTOR dt -> noPic (colorSH (detectorColor dt) $ upperPrismPoly 3 $ rectWH 2 2)
|
||||
|
||||
torchShape :: Shape
|
||||
torchShape = colorSH blue
|
||||
$ translateSHf 0 1.5 side
|
||||
<> translateSHf 0 (-1.5) side
|
||||
<> translateSHz 2.5 top
|
||||
<> translateSHz (-0.5) bot
|
||||
<> translateSHf (-3) 0 back
|
||||
where
|
||||
side = upperPrismPoly 3 $ rectXH 10 0.5
|
||||
top = upperPrismPoly 0.5 $ rectXH 10 2
|
||||
bot = upperPrismPoly 0.5 $ rectXH 9 2
|
||||
back = upperPrismPoly 3 $ rectXH 1 2
|
||||
|
||||
|
||||
modulesSPic :: Item -> SPic
|
||||
modulesSPic _ = mempty
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -327,7 +327,7 @@ spawnerRoom = do
|
||||
|
||||
corDoor :: State StdGen (MetaTree Room String)
|
||||
corDoor = do
|
||||
cor <- shuffleLinks $ cleatOnward corridor
|
||||
cor <- (shuffleLinks $ cleatOnward corridor) <&> rmPmnts .~ []
|
||||
return $ tToBTree "corDoor" $ treePost [door,cor]
|
||||
-- cor <- shuffleLinks corridor
|
||||
-- return $ tToBTree "corDoor" $ treePost [door,cor,cleatOnward door]
|
||||
|
||||
Reference in New Issue
Block a user