Return to project, unsure about changes

This commit is contained in:
2024-05-25 13:10:50 +01:00
parent 08716e8ade
commit c862c862df
63 changed files with 1137641 additions and 52 deletions
+1
View File
@@ -0,0 +1 @@
:set prompt ">"
+1
View File
@@ -0,0 +1 @@
--command "stack ghci --main-is loop:exe:dodge"
+483
View File
@@ -0,0 +1,483 @@
{- |
Weapon effects when pulling the trigger. -}
module Dodge.Item.Weapon.TriggerType
where
import Dodge.Data
import Dodge.SoundLogic
import Dodge.Creature.Action (startReloadingWeapon)
import Dodge.WorldEvent (muzzleFlashAt,tempLightForAt)
import Dodge.WorldEvent.Cloud
import Dodge.RandomHelp
import Dodge.Particle.Bullet.Spawn
import Dodge.Item.Attachment.Data
import Dodge.Item.Data
import Geometry
import System.Random
import Control.Lens
import Control.Monad.State
import Data.Maybe
import qualified Data.IntMap.Strict as IM
import Data.Foldable
withThinSmoke
:: (Creature -> World -> World) -- ^ Underlying effect
-> Creature
-> World
-> World
withThinSmoke eff cr w = eff cr $ foldl' (flip $ makeThinSmokeAt . (+.+ pos)) w ps
where
dir = _crDir cr
pos = _crPos cr +.+ (_crRad cr +0.5) *.* unitVectorAtAngle dir
ps = (replicateM 5 . randInCirc) 8 & evalState $ _randGen w
withThickSmoke
:: (Creature -> World -> World) -- ^ Underlying effect
-> Creature
-> World
-> World
withThickSmoke eff cr w = eff cr $ foldl' (flip $ makeThickSmokeAt . (+.+ pos)) w ps
where
dir = _crDir cr
pos = _crPos cr +.+ (_crRad cr + 15) *.* unitVectorAtAngle dir
ps = (replicateM 20 . randInCirc) 8 & evalState $ _randGen w
{- |
Fires at an increasing rate.
Has different effect after first fire.
Applies ammo check and use cooldown check. -}
rateIncAB
:: Int -- ^ Start rate
-> Int -- ^ End rate
-> (Creature -> World -> World) -- ^ Effect on first fire
-> (Creature -> World -> World) -- ^ Effect on continued fire
-> Creature -- ^ Creature id
-> World
-> World
rateIncAB startRate fastRate shooteff1 shooteff2 cr w
| repeatFire = w
& pointItem %~ ( (itUseRate .~ max fastRate (currentRate - 1))
. (wpLoadedAmmo -~ 1)
. (itUseTime .~ currentRate) )
& shooteff2 cr
| firstFire = w
& pointItem %~ ( (itUseRate .~ startRate - 1)
. (wpLoadedAmmo -~ 1)
. (itUseTime .~ startRate) )
& shooteff1 cr
| reloadCondition = fromMaybe w $ startReloadingWeapon cr w
| otherwise = w
where
cid = _crID cr
itRef = _crInvSel cr
item = _crInv cr IM.! itRef
pointItem = creatures . ix cid . crInv . ix itRef
currentRate = _itUseRate item
repeatFire = _wpReloadState item == 0
&& _itUseTime item == 1
&& _wpLoadedAmmo item > 0
firstFire = _wpReloadState item == 0
&& _itUseTime item == 0
&& _wpLoadedAmmo item > 0
reloadCondition = _wpLoadedAmmo item == 0
{- |
Shoot a weapon rapidly after a warm up.
Applies ammo check as well. -}
withWarmUp
:: Int -- ^ Warm up time (in frames)
-> (Creature -> World -> World)
-- ^ Shoot effect
-> Creature
-> World
-> World
withWarmUp t f cr w
| reloadCondition = fromMaybe w $ startReloadingWeapon cr w
| _wpReloadState item /= 0 = w
| fState == 0 = w
& pointerToItem %~ ( (itUse .~ (\_ -> withWarmUp 100 f)) . (itUseTime .~ 2) )
| t > 2 = w
& pointerToItem %~ ( (itUse .~ (\_ -> withWarmUp (t-1) f)) . (itUseTime .~ 2) )
& soundFrom (CrWeaponSound cid) 26 2 0
| t > 0 = w
& pointerToItem %~ ( (itUse .~ (\_ -> withWarmUp (t-1) f)) . (itUseTime .~ 2) )
| otherwise = w
& pointerToItem %~ ( (itUse .~ (\_ -> withWarmUp 1 f)) . (wpLoadedAmmo -~ 1) . (itUseTime .~ 2) )
& f cr
& soundFrom (CrWeaponSound cid) 28 2 0
where
cid = _crID cr
itRef = _crInvSel cr
item = _crInv cr IM.! itRef
pointerToItem = creatures . ix cid . crInv . ix itRef
fState = _itUseTime item
reloadCondition = _wpLoadedAmmo item == 0
{- | Adds a sound to a creature based world effect.
The sound is emitted from the creature's position. -}
withSound
:: Int -- ^ Sound id
-> (Creature -> World -> World) -- ^ Underlying effect
-> Creature
-> World -> World
withSound soundid f cr = soundOncePos soundid (_crPos cr) . f cr
withRecoil
:: Float -- ^ Recoil amount
-> (Creature -> World -> World)
-- ^ Underlying world effect, takes creature id as input
-> Creature
-> World -> World
withRecoil recoilAmount eff cr = eff cr . over (creatures . ix cid) pushback
where
cid = _crID cr
pushback = over crPos (+.+ rotateV (_crDir cr) (V2 ((-recoilAmount) / _crMass cr ) 0))
{- | Pushes a creature sideways by a random amount.
Applied before the underlying effect. -}
withSidePush
:: Float -- ^ Maximal possible side push amount
-> (Creature -> World -> World)
-- ^ Underlying world effect, takes creature id as input
-> Creature
-> World -> World
withSidePush maxSide eff cr w = eff cr . over (creatures . ix cid) push $ w
where
cid = _crID cr
push = over crPos (+.+ rotateV (_crDir cr) (V2 0 (pushAmount / _crMass cr)))
(pushAmount, _) = randomR (-maxSide,maxSide) $ _randGen w
-- consider unifying the pushes using a direction vector
{- | Pushes a creature sideways by a random amount.
Applied after the underlying effect. -}
withSidePushAfter
:: Float -- ^ Maximal possible side push amount
-> (Creature -> World -> World)
-- ^ Underlying world effect, takes creature id as input
-> Creature -- ^ Creature id
-> World -> World
withSidePushAfter maxSide eff cr w = over (creatures . ix cid) push . eff cr $ w
where
cid = _crID cr
push = over crPos (+.+ rotateV (_crDir cr) (V2 0 (pushAmount / _crMass cr)))
(pushAmount, _) = randomR (-maxSide,maxSide) $ _randGen w
{- | Applies a world effect and sound effect after an ammo check. -}
shootWithSound
:: Int -- ^ Sound identifier
-> (Creature -> World -> World)
-- ^ Shoot effect, takes creature id as input
-> Creature
-> World
-> World
shootWithSound soundid f cr w
| fireCondition = over (pointerToItem . wpLoadedAmmo) (\ammo -> ammo-1)
$ soundOncePos soundid (_crPos cr)
$ set (pointerToItem . itUseTime) (_itUseRate item)
$ f cr w
| reloadCondition = fromMaybe w $ startReloadingWeapon cr w
| otherwise = w
where
cid = _crID cr
itRef = _crInvSel cr
item = _crInv cr IM.! itRef
pointerToItem = creatures . ix cid . crInv . ix itRef
fireCondition = _wpReloadState item == 0
&& _itUseTime item == 0
&& _wpLoadedAmmo item > 0
reloadCondition = _wpLoadedAmmo item == 0
{- | Applies a world effect and sound effect after an ammo check. -}
shootWithSoundI
:: Int -- ^ Sound identifier
-> (Item -> Creature -> World -> World)
-- ^ Shoot effect, takes creature id as input
-> Item
-> Creature
-> World
-> World
shootWithSoundI soundid f item cr w
| fireCondition = over (pointerToItem . wpLoadedAmmo) (\ammo -> ammo-1)
$ soundOncePos soundid (_crPos cr)
$ set (pointerToItem . itUseTime) (_itUseRate item)
$ f item cr w
| reloadCondition = fromMaybe w $ startReloadingWeapon cr w
| otherwise = w
where
cid = _crID cr
itRef = _crInvSel cr
pointerToItem = creatures . ix cid . crInv . ix itRef
fireCondition = _wpReloadState item == 0
&& _itUseTime item == 0
&& _wpLoadedAmmo item > 0
reloadCondition = _wpLoadedAmmo item == 0
{- |
Applies a world effect after an item use cooldown check. -}
useTimeCheck
:: (Creature -> World -> World) -- ^ Underlying effect
-> Creature
-> World
-> World
useTimeCheck f cr w = case theItem ^? itUseTime of
Just 0 -> f cr $ setUseTime w
_ -> w
where
cid = _crID cr
setUseTime = creatures . ix cid . crInv . ix (_crInvSel cr) . itUseTime +~ useRate
theItem = _crInv cr IM.! _crInvSel cr
useRate = fromMaybe 0 $ theItem ^? itUseRate
{- | Applies a world effect after a hammer position check. -}
hammerCheck
:: (Creature -> World -> World) -- ^ Underlying effect
-> Creature
-> World
-> World
hammerCheck f cr w = case (_crInv cr IM.! _crInvSel cr) ^? itHammer of
Just HammerUp -> f cr $ setHammerDown w
_ -> setHammerDown w
where
cid = _crID cr
setHammerDown = creatures . ix cid . crInv . ix (_crInvSel cr) . itHammer .~ HammerDown
{- | Applies a world effect after a hammer position check. -}
hammerCheckI
:: (Item -> Creature -> World -> World) -- ^ Underlying effect
-> Item
-> Creature
-> World
-> World
hammerCheckI f it cr w = case it ^? itHammer of
Just HammerUp -> f it cr $ setHammerDown w
_ -> setHammerDown w
where
cid = _crID cr
setHammerDown = creatures . ix cid . crInv . ix (_crInvSel cr) . itHammer .~ HammerDown
{- | Applies a world effect after an ammo check. -}
shoot
:: (Creature -> World -> World)
-- ^ Underlying effect
-> Creature
-> World
-> World
shoot f cr w
| fireCondition = f cr w & pointerToItem %~
( (wpLoadedAmmo -~ 1) . (itUseTime .~ _itUseRate item) )
| reloadCondition = fromMaybe w $ startReloadingWeapon cr w
| otherwise = w
where
cid = _crID cr
itRef = _crInvSel cr
item = _crInv cr IM.! itRef
pointerToItem = creatures . ix cid . crInv . ix itRef
fireCondition = _wpReloadState item == 0
&& _itUseTime item == 0
&& _wpLoadedAmmo item > 0
reloadCondition = _wpLoadedAmmo item == 0
{- | Applies a world effect after a hammer position check.
Arbitrary inventory position. -}
hammerCheckL
:: (Creature -> Int -> World -> World) -- ^ Underlying effect
-> Creature
-> Int
-> World
-> World
hammerCheckL f cr invid w = case (_crInv cr IM.! invid) ^? itHammer of
Just HammerUp -> f cr invid $ setHammerDown w
_ -> setHammerDown w
where
cid = _crID cr
setHammerDown = creatures . ix cid . crInv . ix invid . itHammer .~ HammerDown
{- | Applies a world effect after an ammo check.
Arbitrary inventory position. -}
shootL
:: (Creature -> Int -> World -> World)
-- ^ Underlying effect
-> Creature
-> Int -- ^ Inventory position
-> World
-> World
shootL f cr invid w
| fireCondition = f cr invid w & pointerToItem %~
( (wpLoadedAmmo -~ 1) . (itUseTime .~ _itUseRate item) )
| reloadCondition = fromMaybe w $ startReloadingWeapon cr w
| otherwise = w
where
cid = _crID cr
item = _crInv cr IM.! invid
pointerToItem = creatures . ix cid . crInv . ix invid
fireCondition = _wpReloadState item == 0
&& _itUseTime item == 0
&& _wpLoadedAmmo item > 0
reloadCondition = _wpLoadedAmmo item == 0
withMuzFlare
:: (Creature -> World -> World) -- ^ Underlying effect
-> Creature
-> World
-> World
withMuzFlare f cr w = tempLightForAt 3 pos . muzzleFlashAt pos2 $ f cr w
where
pos = _crPos cr +.+ _crRad cr *.* unitVectorAtAngle (_crDir cr)
pos2 = _crPos cr +.+ (2 * _crRad cr) *.* unitVectorAtAngle (_crDir cr)
withMuzFlareI
:: (Item -> Creature -> World -> World) -- ^ Underlying effect
-> Item
-> Creature
-> World
-> World
withMuzFlareI f it cr w = tempLightForAt 3 pos . muzzleFlashAt pos2 $ f it cr w
where
pos = _crPos cr +.+ _crRad cr *.* unitVectorAtAngle (_crDir cr)
pos2 = _crPos cr +.+ (2 * _crRad cr) *.* unitVectorAtAngle (_crDir cr)
{- | Applies the effect to a randomly rotated creature. -}
withRandomDir
:: Float -- ^ Max possible rotation
-> (Creature -> World -> World)
-- ^ Underlying effect
-> Creature
-> World
-> World
withRandomDir acc f cr w = f (cr & crDir +~ a) $ set randGen g w
where
(a, g) = randomR (-acc,acc) $ _randGen w
{- | Applies the effect to a randomly rotated creature. -}
withRandomDirI
:: Float -- ^ Max possible rotation
-> (Item -> Creature -> World -> World)
-- ^ Underlying effect
-> Item
-> Creature
-> World
-> World
withRandomDirI acc f it cr w = f it (cr & crDir +~ a) $ set randGen g w
where
(a, g) = randomR (-acc,acc) $ _randGen w
{- | Creates a bullet with a given velocity, width, and 'HitEffect' -}
withVelWthHiteff
:: Point2 -- ^ Velocity, x direction is forward with respect to the creature
-> Float -- ^ Bullet width
-> HitEffect -- ^ Bullet effect when hitting creature, wall etc
-> Creature -- ^ Creature id
-> World
-> World
withVelWthHiteff vel width hiteff cr = over particles (newbul : )
where
cid = _crID cr
newbul = aGenBulAt (Just cid) pos (rotateV dir vel) hiteff width
dir = _crDir cr
pos = _crPos cr +.+ _crRad cr *.* unitVectorAtAngle (_crDir cr)
{- | Apply the effect to a translated creature. -}
withRandomOffset
:: Float -- ^ Max possible translate
-> (Creature -> World -> World)
-- ^ Underlying effect
-> Creature
-> World
-> World
withRandomOffset offsetAmount f cr w = f (cr & crPos %~ (+.+ offV)) $ set randGen g w
where
(offsetVal , g) = randomR (-offsetAmount,offsetAmount) $ _randGen w
offV = rotateV (_crDir cr) (V2 0 offsetVal)
-- | Rotates a creature with minimum rotation at least 0.1.
-- Rotates the player creature before applying the effect, other creatures after.
torqueBeforeForced
:: Float -- ^ Max possible rotation (less the 0.1 forced rotation)
-> (Creature -> World -> World)
-- ^ Underlying effect
-> Creature
-> World
-> World
torqueBeforeForced torque feff cr w
| cid == 0 = feff (cr & crDir +~ rot') $ w
& randGen .~ g
& creatures . ix cid . crDir +~ rot'
& cameraRot +~ rot'
| otherwise = feff cr $ set randGen g $ over (creatures . ix cid . crDir) (+rot') w
where
cid = _crID cr
(rot, g) = randomR (-torque,torque) $ _randGen w
rot' | rot < 0 = rot - 0.1
| otherwise = rot + 0.1
-- | Rotates the player creature before applying an effect.
-- Note this currently (29/4/2021) rotates other creatures /after/ applying the effect.
torqueBefore
:: Float -- ^ Max possible rotation
-> (Creature -> World -> World) -- ^ Underlying effect
-> Creature -- ^ Creature id
-> World
-> World
torqueBefore torque feff cr w
| cid == 0 = feff (cr & crDir +~ rot) $ w
& randGen .~ g
& creatures . ix cid . crDir +~ rot
& cameraRot +~ rot
| otherwise = set randGen g $ over (creatures . ix cid . crDir) (+rot) $ feff cr w
where
cid = _crID cr
(rot, g) = randomR (-torque,torque) $ _randGen w
-- | Rotate a randomly creature after applying an effect.
torqueAfter
:: Float -- ^ Max possible rotation
-> (Creature -> World -> World) -- ^ Underlying effect
-> Creature -- ^ Creature id
-> World
-> World
torqueAfter torque feff cr w
| cid == 0 = rotateScope $ set randGen g $ over cameraRot (+rot) $ feff cr w
| otherwise = set randGen g $ over (creatures . ix cid . crDir) (+rot) $ feff cr w
where
cid = _crID cr
(rot, g) = randomR (-torque,torque) $ _randGen w
rotateScope = creatures . ix 0 . crInv . ix (_crInvSel (_creatures w IM.! 0))
. itAttachment . _Just . scopePos %~ rotateV rot
{- | Create multiple bullets with a given spread, a given amount, given velocity,
given width and given 'HitEffect'. -}
spreadNumVelWthHiteff
:: Float -- ^ Spread
-> Int -- ^ Number of bullets
-> Point2 -- ^ Velocity, x is direction of creature
-> Float -- ^ Bullet width
-> HitEffect -- ^ Effect when hitting creature, wall etc
-> Creature -- ^ Creature id
-> World
-> World
spreadNumVelWthHiteff spread num vel wth eff cr w = over particles (newbuls ++) w
where
cid = _crID cr
newbuls = zipWith
(\pos d -> aGenBulAt (Just cid) pos (rotateV d vel) eff wth)
poss dirs
poss = map ((+.+) $ _crPos cr +.+ _crRad cr *.* unitVectorAtAngle (_crDir cr))
$ (replicateM num . randInCirc) 5 & evalState $ _randGen w
dirs = map (_crDir cr +) $ zipWith (+)
[-spread,-spread+(2*spread/fromIntegral num)..]
(randomRs (0,spread/5) (_randGen w))
{- | Create a number of bullets side by side with a given velocity,
given width and given 'HitEffect'. -}
numVelWthHitEff
:: Int -- ^ Amount of bullets
-> Point2 -- ^ Velocity, x axis is direction of creature
-> Float -- ^ Bullet width
-> HitEffect -- ^ Effect when hitting creature, wall etc
-> Creature
-> World
-> World
numVelWthHitEff num vel wth eff cr = over particles (newbuls ++)
where
cid = _crID cr
newbuls = map (\p -> aGenBulAt (Just cid) p (rotateV d vel) eff wth) poss
d = _crDir cr
poss = map (+.+ pos) $ take num offsets
maxOffset = fromIntegral num * 2.5 - 2.5
offsets = map (rotateV d . V2 0) [-maxOffset,5-maxOffset..]
pos = _crPos cr +.+ _crRad cr *.* unitVectorAtAngle d
{- | Uses '_wpSpread' as a parameter for the current offset angle. -}
randWalkAngle
:: Float -- ^ Max offset angle
-> Float -- ^ Walk speed
-> (Creature -> World -> World) -- ^ Underlying effect
-> Creature -- ^ Creature id
-> World
-> World
randWalkAngle ma aspeed f cr w = w
& f (cr & crDir +~ a)
& creatures . ix cid . crInv . ix i . wpSpread .~ newa
where
cid = _crID cr
a = _wpSpread $ _crInv (_creatures w IM.! cid) IM.! i
(walka, _) = randomR (-aspeed,aspeed) (_randGen w)
newa = min ma $ max (negate ma) (a + walka)
i = _crInvSel $ _creatures w IM.! cid
BIN
View File
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

+26
View File
@@ -0,0 +1,26 @@
{
"_debug_booleans": [
"Show_ms_frame",
"Show_sound",
"Noclip",
"Select_creature"
],
"_debug_view_clip_bounds": "NoRoomClipBoundaries",
"_gameplay_rotate_to_wall": true,
"_graphics_bloom": true,
"_graphics_cloud_shadows": true,
"_graphics_distortion_resolution": "FullRes",
"_graphics_distortions": true,
"_graphics_downsize_resolution": "EighthRes",
"_graphics_num_shadow_casters": "NumShadowCasters20",
"_graphics_shadow_rendering": "GeoObjShads",
"_graphics_shadow_size": "Typical",
"_graphics_world_resolution": "QuarterRes",
"_volume_master": 1,
"_volume_music": 0,
"_volume_sound": 1,
"_windowPosX": 0,
"_windowPosY": 29,
"_windowX": 800,
"_windowY": 835
}
Binary file not shown.
Binary file not shown.
+26
View File
@@ -0,0 +1,26 @@
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE project PUBLIC "-//audacityproject-1.3.0//DTD//EN" "http://audacity.sourceforge.net/xml/audacityproject-1.3.0.dtd" >
<project xmlns="http://audacity.sourceforge.net/xml/" projname="reload_data" version="1.3.0" audacityversion="2.2.1" sel0="1.0000000000" sel1="1.0000000000" vpos="80" h="0.0000000000" zoom="619.9769053118" rate="44100.0" snapto="on" selectionformat="hh:mm:ss + milliseconds" frequencyformat="Hz" bandwidthformat="octaves">
<tags/>
<wavetrack name="Audio Track" channel="2" linked="0" mute="0" solo="0" height="150" minimized="0" isSelected="0" rate="44100" gain="1.0" pan="0.0" colorindex="0"/>
<wavetrack name="Audio Track" channel="0" linked="1" mute="0" solo="0" height="150" minimized="0" isSelected="1" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="44100">
<waveblock start="0">
<simpleblockfile filename="e0002ad8.au" len="44100" min="-0.626438" max="0.756957" rms="0.050527"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" channel="1" linked="0" mute="0" solo="0" height="150" minimized="0" isSelected="1" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="44100">
<waveblock start="0">
<simpleblockfile filename="e0002124.au" len="44100" min="-0.626438" max="0.756957" rms="0.050527"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
</project>
+25
View File
@@ -0,0 +1,25 @@
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE project PUBLIC "-//audacityproject-1.3.0//DTD//EN" "http://audacity.sourceforge.net/xml/audacityproject-1.3.0.dtd" >
<project xmlns="http://audacity.sourceforge.net/xml/" projname="tap_data" version="1.3.0" audacityversion="2.2.1" sel0="0.0000000000" sel1="0.2786394558" vpos="0" h="0.0000000000" zoom="86.1328125000" rate="44100.0" snapto="off" selectionformat="hh:mm:ss + milliseconds" frequencyformat="Hz" bandwidthformat="octaves">
<tags/>
<wavetrack name="Audio Track" channel="0" linked="1" mute="0" solo="0" height="161" minimized="0" isSelected="1" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="12288">
<waveblock start="0">
<simpleblockfile filename="e000077f.au" len="12288" min="-10.632122" max="11.905688" rms="0.574985"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" channel="1" linked="0" mute="0" solo="0" height="139" minimized="0" isSelected="1" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="12288">
<waveblock start="0">
<simpleblockfile filename="e0000254.au" len="12288" min="-11.171772" max="11.837081" rms="0.58168"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
</project>
+73
View File
@@ -0,0 +1,73 @@
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE project PUBLIC "-//audacityproject-1.3.0//DTD//EN" "http://audacity.sourceforge.net/xml/audacityproject-1.3.0.dtd" >
<project xmlns="http://audacity.sourceforge.net/xml/" projname="twoStep_data" version="1.3.0" audacityversion="2.2.1" sel0="0.0000000000" sel1="0.7800000000" vpos="0" h="0.2878780178" zoom="1639.5833333333" rate="44100.0" snapto="on" selectionformat="hh:mm:ss + milliseconds" frequencyformat="Hz" bandwidthformat="octaves">
<tags/>
<wavetrack name="twoStep" channel="2" linked="0" mute="0" solo="0" height="150" minimized="0" isSelected="1" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.15000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="13892">
<waveblock start="0">
<simpleblockfile filename="e00004be.au" len="13892" min="-0.124176" max="0.095367" rms="0.007066"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
<waveclip offset="0.61501134" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="7276">
<waveblock start="0">
<simpleblockfile filename="e00007db.au" len="7276" min="-0.186249" max="0.163513" rms="0.017523"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
<wavetrack name="Audio Track" channel="2" linked="0" mute="0" solo="0" height="150" minimized="0" isSelected="1" rate="44100" gain="1.0" pan="0.0" colorindex="0">
<waveclip offset="0.56501134" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="2205">
<waveblock start="0">
<silentblockfile len="2205"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
<waveclip offset="0.00000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="2205">
<waveblock start="0">
<silentblockfile len="2205"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
<waveclip offset="0.05000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="2205">
<waveblock start="0">
<silentblockfile len="2205"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
<waveclip offset="0.51501134" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="2205">
<waveblock start="0">
<silentblockfile len="2205"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
<waveclip offset="0.10000000" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="2205">
<waveblock start="0">
<silentblockfile len="2205"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
<waveclip offset="0.46501134" colorindex="0">
<sequence maxsamples="262144" sampleformat="262159" numsamples="2205">
<waveblock start="0">
<silentblockfile len="2205"/>
</waveblock>
</sequence>
<envelope numpoints="0"/>
</waveclip>
</wavetrack>
</project>
Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.
+42
View File
@@ -0,0 +1,42 @@
X_RANGE 24.74
Y_RANGE 50384824.00
ORDER OTHER 1
ORDER (153007)fastInsEdge.addS'/fastInsEdge.g1/fastInsEdge/addEdges.f/addEdges/pairsToGraph/generateLevelFromR... 2
ORDER (69921)PINNED 3
ORDER (155902)plLineBlock.makePane/plLineBlock.makeWallAt/plLineBlock.insertBlock/plLineBlock.insertBlocks/plL... 4
ORDER (147714)#..\/#./itemCombinations/CAF:n28_roGVR 5
ORDER (158618)ix/#..\/#./functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRenderSplit/th... 6
ORDER (160173)updateExpBarrel.applyFuseDamage/updateExpBarrel.newCr/updateExpBarrel/updateBarreloid/updateCrea... 7
ORDER (160911)ix/clearTargeting/updateTargeting/invSideEff/stateUpdate/defaultImpulsive/updateHumanoid/updateC... 8
ORDER (159585)updateObjCatMaybes/updateClouds/#..\/#./functionalUpdate/timeFlowUpdate/updateUniverseMid/update... 9
ORDER (153010)zonePe.f/zonePe/generateLevelFromRoomList/generateWorldFromSeed/startSeedGameConc/startSeedGame/... 10
ORDER (162537)zoneCloud/zoneClouds/#..\/#./functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/up... 11
ORDER (152690)generateLevelFromRoomList/generateWorldFromSeed/startSeedGameConc/startSeedGame/startNewGameInSl... 12
ORDER (160250)#..\/#./colCrsWalls/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRende... 13
ORDER (166078)updateCloud.(...)/updateCloud/updateObjCatMaybes.(...)/updateObjCatMaybes/updateClouds/#..\/#./f... 14
ORDER (158550)#..\/#./functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRenderSplit/theUp... 15
ORDER (158734)setOldPos/#..\/#./functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRenderS... 16
ORDER (164223)updateCloud/updateObjCatMaybes.(...)/updateObjCatMaybes/updateClouds/#..\/#./functionalUpdate/ti... 17
ORDER (158568)zoneCreatures/#..\/#./functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRen... 18
ORDER (164235)drawText.f/drawText/updateSection.h/updateSection.tweakfirst/updateSection.shownitems/updateSect... 19
ORDER (164228)updateSection.h/updateSection.tweakfirst/updateSection.shownitems/updateSection/updateSectionsPo... 20
SHADE OTHER 0.00
SHADE (153007)fastInsEdge.addS'/fastInsEdge.g1/fastInsEdge/addEdges.f/addEdges/pairsToGraph/generateLevelFromR... 0.00
SHADE (69921)PINNED 0.00
SHADE (155902)plLineBlock.makePane/plLineBlock.makeWallAt/plLineBlock.insertBlock/plLineBlock.insertBlocks/plL... 0.00
SHADE (147714)#..\/#./itemCombinations/CAF:n28_roGVR 0.10
SHADE (158618)ix/#..\/#./functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRenderSplit/th... 0.10
SHADE (160173)updateExpBarrel.applyFuseDamage/updateExpBarrel.newCr/updateExpBarrel/updateBarreloid/updateCrea... 0.10
SHADE (160911)ix/clearTargeting/updateTargeting/invSideEff/stateUpdate/defaultImpulsive/updateHumanoid/updateC... 0.10
SHADE (159585)updateObjCatMaybes/updateClouds/#..\/#./functionalUpdate/timeFlowUpdate/updateUniverseMid/update... 0.00
SHADE (153010)zonePe.f/zonePe/generateLevelFromRoomList/generateWorldFromSeed/startSeedGameConc/startSeedGame/... 0.00
SHADE (162537)zoneCloud/zoneClouds/#..\/#./functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/up... 0.00
SHADE (152690)generateLevelFromRoomList/generateWorldFromSeed/startSeedGameConc/startSeedGame/startNewGameInSl... 0.00
SHADE (160250)#..\/#./colCrsWalls/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRende... 0.05
SHADE (166078)updateCloud.(...)/updateCloud/updateObjCatMaybes.(...)/updateObjCatMaybes/updateClouds/#..\/#./f... 0.05
SHADE (158550)#..\/#./functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRenderSplit/theUp... 0.05
SHADE (158734)setOldPos/#..\/#./functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRenderS... 0.05
SHADE (164223)updateCloud/updateObjCatMaybes.(...)/updateObjCatMaybes/updateClouds/#..\/#./functionalUpdate/ti... 0.10
SHADE (158568)zoneCreatures/#..\/#./functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRen... 0.10
SHADE (164235)drawText.f/drawText/updateSection.h/updateSection.tweakfirst/updateSection.shownitems/updateSect... 0.10
SHADE (164228)updateSection.h/updateSection.tweakfirst/updateSection.shownitems/updateSection/updateSectionsPo... 0.10
BIN
View File
Binary file not shown.
+335824
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+59304
View File
File diff suppressed because it is too large Load Diff
+232129
View File
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
indentation: 4
comma-style: leading
import-export-comma-style: leading
indent-wheres: false
record-brace-space: false
diff-friendly-import-export: true
respectful: false
haddock-style: multi-line
newlines-between-decls: 0
fixities: []
+29
View File
@@ -0,0 +1,29 @@
/home/justin/Haskell/loop/src/Dodge/Base/You.hs:3:1: warning: [-Wunused-imports]
The import of TreeHelp is redundant
|
3 | import TreeHelp
| ^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Base/You.hs:46:19: warning: [-Wunused-matches]
Defined but not used: cr
|
46 | upDownAttachments cr i j s = s
| ^^
/home/justin/Haskell/loop/src/Dodge/Base/You.hs:46:22: warning: [-Wunused-matches]
Defined but not used: i
|
46 | upDownAttachments cr i j s = s
| ^
/home/justin/Haskell/loop/src/Dodge/Base/You.hs:46:24: warning: [-Wunused-matches]
Defined but not used: j
|
46 | upDownAttachments cr i j s = s
| ^
/home/justin/Haskell/loop/src/Dodge/Item.hs:29:25: warning: [-Wincomplete-patterns]
Pattern match(es) are non-exhaustive
In a case alternative:
Patterns not matched:
BULPAYLOADATTACH
BULTRAJECTORYATTACH
|
29 | itemFromAttachType at = case at of
| ^^^^^^^^^^...
+408
View File
@@ -0,0 +1,408 @@
digraph {
graph [rankdir=LR];
subgraph 1 {
1 [shape=box
,label="LEFT {_ibtLeft = SCROLLWATCH}"];
2 [shape=box
,label="LEFT {_ibtLeft = STOPWATCH}"];
3 [shape=box
,label="LEFT {_ibtLeft = REWINDWATCH}"];
11 [shape=box
,label="EQUIP {_ibtEquip = FUELPACK}"];
15 [shape=box
,label="EQUIP {_ibtEquip = TARGETINGHAT TARGETLASER}"];
16 [shape=box
,label="EQUIP {_ibtEquip = HAT}"];
19 [shape=box
,label="EQUIP {_ibtEquip = TARGETINGHAT TargetRBPress}"];
22 [shape=box
,label="EQUIP {_ibtEquip = TARGETINGHAT TargetRBLine}"];
25 [shape=box
,label="EQUIP {_ibtEquip = TARGETINGHAT TargetRBCreature}"];
28 [shape=box
,label="EQUIP {_ibtEquip = TARGETINGHAT TargetCursor}"];
31 [shape=box
,label="HELD {_ibtHeld = BANGSTICK {_xNum = 1}}"];
35 [shape=box
,label="HELD {_ibtHeld = PISTOL}"];
38 [shape=box
,label="HELD {_ibtHeld = AUTOPISTOL}"];
41 [shape=box
,label="HELD {_ibtHeld = SMG}"];
44 [shape=box
,label="HELD {_ibtHeld = MACHINEPISTOL}"];
46 [shape=box
,label="HELD {_ibtHeld = REVOLVER}"];
49 [shape=box
,label="HELD {_ibtHeld = REVOLVERX {_xNum = 1}}"];
51 [shape=box
,label="HELD {_ibtHeld = BANGCONE}"];
53 [shape=box
,label="HELD {_ibtHeld = BLUNDERBUSS}"];
55 [shape=box
,label="HELD {_ibtHeld = GRAPECANNON {_xNum = 1}}"];
57 [shape=box
,label="HELD {_ibtHeld = RIFLE}"];
59 [shape=box
,label="HELD {_ibtHeld = VOLLEYGUN {_xNum = 3}}"];
61 [shape=box
,label="HELD {_ibtHeld = REPEATER}"];
63 [shape=box
,label="HELD {_ibtHeld = AUTORIFLE}"];
65 [shape=box
,label="HELD {_ibtHeld = BURSTRIFLE}"];
67 [shape=box
,label="HELD {_ibtHeld = MINIGUNX {_xNum = 3}}"];
70 [shape=box
,label="HELD {_ibtHeld = SNIPERRIFLE}"];
71 [shape=box
,label="HELD {_ibtHeld = AMR}"];
74 [shape=box
,label="HELD {_ibtHeld = AUTOAMR}"];
76 [shape=box
,label="HELD {_ibtHeld = MACHINEGUN}"];
78 [shape=box
,label="HELD {_ibtHeld = LAUNCHER}"];
81 [shape=box
,label="HELD {_ibtHeld = LAUNCHERX {_xNum = 2}}"];
85 [shape=box
,label="HELD {_ibtHeld = FLAMESPITTER}"];
89 [shape=box
,label="HELD {_ibtHeld = BLOWTORCH}"];
91 [shape=box
,label="HELD {_ibtHeld = FLAMETHROWER}"];
93 [shape=box
,label="HELD {_ibtHeld = FLAMEWALL}"];
95 [shape=box
,label="HELD {_ibtHeld = FLAMETORRENT}"];
97 [shape=box
,label="HELD {_ibtHeld = LASGUN}"];
101 [shape=box
,label="HELD {_ibtHeld = DUALBEAM}"];
103 [shape=box
,label="HELD {_ibtHeld = LASWIDE {_xNum = 2}}"];
105 [shape=box
,label="HELD {_ibtHeld = LASCIRCLE}"];
107 [shape=box
,label="HELD {_ibtHeld = SPARKGUN}"];
109 [shape=box
,label="HELD {_ibtHeld = TESLAGUN}"];
111 [shape=box
,label="LEFT {_ibtLeft = BLINKER}"];
114 [shape=box
,label="LEFT {_ibtLeft = BLINKERUNSAFE}"];
116 [shape=box
,label="EQUIP {_ibtEquip = MAGSHIELD}"];
119 [shape=box
,label="EQUIP {_ibtEquip = POWERLEGS}"];
125 [shape=box
,label="HELD {_ibtHeld = FLATSHIELD}"];
135 [shape=box
,label="EQUIP {_ibtEquip = AUTODETECTOR ITEMDETECTOR}"];
138 [shape=box
,label="EQUIP {_ibtEquip = AUTODETECTOR WALLDETECTOR}"];
140 [shape=box
,label="EQUIP {_ibtEquip = AUTODETECTOR CREATUREDETECTOR}"];
142 [shape=box
,label="HELD {_ibtHeld = TORCH}"];
146 [shape=box
,label="EQUIP {_ibtEquip = HEADLAMP}"];
154 [shape=box
,label="HELD {_ibtHeld = BANGSTICK {_xNum = 2}}"];
}
subgraph 2 {
0 [shape=point];
4 [shape=point];
8 [shape=point];
10 [shape=point];
14 [shape=point];
18 [shape=point];
21 [shape=point];
24 [shape=point];
27 [shape=point];
30 [shape=point];
34 [shape=point];
37 [shape=point];
40 [shape=point];
43 [shape=point];
45 [shape=point];
48 [shape=point];
50 [shape=point];
52 [shape=point];
54 [shape=point];
56 [shape=point];
58 [shape=point];
60 [shape=point];
62 [shape=point];
64 [shape=point];
66 [shape=point];
69 [shape=point];
72 [shape=point];
73 [shape=point];
75 [shape=point];
77 [shape=point];
80 [shape=point];
82 [shape=point];
84 [shape=point];
88 [shape=point];
90 [shape=point];
92 [shape=point];
94 [shape=point];
96 [shape=point];
100 [shape=point];
102 [shape=point];
104 [shape=point];
106 [shape=point];
108 [shape=point];
110 [shape=point];
113 [shape=point];
115 [shape=point];
118 [shape=point];
121 [shape=point];
122 [shape=point];
123 [shape=point];
124 [shape=point];
126 [shape=point];
128 [shape=point];
131 [shape=point];
134 [shape=point];
137 [shape=point];
139 [shape=point];
141 [shape=point];
145 [shape=point];
147 [shape=point];
149 [shape=point];
151 [shape=point];
153 [shape=point];
155 [shape=point];
157 [shape=point];
159 [shape=point];
161 [shape=point];
163 [shape=point];
}
0 -> 1 [xlabel="",tailport=e];
2 -> 0 [xlabel=1
,arrowhead=onone
,headport=w];
3 -> 0 [xlabel=1
,arrowhead=onone
,headport=w];
4 -> 1 [xlabel="",tailport=e];
8 -> 1 [xlabel="",tailport=e];
10 -> 11 [xlabel="",tailport=e];
14 -> 15 [xlabel="",tailport=e];
16 -> 14 [xlabel=1
,arrowhead=onone
,headport=w];
16 -> 18 [xlabel=1
,arrowhead=onone
,headport=w];
16 -> 21 [xlabel=1
,arrowhead=onone
,headport=w];
16 -> 24 [xlabel=1
,arrowhead=onone
,headport=w];
16 -> 27 [xlabel=1
,arrowhead=onone
,headport=w];
16 -> 145 [xlabel=1
,arrowhead=onone
,headport=w];
18 -> 19 [xlabel="",tailport=e];
21 -> 22 [xlabel="",tailport=e];
24 -> 25 [xlabel="",tailport=e];
27 -> 28 [xlabel="",tailport=e];
30 -> 31 [xlabel="",tailport=e];
31 -> 34 [xlabel=1
,arrowhead=onone
,headport=w];
31 -> 45 [xlabel=1
,arrowhead=onone
,headport=w];
31 -> 56 [xlabel=1
,arrowhead=onone
,headport=w];
31 -> 58 [xlabel=1
,arrowhead=onone
,headport=w];
31 -> 58 [xlabel=1
,arrowhead=onone
,headport=w];
31 -> 58 [xlabel=1
,arrowhead=onone
,headport=w];
31 -> 153 [xlabel=1
,arrowhead=onone
,headport=w];
31 -> 159 [xlabel=1
,arrowhead=onone
,headport=w];
31 -> 161 [xlabel=1
,arrowhead=onone
,headport=w];
34 -> 35 [xlabel="",tailport=e];
35 -> 37 [xlabel=1
,arrowhead=onone
,headport=w];
37 -> 38 [xlabel="",tailport=e];
38 -> 40 [xlabel=1
,arrowhead=onone
,headport=w];
38 -> 43 [xlabel=1
,arrowhead=onone
,headport=w];
40 -> 41 [xlabel="",tailport=e];
43 -> 44 [xlabel="",tailport=e];
45 -> 46 [xlabel="",tailport=e];
46 -> 48 [xlabel=1
,arrowhead=onone
,headport=w];
48 -> 49 [xlabel="",tailport=e];
49 -> 157 [xlabel=1
,arrowhead=onone
,headport=w];
50 -> 51 [xlabel="",tailport=e];
51 -> 52 [xlabel=1
,arrowhead=onone
,headport=w];
52 -> 53 [xlabel="",tailport=e];
53 -> 54 [xlabel=1
,arrowhead=onone
,headport=w];
54 -> 55 [xlabel="",tailport=e];
55 -> 163 [xlabel=1
,arrowhead=onone
,headport=w];
56 -> 57 [xlabel="",tailport=e];
57 -> 60 [xlabel=1
,arrowhead=onone
,headport=w];
57 -> 72 [xlabel=1
,arrowhead=onone
,headport=w];
58 -> 59 [xlabel="",tailport=e];
59 -> 66 [xlabel=1
,arrowhead=onone
,headport=w];
59 -> 159 [xlabel=1
,arrowhead=onone
,headport=w];
60 -> 61 [xlabel="",tailport=e];
61 -> 62 [xlabel=1
,arrowhead=onone
,headport=w];
61 -> 64 [xlabel=1
,arrowhead=onone
,headport=w];
62 -> 63 [xlabel="",tailport=e];
64 -> 65 [xlabel="",tailport=e];
66 -> 67 [xlabel="",tailport=e];
67 -> 161 [xlabel=1
,arrowhead=onone
,headport=w];
69 -> 70 [xlabel="",tailport=e];
71 -> 69 [xlabel=1
,arrowhead=onone
,headport=w];
71 -> 73 [xlabel=1
,arrowhead=onone
,headport=w];
71 -> 75 [xlabel=1
,arrowhead=onone
,headport=w];
72 -> 71 [xlabel="",tailport=e];
73 -> 74 [xlabel="",tailport=e];
75 -> 76 [xlabel="",tailport=e];
77 -> 78 [xlabel="",tailport=e];
78 -> 80 [xlabel=1
,arrowhead=onone
,headport=w];
80 -> 81 [xlabel="",tailport=e];
81 -> 82 [xlabel=1
,arrowhead=onone
,headport=w];
84 -> 85 [xlabel="",tailport=e];
85 -> 88 [xlabel=1
,arrowhead=onone
,headport=w];
85 -> 90 [xlabel=1
,arrowhead=onone
,headport=w];
88 -> 89 [xlabel="",tailport=e];
90 -> 91 [xlabel="",tailport=e];
91 -> 92 [xlabel=1
,arrowhead=onone
,headport=w];
91 -> 94 [xlabel=1
,arrowhead=onone
,headport=w];
92 -> 93 [xlabel="",tailport=e];
94 -> 95 [xlabel="",tailport=e];
96 -> 97 [xlabel="",tailport=e];
97 -> 100 [xlabel=1
,arrowhead=onone
,headport=w];
97 -> 100 [xlabel=1
,arrowhead=onone
,headport=w];
97 -> 102 [xlabel=1
,arrowhead=onone
,headport=w];
97 -> 104 [xlabel=1
,arrowhead=onone
,headport=w];
97 -> 104 [xlabel=1
,arrowhead=onone
,headport=w];
97 -> 104 [xlabel=1
,arrowhead=onone
,headport=w];
100 -> 101 [xlabel=""
,tailport=e];
102 -> 103 [xlabel=""
,tailport=e];
103 -> 151 [xlabel=1
,arrowhead=onone
,headport=w];
104 -> 105 [xlabel=""
,tailport=e];
106 -> 107 [xlabel=""
,tailport=e];
107 -> 108 [xlabel=1
,arrowhead=onone
,headport=w];
108 -> 109 [xlabel=""
,tailport=e];
110 -> 111 [xlabel=""
,tailport=e];
111 -> 113 [xlabel=1
,arrowhead=onone
,headport=w];
113 -> 114 [xlabel=""
,tailport=e];
115 -> 116 [xlabel=""
,tailport=e];
118 -> 119 [xlabel=""
,tailport=e];
124 -> 125 [xlabel=""
,tailport=e];
134 -> 135 [xlabel=""
,tailport=e];
137 -> 138 [xlabel=""
,tailport=e];
139 -> 140 [xlabel=""
,tailport=e];
141 -> 142 [xlabel=""
,tailport=e];
142 -> 145 [xlabel=1
,arrowhead=onone
,headport=w];
145 -> 146 [xlabel=""
,tailport=e];
153 -> 154 [xlabel=""
,tailport=e];
154 -> 155 [xlabel=1
,arrowhead=onone
,headport=w];
}
+2663
View File
File diff suppressed because it is too large Load Diff
+143
View File
@@ -0,0 +1,143 @@
Seed: 7114951007332849727Layout with room names:
rezBox-0
|
autoDoor-1
|
rectPillars-2
|
autoDoor-3
|
Corridor-4
|
autoDoor-5
|
ELECautoRect-6
|
+- triggerDoorRoom-7
| |
| autoDoor-8
| |
| autoDoor-9
| |
| Corridor-10
| |
| autoDoor-11
| |
| 8gon-12
| |
| triggerDoorRoom-13
| |
| autoDoor-14
| |
| autoDoor-15
| |
| Corridor-16
| |
| autoRect-17
| |
| autoDoor-18
| |
| Corridor-19
| |
| autoDoor-20
| |
| 6gon-21
| |
| +- triggerDoorRoom-22
| | |
| | autoDoor-23
| | |
| | autoDoor-24
| | |
| | Corridor-25
| | |
| | autoDoor-26
| | |
| | warningTerm-8gon-27
| | |
| | triggerDoorRoom-28
| | |
| | autoDoor-29
| | |
| | autoDoor-30
| | |
| | Corridor-31
| | |
| | autoRect-32
| | |
| | autoDoor-33
| | |
| | Corridor-34
| | |
| | autoDoor-35
| | |
| | Corridor-36
| | |
| | 8gon-37
| | |
| | triggerDoorRoom-38
| | |
| | autoDoor-39
| | |
| | autoDoor-40
| | |
| | Corridor-41
| | |
| | tanksRoom-42
| | |
| | autoDoor-43
| | |
| | Corridor-44
| | |
| | autoDoor-45
| | |
| | autoRect-46
| | |
| | +- autoDoor-47
| | | |
| | | autoDoor-48
| | | |
| | | Corridor-49
| | | |
| | | autoRect-50
| | | |
| | | defaultRoom-51
| | | |
| | | autoRect-52
| | | |
| | | defaultRoom-53
| | | |
| | | autoRect-54
| | | |
| | | autoDoor-55
| | | |
| | | Corridor-56
| | | |
| | | autoDoor-57
| | | |
| | | 8gon-58
| | | |
| | | triggerDoorRoom-59
| | | |
| | | autoDoor-60
| | | |
| | | autoDoor-61
| | | |
| | | Corridor-62
| | | |
| | | defaultRoom-63
| | |
| | autoDoor-64
| |
| autoDoor-65
| |
| Corridor-66
| |
| autoRect-67
|
autoDoor-68
|
Corridor-69
|
autoRect-70
+4
View File
@@ -0,0 +1,4 @@
Generating level with seed 7114951007332849727
After 1 attempt(s), Successful generation of level with seed 7114951007332849727
71 rooms in total
+1139
View File
File diff suppressed because it is too large Load Diff
+265
View File
@@ -0,0 +1,265 @@
Seed: 7114951007332849727
0:startThenWeaponRoom
|
1:corDoor
|
2:PassthroughLockKeyLists-HELD {_ibtHeld = SPARKGUN}
|
3:corDoor
|
4:lasSensorTurretTest
|
5:corDoor
|
6:SingleRoom
|
7:corDoor
|
8:PassthroughLockKeyLists-HELD {_ibtHeld = KEYCARD 0}
|
9:corDoor
|
10:warningRooms
|
11:corDoor
|
12:chaseCrit+armourChaseCrit rectRoom
|
13:corDoor
|
14:healthTest
|
15:corDoor
|
16:empty tanksRoom
|
17:corDoor
|
18:PassthroughLockKeyLists-HELD {_ibtHeld = MINIGUNX {_xNum = 3}}
|
19:corDoor
|
20:shootingRange
|
21:corDoor
|
22:lasSensorTurretTest
|
23:corDoor
|
24:randomFourCornerRoom
0:0:startThenWeaponRoom
|
0:1:weaponBetweenPillars_BANGSTICK4
0:0:0:rezBox'
0:0:0:0:rezBox
|
0:0:0:1:autoDoor
0:1:0:rectPillars
1:0:corDoor
1:0:0:autoDoor
|
1:0:1:Corridor
2:0:PassthroughLockKeyLists-HELD {_ibtHeld = SPARKGUN}
2:0:0:RassThroughLockKeyLists
|
2:0:1:roomsContaining chaseCritchaseCritTRANSFORMERCANCAN
2:0:0:0:sensorRoomRunPast
2:0:0:0:0:autoDoor
|
2:0:0:0:1:ELECautoRect
|
+- 2:0:0:0:2:triggerDoorRoom
| |
| 2:0:0:0:3:autoDoor
|
2:0:0:0:4:autoDoor
|
2:0:0:0:5:Corridor
2:0:1:0:autoRect
3:0:corDoor
3:0:0:autoDoor
|
3:0:1:Corridor
4:0:lasSensorTurretTest
4:0:0:autoDoor
|
4:0:1:8gon
|
4:0:2:triggerDoorRoom
|
4:0:3:autoDoor
5:0:corDoor
5:0:0:autoDoor
|
5:0:1:Corridor
6:0:SingleRoom
6:0:0:autoRect
7:0:corDoor
7:0:0:autoDoor
|
7:0:1:Corridor
8:0:PassthroughLockKeyLists-HELD {_ibtHeld = KEYCARD 0}
8:0:0:RassThroughLockKeyLists
|
8:0:1:roomsContaining chaseCritchaseCritchaseCritKEYCARD 0
8:0:0:0:keyCardRoomRunPast
8:0:0:0:0:autoDoor
|
8:0:0:0:1:6gon
|
+- 8:0:0:0:2:triggerDoorRoom
| |
| 8:0:0:0:3:autoDoor
|
8:0:0:0:4:autoDoor
|
8:0:0:0:5:Corridor
8:0:1:0:autoRect
9:0:corDoor
9:0:0:autoDoor
|
9:0:1:Corridor
10:0:warningRooms
10:0:0:autoDoor
|
10:0:1:warningTerm-8gon
|
10:0:2:triggerDoorRoom
|
10:0:3:autoDoor
11:0:corDoor
11:0:0:autoDoor
|
11:0:1:Corridor
12:0:chaseCrit+armourChaseCrit rectRoom
12:0:0:autoRect
13:0:corDoor
13:0:0:autoDoor
|
13:0:1:Corridor
14:0:healthTest
14:0:0:autoDoor
|
14:0:1:Corridor
|
14:0:2:8gon
|
14:0:3:triggerDoorRoom
|
14:0:4:autoDoor
15:0:corDoor
15:0:0:autoDoor
|
15:0:1:Corridor
16:0:empty tanksRoom
16:0:0:tanksRoom
17:0:corDoor
17:0:0:autoDoor
|
17:0:1:Corridor
18:0:PassthroughLockKeyLists-HELD {_ibtHeld = MINIGUNX {_xNum = 3}}
18:0:0:RassThroughLockKeyLists
|
18:0:1:roomsContaining chaseCritchaseCritchaseCritMOTORHARDWAREPIPEPIPEPIPEPIPEPIPEPIPE
18:0:0:0:slowDoorRoomRunPast
18:0:0:0:0:autoDoor
|
18:0:0:0:1:autoRect
|
+- 18:0:0:0:2:autoDoor
|
18:0:0:0:3:autoDoor
18:0:1:0:autoRect
19:0:corDoor
19:0:0:autoDoor
|
19:0:1:Corridor
20:0:shootingRange
20:0:0:autoRect
|
20:0:1:defaultRoom
|
20:0:2:autoRect
|
20:0:3:defaultRoom
|
20:0:4:autoRect
21:0:corDoor
21:0:0:autoDoor
|
21:0:1:Corridor
22:0:lasSensorTurretTest
22:0:0:autoDoor
|
22:0:1:8gon
|
22:0:2:triggerDoorRoom
|
22:0:3:autoDoor
23:0:corDoor
23:0:0:autoDoor
|
23:0:1:Corridor
24:0:defaultRoom
Executable
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
stack exec -- hp2ps -e8in -c -M dodge.hp
ps2pdf dodge.ps
rm dodge.ps
okular dodge.pdf
+1
View File
File diff suppressed because one or more lines are too long
+496124
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
7114951007332849727
+9 -2
View File
@@ -4,8 +4,10 @@ import TreeHelp
import Dodge.Data.World
import Dodge.HeldScroll
import qualified IntMapHelp as IM
import qualified Data.Map.Strict as M
import Control.Lens
import Control.Monad
import Data.Maybe
you :: World -> Creature
you w = w ^?! cWorld . lWorld . creatures . ix 0
@@ -35,8 +37,13 @@ yourScopeInvID w = do
yourInv :: World -> IM.IntMap Item
yourInv = _crInv . you
attachmentTree :: Creature -> [Tree Int]
attachmentTree cr = []
attachmentTree :: Creature -> M.Map AttachType Int
attachmentTree cr = fromMaybe mempty $ do
i <- cr ^? crManipulation . manObject . inInventory . ispItem
return $ upDownAttachments cr i i mempty
upDownAttachments :: Creature -> Int -> Int -> M.Map AttachType Int -> M.Map AttachType Int
upDownAttachments cr i j s = s
--yourInvSel :: World -> Int
--yourInvSel = crSel . you
+1 -1
View File
@@ -166,7 +166,7 @@ moduleCombinations =
, homingLaunchers ++ bulletWeapons
,
[ amod [cr MICROCHIP, cr HEATSENSOR] (TARGET TargetRBCreature)
, amod [cr MICROCHIP, cr LIGHTSENSOR] (TARGET TargetLaser)
, amod [cr MICROCHIP, cr LIGHTSENSOR] (TARGET TARGETLASER)
, amod [cr MICROCHIP, cr SOUNDSENSOR] (TARGET TargetRBPress)
]
)
+2
View File
@@ -22,6 +22,7 @@ module Dodge.Creature (
module Dodge.Creature.YourControl,
) where
import Dodge.Item.Scope
import Control.Lens
import Dodge.Creature.Action
import Dodge.Creature.ArmourChase
@@ -215,6 +216,7 @@ inventoryX c = case c of
]
'L' -> [scrollWatch]
'M' -> stackedInventory
'N' -> [zoomScope,targetingScope TARGETLASER, sniperRifle]
'T' -> testInventory
_ -> []
+8 -3
View File
@@ -278,10 +278,15 @@ crGetTargeting :: Creature -> Maybe TargetType
crGetTargeting cr = do
i <- cr ^? crManipulation . manObject . inInventory . ispItem
itm <- cr ^? crInv . ix i
--(cr ^? crInv . ix (i+1) . itUse . equipTargeting . _Just)
itm ^? itType . iyModules . ix ModTarget . imtTargetType
<|> (guard (canAttachTargetingBelow itm)
>> cr ^? crInv . ix (i+1) . itUse . equipTargeting . _Just)
<|> do
tt <- cr ^? crInv . ix (i-1) . itType . iyBase . ibtAttach . ibtAttachTarget
guard (canAttachTargeting tt itm)
return tt
<|> do
tt <- cr ^? crInv . ix (i+1) . itUse . equipTargeting . _Just
guard (canAttachTargeting tt itm)
return tt
weaponReloadSounds :: Creature -> World -> World
weaponReloadSounds cr w = case cr ^? crManipulation . manObject . inInventory . iselAction of
+5 -1
View File
@@ -89,7 +89,7 @@ data ItemBaseType
| EQUIP {_ibtEquip :: EquipItemType}
| CONSUMABLE {_ibtConsumable :: ConsumableItemType}
| CRAFT CraftType
| ATTACH AttachType
| ATTACH {_ibtAttach :: AttachType}
deriving (Eq, Ord, Show, Read)
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
@@ -97,6 +97,9 @@ data ItemBaseType
data AttachType
= SCROLLATTACH ScrollAttachType
| AMMOATTACH AmmoAttachType
| TARGETATTACH {_ibtAttachTarget :: TargetType}
| BULPAYLOADATTACH
| BULTRAJECTORYATTACH
deriving (Eq, Ord, Show, Read)
data ScrollAttachType
@@ -239,6 +242,7 @@ makeLenses ''ItemType
makeLenses ''ItemBaseType
makeLenses ''HeldItemType
makeLenses ''ItemModuleType
makeLenses ''AttachType
deriveJSON defaultOptions ''Stack
deriveJSON defaultOptions ''CraftType
deriveJSON defaultOptions ''ConsumableItemType
+1 -1
View File
@@ -9,7 +9,7 @@ import Data.Aeson
import Data.Aeson.TH
data TargetType
= TargetLaser
= TARGETLASER
| TargetRBPress
| TargetRBLine
| TargetRBCreature
+1
View File
@@ -59,6 +59,7 @@ data ItemUse
data AttachParams
= ScrollAttachParams {_scrollAttachParams :: ScrollAttachParams}
| AmmoAttachParams
| TargetAttachParams
data ScrollAttachParams
= ZoomScrollParams
+1 -1
View File
@@ -63,7 +63,7 @@ parseItem (x : xs) =
<|> (readMaybe ("EQUIP {_ibtEquip=" ++ x ++ "}") <&> (,parseNum xs))
<|> (readMaybe ("LEFT {_ibtLEFT=" ++ x ++ "}") <&> (,parseNum xs))
<|> (readMaybe ("HELD (" ++ x ++ " {_xNum=" ++ show (parseNum xs) ++ "}") <&> (,1))
<|> (readMaybe ("ATTACH " ++ x) <&> (,parseNum xs))
<|> (readMaybe ("ATTACH (" ++ x ++ ")") <&> (,parseNum xs))
<|> (readMaybe ("CONSUMABLE {_ibtConsumable=" ++ x ++ "}") <&> (,parseNum xs))
<|> (readMaybe ("AMMO {_ibtAmmo=" ++ x ++ "}") <&> (,parseNum xs))
<|> parseItem (xs & ix 0 .++~ (x ++ " "))
+2
View File
@@ -14,6 +14,7 @@ import Dodge.Item.Craftable
import Dodge.Item.Equipment
import Dodge.Item.Held
import Dodge.Item.Weapon
import Dodge.Item.Scope
itemFromBase :: ItemBaseType -> Item
itemFromBase ibt = case ibt of
@@ -30,6 +31,7 @@ itemFromAttachType at = case at of
AMMOATTACH DRUMMAG -> drumMag
AMMOATTACH TINMAG -> tinMag
AMMOATTACH BULLETBELT -> beltMag
TARGETATTACH tt -> targetingScope tt
itemFromConsumableType :: ConsumableItemType -> Item
-5
View File
@@ -14,8 +14,3 @@ drumMag = tinMag & itType . iyBase .~ ATTACH (AMMOATTACH DRUMMAG)
beltMag :: Item
beltMag = tinMag & itType . iyBase .~ ATTACH (AMMOATTACH BULLETBELT)
zoomScope :: Item
zoomScope = tinMag
& itType . iyBase .~ ATTACH (SCROLLATTACH ZOOMSCOPE)
& itUse .~ AttachUse (ScrollAttachParams (ZoomScrollParams {_opticPos = 0, _opticZoom = 1, _opticDefaultZoom = 0.5}))
+19 -24
View File
@@ -1,7 +1,7 @@
module Dodge.Item.Display (
--itemDisplay,
itemDisplayOffset,
canAttachTargetingBelow,
canAttachTargeting,
-- selectedItemDisplay,
itemString,
itemBaseName,
@@ -20,34 +20,29 @@ import Padding
itemDisplayOffset :: Creature -> Item -> (Int, [String])
itemDisplayOffset cr itm = case itm ^. itType . iyBase of
EQUIP (TARGETINGHAT tt)
| targetItemCanAttachAbove cr itm ->
( -1
, leftPad 15 ' ' (targetingTypeString tt) :
(itemDisplay cr itm & ix 0 %~ (\s -> itemDisplayPad s (replicate (length (targetingTypeString tt)) '^')))
)
EQUIP (TARGETINGHAT tt) ->
(0, itemDisplay cr itm & ix 0 %~ (\s -> itemDisplayPad s (targetingTypeString tt)))
-- EQUIP (TARGETINGHAT tt)
-- | targetItemCanAttachAbove cr itm ->
-- ( -1
-- , leftPad 15 ' ' (targetingTypeString tt) :
-- (itemDisplay cr itm & ix 0 %~ (\s -> itemDisplayPad s (replicate (length (targetingTypeString tt)) '^')))
-- )
-- EQUIP (TARGETINGHAT tt) ->
-- (0, itemDisplay cr itm & ix 0 %~ (\s -> itemDisplayPad s (targetingTypeString tt)))
_ -> (0, itemDisplay cr itm)
targetItemCanAttachAbove :: Creature -> Item -> Bool
targetItemCanAttachAbove cr itm = fromMaybe False $ do
i <- itm ^? itLocation . ipInvID
itm' <- cr ^? crInv . ix (i - 1)
return $ canAttachTargetingBelow itm'
canAttachTargetingBelow :: Item -> Bool
canAttachTargetingBelow itm =
canAttachTargeting :: TargetType -> Item -> Bool
canAttachTargeting TARGETLASER _ = True
canAttachTargeting _ itm =
isJust (itm ^? itType . iyModules . ix ModBulletTrajectory . imtBulletTrajectoryType)
|| Just LAUNCHHOME == (itm ^? itType . iyModules . ix ModLauncherHoming)
targetingTypeString :: TargetType -> String
targetingTypeString tt = case tt of
TargetLaser -> "LASER"
TargetRBPress -> "POS"
TargetRBLine -> ""
TargetRBCreature -> "LIFEFORM"
TargetCursor -> "CURSOR"
--targetingTypeString :: TargetType -> String
--targetingTypeString tt = case tt of
-- TARGETLASER -> "LASER"
-- TargetRBPress -> "POS"
-- TargetRBLine -> ""
-- TargetRBCreature -> "LIFEFORM"
-- TargetCursor -> "CURSOR"
itemDisplay :: Creature -> Item -> [String]
itemDisplay cr itm =
-3
View File
@@ -68,9 +68,6 @@ sniperRifle =
& itType . iyBase .~ HELD SNIPERRIFLE
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 0.5, _izMin = 0.5,_izFac = 1}
-- & itUse . heldScroll .~ HeldScrollZoom -- zoomLongGun
-- & itType . iyModules . at ModTarget ?~ TARGET TargetLaser
-- & itUse . useTargeting ?~ TargetLaser
machineGun :: Item
machineGun =
+1 -1
View File
@@ -142,7 +142,7 @@ equipInfo eit = case eit of
targetingInfo :: TargetType -> String
targetingInfo tt = case tt of
TargetLaser -> "creates a laser, the end of which becomes the target."
TARGETLASER -> "creates a laser, the end of which becomes the target."
TargetRBPress -> "creates a fixed target."
TargetRBLine -> "creates a line target."
TargetRBCreature -> "targets a creature."
+20
View File
@@ -0,0 +1,20 @@
module Dodge.Item.Scope (
zoomScope,
targetingScope,
) where
import Control.Lens
import Dodge.Data.Item
import Dodge.Default.Item
zoomScope :: Item
zoomScope =
defaultHeldItem
& itType . iyBase .~ ATTACH (SCROLLATTACH ZOOMSCOPE)
& itUse .~ AttachUse (ScrollAttachParams (ZoomScrollParams{_opticPos = 0, _opticZoom = 1, _opticDefaultZoom = 0.5}))
targetingScope :: TargetType -> Item
targetingScope tt =
defaultHeldItem
& itType . iyBase .~ ATTACH (TARGETATTACH tt)
& itUse .~ AttachUse TargetAttachParams
+1 -1
View File
@@ -28,7 +28,7 @@ moduleName imt = case imt of
BULBODY thebody -> Just $ "+" ++ displayBulletBody thebody
BULTRAJ thetraj -> Just $ "+" ++ displayBulletTraj thetraj
TARGET TargetRBCreature -> Just "+CREATURETARGETING"
TARGET TargetLaser -> Just "+LASERTARGETING"
TARGET TARGETLASER -> Just "+LASERTARGETING"
TARGET TargetRBPress -> Just "+POSTIONALTARGETING"
TARGET TargetCursor -> Just "+CURSORTARGETING"
TARGET TargetRBLine -> Just "+LINETARGETING"
+1 -1
View File
@@ -17,7 +17,7 @@ tankSquareDec ::
Color ->
Color ->
Placement
tankSquareDec dec = tankShape (square 20) (dec 20 20 31)
tankSquareDec dec = tankShape (reverse $ square 20) (dec 20 20 31)
tankShape :: [Point2] -> (Color -> Color -> Shape) -> Color -> Color -> Placement
tankShape baseshape facade col col' = sps0 $ decoratedBlock (BlShConst $ facade col col') Metal col 31 baseshape
+2 -2
View File
@@ -19,7 +19,7 @@ import qualified SDL
updateTargeting :: Maybe TargetType -> Creature -> World -> World
updateTargeting tu = case tu of
Nothing -> clearTargeting
Just TargetLaser -> targetLaserUpdate'
Just TARGETLASER -> targetLaserUpdate'
Just TargetRBPress -> upCT (flip targetRBPressUpdate . _crTargeting)
Just TargetRBLine -> upCT (flip targetRBPressUpdate . _crTargeting)
Just TargetRBCreature -> upCT targetRBCreatureUp
@@ -90,7 +90,7 @@ targetLaserUpdate cr w t
, t
& ctPos .~ fmap fst mp
& ctActive .~ True
& ctType ?~ TargetLaser
& ctType ?~ TARGETLASER
)
| otherwise =
( w
+1 -1
View File
@@ -15,7 +15,7 @@ drawTargeting :: TargetType -> Creature -> Configuration -> World -> Picture
drawTargeting td = case td of
TargetRBCreature -> targetRBCreatureDraw
TargetRBLine -> targetDistanceDraw
TargetLaser -> targetSimpleDraw
TARGETLASER -> targetSimpleDraw
TargetRBPress -> targetSimpleDraw
TargetCursor -> targetSimpleDraw
+6 -5
View File
@@ -19,11 +19,12 @@ import Dodge.Data.Universe
--import qualified Data.Map.Strict as M
--import qualified IntMapHelp as IM
testStringInit :: Universe -> [String]
testStringInit u = [fromMaybe "" $ do
cr <- u ^? uvWorld . cWorld . lWorld . creatures . ix 0
i <- cr ^? crManipulation . manObject . inInventory . ispItem
fmap (show . canAttachTargetingBelow) (cr ^? crInv . ix i)
]
testStringInit _ = []
-- [fromMaybe "" $ do
-- cr <- u ^? uvWorld . cWorld . lWorld . creatures . ix 0
-- i <- cr ^? crManipulation . manObject . inInventory . ispItem
-- fmap (show . canAttachTargeting) (cr ^? crInv . ix i)
-- ]
-- getPrettyShort (u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crHotkeys)
+8044
View File
File diff suppressed because it is too large Load Diff
+734
View File
@@ -0,0 +1,734 @@
{-# LANGUAGE TupleSections #-}
{- |
Weapon effects when pulling the trigger.
-}
module Dodge.Item.Weapon.TriggerType (
useAmmoAmount,
useAllAmmo,
useAmmoUpTo,
lockInvFor,
withMuzFlareI,
withMuzPos,
withMuzPosShift,
crAtMuzPos,
withOldDir,
trigDoAlso,
trigDoAlso',
withTempLight,
withItem,
withItemUpdate,
withItemUpdate',
ammoUseCheck,
rateIncAB,
torqueBefore,
torqueBeforeAtLeast,
withTorqueAfter,
torqueSideEffect,
withRandomItemParams,
withRandomItemUpdate,
withSoundStart,
withSoundItemChoiceStart,
withSoundContinue,
withSoundForI,
withSoundForVol,
withSmoke,
withThickSmokeI,
withThinSmokeI,
withPositionOffset,
withPositionWallCheck,
withPosDirWallCheck,
withRandomOffset,
withRandomDirI,
withRecoil,
afterRecoil,
withSidePushAfterI,
withSidePushI,
withWarmUp,
spreadNumI,
spreadLoaded,
repeatOnFrames,
sideEffectOnFrame,
duplicateItem,
duplicateLoadedBarrels,
duplicateLoaded,
duplicateOffsets,
duplicateOffsetsV2,
duplicateOffsetsFocus,
hammerCheckI,
hammerCheckL,
shootL,
useTimeCheck,
ammoCheckI,
applyInaccuracy,
modClock,
ammoHammerCheck,
) where
import Data.Foldable
import Data.Maybe
import Dodge.Base
import Dodge.Creature.HandPos
import Dodge.Creature.Test
import Dodge.Data.World
import Dodge.Inventory.Lock
import Dodge.LightSource
import Dodge.Reloading
import Dodge.SoundLogic
import Dodge.WorldEvent
import Geometry
import LensHelp
import RandomHelp
import Sound.Data
type ChainEffect =
(Item -> Creature -> World -> World) ->
Item ->
Creature ->
World ->
World
lockInvFor :: Int -> ChainEffect
lockInvFor i f it cr =
f it cr . (cWorld . lWorld . delayedEvents .:~ (i, UnlockInv (_crID cr)))
. lockInv (_crID cr)
trigDoAlso' ::
(Item -> Item) ->
(Creature -> Creature) ->
(Item -> Creature -> World -> World) ->
ChainEffect
trigDoAlso' fit fcr f g itm cr = g itm cr . f (fit itm) (fcr cr)
-- Note that this uses the "base" creature and item values
trigDoAlso ::
(Item -> Creature -> World -> World) ->
ChainEffect
trigDoAlso afterEff eff item cr = afterEff item cr . eff item cr
withSmoke :: Int -> Point4 -> Float -> Int -> Float -> ChainEffect
withSmoke num col rad t alt eff item cr w =
eff item cr $
foldl' (flip $ smokeCloudAt col rad t alt . (+.+.+ pos) . (* 8)) w ps
where
dir = _crDir cr
pos = addZ 0 $ _crPos cr +.+ (_crRad cr + 15) *.* unitVectorAtAngle dir
ps = replicateM num randOnUnitSphere & evalState $ _randGen w
withThinSmokeI :: ChainEffect
withThinSmokeI eff item cr w =
eff item cr $
foldl' (flip $ makeThinSmokeAt . (+.+.+ pos) . (* 8)) w ps
where
dir = _crDir cr
pos = addZ 0 $ _crPos cr +.+ (_crRad cr + 0.5) *.* unitVectorAtAngle dir
ps = replicateM 5 randOnUnitSphere & evalState $ _randGen w
withThickSmokeI :: ChainEffect
withThickSmokeI eff item cr w =
eff item cr $
foldl' (flip $ makeThickSmokeAt . (+.+.+ pos) . (* 8)) w ps
where
dir = _crDir cr
pos = addZ 0 $ _crPos cr +.+ (_crRad cr + 15) *.* unitVectorAtAngle dir
ps = replicateM 20 randOnUnitSphere & evalState $ _randGen w
-- TODO create a trigger that does different things on first and continued
-- fire.
ammoCheckI :: ChainEffect
ammoCheckI eff itm cr w
| _laLoaded ic <= 0 || not (_laPrimed ic) = w
| otherwise = eff itm cr $ w & cWorld . lWorld . creatures . ix (_crID cr) %~ crCancelReloading
where
ic = _heldConsumption $ _itUse itm
-- combined ammo and hammer check: want to be able to auto-reload even if the
-- hammer is down?
ammoHammerCheck :: ChainEffect
ammoHammerCheck eff it cr w
| _laLoaded ic <= 0 || not (_laPrimed ic) = w -- fromMaybe w (startReloadingWeapon cr w)
| otherwise = case it ^? itUse . heldHammer of
Just HammerUp -> eff it cr $ w & cWorld . lWorld . creatures . ix (_crID cr) %~ crCancelReloading
_ -> w
where
ic = _heldConsumption $ _itUse it
itUseCharge :: Int -> Item -> Item
itUseCharge x = itUse . leftConsumption . arLoaded %~ (max 0 . subtract x)
itUseAmmo :: Int -> Item -> Item
itUseAmmo x = itUse . heldConsumption . laLoaded %~ (max 0 . subtract x)
{- | Fires at an increasing rate.
Has different effect after first fire.
Applies ammo check and use cooldown check.
-}
rateIncAB ::
-- | Extra effect on first fire
ChainEffect ->
-- | Extra effect on continued fire
ChainEffect ->
ChainEffect
rateIncAB exeffFirst exeffCont eff item cr w
| repeatFire =
w
& pointItem
%~ ( (itUse . heldDelay . rateMax .~ max fastRate (currentRate - 1))
. itUseAmmo 1
. (itUse . heldDelay . rateTime .~ currentRate)
)
& exeffCont eff item cr
| firstFire =
w
& pointItem
%~ ( (itUse . heldDelay . rateMax .~ startRate - 1)
. itUseAmmo 1
. (itUse . heldDelay . rateTime .~ startRate)
)
& exeffFirst eff item cr
| otherwise = w
where
fastRate = _rateMinMax . _heldDelay $ _itUse item
startRate = _rateMaxMax . _heldDelay $ _itUse item
cid = _crID cr
itRef = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change
pointItem = cWorld . lWorld . creatures . ix cid . crInv . ix itRef
currentRate = _rateMax (_heldDelay (_itUse item))
repeatFire = crWeaponReady cr && _rateTime (_heldDelay (_itUse item)) == 1
firstFire = crWeaponReady cr && _rateTime (_heldDelay (_itUse item)) == 0
-- | Apply effect after a warm up.
-- note this is quite unsafe, requires the item to have the correct delay type
withWarmUp ::
-- | warm up sound id
SoundID ->
ChainEffect
withWarmUp soundID f item cr w
| curWarmUp < maxWarmUp && crWeaponReady cr =
w
& pointerToItem . itUse . heldDelay . warmTime +~ 2
& soundContinue (CrWeaponSound cid 0) (_crPos cr) soundID (Just 2)
| otherwise =
w
& pointerToItem . itUse . heldDelay . warmTime .~ maxWarmUp
& f item cr
where
cid = _crID cr
itRef = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change
pointerToItem = cWorld . lWorld . creatures . ix cid . crInv . ix itRef
curWarmUp = _warmTime . _heldDelay $ _itUse item
maxWarmUp = _warmMax . _heldDelay $ _itUse item
withSoundItemChoiceStart ::
(Item -> SoundID) ->
ChainEffect
withSoundItemChoiceStart soundf f it cr =
soundMultiFrom
[CrWeaponSound cid 0, CrWeaponSound cid 1, CrWeaponSound cid 2]
(_crPos cr)
(soundf it)
Nothing
. f it cr
where
cid = _crID cr
{- | Adds a sound to a creature based world effect.
The sound is emitted from the creature's position.
-}
withSoundStart ::
-- | Sound id
SoundID ->
ChainEffect
withSoundStart soundid f item cr =
soundMultiFrom [CrWeaponSound cid 0, CrWeaponSound cid 1, CrWeaponSound cid 2] (_crPos cr) soundid Nothing
. f item cr
where
cid = _crID cr
{- | Adds a sound to a creature based world effect.
The sound is emitted from the creature's position.
-}
withSoundContinue ::
-- | Sound id
SoundID ->
ChainEffect
withSoundContinue soundid f item cr =
soundContinue (CrWeaponSound cid 0) (_crPos cr) soundid Nothing
. f item cr
where
cid = _crID cr
{- | Adds a sound to a creature based world effect.
The sound is emitted from the creature's position.
-}
withSoundForI ::
-- | Sound id
SoundID ->
-- | Frames to play
Int ->
ChainEffect
withSoundForI soundid playTime f item cr =
soundContinue (CrWeaponSound (_crID cr) 0) (_crPos cr) soundid (Just playTime)
. f item cr
{- | Adds a sound to a creature based world effect.
The sound is emitted from the creature's position.
-}
withSoundForVol ::
-- | volume
Float ->
-- | Sound id
SoundID ->
-- | Frames to play
Int ->
ChainEffect
withSoundForVol vol soundid playTime f item cr =
soundContinueVol vol (CrWeaponSound (_crID cr) 0) (_crPos cr) soundid (Just playTime)
. f item cr
afterRecoil ::
-- | Recoil amount
Float ->
ChainEffect
afterRecoil recoilAmount eff item cr = eff item (pushback cr) . over (cWorld . lWorld . creatures . ix cid) pushback
where
cid = _crID cr
pushback = over crPos (+.+ rotateV (_crDir cr) (V2 ((- recoilAmount) / _crMass cr) 0))
withRecoil :: ChainEffect
withRecoil eff it cr = eff it cr . over (cWorld . lWorld . creatures . ix cid) pushback
where
cid = _crID cr
recoilAmount = fromMaybe 0 $ it ^? itParams . recoil
pushback = over crPos (+.+ rotateV (_crDir cr) (V2 ((- recoilAmount) / _crMass cr) 0))
{- | Pushes a creature sideways by a random amount.
Applied before the underlying effect.
-}
withSidePushI ::
-- | Maximal possible side push amount
Float ->
ChainEffect
withSidePushI maxSide eff item cr w =
eff item (push cr) $
w
& cWorld . lWorld . creatures . ix cid %~ push
& randGen .~ g
where
cid = _crID cr
push = over crPos (+.+ rotateV (_crDir cr) (V2 0 (pushAmount / _crMass cr)))
(pushAmount, g) = randomR (- maxSide, maxSide) $ _randGen w
-- consider unifying the pushes using a direction vector
{- | Pushes a creature sideways by a random amount.
Applied after the underlying effect.
-}
withSidePushAfterI ::
-- | Maximal possible side push amount
Float ->
ChainEffect
withSidePushAfterI maxSide eff item cr w =
over (cWorld . lWorld . creatures . ix cid) push . eff item cr $
w
& randGen .~ g
where
cid = _crID cr
push = over crPos (+.+ rotateV (_crDir cr) (V2 0 (pushAmount / _crMass cr)))
(pushAmount, g) = randomR (- maxSide, maxSide) $ _randGen w
useAllAmmo :: ChainEffect
useAllAmmo eff item cr =
eff item cr
. (cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix itRef . itUse . heldConsumption . laLoaded .~ 0)
where
itRef = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change
useAmmoUpTo :: Int -> ChainEffect
useAmmoUpTo amAmount eff item cr =
eff item cr
. ( cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix itRef . itUse . heldConsumption . laLoaded
%~ (max 0 . subtract amAmount)
)
where
itRef = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change
useAmmoAmount :: Int -> ChainEffect
useAmmoAmount amAmount eff item cr =
eff item cr
. (cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix itRef . itUse . heldConsumption . laLoaded -~ amAmount)
where
itRef = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change
{- |
Applies a world effect after an item use cooldown check.
-}
useTimeCheck :: ChainEffect
useTimeCheck f item cr w = case item ^? itUse . heldDelay . rateTime of
Just 0 -> f item cr $ setUseTime w
_ -> w
where
cid = _crID cr
setUseTime = cWorld . lWorld . creatures . ix cid . crInv . ix itRef . itUse . heldDelay . rateTime +~ userate
itRef = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change
userate = fromMaybe 0 $ item ^? itUse . heldDelay . rateMax
-- | Applies a world effect after a hammer position check.
hammerCheckI :: ChainEffect
hammerCheckI f it cr w = case it ^? itUse . heldHammer of
Just HammerUp
| _laPrimed (_heldConsumption (_itUse it)) ->
f it cr w
_ -> w
-- | Applies a world effect after an ammo check.
-- this should be made "safe" incase there is no _rateTime
ammoUseCheck :: ChainEffect
ammoUseCheck f item cr w
| fireCondition =
f item cr w & pointerToItem
%~ ( itUseAmmo 1
. (itUse . heldDelay . rateTime .~ _rateMax (_heldDelay (_itUse item)))
)
-- | reloadCondition = fromMaybe w $ startReloadingWeapon cr w
| otherwise = w
where
cid = _crID cr
itRef = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change
pointerToItem = cWorld . lWorld . creatures . ix cid . crInv . ix itRef
fireCondition =
crWeaponReady cr
&& _rateTime (_heldDelay (_itUse item)) == 0
&& _laLoaded (_heldConsumption (_itUse item)) > 0
-- reloadCondition = _laLoaded (_itConsumption item) == 0
{- | Applies a world effect after a hammer position check.
Arbitrary inventory position.
-}
hammerCheckL ::
-- | Underlying effect
(Item -> Creature -> World -> World) ->
Item ->
Creature ->
World ->
World
hammerCheckL f itm cr w = case itm ^? itUse . leftHammer of
Just HammerUp -> f itm cr w
_ -> w
{- | Applies a world effect after an ammo check.
Arbitrary inventory position -- cannot be replaced with ammoUseCheck.
-}
shootL ::
-- | Underlying effect
(Item -> Creature -> World -> World) ->
Item ->
Creature ->
World ->
World
shootL f item cr w
| fireCondition =
f item cr w & pointerToItem
%~ ( itUseCharge 1
. (itUse . leftDelay . rateTime .~ _rateMax (_leftDelay (_itUse item)))
)
-- | reloadCondition = fromMaybe w $ startReloadingWeapon cr w
| otherwise = w
where
cid = _crID cr
invid = _ipInvID $ _itLocation item
pointerToItem = cWorld . lWorld . creatures . ix cid . crInv . ix invid
fireCondition =
_rateTime (_leftDelay (_itUse item)) == 0
&& _arLoaded (_leftConsumption (_itUse item)) > 0
-- reloadCondition = _laLoaded (_itConsumption item) == 0
withItem :: (Item -> ChainEffect) -> ChainEffect
withItem g f it = g it f it
-- not ideal
withItemUpdate' :: (Item -> Item) -> ChainEffect
withItemUpdate' up f it cr = f (up it) cr . (cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix itRef %~ up)
where
itRef = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change
withItemUpdate :: (Item -> Item) -> (Item -> ChainEffect) -> ChainEffect
withItemUpdate up g f it cr = g it f it cr . (cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix itRef %~ up)
where
itRef = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change
withTempLight :: Int -> Float -> V3 Float -> ChainEffect
withTempLight time rad col eff item cr =
eff item cr
. over (cWorld . lWorld . tempLightSources) (theTLS :)
where
theTLS = tlsTimeRadColPos time rad col (V3 x y 10)
V2 x y = _crPos cr +.+ 15 *.* unitVectorAtAngle (_crDir cr)
modClock :: Int -> ChainEffect -> ChainEffect
modClock n chainEff eff it cr w
| (w ^. cWorld . lWorld . lClock) `mod` n == 0 = chainEff eff it cr w
| otherwise = eff it cr w
withMuzFlareI :: ChainEffect
withMuzFlareI f it cr w =
makeTlsTimeRadColPos 2 100 (V3 1 1 0.5) flashPos
. muzFlareAt (V4 5 5 0 2) flarePos cdir
$ f it cr w
where
flarePos = addZ 0 (_crPos cr) +.+.+ rotate3z cdir (muzzleOffset cr it +.+.+ V3 0 0 20)
flashPos = addZ 0 (_crPos cr) +.+.+ rotate3z cdir (muzzleOffset cr it +.+.+ V3 5 0 20)
-- muzzleOffset = V3 (_muzPos (_dimPortage (_itDimension it))) 0 0
cdir = _crDir cr
muzzleOffset :: Creature -> Item -> Point3
muzzleOffset cr it = V3 (holdOffset + 5 + _aimMuzPos dimPort - _aimHandlePos dimPort) 0 0
where
dimPort = _heldAim $ _itUse it
holdOffset
| crInAimStance OneHand cr = 10
| otherwise = 0
withMuzPos :: (Point3 -> World -> World) -> ChainEffect
withMuzPos = withMuzPosShift (V2 0 0)
withMuzPosShift :: Point2 -> (Point3 -> World -> World) -> ChainEffect
withMuzPosShift p g f it cr w =
g (pos `v2z` 20) $
f it cr w
where
pos =
_crPos cr
+.+ rotateV dir p
+.+ aimingMuzzlePos cr it *.* unitVectorAtAngle dir
dir = _crDir cr
crAtMuzPos :: ChainEffect
crAtMuzPos f it cr = f it (cr & crPos +.+.~ (aimingMuzzlePos cr it *.* unitVectorAtAngle (_crDir cr)))
{- | Applies the effect to a randomly rotated creature,
- rotation amount given by inaccuracy in itParams
-}
applyInaccuracy :: ChainEffect
applyInaccuracy f it = withRandomDirI acc f it
where
acc = _brlInaccuracy . _gunBarrels $ _itParams it
-- | Applies the effect to a randomly rotated creature.
withRandomDirI ::
-- | Max possible rotation
Float ->
ChainEffect
withRandomDirI acc f it cr w = f it (cr & crDir +~ a) $ set randGen g w
where
(a, g) = randomR (- acc, acc) $ _randGen w
withOldDir ::
-- | The fraction of the old direction
Float ->
ChainEffect
withOldDir aFrac eff item cr =
eff item (cr & crDir %~ tweenAngles aFrac (_crOldDir cr))
withRandomItemUpdate ::
State StdGen (Item -> Item) ->
ChainEffect
withRandomItemUpdate randItUp eff it cr w = eff (f it) cr $ w & randGen .~ g
where
(f, g) = runState randItUp (_randGen w)
withRandomItemParams :: State StdGen (ItemParams -> ItemParams) -> ChainEffect
withRandomItemParams rip eff it cr w = eff (it & itParams %~ f) cr $ w & randGen .~ g
where
(f, g) = runState rip (_randGen w)
withPositionOffset ::
(Item -> Creature -> World -> (Point2, Float)) ->
ChainEffect
withPositionOffset h f it cr w = f it (cr & crPos .+.+~ p & crDir +~ a) w
where
(p, a) = h it cr w
withPositionWallCheck ::
(Item -> Creature -> World -> Point2) ->
ChainEffect
withPositionWallCheck h f it cr w
| hasLOS p (_crPos cr) w = f it (cr & crPos .~ p) w
| otherwise = w
where
p = h it cr w
withPosDirWallCheck ::
(Item -> Creature -> World -> (Point2, Float)) ->
ChainEffect
withPosDirWallCheck h f it cr w
| hasLOS p (_crPos cr) w = f it (cr & crPos .~ p & crDir .~ a) w
| otherwise = w
where
(p, a) = h it cr w
-- | Apply the effect to a translated creature.
withRandomOffset :: ChainEffect
withRandomOffset f item cr w = f item (cr & crPos %~ (+.+ offV)) $ set randGen g w
where
(offsetVal, g) = randomR (- offsetAmount, offsetAmount) $ _randGen w
offV = rotateV (_crDir cr) (V2 0 offsetVal)
offsetAmount = fromMaybe 0 $ item ^? itParams . randomOffset
-- | Rotates a creature
torqueBefore ::
-- | Max possible rotation
Float ->
ChainEffect
torqueBefore torque feff item cr w
| cid == 0 =
feff item (cr & crDir +~ rot) $
w
& randGen .~ g
& cWorld . lWorld . creatures . ix cid . crDir +~ rot
& wCam . camRot +~ rot
| otherwise = feff item cr $ set randGen g $ over (cWorld . lWorld . creatures . ix cid . crDir) (+ rot) w
where
cid = _crID cr
(rot, g) = randomR (- torque, torque) $ _randGen w
{- | Rotates a creature with minimum rotation
Rotates the player creature before applying the effect, other creatures after.
-}
torqueBeforeAtLeast ::
-- | Minimal possible rotation
Float ->
-- | Extra possible rotation
Float ->
ChainEffect
torqueBeforeAtLeast minTorque exTorque feff item cr w
| cid == 0 =
feff item (cr & crDir +~ rot') $
w
& randGen .~ g
& cWorld . lWorld . creatures . ix cid . crDir +~ rot'
& wCam . camRot +~ rot'
| otherwise = feff item cr $ set randGen g $ over (cWorld . lWorld . creatures . ix cid . crDir) (+ rot') w
where
cid = _crID cr
(rot, g) = randomR (- exTorque, exTorque) $ _randGen w
rot'
| rot < 0 = rot - minTorque
| otherwise = rot + minTorque
-- | Rotate a randomly creature after applying an effect.
withTorqueAfter :: ChainEffect
withTorqueAfter feff item cr w
-- | cid == 0 = rotateScope $ set randGen g $ over cameraRot (+rot) $ feff item cr w
| cid == 0 = set randGen g $ over (wCam . camRot) (+ rot) $ feff item cr w
| otherwise = set randGen g $ over (cWorld . lWorld . creatures . ix cid . crDir) (+ rot) $ feff item cr w
where
cid = _crID cr
(rot, g) = randomR (- torque, torque) $ _randGen w
torque = fromMaybe 0 $ item ^? itParams . torqueAfter
spreadNumI :: ChainEffect
spreadNumI eff item cr w = foldr f w dirs
where
dirs =
zipWith
(+)
[- spread, - spread + (2 * spread / fromIntegral numBul) .. spread]
(randomRs (0, spread / fromIntegral numBul) (_randGen w))
f dir = eff item (cr & crDir +~ dir)
spread = _spreadAngle . _brlSpread . _gunBarrels $ _itParams item
numBul = _brlNum . _gunBarrels $ _itParams item
spreadLoaded :: ChainEffect
spreadLoaded eff item cr w = foldr f w dirs
where
cd = 0.5 * spread * fromIntegral (numBulLoaded -1)
dirs = subtract cd . (spread *) . fromIntegral <$> [0 .. numBulLoaded - 1]
f dir = eff item (cr & crDir +~ dir)
spread = _spreadAngle . _brlSpread . _gunBarrels $ _itParams item
numBulLoaded = _laLoaded $ _heldConsumption (_itUse item)
sideEffectOnFrame ::
Int ->
(Item -> Creature -> WdWd) ->
ChainEffect
sideEffectOnFrame i sf f it cr w =
f it cr w
& cWorld . lWorld . delayedEvents .:~ (i, sf it cr)
torqueSideEffect :: Float -> Item -> Creature -> World -> World
torqueSideEffect torque _ cr w
| cid == 0 = set randGen g $ over (wCam . camRot) (+ rot) w
| otherwise = set randGen g $ over (cWorld . lWorld . creatures . ix cid . crDir) (+ rot) w
where
cid = _crID cr
(rot, g) = randomR (- torque, torque) $ _randGen w
-- pump the updated creature into the chain in later frames
repeatOnFrames :: [Int] -> HeldMod -> ChainEffect
--repeatOnFrames is hm f it cr w = f it cr w
repeatOnFrames is hm f it cr w =
f it cr $
w
& cWorld . lWorld . delayedEvents .++~ (is <&> (,WdWdFromItCrixWdWd (it & itUse . heldMods .~ hm) (_crID cr) ItCrWdItemEffect))
-- where
-- f' = fromMaybe w' $ do
-- cr' <- w' ^? creatures . ix (_crID cr)
-- return $ f it cr' w'
duplicateLoaded :: ChainEffect
duplicateLoaded eff it cr w = foldr f w [1 .. numBul]
where
f _ = eff it cr
numBul = _laLoaded $ _heldConsumption (_itUse it)
duplicateLoadedBarrels :: ChainEffect
duplicateLoadedBarrels eff item cr w = foldr f w poss
where
cp :: Float
cp = -0.5 * (fromIntegral numBar - 1)
poss :: [V2 Float]
poss = map (rotateV (_crDir cr) . V2 0 . (* 5) . (+ cp) . fromIntegral) [0 .. numBul - 1]
f pos = eff item (cr & crPos %~ (+.+ pos))
numBar = _brlNum . _gunBarrels $ _itParams item
numBul = _laLoaded $ _heldConsumption (_itUse item)
duplicateOffsetsFocus :: [Float] -> ChainEffect
duplicateOffsetsFocus xs eff item cr w = foldr f w poss
where
poss :: [V2 Float]
poss = map (rotateV (_crDir cr) . V2 0) xs
f pos =
eff item $
cr
& crPos %~ (+.+ pos)
& crDir .~ thedir pos
thedir pos
| dist (mouseWorldPos (w ^. input) (w ^. wCam)) (_crPos cr) < aimingMuzzlePos cr item =
argV
( _crPos cr +.+ aimingMuzzlePos cr item *.* unitVectorAtAngle (_crDir cr)
-.- (_crPos cr +.+ pos)
)
| otherwise = argV (mouseWorldPos (w ^. input) (w ^. wCam) -.- (_crPos cr +.+ pos))
duplicateItem :: (Item -> [Item]) -> ChainEffect
duplicateItem fit eff itm cr w = foldr f w (fit itm)
where
f itm' = eff itm' cr
duplicateOffsetsV2 :: [Point2] -> ChainEffect
duplicateOffsetsV2 xs eff item cr w = foldr f w poss
where
poss = map (rotateV (_crDir cr)) xs
f pos = eff item (cr & crPos +.+.~ pos)
duplicateOffsets :: [Float] -> ChainEffect
duplicateOffsets xs eff item cr w = foldr f w poss
where
poss :: [V2 Float]
poss = map (rotateV (_crDir cr) . V2 0) xs
f pos = eff item (cr & crPos +.+.~ pos)
+53
View File
@@ -0,0 +1,53 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQGNBFwOmrgBDAC9FZW3dFpew1hwDaqRfdQQ1ABcmOYu1NKZHwYjd+bGvcR2LRGe
R5dfRqG1Uc/5r6CPCMvnWxFprymkqKEADn8eFn+aCnPx03HrhA+lNEbciPfTHylt
NTTuRua7YpJIgEOjhXUbxXxnvF8fhUf5NJpJg6H6fPQARUW+5M//BlVgwn2jhzlW
U+uwgeJthhiuTXkls9Yo3EoJzmkUih+ABZgvaiBpr7GZRw9GO1aucITct0YDNTVX
KA6el78/udi5GZSCKT94yY9ArN4W6NiOFCLV7MU5d6qMjwGFhfg46NBv9nqpGinK
3NDjqCevKouhtKl2J+nr3Ju3Spzuv6Iex7tsOqt+XdZCoY+8+dy3G5zbJwBYsMiS
rTNF55PHtBH1S0QK5OoN2UR1ie/aURAyAFEMhTzvFB2B2v7C0IKIOmYMEG+DPMs9
FQs/vZ1UnAQgWk02ZiPryoHfjFO80+XYMrdWN+RSo5q9ODClloaKXjqI/aWLGirm
KXw2R8tz31go3NMAEQEAAbQnV2luZUhRIHBhY2thZ2VzIDx3aW5lLWRldmVsQHdp
bmVocS5vcmc+iQHOBBMBCgA4AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAFiEE
1D9kAUU2nFHXht3qdvGiD/mHZy8FAlwOmyUACgkQdvGiD/mHZy/zkwv7B+nKFlDY
Bzz/7j0gqIODbs5FRZRtuf/IuPP3vZdWlNfAW/VyaLtVLJCM/mmaf/O6/gJ+D+E9
BBoSmHdHzBBOQHIj5IbRedynNcHT5qXsdBeU2ZPR50sdE+jmukvw3Wa5JijoDgUu
LGLGtU48Z3JsBXQ54OlnTZXQ2SMFhRUa10JANXSJQ+QY2Wo2Pi2+MEAHcrd71A2S
0mT2DQSSBQ92c6WPfUpOSBawd8P0ipT7rVFNLJh8HVQGyEWxPl8ecDEHoVfG2rdV
D0ADbNLx9031UUwpUicO6vW/2Ec7c3VNG1cpOtyNTw/lEgvsXOh3GQs/DvFvMy/h
QzaeF3Qq6cAPlKuxieJe4lLYFBTmCAT4iB1J8oeFs4G7ScfZH4+4NBe3VGoeCD/M
Wl+qxntAroblxiFuqtPJg+NKZYWBzkptJNhnrBxcBnRinGZLw2k/GR/qPMgsR2L4
cP+OUuka+R2gp9oDVTZTyMowz+ROIxnEijF50pkj2VBFRB02rfiMp7q6iQIzBBAB
CgAdFiEE2iNXmnTUrZr50/lFzvrI6q8XUZ0FAlwOm3AACgkQzvrI6q8XUZ3KKg/+
MD8CgvLiHEX90fXQ23RZQRm2J21w3gxdIen/N8yJVIbK7NIgYhgWfGWsGQedtM7D
hMwUlDSRb4rWy9vrXBaiZoF3+nK9AcLvPChkZz28U59Jft6/l0gVrykey/ERU7EV
w1Ie1eRu0tRSXsKvMZyQH8897iHZ7uqoJgyk8U8CvSW+V80yqLB2M8Tk8ECZq34f
HqUIGs4Wo0UZh0vV4+dEQHBh1BYpmmWl+UPf7nzNwFWXu/EpjVhkExRqTnkEJ+Ai
OxbtrRn6ETKzpV4DjyifqQF639bMIem7DRRf+mkcrAXetvWkUkE76e3E9KLvETCZ
l4SBfgqSZs2vNngmpX6Qnoh883aFo5ZgVN3v6uTS+LgTwMt/XlnDQ7+Zw+ehCZ2R
CO21Y9Kbw6ZEWls/8srZdCQ2LxnyeyQeIzsLnqT/waGjQj35i4exzYeWpojVDb3r
tvvOALYGVlSYqZXIALTx2/tHXKLHyrn1C0VgHRnl+hwv7U49f7RvfQXpx47YQN/C
PWrpbG69wlKuJptr+olbyoKAWfl+UzoO8vLMo5njWQNAoAwh1H8aFUVNyhtbkRuq
l0kpy1Cmcq8uo6taK9lvYp8jak7eV8lHSSiGUKTAovNTwfZG2JboGV4/qLDUKvpa
lPp2xVpF9MzA8VlXTOzLpSyIVxZnPTpL+xR5P9WQjMS5AY0EXA6auAEMAMReKL89
0z0SL+/i/geB/agfG/k6AXiG2a9kVWeIjAqFwHKl9W/DTNvOqCDgAt51oiHGRRjt
1Xm3XZD4p+GM1uZWn9qIFL49Gt5x94TqdrsKTVCJr0Kazn2mKQc7aja0zac+WtZG
OFn7KbniuAcwtC780cyikfmmExLI1/Vjg+NiMlMtZfpK6FIW+ulPiDQPdzIhVppx
w9/KlR2Fvh4TbzDsUqkFQSSAFdQ65BWgvzLpZHdKO/ILpDkThLbipjtvbBv/pHKM
O/NFTNoYkJ3cNW/kfcynwV+4AcKwdRz2A3Mez+g5TKFYPZROIbayOo01yTMLfz2p
jcqki/t4PACtwFOhkAs+MYPPyZDUkTFcEJQCPDstkAgmJWI3K2qELtDOLQyps3WY
Mfp+mntOdc8bKjFTMcCEk1zcm14K4Oms+w6dw2UnYsX1FAYYhPm8HUYwE4kP8M+D
9HGLMjLqqF/kanlCFZs5Avx3mDSAx6zS8vtNdGh+64oDNk4x4A2j8GTUuQARAQAB
iQG8BBgBCgAmFiEE1D9kAUU2nFHXht3qdvGiD/mHZy8FAlwOmrgCGwwFCQPCZwAA
CgkQdvGiD/mHZy9FnAwAgfUkxsO53Pm2iaHhtF4+BUc8MNJj64Jvm1tghr6PBRtM
hpbvvN8SSOFwYIsS+2BMsJ2ldox4zMYhuvBcgNUlix0G0Z7h1MjftDdsLFi1DNv2
J9dJ9LdpWdiZbyg4Sy7WakIZ/VvH1Znd89Imo7kCScRdXTjIw2yCkotE5lK7A6Ns
NbVuoYEN+dbGioF4csYehnjTdojwF/19mHFxrXkdDZ/V6ZYFIFxEsxL8FEuyI4+o
LC3DFSA4+QAFdkjGFXqFPlaEJxWt5d7wk0y+tt68v+ulkJ900BvR+OOMqQURwrAi
iP3I28aRrMjZYwyqHl8i/qyIv+WRakoDKV+wWteR5DmRAPHmX2vnlPlCmY8ysR6J
2jUAfuDFVu4/qzJe6vw5tmPJMdfvy0W5oogX6sEdin5M5w2b3WrN8nXZcjbWymqP
6jCdl6eoCCkKNOIbr/MMSkd2KqAqDVM5cnnlQ7q+AXzwNpj3RGJVoBxbS0nn9JWY
QNQrWh9rAcMIGT+b1le0
=4lsa
-----END PGP PUBLIC KEY BLOCK-----