Skip to content

Commit

Permalink
feat: basic commands for BoostStats and ScreenEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
bradhannah committed Dec 9, 2023
1 parent e496bef commit 7df70f2
Show file tree
Hide file tree
Showing 9 changed files with 149 additions and 6 deletions.
14 changes: 12 additions & 2 deletions Ultima5Redux/DataFiles/CutSceneScripts.csv
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,18 @@ MapNum,FrameNum,Command,StrParam,IntParam,X,Y,Visible,Comment
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,"ShrineStatus.ShrineOrdainedNoCodex",0,0,0,false,
1,302,Goto,,11,0,0,false,Leave Shrine
1,301,OutputModalText,"Well 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,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,ScreenEffect,ShakeScreen,1,0,0,false,"Earthquake!"
1,307,Pause,,100,0,0,false,"Hold Tight for EarthQuake"
1,308,ScreenEffect,ShakeScreen,0,0,0,false,"Earthquake 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
1,400,NoOp,,0,0,0,false,Jumped to if ShrineStatus.ShrineOrdainedWithCodex
1,401,OutputModalText,"ShrineStatus.ShrineOrdainedWithCodex",0,0,0,false,
1,402,Goto,,11,0,0,false,Leave Shrine
Expand Down
102 changes: 101 additions & 1 deletion Ultima5Redux/DataFiles/CutSceneScripts.json
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@
{
"FrameNum": 301,
"Command": "OutputModalText",
"StrParam": "ShrineStatus.ShrineOrdainedNoCodex",
"StrParam": "Well Done!",
"IntParam": 0,
"X": 0,
"Y": 0,
Expand All @@ -754,6 +754,106 @@
},
{
"FrameNum": 302,
"Command": "SoundEffect",
"StrParam": "HighPitchedYay",
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
"Comment": "Cool little sound!"
},
{
"FrameNum": 303,
"Command": "ScreenEffect",
"StrParam": "InvertColors",
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
"Comment": "Invert the Colours"
},
{
"FrameNum": 304,
"Command": "Pause",
"StrParam": "",
"IntParam": 500,
"X": 0,
"Y": 0,
"Visible": false,
"Comment": "Hold Tight"
},
{
"FrameNum": 305,
"Command": "ScreenEffect",
"StrParam": "InvertColors",
"IntParam": 0,
"X": 0,
"Y": 0,
"Visible": false,
"Comment": "Uninvert Colors"
},
{
"FrameNum": 305,
"Command": "SoundEffect",
"StrParam": "HighPitchedYay",
"IntParam": 0,
"X": 0,
"Y": 0,
"Visible": false,
"Comment": "Stop the no longer cool sound..."
},
{
"FrameNum": 306,
"Command": "ScreenEffect",
"StrParam": "ShakeScreen",
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
"Comment": "Earthquake!"
},
{
"FrameNum": 307,
"Command": "Pause",
"StrParam": "",
"IntParam": 100,
"X": 0,
"Y": 0,
"Visible": false,
"Comment": "Hold Tight for EarthQuake"
},
{
"FrameNum": 308,
"Command": "ScreenEffect",
"StrParam": "ShakeScreen",
"IntParam": 0,
"X": 0,
"Y": 0,
"Visible": false,
"Comment": "Earthquake is over..."
},
{
"FrameNum": 309,
"Command": "BoostStats",
"StrParam": "",
"IntParam": 1,
"X": 0,
"Y": 0,
"Visible": false,
"Comment": "Boost stats depending on which shrine they are at"
},
{
"FrameNum": 310,
"Command": "ChangeShrineState",
"StrParam": "ShrineOrdainedWithCodex",
"IntParam": 0,
"X": 0,
"Y": 0,
"Visible": false,
"Comment": ""
},
{
"FrameNum": 311,
"Command": "Goto",
"StrParam": "",
"IntParam": 11,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Ultima5Redux.Maps;

namespace Ultima5Redux.MapUnits.TurnResults.SpecificTurnResults.ScriptTurnResults {
public class BoostStats : CutOrIntroSceneScriptLineTurnResult {
public BoostStats(CutOrIntroSceneScriptLine scriptLine) : base(TurnResultType.Script_BoostStats,
TurnResulActionType.ActionRequired, scriptLine) {
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Ultima5Redux.Maps;

namespace Ultima5Redux.MapUnits.TurnResults.SpecificTurnResults.ScriptTurnResults {
public class ScreenEffect : CutOrIntroSceneScriptLineTurnResult {
public ScreenEffect(CutOrIntroSceneScriptLine scriptLine) : base(TurnResultType.Script_ScreenEffect,
TurnResulActionType.ActionRequired, scriptLine) {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Ultima5Redux.MapUnits.TurnResults.SpecificTurnResults.ScriptTurnResult
{
public class SoundEffect : CutOrIntroSceneScriptLineTurnResult
{
public enum SoundEffectType { WalkOnGrass, DaaaaDoooo }
public enum SoundEffectType { WalkOnGrass, DaaaaDoooo, HighPitchedYay }

public SoundEffectType TheSoundEffectType { get; private set; }

Expand Down
2 changes: 1 addition & 1 deletion Ultima5Redux/MapUnits/TurnResults/TurnResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public enum TurnResultType
PlayerTakesDamage, TeleportToNewLocation, LoadCombatMap, ExecuteCutScene, Script_PromptVirtueMeditate,
Script_ExitBuilding, Script_CreateMapUnit, Script_MapUnitMove, Script_Pause, Script_SoundEffect,
Script_Goto, Script_GotoIf, Script_NoOp, Script_PromptMantra, Script_OutputModalText,
Script_ChangeShrineState
Script_ChangeShrineState, Script_ScreenEffect, Script_BoostStats
}

[SuppressMessage("ReSharper", "SwitchStatementMissingSomeEnumCasesNoDefault")]
Expand Down
10 changes: 9 additions & 1 deletion Ultima5Redux/Maps/CutOrIntroSceneScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public enum Result { Continue, Goto, EndSequence, GotoIf }
public enum CutOrIntroSceneScriptLineCommand
{
CreateMapunit, MoveMapunit, PromptVirtueMeditate, PromptMantra, EndSequence, Comment, Output, Pause,
SoundEffect, Goto, GotoIf, NoOp, OutputModalText, ChangeShrineState
SoundEffect, Goto, GotoIf, NoOp, OutputModalText, ChangeShrineState, ScreenEffect, BoostStats
}

// "FrameNum": 0,
Expand Down Expand Up @@ -90,6 +90,14 @@ public enum CutOrIntroSceneScriptLineCommand
IEnumerable<CutOrIntroSceneScriptLine> scriptLinesInFrame = _scriptLines.Where(i => i.FrameNum == nFrame);
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));
break;
case CutOrIntroSceneScriptLine.CutOrIntroSceneScriptLineCommand.ChangeShrineState:
turnResults.PushTurnResult(new ChangeShrineState(scriptLine, shrineReference));
break;
Expand Down
5 changes: 5 additions & 0 deletions Ultima5Redux/Maps/CutSceneMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ public class CutSceneMap : Map
mapUnitToMove.MapUnitPosition.XY = scriptLine.Position;
mapUnitToMove.SetActive(scriptLine.Visible);
break;
case CutOrIntroSceneScriptLine.CutOrIntroSceneScriptLineCommand.BoostStats:
// todo: boost those stats!
break;
case CutOrIntroSceneScriptLine.CutOrIntroSceneScriptLineCommand.ScreenEffect:
break;
case CutOrIntroSceneScriptLine.CutOrIntroSceneScriptLineCommand.SoundEffect:
break;
case CutOrIntroSceneScriptLine.CutOrIntroSceneScriptLineCommand.Pause:
Expand Down
2 changes: 2 additions & 0 deletions Ultima5Redux/Ultima5Redux.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
<Compile Include="MapUnits\TurnResults\SpecificTurnResults\OutputToConsole.cs" />
<Compile Include="MapUnits\TurnResults\SpecificTurnResults\PlayerMoved.cs" />
<Compile Include="MapUnits\TurnResults\SpecificTurnResults\ReadScroll.cs" />
<Compile Include="MapUnits\TurnResults\SpecificTurnResults\ScriptTurnResults\BoostStats.cs" />
<Compile Include="MapUnits\TurnResults\SpecificTurnResults\ScriptTurnResults\ChangeShrineState.cs" />
<Compile Include="MapUnits\TurnResults\SpecificTurnResults\ScriptTurnResults\CreateMapUnit.cs" />
<Compile Include="MapUnits\TurnResults\SpecificTurnResults\ScriptTurnResults\ExecuteCutScene.cs" />
Expand All @@ -192,6 +193,7 @@
<Compile Include="MapUnits\TurnResults\SpecificTurnResults\ScriptTurnResults\PromptMantra.cs" />
<Compile Include="MapUnits\TurnResults\SpecificTurnResults\ScriptTurnResults\PromptVirtueMeditate.cs" />
<Compile Include="MapUnits\TurnResults\SpecificTurnResults\ScriptTurnResults\CutOrIntroSceneScriptLineResult.cs" />
<Compile Include="MapUnits\TurnResults\SpecificTurnResults\ScriptTurnResults\ScreenEffect.cs" />
<Compile Include="MapUnits\TurnResults\SpecificTurnResults\ScriptTurnResults\SoundEffect.cs" />
<Compile Include="MapUnits\TurnResults\SpecificTurnResults\ShoppeKeeperInteraction.cs" />
<Compile Include="MapUnits\TurnResults\SpecificTurnResults\SinglePlayerCharacterAffected.cs" />
Expand Down

0 comments on commit 7df70f2

Please sign in to comment.