From 72a1399da0ac71b2d2bd80e74b741d3101af95d9 Mon Sep 17 00:00:00 2001 From: justin Date: Tue, 22 Mar 2022 18:42:48 +0000 Subject: [PATCH] Modify analyser sounds --- src/Dodge/Creature.hs | 4 +- src/Dodge/Floor.hs | 4 +- src/Dodge/Item/Weapon/BulletGun/Cane.hs | 2 +- src/Dodge/Item/Weapon/BulletGun/Stick.hs | 4 +- src/Dodge/LockAndKey.hs | 5 + src/Dodge/Placement/Instance/Analyser.hs | 9 +- src/Dodge/Placement/Instance/Terminal.hs | 13 +- src/Dodge/Room/Boss.hs | 4 +- src/Dodge/Room/LasTurret.hs | 9 +- .../SoundLogic/ExternallyGeneratedSounds.hs | 282 +++++++++--------- 10 files changed, 176 insertions(+), 160 deletions(-) diff --git a/src/Dodge/Creature.hs b/src/Dodge/Creature.hs index bbb6ec912..4ee025d08 100644 --- a/src/Dodge/Creature.hs +++ b/src/Dodge/Creature.hs @@ -179,8 +179,8 @@ testInventory = IM.fromList $ zip [0..] , makeTypeCraftNum 3 PUMP -- , makeTypeCraftNum 1 MAGNET , makeTypeCraftNum 1 TRANSMITTER - , makeTypeCraftNum 1 HARDWARE --- , makeTypeCraftNum 3 SPRING + , makeTypeCraftNum 10 HARDWARE + , makeTypeCraftNum 3 SPRING , makeTypeCraftNum 10 CAN , makeTypeCraftNum 3 TIN , makeTypeCraftNum 3 PLANK diff --git a/src/Dodge/Floor.hs b/src/Dodge/Floor.hs index 9a8946640..7b3ff01f4 100644 --- a/src/Dodge/Floor.hs +++ b/src/Dodge/Floor.hs @@ -36,8 +36,8 @@ import System.Random initialAnoTree :: RandomGen g => Tree [Annotation g] initialAnoTree = padSucWithDoors $ treeFromTrunk [[AnoApplyInt 0 startRoom] - , [AnoApplyInt 100 healthTest] --- , [SpecificRoom $ return . UseAll <$> tanksRoom [] []] +-- , [AnoApplyInt 100 healthTest] + , [SpecificRoom $ return . UseAll <$> tanksRoom [] []] , [PassthroughLockKeyLists 2 lockRoomKeyItems itemRooms] , [SpecificRoom randomChallenges] , [AnoApplyInt 1 lasSensorTurretTest] diff --git a/src/Dodge/Item/Weapon/BulletGun/Cane.hs b/src/Dodge/Item/Weapon/BulletGun/Cane.hs index 6ad85a2b8..879ec8f7d 100644 --- a/src/Dodge/Item/Weapon/BulletGun/Cane.hs +++ b/src/Dodge/Item/Weapon/BulletGun/Cane.hs @@ -58,7 +58,7 @@ bangCane = defaultGun , _itConsumption = defaultAmmo { _aoType = basicBullet , _ammoBaseMax = 1 - , _reloadTime = 20 + , _reloadTime = 15 , _reloadType = ActivePartial 1 } , _itUse = ruseAmmoParamsRate 6 upHammer diff --git a/src/Dodge/Item/Weapon/BulletGun/Stick.hs b/src/Dodge/Item/Weapon/BulletGun/Stick.hs index be95c3e96..d7aab429d 100644 --- a/src/Dodge/Item/Weapon/BulletGun/Stick.hs +++ b/src/Dodge/Item/Weapon/BulletGun/Stick.hs @@ -49,7 +49,7 @@ bangStick i = defaultGun , _itConsumption = defaultAmmo { _aoType = basicBullet , _ammoBaseMax = i - , _reloadTime = 15 + , _reloadTime = 10 , _reloadType = ActivePartial 1 } , _itUse = ruseAmmoParamsRate 8 upHammer @@ -123,7 +123,7 @@ revolver = pistol { _aoType = basicBullet , _ammoBaseMax = 6 , _ammoLoaded = 0 - , _reloadTime = 15 + , _reloadTime = 10 , _reloadType = ActivePartial 1 } } diff --git a/src/Dodge/LockAndKey.hs b/src/Dodge/LockAndKey.hs index 0c3326d8e..3638167a8 100644 --- a/src/Dodge/LockAndKey.hs +++ b/src/Dodge/LockAndKey.hs @@ -13,6 +13,11 @@ import Dodge.Item import System.Random import Control.Monad.State +bossKeyItems :: RandomGen g => [ (State g (SubCompTree Room), State g CombineType) ] +bossKeyItems = + [(return . UseAll <$> bossRoom autoCrit, takeOne [PISTOL]) + ] + lockRoomKeyItems :: RandomGen g => [ (Int -> State g (SubCompTree Room) , State g CombineType ) ] lockRoomKeyItems = -- [(lasCenSensEdge, takeOne [LAUNCHER,LASGUN,SPARKGUN,FLATSHIELD] ) diff --git a/src/Dodge/Placement/Instance/Analyser.hs b/src/Dodge/Placement/Instance/Analyser.hs index 7eb0e50db..50ea962c0 100644 --- a/src/Dodge/Placement/Instance/Analyser.hs +++ b/src/Dodge/Placement/Instance/Analyser.hs @@ -61,7 +61,7 @@ analyser' starts sucs fails afters upf pslight psmc = extTrigLitPos pslight $ \t TerminalParams { _termDisplayedLines = [] , _termFutureLines = - map simpleline topflush + map simpleline (topFlushStrings allstrings) ++ map simpleline starts ++ [testline' (_mcID mc)] ++ map simpleline afters @@ -72,7 +72,6 @@ analyser' starts sucs fails afters upf pslight psmc = extTrigLitPos pslight $ \t (\mc -> upf mc . (triggers . ix (fromJust $ _plMID tp) .~ const (_sensToggle $ _mcSensor mc)) ) allstrings = sucs : fails : afters ++ starts - topflush = [replicate i ' ' ++ "*" | i <- [0,3 .. maximum (map length allstrings)]] simpleline str = TerminalLineDisplay {_tlPause = 0, _tlString = const (str,white)} testline' mcid = TerminalLineDisplay 0 (testline mcid) testline mcid w = case w ^? machines . ix mcid . mcSensor . sensToggle of @@ -124,9 +123,9 @@ analyserTest t mc w = case (_,True,_,_) -> w (_,False,True,True) -> w & machines . ix (_mcID mc) . mcSensor . sensToggle .~ True - & playsound dededaS + & playsound dedaS & machines . ix (_mcID mc) . mcSensor . sensCloseToggle .~ IsClose - (NotClose,_,False,True) -> w & playsound dededumS + (NotClose,_,False,True) -> w & playsound dedumS & machines . ix (_mcID mc) . mcSensor . sensCloseToggle .~ IsClose (_,_,_,False) -> w & machines . ix (_mcID mc) . mcSensor . sensCloseToggle .~ NotClose _ -> w @@ -136,7 +135,7 @@ analyserTest t mc w = case sens = _mcSensor mc testYouHave :: CombineType -> Machine -> World -> World -testYouHave ct = analyserTest (\w -> any (\itm -> _itType itm == ct) (_crInv (you w))) +testYouHave ct = analyserTest (any (\itm -> _itType itm == ct) . _crInv . you ) testYourHealth :: Int -> Machine -> World -> World testYourHealth hp = analyserTest (\w -> _crHP (you w) >= hp) diff --git a/src/Dodge/Placement/Instance/Terminal.hs b/src/Dodge/Placement/Instance/Terminal.hs index 631ac2bec..0ad55aa69 100644 --- a/src/Dodge/Placement/Instance/Terminal.hs +++ b/src/Dodge/Placement/Instance/Terminal.hs @@ -4,6 +4,7 @@ module Dodge.Placement.Instance.Terminal , putTerminal' , simpleTermMessage , genTermMessage + , topFlushStrings ) where import Dodge.Data import Dodge.LevelGen.Data @@ -86,27 +87,31 @@ simpleTermMessage :: [String] -> (GenParams -> TerminalParams) simpleTermMessage ss = const $ TerminalParams {_termDisplayedLines = [] ,_termFutureLines = TerminalLineEffect 0 termsound - : map totermline (topflush ++ ss) + : map totermline (topFlushStrings ss ++ ss) ,_termMaxLines = 7 ,_termTitle = "TERMINAL" } where - topflush = [replicate i ' ' ++ "*" | i <- [0,2 .. maximum (map length ss)]] totermline s = TerminalLineDisplay 0 (const (s,white)) termsound subinv w' = soundStart TerminalSound tpos computerBeepingS Nothing w' where tpos = fromMaybe 0 $ w' ^? buttons . ix (_termID subinv) . btPos +topFlushStrings :: [String] -> [String] +topFlushStrings = topFlush . maximum . map length + +topFlush :: Int -> [String] +topFlush twidth = [replicate i ' ' ++ "*" | i <- [0, max 1 $ twidth `div` 5 .. twidth]] + genTermMessage :: (GenParams -> [String]) -> (GenParams -> TerminalParams) genTermMessage f = \gp -> TerminalParams {_termDisplayedLines = [] ,_termFutureLines = termSoundLine computerBeepingS - : map totermline (topflush (f gp) ++ f gp) + : map totermline (topFlushStrings (f gp) ++ f gp) ,_termMaxLines = 7 ,_termTitle = "TERMINAL" } where - topflush ss = [replicate i ' ' ++ "*" | i <- [0,2 .. maximum (map length ss)]] totermline s = TerminalLineDisplay 0 (const (s,white)) termSoundLine :: SoundID -> TerminalLine diff --git a/src/Dodge/Room/Boss.hs b/src/Dodge/Room/Boss.hs index b36e5cd4c..ef62f11f0 100644 --- a/src/Dodge/Room/Boss.hs +++ b/src/Dodge/Room/Boss.hs @@ -16,10 +16,10 @@ import Dodge.RandomHelp import Dodge.Tree import Dodge.LevelGen.StaticWalls import Geometry +import LensHelp import Data.Tree import Control.Monad.State -import Control.Lens import System.Random roomGlassOctogon :: Float -- ^ Size @@ -56,7 +56,7 @@ roomGlassOctogon x = createPathGrid $ defaultRoom ] bossRoom :: RandomGen g => Creature -> State g Room -bossRoom cr = randomMediumRoom <&> rmPmnts %~ ( sPS (V2 0 100) (negate $ pi/2) (PutCrit cr) :) +bossRoom cr = randomMediumRoom <&> rmPmnts .:~ sPS (V2 0 100) (negate $ pi/2) (PutCrit cr) armouredChasers :: RandomGen g => State g (Tree Room) armouredChasers = do diff --git a/src/Dodge/Room/LasTurret.hs b/src/Dodge/Room/LasTurret.hs index 4e573fe6e..afd67ab34 100644 --- a/src/Dodge/Room/LasTurret.hs +++ b/src/Dodge/Room/LasTurret.hs @@ -91,8 +91,8 @@ keyCardAnalyserByDoor keyid = analyserByDoor (bar : replicate 2 "") (machineAddSound fridgeHumS $ testYouHave (KEYCARD 0)) where - hic = "HEALTH INTEGRITY CHECK" - bar = replicate (length hic) '-' + hic = "SECURITY CHECK" + bar = replicate 18 '-' healthAnalyserByDoor :: Int -> Room -> Room healthAnalyserByDoor = analyserByDoor @@ -113,8 +113,6 @@ analyserByDoor sa sb sc sd mcf outplid rm = rm & rmPmnts .++~ [ psPt atFstLnkOut $ PutShape $ colorSH yellow $ barPP 1.5 (V3 20 (-1) 0) (V3 20 (-1) 80) - , heightWallPS (atNthLnkOutShiftInward 1 100) 30 covershape - , heightWallPS (atFstLnkOutShiftInward 100) 30 covershape ] & rmOutPmnt .~ [OutPlacement @@ -125,8 +123,7 @@ analyserByDoor sa sb sc sd mcf outplid rm = rm ) outplid] where - covershape = rectNSEW 10 (-10) 20 (-20) - sensorshift (p,a) = (p +.+ rotateV a (V2 60 (-20)), a) + sensorshift (p,a) = (p +.+ rotateV a (V2 30 (-10)), a) healthTest :: RandomGen g => Int -> State g (SubCompTree Room) healthTest n = do diff --git a/src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs b/src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs index a00bfdb37..529ffdcdd 100644 --- a/src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs +++ b/src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs @@ -1,4 +1,4 @@ --- generated at 2022-03-22 10:04:11.692663796 UTC +-- generated at 2022-03-22 15:35:37.255279739 UTC module Dodge.SoundLogic.ExternallyGeneratedSounds where import Sound.Data soundToVol :: SoundID -> Float @@ -26,51 +26,53 @@ soundToVol v = case _getSoundID v of 20 -> 4000 21 -> 5000 22 -> 5000 - 23 -> 20000 - 24 -> 4000 - 25 -> 10000 - 26 -> 8000 - 27 -> 4000 - 28 -> 2000 - 29 -> 6000 - 30 -> 500 - 31 -> 5000 - 32 -> 8000 + 23 -> 5000 + 24 -> 20000 + 25 -> 4000 + 26 -> 10000 + 27 -> 8000 + 28 -> 4000 + 29 -> 2000 + 30 -> 6000 + 31 -> 500 + 32 -> 5000 33 -> 8000 34 -> 8000 - 35 -> 5000 - 36 -> 8000 - 37 -> 4000 - 38 -> 3000 - 39 -> 8000 - 40 -> 2000 - 41 -> 10000 - 42 -> 5000 - 43 -> 2000 - 44 -> 3000 - 45 -> 5000 - 46 -> 10000 - 47 -> 12000 - 48 -> 5000 - 49 -> 10000 - 50 -> 12000 - 51 -> 2000 - 52 -> 3000 - 53 -> 8000 - 54 -> 5000 - 55 -> 2000 - 56 -> 3000 - 57 -> 10000 - 58 -> 500 - 59 -> 10000 - 60 -> 3000 - 61 -> 15000 - 62 -> 10000 - 63 -> 3000 - 64 -> 1000 - 65 -> 15000 - 66 -> 10000 - 67 -> 8000 + 35 -> 8000 + 36 -> 5000 + 37 -> 8000 + 38 -> 4000 + 39 -> 3000 + 40 -> 8000 + 41 -> 2000 + 42 -> 10000 + 43 -> 5000 + 44 -> 2000 + 45 -> 3000 + 46 -> 5000 + 47 -> 10000 + 48 -> 12000 + 49 -> 5000 + 50 -> 10000 + 51 -> 12000 + 52 -> 2000 + 53 -> 3000 + 54 -> 8000 + 55 -> 5000 + 56 -> 2000 + 57 -> 3000 + 58 -> 10000 + 59 -> 500 + 60 -> 10000 + 61 -> 3000 + 62 -> 15000 + 63 -> 10000 + 64 -> 3000 + 65 -> 1000 + 66 -> 15000 + 67 -> 10000 + 68 -> 5000 + 69 -> 8000 _ -> 50 soundToOnomato :: SoundID -> String soundToOnomato v = case _getSoundID v of @@ -96,52 +98,54 @@ soundToOnomato v = case _getSoundID v of 19 -> "TNKTNKTNK" 20 -> "TIPTAP" 21 -> "WRR" - 22 -> "HSS" - 23 -> "BOOM" - 24 -> "CLNK" - 25 -> "BRAP" - 26 -> "CRSNK" - 27 -> "TAPP" - 28 -> "BLIH" - 29 -> "TAPTIP" - 30 -> "CLICK" - 31 -> "FWUMP" - 32 -> "RINGGG" - 33 -> "BRAP" - 34 -> "CRUMPLE" - 35 -> "TRINKL" - 36 -> "TAK" - 37 -> "SMACK" - 38 -> "DRR" - 39 -> "CRASH" - 40 -> "SWSH" - 41 -> "CRAKLE" - 42 -> "CRTINK" - 43 -> "FHP" - 44 -> "CHPCHPCHP" - 45 -> "BIPBIPBIP" - 46 -> "CHUGUGUG" - 47 -> "BRPBRPBRP" - 48 -> "CHNKCHNKCHUNK" - 49 -> "WRRR" - 50 -> "BRDBRDBRD" - 51 -> "PHF" - 52 -> "BWAAH" - 53 -> "BEP" - 54 -> "HSSS" - 55 -> "SHUHP" - 56 -> "THUD" - 57 -> "WHSSH" - 58 -> "HMM" - 59 -> "BRAHCHCH" - 60 -> "TIP" - 61 -> "BANGG" - 62 -> "ZHM" - 63 -> "TAP" - 64 -> "BLPCHCH" - 65 -> "BANG" - 66 -> "CHUGUGUG" - 67 -> "CRISH" + 22 -> "DEDUM" + 23 -> "HSS" + 24 -> "BOOM" + 25 -> "CLNK" + 26 -> "BRAP" + 27 -> "CRSNK" + 28 -> "TAPP" + 29 -> "BLIH" + 30 -> "TAPTIP" + 31 -> "CLICK" + 32 -> "FWUMP" + 33 -> "RINGGG" + 34 -> "BRAP" + 35 -> "CRUMPLE" + 36 -> "TRINKL" + 37 -> "TAK" + 38 -> "SMACK" + 39 -> "DRR" + 40 -> "CRASH" + 41 -> "SWSH" + 42 -> "CRAKLE" + 43 -> "CRTINK" + 44 -> "FHP" + 45 -> "CHPCHPCHP" + 46 -> "BIPBIPBIP" + 47 -> "CHUGUGUG" + 48 -> "BRPBRPBRP" + 49 -> "CHNKCHNKCHUNK" + 50 -> "WRRR" + 51 -> "BRDBRDBRD" + 52 -> "PHF" + 53 -> "BWAAH" + 54 -> "BEP" + 55 -> "HSSS" + 56 -> "SHUHP" + 57 -> "THUD" + 58 -> "WHSSH" + 59 -> "HMM" + 60 -> "BRAHCHCH" + 61 -> "TIP" + 62 -> "BANGG" + 63 -> "ZHM" + 64 -> "TAP" + 65 -> "BLPCHCH" + 66 -> "BANG" + 67 -> "CHUGUGUG" + 68 -> "DEDA" + 69 -> "CRISH" _ -> error "unitialised sound" soundPathList :: [String] soundPathList = @@ -167,6 +171,7 @@ soundPathList = , "reload.TNKTNKTNK.3000.wav" , "twoStep.TIPTAP.4000.wav" , "fire.WRR.5000.wav" + , "dedum.DEDUM.5000.wav" , "foamSprayFadeOut.HSS.5000.wav" , "explosion.BOOM.20000.wav" , "tapQuiet.CLNK.4000.wav" @@ -212,6 +217,7 @@ soundPathList = , "oldMachineBoot.BLPCHCH.1000.wav" , "bang.BANG.15000.wav" , "seagullChatter.CHUGUGUG.10000.wav" + , "deda.DEDA.5000.wav" , "impact4.CRISH.8000.wav" ] tone440sawtoothquietS :: SoundID @@ -258,95 +264,99 @@ twoStepS :: SoundID twoStepS = SoundID 20 fireS :: SoundID fireS = SoundID 21 +dedumS :: SoundID +dedumS = SoundID 22 foamSprayFadeOutS :: SoundID -foamSprayFadeOutS = SoundID 22 +foamSprayFadeOutS = SoundID 23 explosionS :: SoundID -explosionS = SoundID 23 +explosionS = SoundID 24 tapQuietS :: SoundID -tapQuietS = SoundID 24 +tapQuietS = SoundID 25 autoGunS :: SoundID -autoGunS = SoundID 25 +autoGunS = SoundID 26 glassShat1S :: SoundID -glassShat1S = SoundID 26 +glassShat1S = SoundID 27 foot3S :: SoundID -foot3S = SoundID 27 +foot3S = SoundID 28 healS :: SoundID -healS = SoundID 28 +healS = SoundID 29 twoStep1S :: SoundID -twoStep1S = SoundID 29 +twoStep1S = SoundID 30 click1S :: SoundID -click1S = SoundID 30 +click1S = SoundID 31 tap4S :: SoundID -tap4S = SoundID 31 +tap4S = SoundID 32 tinitusS :: SoundID -tinitusS = SoundID 32 +tinitusS = SoundID 33 tap3S :: SoundID -tap3S = SoundID 33 +tap3S = SoundID 34 impact3S :: SoundID -impact3S = SoundID 34 +impact3S = SoundID 35 smallGlass1S :: SoundID -smallGlass1S = SoundID 35 +smallGlass1S = SoundID 36 tap1S :: SoundID -tap1S = SoundID 36 +tap1S = SoundID 37 hit1S :: SoundID -hit1S = SoundID 37 +hit1S = SoundID 38 slideDoorS :: SoundID -slideDoorS = SoundID 38 +slideDoorS = SoundID 39 impact1S :: SoundID -impact1S = SoundID 39 +impact1S = SoundID 40 knifeS :: SoundID -knifeS = SoundID 40 +knifeS = SoundID 41 elecCrackleS :: SoundID -elecCrackleS = SoundID 41 +elecCrackleS = SoundID 42 smallGlass3S :: SoundID -smallGlass3S = SoundID 42 +smallGlass3S = SoundID 43 whiteNoiseFadeInS :: SoundID -whiteNoiseFadeInS = SoundID 43 +whiteNoiseFadeInS = SoundID 44 reload1S :: SoundID -reload1S = SoundID 44 +reload1S = SoundID 45 computerBeepingS :: SoundID -computerBeepingS = SoundID 45 +computerBeepingS = SoundID 46 seagullChatter1S :: SoundID -seagullChatter1S = SoundID 46 +seagullChatter1S = SoundID 47 miniS :: SoundID -miniS = SoundID 47 +miniS = SoundID 48 crankSlowS :: SoundID -crankSlowS = SoundID 48 +crankSlowS = SoundID 49 fireLoudS :: SoundID -fireLoudS = SoundID 49 +fireLoudS = SoundID 50 mini1S :: SoundID -mini1S = SoundID 50 +mini1S = SoundID 51 whiteNoiseFadeOutS :: SoundID -whiteNoiseFadeOutS = SoundID 51 +whiteNoiseFadeOutS = SoundID 52 sineRaisePitchTwoSecS :: SoundID -sineRaisePitchTwoSecS = SoundID 52 +sineRaisePitchTwoSecS = SoundID 53 tone440S :: SoundID -tone440S = SoundID 53 +tone440S = SoundID 54 foamSprayLoopS :: SoundID -foamSprayLoopS = SoundID 54 +foamSprayLoopS = SoundID 55 pickUpS :: SoundID -pickUpS = SoundID 55 +pickUpS = SoundID 56 hitS :: SoundID -hitS = SoundID 56 +hitS = SoundID 57 missileLaunchS :: SoundID -missileLaunchS = SoundID 57 +missileLaunchS = SoundID 58 fridgeHumS :: SoundID -fridgeHumS = SoundID 58 +fridgeHumS = SoundID 59 shotgunS :: SoundID -shotgunS = SoundID 59 +shotgunS = SoundID 60 foot1S :: SoundID -foot1S = SoundID 60 +foot1S = SoundID 61 bangEchoS :: SoundID -bangEchoS = SoundID 61 +bangEchoS = SoundID 62 teleS :: SoundID -teleS = SoundID 62 +teleS = SoundID 63 foot2S :: SoundID -foot2S = SoundID 63 +foot2S = SoundID 64 oldMachineBootS :: SoundID -oldMachineBootS = SoundID 64 +oldMachineBootS = SoundID 65 bangS :: SoundID -bangS = SoundID 65 +bangS = SoundID 66 seagullChatterS :: SoundID -seagullChatterS = SoundID 66 +seagullChatterS = SoundID 67 +dedaS :: SoundID +dedaS = SoundID 68 impact4S :: SoundID -impact4S = SoundID 67 +impact4S = SoundID 69