Work towards duct taping torch
This commit is contained in:
@@ -130,6 +130,14 @@ moduleCombinations =
|
|||||||
,amod [cr MOTOR,cr HARDWARE] BELTMAG
|
,amod [cr MOTOR,cr HARDWARE] BELTMAG
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
, ( ModHeldAttach
|
||||||
|
, [rifle
|
||||||
|
,autoRifle
|
||||||
|
,burstRifle
|
||||||
|
]
|
||||||
|
, [amod [cr DUCTTAPE,HELD TORCH] ATTACHTORCH
|
||||||
|
]
|
||||||
|
)
|
||||||
, ( ModAutoMag
|
, ( ModAutoMag
|
||||||
, [autoRifle
|
, [autoRifle
|
||||||
,autoPistol
|
,autoPistol
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ data CraftType
|
|||||||
| TUBE
|
| TUBE
|
||||||
| HARDWARE
|
| HARDWARE
|
||||||
| SPRING
|
| SPRING
|
||||||
|
| DUCTTAPE
|
||||||
| CAN
|
| CAN
|
||||||
| TIN
|
| TIN
|
||||||
| DRUM
|
| DRUM
|
||||||
@@ -197,6 +198,7 @@ data ItemModuleType
|
|||||||
| WEPTELE
|
| WEPTELE
|
||||||
| LAUNCHHOME
|
| LAUNCHHOME
|
||||||
| EXTRABATTERY
|
| EXTRABATTERY
|
||||||
|
| ATTACHTORCH
|
||||||
deriving (Eq,Ord,Show)
|
deriving (Eq,Ord,Show)
|
||||||
|
|
||||||
data Detector
|
data Detector
|
||||||
@@ -215,7 +217,7 @@ data ModuleSlot
|
|||||||
| ModBattery
|
| ModBattery
|
||||||
| ModTeleport
|
| ModTeleport
|
||||||
| ModDualBeam
|
| ModDualBeam
|
||||||
| ModAlongsideWeapon
|
| ModHeldAttach
|
||||||
deriving (Eq,Ord,Show)
|
deriving (Eq,Ord,Show)
|
||||||
|
|
||||||
makeLenses ''ItemType
|
makeLenses ''ItemType
|
||||||
|
|||||||
@@ -38,6 +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
|
||||||
where
|
where
|
||||||
f ameff = itConsumption . laAmmoType . amBulEff .~ ameff
|
f ameff = itConsumption . laAmmoType . amBulEff .~ ameff
|
||||||
makeDirectedTele it = it
|
makeDirectedTele it = it
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import Dodge.Prop.Gib
|
|||||||
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.Creature.Test
|
import Dodge.LightSource.Torch
|
||||||
--import Dodge.Base
|
--import Dodge.Base
|
||||||
import Dodge.SoundLogic
|
import Dodge.SoundLogic
|
||||||
import RandomHelp
|
import RandomHelp
|
||||||
@@ -24,12 +24,12 @@ import Picture
|
|||||||
import Shape
|
import Shape
|
||||||
import ShapePicture
|
import ShapePicture
|
||||||
import qualified IntMapHelp as IM
|
import qualified IntMapHelp as IM
|
||||||
|
import LensHelp
|
||||||
--import StrictHelp
|
--import StrictHelp
|
||||||
--import FoldableHelp
|
--import FoldableHelp
|
||||||
|
|
||||||
|
|
||||||
import Data.Function
|
import Data.Function
|
||||||
import Control.Lens
|
|
||||||
--import qualified Data.IntSet as IS
|
--import qualified Data.IntSet as IS
|
||||||
--import Data.Maybe
|
--import Data.Maybe
|
||||||
--import Control.Applicative
|
--import Control.Applicative
|
||||||
@@ -212,7 +212,20 @@ equipmentEffects cr = flip (foldr $ useEquipment cr) (IM.keys $ _crInvEquipped c
|
|||||||
invSideEff :: Creature -> World -> World
|
invSideEff :: Creature -> World -> World
|
||||||
invSideEff cr w = weaponReloadSounds cr $ IM.foldrWithKey f w (_crInv cr)
|
invSideEff cr w = weaponReloadSounds cr $ IM.foldrWithKey f w (_crInv cr)
|
||||||
where
|
where
|
||||||
f i it w' = doItemTargeting i cr w' & maybe id (\g -> g it cr) (it ^? itEffect . ieInv)
|
f i it w' = itemInvSideEffect cr it
|
||||||
|
$ doItemTargeting i cr w' & maybe id (\g -> g it cr) (it ^? itEffect . ieInv)
|
||||||
|
|
||||||
|
itemInvSideEffect :: Creature -> Item -> World -> World
|
||||||
|
itemInvSideEffect cr it
|
||||||
|
| hastorchattach = createAttachLight cr it
|
||||||
|
| otherwise = id
|
||||||
|
where
|
||||||
|
hastorchattach = it ^? itType . iyModules . ix ModHeldAttach == Just ATTACHTORCH && _itIsHeld it
|
||||||
|
|
||||||
|
createAttachLight :: Creature -> Item -> World -> World
|
||||||
|
createAttachLight cr it = createTorchLightOffset cr it attachoff
|
||||||
|
where
|
||||||
|
attachoff = it ^?! itUse . heldAttachPos
|
||||||
|
|
||||||
itemUpdate :: Creature -> Int -> Item -> Item
|
itemUpdate :: Creature -> Int -> Item -> Item
|
||||||
itemUpdate cr i
|
itemUpdate cr i
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import Geometry
|
|||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
|
|
||||||
itemSPic :: Item -> SPic
|
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
|
HELD ht -> heldItemSPic ht it
|
||||||
LEFT lt -> leftItemSPic lt it
|
LEFT lt -> leftItemSPic lt it
|
||||||
EQUIP et -> equipItemSPic et it
|
EQUIP et -> equipItemSPic et it
|
||||||
@@ -116,8 +116,10 @@ torchShape = colorSH blue
|
|||||||
back = upperPrismPoly 3 $ rectXH 1 2
|
back = upperPrismPoly 3 $ rectXH 1 2
|
||||||
|
|
||||||
|
|
||||||
modulesSPic :: Item -> SPic
|
modulesSPic :: Item -> ItemModuleType -> SPic -> SPic
|
||||||
modulesSPic _ = mempty
|
modulesSPic it imt = case imt of
|
||||||
|
ATTACHTORCH -> (<> noPic (overPosSH (+.+.+ _heldAttachPos (_itUse it)) torchShape))
|
||||||
|
_ -> id
|
||||||
|
|
||||||
baseStickShapeX :: Item -> Int -> Shape
|
baseStickShapeX :: Item -> Int -> Shape
|
||||||
baseStickShapeX it i = foldMap f [0..i-1]
|
baseStickShapeX it i = foldMap f [0..i-1]
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ module Dodge.Item.Equipment
|
|||||||
, flameShield
|
, flameShield
|
||||||
) where
|
) where
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
|
import Dodge.LightSource.Torch
|
||||||
import Dodge.Item.Draw
|
import Dodge.Item.Draw
|
||||||
import Dodge.Item.Equipment.Booster
|
import Dodge.Item.Equipment.Booster
|
||||||
import Dodge.LightSource
|
import Dodge.LightSource
|
||||||
@@ -114,11 +115,11 @@ torch = defaultWeapon
|
|||||||
& itUse . useAim . aimMuzPos .~ 10
|
& itUse . useAim . aimMuzPos .~ 10
|
||||||
|
|
||||||
createHeldLight :: Creature -> Int -> World -> World
|
createHeldLight :: Creature -> Int -> World -> World
|
||||||
createHeldLight cr i w = w
|
createHeldLight cr i = createTorchLightOffset cr itm 0
|
||||||
& tempLightSources .:~ tlsTimeRadColPos 1 250 0.7
|
-- tempLightSources .:~ tlsTimeRadColPos 1 250 0.7
|
||||||
(p +.+.+ rotate3 (_crDir cr) (heldItemOffset itm cr (V3 8 0 1.5)))
|
-- (p +.+.+ rotate3 (_crDir cr) (heldItemOffset itm cr (V3 8 0 1.5)))
|
||||||
where
|
where
|
||||||
p = addZ 0 $ _crPos cr
|
-- p = addZ 0 $ _crPos cr
|
||||||
itm = cr ^?! crInv . ix i
|
itm = cr ^?! crInv . ix i
|
||||||
|
|
||||||
flatShield :: Item
|
flatShield :: Item
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ rifle = defaultBangCane
|
|||||||
& itUse . useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
-- & itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
-- & itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
||||||
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 2}
|
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 2}
|
||||||
|
& itType . iyModules . at ModHeldAttach ?~ EMPTYMODULE
|
||||||
repeater :: Item
|
repeater :: Item
|
||||||
repeater = rifle
|
repeater = rifle
|
||||||
& itType . iyModules . at ModRifleMag ?~ EMPTYMODULE
|
& itType . iyModules . at ModRifleMag ?~ EMPTYMODULE
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ moduleName imt = case imt of
|
|||||||
WEPTELE -> Just "+DIRECTEDTELE"
|
WEPTELE -> Just "+DIRECTEDTELE"
|
||||||
LAUNCHHOME -> Just "+TARGET HOMING"
|
LAUNCHHOME -> Just "+TARGET HOMING"
|
||||||
EXTRABATTERY -> Just "+BATTERY"
|
EXTRABATTERY -> Just "+BATTERY"
|
||||||
|
ATTACHTORCH -> Just "+TORCH"
|
||||||
|
|
||||||
--moduleFold :: (m -> m -> m) -> (ItemModule -> Maybe m) -> m -> Item -> m
|
--moduleFold :: (m -> m -> m) -> (ItemModule -> Maybe m) -> m -> Item -> m
|
||||||
--moduleFold g f e = foldr (g . fromMaybe e . f) e
|
--moduleFold g f e = foldr (g . fromMaybe e . f) e
|
||||||
|
|||||||
Reference in New Issue
Block a user