Skip to content

Commit

Permalink
add toggle to not scramble vlad relics, rebalance help items, prevent…
Browse files Browse the repository at this point in the history
… entrance slam softlock
  • Loading branch information
TalicZealot committed Oct 18, 2021
1 parent 5863483 commit 63c54a2
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 116 deletions.
2 changes: 2 additions & 0 deletions SotnRandoTools/src/Configuration/KhaosConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public KhaosConfig()
PandoraMaxItems = 32;
QueueInterval = new System.TimeSpan(0, 0, 31);
DynamicInterval = true;
KeepVladRelics = false;

Actions = new List<Action>
{
Expand Down Expand Up @@ -68,5 +69,6 @@ public KhaosConfig()
public int PandoraMaxItems { get; set; }
public System.TimeSpan QueueInterval { get; set; }
public bool DynamicInterval { get; set; }
public bool KeepVladRelics { get; set; }
}
}
103 changes: 59 additions & 44 deletions SotnRandoTools/src/Khaos/KhaosController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,22 @@ public class KhaosController
private string[] mediumHelpItems =
{
"Fire shield",
"Iron shield",
"Medusa shield",
"Alucard shield",
"Alucard shield",
"Cross shuriken",
"Shield rod",
"Buffalo star",
"Flame star",
"Zweihander",
"Obsidian sword",
"Marsil",
"Estoc",
"Zweihander",
"Obsidian sword",
"Iron Fist",
"Elixir",
"Gram",
"Holy sword",
"Dark Blade",
Expand All @@ -98,8 +108,10 @@ public class KhaosController
"Fury plate",
"Joseph's cloak",
"Twilight cloak",
"Library card",
"Moonstone",
"Turquoise",
"Diamond",
"Onyx",
"Mystic pendant",
"Gauntlet",
Expand All @@ -108,31 +120,21 @@ public class KhaosController
};
private string[] heavyHelpItems =
{
"Shield rod",
"Iron shield",
"Medusa shield",
"Alucard shield",
"Zweihander",
"Obsidian sword",
"Mablung Sword",
"Masamune",
"Elixir",
"Manna prism",
"Marsil",
"Fist of Tulkas",
"Gurthang",
"Alucard sword",
"Vorpal blade",
"Crissaegirm",
"Yasatsuna",
"Library card",
"Dragon helm",
"Holy glasses",
"Spike Breaker",
"Dark armor",
"Dracula tunic",
"God's Garb",
"Diamond",
"Ring of Ares",
"Ring of Varda",
"Duplicator",
Expand Down Expand Up @@ -338,6 +340,7 @@ public void KhaosStatus(string user = "Khaos")
uint mapX = alucardApi.MapX;
uint mapY = alucardApi.MapY;
bool keepRichterRoom = ((mapX >= 31 && mapX <= 34) && mapY == 8);
bool entranceCutscene = ((mapX >= 0 && mapX <= 18) && mapY == 44);
bool succubusRoom = (mapX == 0 && mapY == 0);
Random rnd = new Random();
int max = 9;
Expand All @@ -363,7 +366,7 @@ public void KhaosStatus(string user = "Khaos")
notificationService.AddMessage($"{user} petrified you");
break;
case 4:
if (succubusRoom)
if (succubusRoom || entranceCutscene)
{
SpawnPoisonHitbox();
notificationService.AddMessage($"{user} poisoned you");
Expand Down Expand Up @@ -1317,15 +1320,15 @@ private void ExecuteFastAction(Object sender, EventArgs e)
uint mapX = alucardApi.MapX;
uint mapY = alucardApi.MapY;
bool keepRichterRoom = ((mapX >= 31 && mapX <= 34) && mapY == 8);
if (gameApi.InAlucardMode() && gameApi.CanMenu() && alucardApi.CurrentHp > 0 && !gameApi.CanSave() && !keepRichterRoom)
if (gameApi.InAlucardMode() && gameApi.CanMenu() && alucardApi.CurrentHp > 0 && !gameApi.CanSave() && !keepRichterRoom && !gameApi.InTransition && !gameApi.IsLoading)
{
shaftHpSet = false;
if (queuedFastActions.Count > 0)
{
queuedFastActions.Dequeue()();
}
}
if (gameApi.InAlucardMode() && gameApi.CanMenu() && alucardApi.CurrentHp > 0 && !gameApi.CanSave() && keepRichterRoom && !shaftHpSet)
if (gameApi.InAlucardMode() && gameApi.CanMenu() && alucardApi.CurrentHp > 0 && !gameApi.CanSave() && keepRichterRoom && !shaftHpSet && !gameApi.InTransition && !gameApi.IsLoading)
{
SetShaftHp();
}
Expand Down Expand Up @@ -1466,6 +1469,10 @@ private void RandomizeRelicsActivate()
var relics = Enum.GetValues(typeof(Relic));
foreach (var relic in relics)
{
if ((int) relic < 25)
{
alucardApi.GrantRelic((Relic) relic);
}
int roll = rnd.Next(0, 2);
if (roll > 0)
{
Expand All @@ -1476,7 +1483,10 @@ private void RandomizeRelicsActivate()
}
else
{
alucardApi.TakeRelic((Relic) relic);
if (!toolConfig.Khaos.KeepVladRelics || (toolConfig.Khaos.KeepVladRelics && (int) relic < 25))
{
alucardApi.TakeRelic((Relic) relic);
}
}
}
}
Expand Down Expand Up @@ -1741,44 +1751,50 @@ private void EnduranceSpawn(Object sender, EventArgs e)
}
private void SpawnPoisonHitbox()
{
Actor poison = new Actor();
poison.HitboxHeight = 255;
poison.HitboxWidth = 255;
poison.AutoToggle = 1;
poison.Damage = (ushort)(alucardApi.Def + 5);
poison.DamageTypeA = (uint) Actors.Poison;
actorApi.SpawnActor(poison);
Actor hitbox = new Actor();
hitbox.HitboxHeight = 255;
hitbox.HitboxWidth = 255;
hitbox.AutoToggle = 1;
hitbox.Damage = (ushort)(alucardApi.Def + 5);
hitbox.DamageTypeA = (uint) Actors.Poison;
actorApi.SpawnActor(hitbox);
}
private void SpawnCurseHitbox()
{
Actor poison = new Actor();
poison.HitboxHeight = 255;
poison.HitboxWidth = 255;
poison.AutoToggle = 1;
poison.Damage = (ushort) (alucardApi.Def + 5);
poison.DamageTypeB = (uint) Actors.Curse;
actorApi.SpawnActor(poison);
Actor hitbox = new Actor();
hitbox.HitboxHeight = 255;
hitbox.HitboxWidth = 255;
hitbox.AutoToggle = 1;
hitbox.Damage = (ushort) (alucardApi.Def + 5);
hitbox.DamageTypeB = (uint) Actors.Curse;
actorApi.SpawnActor(hitbox);
}
private void SpawnStoneHitbox()
{
Actor poison = new Actor();
poison.HitboxHeight = 255;
poison.HitboxWidth = 255;
poison.AutoToggle = 1;
poison.Damage = (ushort) (alucardApi.Def + 5);
poison.DamageTypeA = (uint) Actors.Stone;
poison.DamageTypeB = (uint) Actors.Stone;
actorApi.SpawnActor(poison);
Actor hitbox = new Actor();
Random rnd = new Random();
int roll = rnd.Next(0, 2);
hitbox.Xpos = roll == 1 ? (ushort) 200 : (ushort) 0;
hitbox.HitboxHeight = 255;
hitbox.HitboxWidth = 255;
hitbox.AutoToggle = 1;
hitbox.Damage = (ushort) (alucardApi.Def + 5);
hitbox.DamageTypeA = (uint) Actors.Stone;
hitbox.DamageTypeB = (uint) Actors.Stone;
actorApi.SpawnActor(hitbox);
}
private void SpawnSlamHitbox()
{
Actor poison = new Actor();
poison.HitboxHeight = 255;
poison.HitboxWidth = 255;
poison.AutoToggle = 1;
poison.Damage = (ushort) (alucardApi.Def + 5);
poison.DamageTypeA = (uint) Actors.Slam;
actorApi.SpawnActor(poison);
Actor hitbox = new Actor();
Random rnd = new Random();
int roll = rnd.Next(0, 2);
hitbox.Xpos = roll == 1 ? (ushort)200 : (ushort) 0;
hitbox.HitboxHeight = 255;
hitbox.HitboxWidth = 255;
hitbox.AutoToggle = 1;
hitbox.Damage = (ushort) (alucardApi.Def + 5);
hitbox.DamageTypeA = (uint) Actors.Slam;
actorApi.SpawnActor(hitbox);
}
private void BankruptActivate()
{
Expand Down Expand Up @@ -1894,7 +1910,6 @@ private void HasteOff(Object sender, EventArgs e)
superHaste = false;
hasteActive = false;
speedLocked = false;
hasteSpeedOn = false;
hasteOverdriveOffTimer.Start();
}
private void SetHasteStaticSpeeds(bool super = false)
Expand Down
Loading

0 comments on commit 63c54a2

Please sign in to comment.