diff --git a/Ultima5Redux/DataFiles/CutSceneScripts.csv b/Ultima5Redux/DataFiles/CutSceneScripts.csv index ac1e6e4..ff2c56c 100644 --- a/Ultima5Redux/DataFiles/CutSceneScripts.csv +++ b/Ultima5Redux/DataFiles/CutSceneScripts.csv @@ -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" @@ -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 @@ -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 diff --git a/Ultima5Redux/DataFiles/CutSceneScripts.json b/Ultima5Redux/DataFiles/CutSceneScripts.json index 5c4e8bd..e9a5329 100644 --- a/Ultima5Redux/DataFiles/CutSceneScripts.json +++ b/Ultima5Redux/DataFiles/CutSceneScripts.json @@ -76,7 +76,7 @@ "FrameNum": 1, "Command": "SoundEffect", "StrParam": "WalkOnGrass", - "IntParam": 0, + "IntParam": 1, "X": 0, "Y": 0, "Visible": false, @@ -106,7 +106,7 @@ "FrameNum": 2, "Command": "SoundEffect", "StrParam": "WalkOnGrass", - "IntParam": 0, + "IntParam": 1, "X": 0, "Y": 0, "Visible": false, @@ -136,7 +136,7 @@ "FrameNum": 3, "Command": "SoundEffect", "StrParam": "WalkOnGrass", - "IntParam": 0, + "IntParam": 1, "X": 0, "Y": 0, "Visible": false, @@ -166,7 +166,7 @@ "FrameNum": 4, "Command": "SoundEffect", "StrParam": "WalkOnGrass", - "IntParam": 0, + "IntParam": 1, "X": 0, "Y": 0, "Visible": false, @@ -196,7 +196,7 @@ "FrameNum": 5, "Command": "SoundEffect", "StrParam": "WalkOnGrass", - "IntParam": 0, + "IntParam": 1, "X": 0, "Y": 0, "Visible": false, @@ -226,7 +226,7 @@ "FrameNum": 6, "Command": "SoundEffect", "StrParam": "WalkOnGrass", - "IntParam": 0, + "IntParam": 1, "X": 0, "Y": 0, "Visible": false, @@ -256,7 +256,7 @@ "FrameNum": 7, "Command": "SoundEffect", "StrParam": "WalkOnGrass", - "IntParam": 0, + "IntParam": 1, "X": 0, "Y": 0, "Visible": false, @@ -286,7 +286,7 @@ "FrameNum": 8, "Command": "SoundEffect", "StrParam": "WalkOnGrass", - "IntParam": 0, + "IntParam": 1, "X": 0, "Y": 0, "Visible": false, @@ -486,7 +486,7 @@ "FrameNum": 12, "Command": "SoundEffect", "StrParam": "WalkOnGrass", - "IntParam": 0, + "IntParam": 1, "X": 0, "Y": 0, "Visible": false, @@ -516,7 +516,7 @@ "FrameNum": 13, "Command": "SoundEffect", "StrParam": "WalkOnGrass", - "IntParam": 0, + "IntParam": 1, "X": 0, "Y": 0, "Visible": false, @@ -546,7 +546,7 @@ "FrameNum": 14, "Command": "SoundEffect", "StrParam": "WalkOnGrass", - "IntParam": 0, + "IntParam": 1, "X": 0, "Y": 0, "Visible": false, @@ -576,7 +576,7 @@ "FrameNum": 15, "Command": "SoundEffect", "StrParam": "WalkOnGrass", - "IntParam": 0, + "IntParam": 1, "X": 0, "Y": 0, "Visible": false, @@ -606,7 +606,7 @@ "FrameNum": 16, "Command": "SoundEffect", "StrParam": "WalkOnGrass", - "IntParam": 0, + "IntParam": 1, "X": 0, "Y": 0, "Visible": false, @@ -696,7 +696,7 @@ "FrameNum": 202, "Command": "SoundEffect", "StrParam": "DaaaaDoooo", - "IntParam": 0, + "IntParam": 1, "X": 0, "Y": 0, "Visible": false, @@ -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, @@ -776,7 +776,7 @@ "FrameNum": 304, "Command": "Pause", "StrParam": "", - "IntParam": 500, + "IntParam": 1500, "X": 0, "Y": 0, "Visible": false, @@ -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", @@ -816,7 +826,7 @@ "FrameNum": 307, "Command": "Pause", "StrParam": "", - "IntParam": 100, + "IntParam": 2000, "X": 0, "Y": 0, "Visible": false, @@ -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", diff --git a/Ultima5Redux/MapUnits/TurnResults/SpecificTurnResults/ScriptTurnResults/BoostStats.cs b/Ultima5Redux/MapUnits/TurnResults/SpecificTurnResults/ScriptTurnResults/BoostStats.cs index 220bd57..8749e22 100644 --- a/Ultima5Redux/MapUnits/TurnResults/SpecificTurnResults/ScriptTurnResults/BoostStats.cs +++ b/Ultima5Redux/MapUnits/TurnResults/SpecificTurnResults/ScriptTurnResults/BoostStats.cs @@ -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; } } \ No newline at end of file diff --git a/Ultima5Redux/MapUnits/TurnResults/SpecificTurnResults/ScriptTurnResults/ScreenEffect.cs b/Ultima5Redux/MapUnits/TurnResults/SpecificTurnResults/ScriptTurnResults/ScreenEffect.cs index a2d3145..3395c1a 100644 --- a/Ultima5Redux/MapUnits/TurnResults/SpecificTurnResults/ScriptTurnResults/ScreenEffect.cs +++ b/Ultima5Redux/MapUnits/TurnResults/SpecificTurnResults/ScriptTurnResults/ScreenEffect.cs @@ -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; } } } \ No newline at end of file diff --git a/Ultima5Redux/MapUnits/TurnResults/SpecificTurnResults/ScriptTurnResults/SoundEffect.cs b/Ultima5Redux/MapUnits/TurnResults/SpecificTurnResults/ScriptTurnResults/SoundEffect.cs index 580a85f..af73e79 100644 --- a/Ultima5Redux/MapUnits/TurnResults/SpecificTurnResults/ScriptTurnResults/SoundEffect.cs +++ b/Ultima5Redux/MapUnits/TurnResults/SpecificTurnResults/ScriptTurnResults/SoundEffect.cs @@ -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; + } } } \ No newline at end of file diff --git a/Ultima5Redux/Maps/CutOrIntroSceneScript.cs b/Ultima5Redux/Maps/CutOrIntroSceneScript.cs index 9db0a27..ba73ecd 100644 --- a/Ultima5Redux/Maps/CutOrIntroSceneScript.cs +++ b/Ultima5Redux/Maps/CutOrIntroSceneScript.cs @@ -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)); @@ -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); diff --git a/Ultima5Redux/Maps/CutSceneMap.cs b/Ultima5Redux/Maps/CutSceneMap.cs index a3a8564..dae8e4b 100644 --- a/Ultima5Redux/Maps/CutSceneMap.cs +++ b/Ultima5Redux/Maps/CutSceneMap.cs @@ -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; diff --git a/Ultima5Redux/References/Maps/ShrineReference.cs b/Ultima5Redux/References/Maps/ShrineReference.cs index adf6575..7940b9e 100644 --- a/Ultima5Redux/References/Maps/ShrineReference.cs +++ b/Ultima5Redux/References/Maps/ShrineReference.cs @@ -1,3 +1,6 @@ +using System; +using Ultima5Redux.PlayerCharacters; + namespace Ultima5Redux.References.Maps { public class ShrineReference @@ -7,9 +10,64 @@ public class ShrineReference public Point2D Position { get; } public VirtueReference VirtueRef { get; private set; } + public class StatAttributeBoosts { + public int Strength { get; internal set; } + public int Dexterity { get; internal set; } + public int Intelligence { get; internal set; } + + public string GetStatBoostString() => + ((Strength > 0 ? "Strength +" + Strength + "\n" : string.Empty) + + (Dexterity > 0 ? "Dexterity +" + Dexterity + "\n" : string.Empty) + + (Intelligence > 0 ? "Intelligence +" + Intelligence : string.Empty)).TrimEnd(); + } + + public StatAttributeBoosts TheStatAttributeBoosts { get; } = new(); + internal ShrineReference(VirtueReference virtueRef, Point2D position) { VirtueRef = virtueRef; Position = position; + + switch (virtueRef.Virtue) { + case VirtueReference.VirtueType.Honesty: + TheStatAttributeBoosts.Intelligence = 1; + break; + case VirtueReference.VirtueType.Compassion: + TheStatAttributeBoosts.Dexterity = 1; + break; + case VirtueReference.VirtueType.Valor: + TheStatAttributeBoosts.Strength = 1; + break; + case VirtueReference.VirtueType.Justice: + TheStatAttributeBoosts.Dexterity = 1; + TheStatAttributeBoosts.Intelligence = 1; + break; + case VirtueReference.VirtueType.Sacrifice: + TheStatAttributeBoosts.Dexterity = 1; + TheStatAttributeBoosts.Strength = 1; + break; + case VirtueReference.VirtueType.Honor: + TheStatAttributeBoosts.Strength = 1; + TheStatAttributeBoosts.Intelligence = 1; + break; + case VirtueReference.VirtueType.Spirituality: + TheStatAttributeBoosts.Dexterity = 1; + TheStatAttributeBoosts.Intelligence = 1; + TheStatAttributeBoosts.Strength = 1; + break; + case VirtueReference.VirtueType.Humility: + // no boost - thou art far too humble to accept a boost + break; + case VirtueReference.VirtueType.None: + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + + public void BoostStats(CharacterStats stats) { + stats.Dexterity += TheStatAttributeBoosts.Dexterity; + stats.Intelligence += TheStatAttributeBoosts.Intelligence; + stats.Strength += TheStatAttributeBoosts.Strength; } } } \ No newline at end of file