Skip to content

Commit

Permalink
value adjustments, added slam damage type for super horde, optimized …
Browse files Browse the repository at this point in the history
…input reading
  • Loading branch information
TalicZealot committed Jul 25, 2022
1 parent 5b329fa commit 818aad0
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 13 deletions.
2 changes: 2 additions & 0 deletions SotnRandoTools/src/Constants/InputKeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public static class InputKeys
public const string DragonPunch = "DP";
public const string HalfCircleForward = "HCF";
public const string QuarterCircleForward = "QCF";
public const string QuarterCircleLeft = "QCL";
public const string QuarterCircleRight = "QCR";
public const string Dash = "Dash";
}
}
4 changes: 2 additions & 2 deletions SotnRandoTools/src/Khaos/CheatsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ public void StartCheats()
{
FaerieScroll.Enable();
Cheat batCardXp = cheats.GetCheatByName("BatCardXp");
batCardXp.PokeValue(10000);
batCardXp.PokeValue(7000);
batCardXp.Enable();
Cheat ghostCardXp = cheats.GetCheatByName("GhostCardXp");
ghostCardXp.PokeValue(10000);
ghostCardXp.PokeValue(7000);
ghostCardXp.Enable();
Cheat faerieCardXp = cheats.GetCheatByName("FaerieCardXp");
faerieCardXp.Enable();
Expand Down
14 changes: 9 additions & 5 deletions SotnRandoTools/src/Khaos/KhaosController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ public void Update()
CheckWhiteDragon();

CheckManaUsage();
FixSlowEntranceSlow();
FixEntranceSlow();
FixSlowWarps();
CheckSubweaponsOnlyEquipment();

Expand Down Expand Up @@ -1528,7 +1528,7 @@ private void BloodManaOff()
private void ThirstDrain()
{
uint superDrain = superThirst ? Constants.Khaos.SuperThirstExtraDrain : 0u;
if (sotnApi.AlucardApi.CurrentHp > toolConfig.Khaos.ThirstDrainPerSecond + 1 + +superDrain)
if (sotnApi.AlucardApi.CurrentHp > toolConfig.Khaos.ThirstDrainPerSecond + 1 + superDrain)
{
sotnApi.AlucardApi.CurrentHp -= (toolConfig.Khaos.ThirstDrainPerSecond + superDrain);
}
Expand Down Expand Up @@ -1593,7 +1593,7 @@ private void HordeSpawn()

if (superHorde)
{
int damageTypeRoll = rng.Next(0, 4);
int damageTypeRoll = rng.Next(0, 5);

switch (damageTypeRoll)
{
Expand All @@ -1607,6 +1607,9 @@ private void HordeSpawn()
hordeEnemies[enemyIndex].DamageTypeA = (uint) Entities.Stone;
hordeEnemies[enemyIndex].DamageTypeB = (uint) Entities.Stone;
break;
case 4:
hordeEnemies[enemyIndex].DamageTypeA = (uint) Entities.Slam;
break;
default:
break;
}
Expand Down Expand Up @@ -2329,7 +2332,8 @@ private void CheckVermillionBirdFireballs()
inputService.Polling--;
}

if (notificationService.VermillionBirds > 0 && fireballCooldown == 0 && inputService.RegisteredMove(InputKeys.QuarterCircleForward, Globals.UpdateCooldownFrames))
if (notificationService.VermillionBirds > 0 && fireballCooldown == 0
&& inputService.RegisteredMove(InputKeys.QuarterCircleForward, Globals.UpdateCooldownFrames))
{
notificationService.VermillionBirds--;
Entity fireball = new Entity(Constants.Khaos.FireballEntityBytes);
Expand Down Expand Up @@ -2686,7 +2690,7 @@ private void CheckWhiteDragon()
hellfireCasted = false;
}
}
private void FixSlowEntranceSlow()
private void FixEntranceSlow()
{
if (slowActive && !slowPaused && IsInRoomList(Constants.Khaos.EntranceCutsceneRooms))
{
Expand Down
1 change: 0 additions & 1 deletion SotnRandoTools/src/Khaos/KhaosEventScheduler.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using SotnRandoTools.Configuration.Interfaces;
using SotnRandoTools.Khaos.Interfaces;
using SotnRandoTools.Khaos.Models;
Expand Down
42 changes: 38 additions & 4 deletions SotnRandoTools/src/Services/InputService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,34 @@ public class InputService : IInputService
Activator = new Dictionary<string, object> { [PlaystationInputKeys.Square] = true }
}
},
{
InputKeys.QuarterCircleRight,
new Input
{
Enabled = false,
MotionSequence = new List<Dictionary<string, object>>
{
new Dictionary<string, object> {[PlaystationInputKeys.Right] = false, [PlaystationInputKeys.Down] = true},
new Dictionary<string, object> {[PlaystationInputKeys.Right] = true, [PlaystationInputKeys.Down] = true},
new Dictionary<string, object> {[PlaystationInputKeys.Right] = true, [PlaystationInputKeys.Down] = false}
},
Activator = new Dictionary<string, object> { [PlaystationInputKeys.Square] = true }
}
},
{
InputKeys.QuarterCircleLeft,
new Input
{
Enabled = false,
MotionSequence = new List<Dictionary<string, object>>
{
new Dictionary<string, object> {[PlaystationInputKeys.Left] = false, [PlaystationInputKeys.Down] = true},
new Dictionary<string, object> {[PlaystationInputKeys.Left] = true, [PlaystationInputKeys.Down] = true},
new Dictionary<string, object> {[PlaystationInputKeys.Left] = true, [PlaystationInputKeys.Down] = false}
},
Activator = new Dictionary<string, object> { [PlaystationInputKeys.Square] = true }
}
},
{
InputKeys.Dash,
new Input
Expand Down Expand Up @@ -186,19 +214,25 @@ public void UpdateInputs()
moveHistory.RemoveAt(0);
}

bool leftPressed = Convert.ToBoolean(inputHistory[inputHistory.Count - 1][leftKey]);
bool rightPressed = Convert.ToBoolean(inputHistory[inputHistory.Count - 1][rightKey]);


if (sotnApi.AlucardApi.FacingLeft)
{
diractionalHistory[diractionalHistory.Count - 1].Add(InputKeys.Forward, Convert.ToBoolean(inputHistory[inputHistory.Count - 1][leftKey]));
diractionalHistory[diractionalHistory.Count - 1].Add(InputKeys.Back, Convert.ToBoolean(inputHistory[inputHistory.Count - 1][rightKey]));
diractionalHistory[diractionalHistory.Count - 1].Add(InputKeys.Forward, leftPressed);
diractionalHistory[diractionalHistory.Count - 1].Add(InputKeys.Back, rightPressed);
}
else
{
diractionalHistory[diractionalHistory.Count - 1].Add(InputKeys.Forward, Convert.ToBoolean(inputHistory[inputHistory.Count - 1][rightKey]));
diractionalHistory[diractionalHistory.Count - 1].Add(InputKeys.Back, Convert.ToBoolean(inputHistory[inputHistory.Count - 1][leftKey]));
diractionalHistory[diractionalHistory.Count - 1].Add(InputKeys.Forward, rightPressed);
diractionalHistory[diractionalHistory.Count - 1].Add(InputKeys.Back, leftPressed);
}

diractionalHistory[diractionalHistory.Count - 1].Add(upKey, Convert.ToBoolean(inputHistory[inputHistory.Count - 1][upKey]));
diractionalHistory[diractionalHistory.Count - 1].Add(downKey, Convert.ToBoolean(inputHistory[inputHistory.Count - 1][downKey]));
diractionalHistory[diractionalHistory.Count - 1].Add(leftKey, leftPressed);
diractionalHistory[diractionalHistory.Count - 1].Add(rightKey, rightPressed);

foreach (var input in inputs)
{
Expand Down
2 changes: 1 addition & 1 deletion SotnRandoTools/src/SotnRandoTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<OutputType>Library</OutputType>
<EnforceCodeStyleInBuild>false</EnforceCodeStyleInBuild>
<AnalysisLevel>5.0</AnalysisLevel>
<Version>1.3.5</Version>
<Version>1.3.6</Version>
<Description>A collection of tools to enhance the experience of playign the SotN randomizer.</Description>
<Copyright />
<PackageProjectUrl>https://taliczealot.github.io/</PackageProjectUrl>
Expand Down

0 comments on commit 818aad0

Please sign in to comment.