Enable duct taping torches to rifles

This commit is contained in:
2022-07-14 11:32:32 +01:00
parent 2cfa3ca3a7
commit 79791d0df2
18 changed files with 109 additions and 154 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ moduleModification imt = case imt of
WEPTELE -> makeDirectedTele WEPTELE -> makeDirectedTele
LAUNCHHOME -> itConsumption . laAmmoType . amPjCreation .~ fireTrackingShell LAUNCHHOME -> itConsumption . laAmmoType . amPjCreation .~ fireTrackingShell
EXTRABATTERY -> itConsumption . laMax +~ 1000 EXTRABATTERY -> itConsumption . laMax +~ 1000
ATTACHTORCH -> itUse . heldAttachment .~ Torch ATTACHTORCH -> id
where where
f ameff = itConsumption . laAmmoType . amBulEff .~ ameff f ameff = itConsumption . laAmmoType . amBulEff .~ ameff
makeDirectedTele it = it makeDirectedTele it = it
+1 -19
View File
@@ -7,38 +7,20 @@ import Dodge.Damage
import Dodge.Hammer import Dodge.Hammer
import Dodge.Reloading import Dodge.Reloading
import Dodge.Prop.Gib import Dodge.Prop.Gib
--import Dodge.Base.Arithmetic
import Dodge.Base import Dodge.Base
import Dodge.Creature.State.WalkCycle import Dodge.Creature.State.WalkCycle
import Dodge.Creature.Impulse.Movement import Dodge.Creature.Impulse.Movement
import Dodge.LightSource.Torch import Dodge.LightSource.Torch
--import Dodge.Base
import Dodge.SoundLogic import Dodge.SoundLogic
import RandomHelp import RandomHelp
import Dodge.WorldEvent import Dodge.WorldEvent
--import Dodge.WallCreatureCollisions
import Dodge.Creature.Action import Dodge.Creature.Action
--import Dodge.Hammer
import Geometry import Geometry
import Picture import Picture
import Shape import Shape
import ShapePicture import ShapePicture
import qualified IntMapHelp as IM import qualified IntMapHelp as IM
import LensHelp import LensHelp
--import StrictHelp
--import FoldableHelp
import Data.Function
--import qualified Data.IntSet as IS
--import Data.Maybe
--import Control.Applicative
--import qualified SDL
--import qualified SDL.Mixer as Mix
--import qualified Data.Set as S
--import qualified Data.Map as M
--import qualified Data.Vector as V
--import qualified Data.Vector.Mutable as MV
foldCr :: [Creature -> World -> World] foldCr :: [Creature -> World -> World]
-> Creature -> World -> World -> Creature -> World -> World
@@ -225,7 +207,7 @@ itemInvSideEffect cr it
createAttachLight :: Creature -> Item -> World -> World createAttachLight :: Creature -> Item -> World -> World
createAttachLight cr it = createTorchLightOffset cr it attachoff createAttachLight cr it = createTorchLightOffset cr it attachoff
where where
attachoff = it ^?! itUse . heldAttachPos attachoff = it ^?! itDimension . dimAttachPos
itemUpdate :: Creature -> Int -> Item -> Item itemUpdate :: Creature -> Int -> Item -> Item
itemUpdate cr i itemUpdate cr i
+1 -4
View File
@@ -482,8 +482,6 @@ data ItemUse
, _useMods :: [(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World] , _useMods :: [(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World]
, _useHammer :: HammerPosition , _useHammer :: HammerPosition
, _useAim :: AimParams , _useAim :: AimParams
, _heldAttachPos :: Point3
, _heldAttachment :: HeldAttachment
, _heldScroll :: Float -> Creature -> Item -> Item , _heldScroll :: Float -> Creature -> Item -> Item
} }
| LeftUse | LeftUse
@@ -574,8 +572,7 @@ data Targeting
data ItemDimension = ItemDimension data ItemDimension = ItemDimension
{ _dimRad :: Float { _dimRad :: Float
, _dimCenter :: Point3 , _dimCenter :: Point3
-- , _dimPortage :: ItemPortage , _dimAttachPos :: Point3
-- , _dimSPic :: Item -> SPic
} }
data ItemPortage data ItemPortage
= HeldItem = HeldItem
+2 -1
View File
@@ -3,6 +3,7 @@ module Dodge.Default.Item
) where ) where
import Dodge.Data import Dodge.Data
import Picture import Picture
import Geometry.Data
--import Shape --import Shape
defaultItem :: Item defaultItem :: Item
@@ -16,7 +17,7 @@ defaultItem = Item
, _itInvColor = yellow , _itInvColor = yellow
, _itInvSize = 1 , _itInvSize = 1
, _itPos = VoidItm , _itPos = VoidItm
, _itDimension = ItemDimension 2 0 , _itDimension = ItemDimension 2 0 (V3 10 (-5) 3)
, _itConsumption = NoConsumption , _itConsumption = NoConsumption
, _itUse = NoUse , _itUse = NoUse
, _itAttachment = NoItAttachment , _itAttachment = NoItAttachment
-3
View File
@@ -8,7 +8,6 @@ import Dodge.Default.Item
import Dodge.Default.AimParams import Dodge.Default.AimParams
--import Dodge.Item.Draw --import Dodge.Item.Draw
import Picture import Picture
import Geometry.Data
import qualified Data.Map.Strict as M import qualified Data.Map.Strict as M
import Control.Lens import Control.Lens
@@ -66,8 +65,6 @@ defaultrUse = RightUse
, _useMods = [] , _useMods = []
, _useHammer = HammerUp , _useHammer = HammerUp
, _useAim = defaultAimParams , _useAim = defaultAimParams
, _heldAttachPos = V3 0 (-10) 0
, _heldAttachment = NoHeldAttachment
, _heldScroll = \_ _ -> id , _heldScroll = \_ _ -> id
} }
defaultlUse :: ItemUse defaultlUse :: ItemUse
+1 -52
View File
@@ -7,15 +7,13 @@ module Dodge.Item.Draw
, heldItemOffset , heldItemOffset
) where ) where
import Dodge.Data import Dodge.Data
import Dodge.Item.HeldOffset
import ShapePicture import ShapePicture
import Dodge.Creature.HandPos
import Dodge.Item.Equipment.Shape import Dodge.Item.Equipment.Shape
import Dodge.Item.Draw.SPic import Dodge.Item.Draw.SPic
import Geometry
import qualified Data.IntMap.Strict as IM import qualified Data.IntMap.Strict as IM
import Control.Lens import Control.Lens
import Data.Maybe
itemEquipPict :: Creature -> Item -> SPic itemEquipPict :: Creature -> Item -> SPic
itemEquipPict cr it = case it ^?! itUse of itemEquipPict cr it = case it ^?! itUse of
@@ -81,53 +79,4 @@ pictureWeaponOnAimItem p' cr posInInv
-- f i = 0.1 * fromIntegral (sLen - i) / fromIntegral sLen -- f i = 0.1 * fromIntegral (sLen - i) / fromIntegral sLen
-- sLen = _strideLength $ _crStance cr -- sLen = _strideLength $ _crStance cr
heldItemOffset :: Item -> Creature -> Point3 -> Point3
heldItemOffset itm cr
| isSelected && _posture (_crStance cr) == Aiming =
(+.+.+ V3 (aimingWeaponZeroPos cr itm) 0 shoulderD)
| isSelected && isTwoHandFlat
= (+.+.+ V3 (_crRad cr) 0 handD)
. rotate3 (twoFlatHRot cr)
. transToHandle
| isSelected && isOneHand
= (+.+.+ V3 0 0 handD)
. (+.+.+ V3 (_crRad cr * 0.7 + handPos) (_crRad cr * negate 0.7) 0)
. (+.+.+ V3 (-2) 0 0)
. transToHandle
| isSelected
= (+.+.+ V3 0 0 handD)
. (+.+.+ V3 (_crRad cr) 0 0)
. rotate3 (strideRot cr + 1.2)
. (+.+.+ V3 (-5) 0 0)
-- . (+.+.+ V3 (-5) 0 0)
. transToHandle
| otherwise = id
where
transToHandle = fromMaybe id $ do
x <- itm ^? itUse . useAim . aimHandlePos
return (-.-.- V3 x 0 0)
shoulderD = 18
handD = 15
isSelected = _itIsHeld itm
handPos = case cr^? crStance . carriage of
Just (Walking x LeftForward) -> f x * 50
_ -> 0
theIt = itm
isOneHand = theIt ^? itUseAimStance == Just OneHand
|| isNothing (theIt ^? itUseAimStance)
isTwoHandFlat = theIt ^? itUseAimStance == Just TwoHandFlat
itUseAimStance = itUse . useAim . aimStance
f i = 0.1 * fromIntegral (sLen - i) / fromIntegral sLen
sLen = _strideLength $ _crStance cr
strideRot :: Creature -> Float
strideRot cr = case cr ^? crStance . carriage of
Just (Walking x LeftForward) -> f x
Just (Walking x RightForward) -> - f x
_ -> 0
where
f i = 0.1 * fromIntegral (sLen - i) / fromIntegral sLen
sLen = _strideLength $ _crStance cr
twoFlatHRot :: Creature -> Float
twoFlatHRot cr = 2*strideRot cr
+3 -3
View File
@@ -54,7 +54,7 @@ heldItemSPic :: HeldItemType -> Item -> SPic
heldItemSPic ht it = case ht of heldItemSPic ht it = case ht of
FLATSHIELD -> flatShieldEquipSPic FLATSHIELD -> flatShieldEquipSPic
FORCEFIELDGUN -> defSPic FORCEFIELDGUN -> defSPic
TORCH -> noPic $ torchShape TORCH -> noPic torchShape
BANGSTICK i -> noPic $ baseStickShapeX it i <> stickClip it BANGSTICK i -> noPic $ baseStickShapeX it i <> stickClip it
PISTOL -> noPic $ baseStickShape <> makeTinClipAt pi (V3 5 2 0) it PISTOL -> noPic $ baseStickShape <> makeTinClipAt pi (V3 5 2 0) it
REVOLVER -> noPic $ baseStickShape <> revolverClip it REVOLVER -> noPic $ baseStickShape <> revolverClip it
@@ -108,7 +108,7 @@ torchShape = colorSH blue
<> translateSHf 0 (-1.5) side <> translateSHf 0 (-1.5) side
<> translateSHz 2.5 top <> translateSHz 2.5 top
<> translateSHz (-0.5) bot <> translateSHz (-0.5) bot
<> translateSHf (-3) 0 back <> back
where where
side = upperPrismPoly 3 $ rectXH 10 0.5 side = upperPrismPoly 3 $ rectXH 10 0.5
top = upperPrismPoly 0.5 $ rectXH 10 2 top = upperPrismPoly 0.5 $ rectXH 10 2
@@ -118,7 +118,7 @@ torchShape = colorSH blue
modulesSPic :: Item -> ItemModuleType -> SPic -> SPic modulesSPic :: Item -> ItemModuleType -> SPic -> SPic
modulesSPic it imt = case imt of modulesSPic it imt = case imt of
ATTACHTORCH -> (<> noPic (overPosSH (+.+.+ _heldAttachPos (_itUse it)) torchShape)) ATTACHTORCH -> (<> noPic (overPosSH (+.+.+ _dimAttachPos (_itDimension it)) torchShape))
_ -> id _ -> id
baseStickShapeX :: Item -> Int -> Shape baseStickShapeX :: Item -> Int -> Shape
+58
View File
@@ -0,0 +1,58 @@
module Dodge.Item.HeldOffset where
import Dodge.Data
import Dodge.Creature.HandPos
import Geometry
import LensHelp
import Data.Maybe
heldItemOffset :: Item -> Creature -> Point3 -> Point3
heldItemOffset itm cr
| isSelected && _posture (_crStance cr) == Aiming =
(+.+.+ V3 (aimingWeaponZeroPos cr itm) 0 shoulderD)
| isSelected && isTwoHandFlat
= (+.+.+ V3 (_crRad cr) 0 handD)
. rotate3 (twoFlatHRot cr)
. transToHandle
| isSelected && isOneHand
= (+.+.+ V3 0 0 handD)
. (+.+.+ V3 (_crRad cr * 0.7 + handPos) (_crRad cr * negate 0.7) 0)
. (+.+.+ V3 (-2) 0 0)
. transToHandle
| isSelected
= (+.+.+ V3 0 0 handD)
. (+.+.+ V3 (_crRad cr) 0 0)
. rotate3 (strideRot cr + 1.2)
. (+.+.+ V3 (-5) 0 0)
-- . (+.+.+ V3 (-5) 0 0)
. transToHandle
| otherwise = id
where
transToHandle = fromMaybe id $ do
x <- itm ^? itUse . useAim . aimHandlePos
return (-.-.- V3 x 0 0)
shoulderD = 18
handD = 15
isSelected = _itIsHeld itm
handPos = case cr^? crStance . carriage of
Just (Walking x LeftForward) -> f x * 50
_ -> 0
theIt = itm
isOneHand = theIt ^? itUseAimStance == Just OneHand
|| isNothing (theIt ^? itUseAimStance)
isTwoHandFlat = theIt ^? itUseAimStance == Just TwoHandFlat
itUseAimStance = itUse . useAim . aimStance
f i = 0.1 * fromIntegral (sLen - i) / fromIntegral sLen
sLen = _strideLength $ _crStance cr
strideRot :: Creature -> Float
strideRot cr = case cr ^? crStance . carriage of
Just (Walking x LeftForward) -> f x
Just (Walking x RightForward) -> - f x
_ -> 0
where
f i = 0.1 * fromIntegral (sLen - i) / fromIntegral sLen
sLen = _strideLength $ _crStance cr
twoFlatHRot :: Creature -> Float
twoFlatHRot cr = 2*strideRot cr
+7 -17
View File
@@ -70,15 +70,11 @@ sparkGun = teslaGun
& itParams . arcSize .~ 10 & itParams . arcSize .~ 10
teslaGun :: Item teslaGun :: Item
teslaGun = defaultBatteryGun teslaGun = defaultBatteryGun
{ _itConsumption = defaultLoadable & itConsumption . laMax .~ 200
& laMax .~ 200 & itConsumption . laCycle .~ [loadEject 10, loadInsert 10 , loadPrime 60]
& laCycle .~ [loadEject 10, loadInsert 10 , loadPrime 60] & itDimension . dimRad .~ 9
, _itDimension = ItemDimension & itDimension . dimCenter .~ V3 4 0 0
{ _dimRad = 9 & itParams .~ teslaParams
, _dimCenter = V3 4 0 0
}
, _itParams = teslaParams
}
& itUse . rUse .~ shootTeslaArc & itUse . rUse .~ shootTeslaArc
& itUse . useDelay .~ NoDelay & itUse . useDelay .~ NoDelay
& itUse . useMods .~ & itUse . useMods .~
@@ -288,10 +284,8 @@ lasGun = defaultAutoBatteryGun
{ _tweakParams = IM.fromList [(0,lasGunTweak)] { _tweakParams = IM.fromList [(0,lasGunTweak)]
, _tweakSel = 0 , _tweakSel = 0
} }
& itDimension .~ ItemDimension & itDimension . dimRad .~ 10
{ _dimRad = 10 & itDimension . dimCenter .~ V3 15 0 0
, _dimCenter = V3 15 0 0
}
& itUse . rUse .~ shootLaser & itUse . rUse .~ shootLaser
& itUse . useDelay .~ NoDelay & itUse . useDelay .~ NoDelay
& itUse . useMods .~ & itUse . useMods .~
@@ -332,10 +326,6 @@ tractorGun = lasGun
{ _itConsumption = defaultLoadable { _itConsumption = defaultLoadable
& laMax .~ 10000 & laMax .~ 10000
& laCycle .~ [loadEject 10, loadInsert 10 , loadPrime 60] & laCycle .~ [loadEject 10, loadInsert 10 , loadPrime 60]
, _itDimension = ItemDimension
{ _dimRad = 10
, _dimCenter = V3 15 0 0
}
, _itParams = Attracting {_attractionPower = 1} , _itParams = Attracting {_attractionPower = 1}
, _itTweaks = Tweakable , _itTweaks = Tweakable
{ _tweakParams = IM.fromList [(0,tractorGunTweak)] { _tweakParams = IM.fromList [(0,tractorGunTweak)]
+7 -20
View File
@@ -28,7 +28,7 @@ import LensHelp
defaultBangCane :: Item defaultBangCane :: Item
defaultBangCane = defaultBulletWeapon defaultBangCane = defaultBulletWeapon
{ _itParams = BulletShooter & itParams .~ BulletShooter
{ _muzVel = 0.8 { _muzVel = 0.8
, _rifling = 0.9 , _rifling = 0.9
, _bore = 2 , _bore = 2
@@ -39,11 +39,8 @@ defaultBangCane = defaultBulletWeapon
, _torqueAfter = 0.1 , _torqueAfter = 0.1
, _randomOffset = 0 , _randomOffset = 0
} }
, _itDimension = ItemDimension & itDimension . dimRad .~ 8
{ _dimRad = 8 & itDimension . dimCenter .~ V3 5 0 0
, _dimCenter = V3 5 0 0
}
}
& itUse . useDelay . rateMax .~ 6 & itUse . useDelay . rateMax .~ 6
& itUse . useMods .~ & itUse . useMods .~
[ ammoHammerCheck [ ammoHammerCheck
@@ -63,7 +60,7 @@ defaultBangCane = defaultBulletWeapon
& itConsumption . laMax .~ 1 & itConsumption . laMax .~ 1
& itConsumption . laCycle .~ [loadPartialInsert 10 1] & itConsumption . laCycle .~ [loadPartialInsert 10 1]
volleyGun :: Int -> Item volleyGun :: Int -> Item
volleyGun i = defaultBulletWeapon volleyGun i = defaultBangCane
& itUse . useDelay . rateMax .~ 6 & itUse . useDelay . rateMax .~ 6
& itUse . useMods .~ & itUse . useMods .~
[ ammoHammerCheck [ ammoHammerCheck
@@ -76,10 +73,6 @@ volleyGun i = defaultBulletWeapon
, withMuzFlareI , withMuzFlareI
, withRecoil , withRecoil
] ]
& itDimension .~ ItemDimension
{ _dimRad = 8
, _dimCenter = V3 5 0 0
}
& itUse . useAim . aimWeight .~ 6 & itUse . useAim . aimWeight .~ 6
& itUse . useAim . aimRange .~ 1 & itUse . useAim . aimRange .~ 1
& itUse . useAim . aimStance .~ TwoHandFlat & itUse . useAim . aimStance .~ TwoHandFlat
@@ -111,11 +104,6 @@ caneStickSoundChoice it
| otherwise = shotgunS | otherwise = shotgunS
rifle :: Item rifle :: Item
rifle = defaultBangCane rifle = defaultBangCane
{ _itDimension = ItemDimension
{ _dimRad = 8
, _dimCenter = V3 5 0 0
}
}
& itUse . useAim . aimStance .~ TwoHandTwist & itUse . useAim . aimStance .~ TwoHandTwist
& itType . iyBase .~ HELD RIFLE & itType . iyBase .~ HELD RIFLE
& itConsumption . laMax .~ 1 & itConsumption . laMax .~ 1
@@ -249,10 +237,9 @@ miniGunX i = defaultAutoGun
, _randomOffset = 10 , _randomOffset = 10
} }
, _itInvSize = 4 , _itInvSize = 4
, _itDimension = ItemDimension
{ _dimRad = 20
, _dimCenter = V3 5 0 0
}
} }
& itDimension . dimRad .~ 20
& itDimension . dimCenter .~ V3 5 0 0
& itDimension . dimAttachPos .~ V3 5 (-5) 0
& itType . iyBase .~ HELD (MINIGUNX i) & itType . iyBase .~ HELD (MINIGUNX i)
& itUse . useAim . aimMuzPos .~ 40 & itUse . useAim . aimMuzPos .~ 40
+2 -4
View File
@@ -52,10 +52,8 @@ bangRod = defaultBulletWeapon
, withMuzFlareI , withMuzFlareI
, withRecoil , withRecoil
] ]
& itDimension .~ ItemDimension & itDimension . dimRad .~ 12
{ _dimRad = 12 & itDimension . dimCenter .~ V3 5 0 0
, _dimCenter = V3 5 0 0
}
& itConsumption . laMax .~ 1 & itConsumption . laMax .~ 1
& itConsumption . laCycle .~ [loadEject 5, loadInsert 10 , loadPrime 5] & itConsumption . laCycle .~ [loadEject 5, loadInsert 10 , loadPrime 5]
& itType . iyBase .~ HELD BANGROD & itType . iyBase .~ HELD BANGROD
+2 -4
View File
@@ -44,10 +44,8 @@ bangStick i = defaultBulletWeapon
, _randomOffset = 0 , _randomOffset = 0
} }
& itInvSize .~ fromIntegral i / 3 & itInvSize .~ fromIntegral i / 3
& itDimension .~ ItemDimension & itDimension . dimRad .~ 5
{ _dimRad = 5 & itDimension . dimCenter .~ V3 5 0 0
, _dimCenter = V3 5 0 0
}
& itUse . useDelay . rateMax .~ 8 & itUse . useDelay . rateMax .~ 8
& itUse . useMods .~ & itUse . useMods .~
[ ammoHammerCheck [ ammoHammerCheck
+2 -9
View File
@@ -100,11 +100,9 @@ bangCone = defaultBulletWeapon
, _torqueAfter = 0.1 , _torqueAfter = 0.1
, _randomOffset = 12 , _randomOffset = 12
} }
, _itDimension = ItemDimension
{ _dimRad = 8
, _dimCenter = V3 5 0 0
}
} }
& itDimension . dimRad .~ 8
& itDimension . dimCenter .~ V3 5 0 0
& itUse . useDelay . rateMax .~ 20 & itUse . useDelay . rateMax .~ 20
& itUse . useMods .~ & itUse . useMods .~
[ ammoCheckI [ ammoCheckI
@@ -141,11 +139,6 @@ coneRandItemParams = do
blunderbuss :: Item blunderbuss :: Item
blunderbuss = bangCone blunderbuss = bangCone
{_itDimension = ItemDimension
{ _dimRad = 8
, _dimCenter = V3 5 0 0
}
}
& itConsumption . laMax .~ 25 & itConsumption . laMax .~ 25
& itConsumption . laCycle .~ [loadEject 5, loadInsert 30 , loadPrime 5] & itConsumption . laCycle .~ [loadEject 5, loadInsert 30 , loadPrime 5]
& itUse . useAim . aimStance .~ TwoHandTwist & itUse . useAim . aimStance .~ TwoHandTwist
+2 -4
View File
@@ -57,11 +57,9 @@ launcher = defaultWeapon
, _tweakParams = basicAmPjMoves , _tweakParams = basicAmPjMoves
} }
, _itInvSize = 3 , _itInvSize = 3
, _itDimension = ItemDimension
{ _dimRad = 9
, _dimCenter = V3 10 0 0
}
} }
& itDimension . dimRad .~ 9
& itDimension . dimCenter .~ V3 10 0 0
& itUse . useDelay . rateMax .~ 20 & itUse . useDelay . rateMax .~ 20
& itUse . rUse .~ usePjCreation & itUse . rUse .~ usePjCreation
& itUse . useMods .~ & itUse . useMods .~
+2 -4
View File
@@ -33,11 +33,9 @@ sonicGun = defaultAutoGun
& laCycle .~ [loadEject 10, loadInsert 10 , loadPrime 60] & laCycle .~ [loadEject 10, loadInsert 10 , loadPrime 60]
, _itParams = NoParams , _itParams = NoParams
, _itTweaks = NoTweaks , _itTweaks = NoTweaks
, _itDimension = ItemDimension
{ _dimRad = 10
, _dimCenter = V3 15 0 0
}
} }
& itDimension . dimRad .~ 10
& itDimension . dimCenter .~ V3 15 0 0
& itUse . useDelay . rateMax .~ 8 & itUse . useDelay . rateMax .~ 8
& itUse . rUse .~ aSonicWave & itUse . rUse .~ aSonicWave
& itUse . useMods .~ & itUse . useMods .~
+2 -5
View File
@@ -115,12 +115,9 @@ flameThrower = defaultAutoGun
} }
] ]
} }
, _itDimension = ItemDimension
{ _dimRad = 7
, _dimCenter = V3 9 0 0
}
-- , _itFloorPict = flamerPic
} }
& itDimension . dimRad .~ 7
& itDimension . dimCenter .~ V3 9 0 0
& itUse . rUse .~ overNozzles useGasParams & itUse . rUse .~ overNozzles useGasParams
& itUse . useDelay .~ NoDelay & itUse . useDelay .~ NoDelay
& itUse . useMods .~ & itUse . useMods .~
+12
View File
@@ -0,0 +1,12 @@
module Dodge.LightSource.Torch where
import Dodge.Data
import Geometry
import LensHelp
import Dodge.Item.Draw -- heldItemOffset needs to be moved somewhere more sensible
import Dodge.LightSource -- this needs to be split!
createTorchLightOffset :: Creature -> Item -> Point3 -> World -> World
createTorchLightOffset cr it off = tempLightSources .:~ tlsTimeRadColPos 1 250 0.7
(p +.+.+ rotate3 (_crDir cr) (heldItemOffset it cr (off +.+.+ V3 8 0 1.5)))
where
p = addZ 0 $ _crPos cr
+1 -1
View File
@@ -327,7 +327,7 @@ spawnerRoom = do
corDoor :: State StdGen (MetaTree Room String) corDoor :: State StdGen (MetaTree Room String)
corDoor = do corDoor = do
cor <- (shuffleLinks $ cleatOnward corridor) <&> rmPmnts .~ [] cor <- shuffleLinks (cleatOnward corridor) <&> rmPmnts .~ []
return $ tToBTree "corDoor" $ treePost [door,cor] return $ tToBTree "corDoor" $ treePost [door,cor]
-- cor <- shuffleLinks corridor -- cor <- shuffleLinks corridor
-- return $ tToBTree "corDoor" $ treePost [door,cor,cleatOnward door] -- return $ tToBTree "corDoor" $ treePost [door,cor,cleatOnward door]