Skip to content

Commit

Permalink
feat: added timed cutscene sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
bradhannah committed Dec 13, 2023
1 parent 7df70f2 commit d1e3031
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 43 deletions.
36 changes: 19 additions & 17 deletions Ultima5Redux/DataFiles/CutSceneScripts.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ MapNum,FrameNum,Command,StrParam,IntParam,X,Y,Visible,Comment
1,0,Output,"\nThou dost approach the tranquil Shrine...",0,0,0,false,""
1,0,CreateMapunit,avatar,332,5,10,false,"off camera"
1,1,MoveMapunit,avatar,0,5,10,false,"off camera"
1,1,SoundEffect,WalkOnGrass,0,0,0,false,"Heard off camera"
1,1,SoundEffect,WalkOnGrass,1,0,0,false,"Heard off camera"
1,1,Pause,,500,0,0,false,""
1,2,MoveMapunit,avatar,0,5,10,false,"off camera"
1,2,SoundEffect,WalkOnGrass,0,0,0,false,"Heard off camera"
1,2,SoundEffect,WalkOnGrass,1,0,0,false,"Heard off camera"
1,2,Pause,,500,0,0,false,""
1,3,MoveMapunit,avatar,0,5,10,false,"off camera"
1,3,SoundEffect,WalkOnGrass,0,0,0,false,"Heard off camera"
1,3,SoundEffect,WalkOnGrass,1,0,0,false,"Heard off camera"
1,3,Pause,,500,0,0,false,""
1,4,MoveMapunit,avatar,0,5,10,true,"avatar enters on camera"
1,4,SoundEffect,WalkOnGrass,0,0,0,false,"walking in grass"
1,4,SoundEffect,WalkOnGrass,1,0,0,false,"walking in grass"
1,4,Pause,,500,0,0,false,""
1,5,MoveMapunit,avatar,0,5,9,true,"moves forward"
1,5,SoundEffect,WalkOnGrass,0,0,0,false,"walking in grass"
1,5,SoundEffect,WalkOnGrass,1,0,0,false,"walking in grass"
1,5,Pause,,500,0,0,false,""
1,6,MoveMapunit,avatar,0,5,8,true,"moves forward"
1,6,SoundEffect,WalkOnGrass,0,0,0,false,"walking in grass"
1,6,SoundEffect,WalkOnGrass,1,0,0,false,"walking in grass"
1,6,Pause,,500,0,0,false,""
1,7,MoveMapunit,avatar,0,5,7,true,"moves forward"
1,7,SoundEffect,WalkOnGrass,0,0,0,false,"walking in grass"
1,7,SoundEffect,WalkOnGrass,1,0,0,false,"walking in grass"
1,7,Pause,,500,0,0,false,""
1,8,MoveMapunit,avatar,0,5,6,true,"moves forward"
1,8,SoundEffect,WalkOnGrass,0,0,0,false,"walking in grass"
1,8,SoundEffect,WalkOnGrass,1,0,0,false,"walking in grass"
1,8,Pause,,500,0,0,false,""
1,9,MoveMapunit,avatar,0,5,6,false,"avatar stands up"
1,9,CreateMapunit,beggar,364,5,6,true,"switch to beggar/prayer"
Expand All @@ -47,19 +47,19 @@ MapNum,FrameNum,Command,StrParam,IntParam,X,Y,Visible,Comment
1,11,MoveMapunit,avatar,0,5,6,true,"avatar stands up"
1,11,Pause,,500,0,0,false,""
1,12,MoveMapunit,avatar,0,5,7,true,"avatar walks out"
1,12,SoundEffect,WalkOnGrass,0,0,0,false,"walking in grass"
1,12,SoundEffect,WalkOnGrass,1,0,0,false,"walking in grass"
1,12,Pause,,500,0,0,false,""
1,13,MoveMapunit,avatar,0,5,8,true,"avatar walks out"
1,13,SoundEffect,WalkOnGrass,0,0,0,false,"walking in grass"
1,13,SoundEffect,WalkOnGrass,1,0,0,false,"walking in grass"
1,13,Pause,,500,0,0,false,""
1,14,MoveMapunit,avatar,0,5,9,true,"avatar walks out"
1,14,SoundEffect,WalkOnGrass,0,0,0,false,"walking in grass"
1,14,SoundEffect,WalkOnGrass,1,0,0,false,"walking in grass"
1,14,Pause,,500,0,0,false,""
1,15,MoveMapunit,avatar,0,5,10,true,"avatar walks out"
1,15,SoundEffect,WalkOnGrass,0,0,0,false,"walking in grass"
1,15,SoundEffect,WalkOnGrass,1,0,0,false,"walking in grass"
1,15,Pause,,500,0,0,false,""
1,16,MoveMapunit,avatar,0,0,0,false,avatar walks out
1,16,SoundEffect,WalkOnGrass,0,0,0,false,"walking in grass"
1,16,SoundEffect,WalkOnGrass,1,0,0,false,"walking in grass"
1,16,Pause,,500,0,0,false,""
1,17,EndSequence,,0,0,0,false,end of scene1
1,100,NoOp,,0,0,0,false,Jumped to if BadMantra
Expand All @@ -68,20 +68,22 @@ MapNum,FrameNum,Command,StrParam,IntParam,X,Y,Visible,Comment
1,200,NoOp,,0,0,0,false,Jumped to if ShrineStatus.QuestNotStarted
1,200,OutputModalText,The Altar speaks and a Quest is ordained!,0,0,0,false,
1,201,OutputModalText,"'Tis now thy sacred quest to unto the Codex and learn the darkness of Dishonor!",0,0,0,false,
1,202,SoundEffect,DaaaaDoooo,0,0,0,false,"Cool little sound!"
1,202,SoundEffect,DaaaaDoooo,1,0,0,false,"Cool little sound!"
1,203,OutputModalText,"Return again why thy Quest is done!",0,0,0,false,
1,204,ChangeShrineState,ShrineOrdainedNoCodex,0,0,0,false
1,205,Goto,,11,0,0,false,Leave Shrine
1,300,NoOp,,0,0,0,false,Jumped to if ShrineStatus.ShrineOrdainedNoCodex
1,301,OutputModalText,"Well Done!",0,0,0,false,
1,301,OutputModalText,"A thunderous voice booms:\n\nWell Done!",0,0,0,false,
1,302,SoundEffect,HighPitchedYay,1,0,0,false,"Cool little sound!"
1,303,ScreenEffect,InvertColors,1,0,0,false,"Invert the Colours"
1,304,Pause,,500,0,0,false,"Hold Tight"
1,304,Pause,,1500,0,0,false,"Hold Tight"
1,305,ScreenEffect,InvertColors,0,0,0,false,"Uninvert Colors"
1,305,SoundEffect,HighPitchedYay,0,0,0,false,"Stop the no longer cool sound..."
1,306,SoundEffect,EarthQuake,1,0,0,false,"Start the rumble!"
1,306,ScreenEffect,ShakeScreen,1,0,0,false,"Earthquake!"
1,307,Pause,,100,0,0,false,"Hold Tight for EarthQuake"
1,307,Pause,,3000,0,0,false,"Hold Tight for EarthQuake"1
1,308,ScreenEffect,ShakeScreen,0,0,0,false,"Earthquake is over..."
1,308,SoundEffect,EarthQuake,0,0,0,false,"Earthquake rumble is over!"
1,309,BoostStats,,1,0,0,false,"Boost stats depending on which shrine they are at"
1,310,ChangeShrineState,ShrineOrdainedWithCodex,0,0,0,false
1,311,Goto,,11,0,0,false,Leave Shrine
Expand Down
54 changes: 37 additions & 17 deletions Ultima5Redux/DataFiles/CutSceneScripts.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"FrameNum": 1,
"Command": "SoundEffect",
"StrParam": "WalkOnGrass",
"IntParam": 0,
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
Expand Down Expand Up @@ -106,7 +106,7 @@
"FrameNum": 2,
"Command": "SoundEffect",
"StrParam": "WalkOnGrass",
"IntParam": 0,
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
Expand Down Expand Up @@ -136,7 +136,7 @@
"FrameNum": 3,
"Command": "SoundEffect",
"StrParam": "WalkOnGrass",
"IntParam": 0,
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
Expand Down Expand Up @@ -166,7 +166,7 @@
"FrameNum": 4,
"Command": "SoundEffect",
"StrParam": "WalkOnGrass",
"IntParam": 0,
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
Expand Down Expand Up @@ -196,7 +196,7 @@
"FrameNum": 5,
"Command": "SoundEffect",
"StrParam": "WalkOnGrass",
"IntParam": 0,
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
Expand Down Expand Up @@ -226,7 +226,7 @@
"FrameNum": 6,
"Command": "SoundEffect",
"StrParam": "WalkOnGrass",
"IntParam": 0,
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
Expand Down Expand Up @@ -256,7 +256,7 @@
"FrameNum": 7,
"Command": "SoundEffect",
"StrParam": "WalkOnGrass",
"IntParam": 0,
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
Expand Down Expand Up @@ -286,7 +286,7 @@
"FrameNum": 8,
"Command": "SoundEffect",
"StrParam": "WalkOnGrass",
"IntParam": 0,
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
Expand Down Expand Up @@ -486,7 +486,7 @@
"FrameNum": 12,
"Command": "SoundEffect",
"StrParam": "WalkOnGrass",
"IntParam": 0,
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
Expand Down Expand Up @@ -516,7 +516,7 @@
"FrameNum": 13,
"Command": "SoundEffect",
"StrParam": "WalkOnGrass",
"IntParam": 0,
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
Expand Down Expand Up @@ -546,7 +546,7 @@
"FrameNum": 14,
"Command": "SoundEffect",
"StrParam": "WalkOnGrass",
"IntParam": 0,
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
Expand Down Expand Up @@ -576,7 +576,7 @@
"FrameNum": 15,
"Command": "SoundEffect",
"StrParam": "WalkOnGrass",
"IntParam": 0,
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
Expand Down Expand Up @@ -606,7 +606,7 @@
"FrameNum": 16,
"Command": "SoundEffect",
"StrParam": "WalkOnGrass",
"IntParam": 0,
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
Expand Down Expand Up @@ -696,7 +696,7 @@
"FrameNum": 202,
"Command": "SoundEffect",
"StrParam": "DaaaaDoooo",
"IntParam": 0,
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
Expand Down Expand Up @@ -745,7 +745,7 @@
{
"FrameNum": 301,
"Command": "OutputModalText",
"StrParam": "Well Done!",
"StrParam": "A thunderous voice booms:\\n\\nWell Done!",
"IntParam": 0,
"X": 0,
"Y": 0,
Expand Down Expand Up @@ -776,7 +776,7 @@
"FrameNum": 304,
"Command": "Pause",
"StrParam": "",
"IntParam": 500,
"IntParam": 1500,
"X": 0,
"Y": 0,
"Visible": false,
Expand All @@ -802,6 +802,16 @@
"Visible": false,
"Comment": "Stop the no longer cool sound..."
},
{
"FrameNum": 306,
"Command": "SoundEffect",
"StrParam": "EarthQuake",
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
"Comment": "Start the rumble!"
},
{
"FrameNum": 306,
"Command": "ScreenEffect",
Expand All @@ -816,7 +826,7 @@
"FrameNum": 307,
"Command": "Pause",
"StrParam": "",
"IntParam": 100,
"IntParam": 2000,
"X": 0,
"Y": 0,
"Visible": false,
Expand All @@ -832,6 +842,16 @@
"Visible": false,
"Comment": "Earthquake is over..."
},
{
"FrameNum": 308,
"Command": "SoundEffect",
"StrParam": "EarthQuake",
"IntParam": 0,
"X": 0,
"Y": 0,
"Visible": false,
"Comment": "Earthquake rumble is over!"
},
{
"FrameNum": 309,
"Command": "BoostStats",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
using Ultima5Redux.Maps;
using Ultima5Redux.References.Maps;

namespace Ultima5Redux.MapUnits.TurnResults.SpecificTurnResults.ScriptTurnResults {
public class BoostStats : CutOrIntroSceneScriptLineTurnResult {
public BoostStats(CutOrIntroSceneScriptLine scriptLine) : base(TurnResultType.Script_BoostStats,
TurnResulActionType.ActionRequired, scriptLine) {
}
public ShrineReference ShrineReference { get; }

public BoostStats(CutOrIntroSceneScriptLine scriptLine, ShrineReference shrineReference) : base(
TurnResultType.Script_BoostStats,
TurnResulActionType.ActionRequired, scriptLine) =>
ShrineReference = shrineReference;
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
using System;
using Ultima5Redux.Maps;

namespace Ultima5Redux.MapUnits.TurnResults.SpecificTurnResults.ScriptTurnResults {
public class ScreenEffect : CutOrIntroSceneScriptLineTurnResult {
public enum ScreenEffectType { ShakeScreen, InvertColors }

public bool StartScreenEffect { get; }

public ScreenEffectType TheScreenEffectType { get; }

public ScreenEffect(CutOrIntroSceneScriptLine scriptLine) : base(TurnResultType.Script_ScreenEffect,
TurnResulActionType.ActionRequired, scriptLine) {
TheScreenEffectType = (ScreenEffectType)Enum.Parse(typeof(ScreenEffectType), scriptLine.StrParam);
StartScreenEffect = scriptLine.IntParam != 0;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ namespace Ultima5Redux.MapUnits.TurnResults.SpecificTurnResults.ScriptTurnResult
{
public class SoundEffect : CutOrIntroSceneScriptLineTurnResult
{
public enum SoundEffectType { WalkOnGrass, DaaaaDoooo, HighPitchedYay }
public enum SoundEffectType { WalkOnGrass, DaaaaDoooo, HighPitchedYay, EarthQuake }

public SoundEffectType TheSoundEffectType { get; private set; }

public bool StartSoundEffect { get; }

public SoundEffect(CutOrIntroSceneScriptLine scriptLine) : base(
TurnResultType.Script_SoundEffect, TurnResulActionType.ActionRequired, scriptLine) =>
TurnResultType.Script_SoundEffect, TurnResulActionType.ActionRequired, scriptLine) {
TheSoundEffectType = (SoundEffectType)Enum.Parse(typeof(SoundEffectType), scriptLine.StrParam);
StartSoundEffect = scriptLine.IntParam > 0;
}
}
}
5 changes: 2 additions & 3 deletions Ultima5Redux/Maps/CutOrIntroSceneScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,10 @@ public enum CutOrIntroSceneScriptLineCommand
foreach (CutOrIntroSceneScriptLine scriptLine in scriptLinesInFrame) {
switch (scriptLine.Command) {
case CutOrIntroSceneScriptLine.CutOrIntroSceneScriptLineCommand.ScreenEffect:
// todo: oof
turnResults.PushTurnResult(new ScreenEffect(scriptLine));
break;
case CutOrIntroSceneScriptLine.CutOrIntroSceneScriptLineCommand.BoostStats:
// todo: oof
turnResults.PushTurnResult(new BoostStats(scriptLine));
turnResults.PushTurnResult(new BoostStats(scriptLine, shrineReference));
break;
case CutOrIntroSceneScriptLine.CutOrIntroSceneScriptLineCommand.ChangeShrineState:
turnResults.PushTurnResult(new ChangeShrineState(scriptLine, shrineReference));
Expand Down Expand Up @@ -126,6 +124,7 @@ public enum CutOrIntroSceneScriptLineCommand
break;
case CutOrIntroSceneScriptLine.CutOrIntroSceneScriptLineCommand.Comment:
// do nothing - this is just to keep track
// todo: pass it on, because this is great for Debugging
break;
case CutOrIntroSceneScriptLine.CutOrIntroSceneScriptLineCommand.Output:
turnResults.PushOutputToConsole(scriptLine.StrParam, false);
Expand Down
3 changes: 2 additions & 1 deletion Ultima5Redux/Maps/CutSceneMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ public class CutSceneMap : Map
mapUnitToMove.SetActive(scriptLine.Visible);
break;
case CutOrIntroSceneScriptLine.CutOrIntroSceneScriptLineCommand.BoostStats:
// todo: boost those stats!
ShrineCutSceneState.CurrentShrine.BoostStats(GameStateReference.State.CharacterRecords.AvatarRecord
.Stats);
break;
case CutOrIntroSceneScriptLine.CutOrIntroSceneScriptLineCommand.ScreenEffect:
break;
Expand Down
Loading

0 comments on commit d1e3031

Please sign in to comment.