Skip to content

Commit

Permalink
Fix Chaos Mode RNG, update probabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrineFox committed Aug 3, 2024
1 parent 14cea9a commit c3e6b8a
Show file tree
Hide file tree
Showing 4 changed files with 3,648 additions and 3,587 deletions.
60 changes: 60 additions & 0 deletions ChaosModeEditor/ChaosModeEditorForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ChaosModeEditor/ChaosModeEditorForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void GetCurrentValues()
private void Update_Click(object sender, EventArgs e)
{
var lines = File.ReadAllLines(chaosModeLocation).ToList();
lines.RemoveRange(13, 12);
lines.RemoveRange(14, 12);

var controls = WinForms.EnumerateControls(this)
.Where(x => x.GetType() == typeof(NumericUpDown) && x.Enabled == true);
Expand All @@ -69,7 +69,7 @@ private void Update_Click(object sender, EventArgs e)
foreach (NumericUpDown numUpDwn in numUpDwnList.OrderBy(x => x.Value))
{
string gotoName = numUpDwn.Name.Replace("num_", "");
lines.Insert(13, $"\tload_registers_global if result_is_greaterthan_orequal({numUpDwn.Value}) {{ goto({gotoName}) }}");
lines.Insert(14, $"\tload_registers_global if result_is_greaterthan_orequal({numUpDwn.Value}) {{ goto({gotoName}) }}");
}

File.WriteAllLines(chaosModeLocation, lines);
Expand Down
31 changes: 16 additions & 15 deletions CoilsnakeProj/ccscript/_scripts/mainmenu/chaosmode.ccs
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@ import "../asm/bg_viewer.ccs"
import "../asm/drug_util.ccs"
import "../asm/cc_actionscript.ccs"

command compare_reg(num, reg) "[18 07 {long num} {byte reg}]"

ChaosMode:
set(flg_RandomWarp)

random(104)

if result_is(0) { eob }
load_registers_global if result_is_greaterthan_orequal(99) { goto(RandomBattle) }
load_registers_global if result_is_greaterthan_orequal(97) { goto(CorruptMap) }
load_registers_global if result_is_greaterthan_orequal(95) { goto(RandomWarp) }
random(255)
store_registers_global
load_registers_global if result_is_greaterthan_orequal(220) { goto(RandomPalette) }
load_registers_global if result_is_greaterthan_orequal(200) { goto(RandomBattle) }
load_registers_global if result_is_greaterthan_orequal(160) { goto(RandomWarp) }
load_registers_global if result_is_greaterthan_orequal(140) { goto(RandomFloatSprite) }
load_registers_global if result_is_greaterthan_orequal(90) { goto(RandomBGM) }
load_registers_global if result_is_greaterthan_orequal(85) { goto(RandomFloatSprite) }
load_registers_global if result_is_greaterthan_orequal(80) { goto(BacktrackWarp) }
load_registers_global if result_is_greaterthan_orequal(70) { goto(RandomizeMainParty) }
load_registers_global if result_is_greaterthan_orequal(60) { goto(RandomizeNpcParty) }
load_registers_global if result_is_greaterthan_orequal(50) { goto(RandomSound) }
load_registers_global if result_is_greaterthan_orequal(33) { goto(RandomDistortion) }
load_registers_global if result_is_greaterthan_orequal(30) { goto(RandomBBG) }
load_registers_global if result_is_greaterthan_orequal(1) { goto(RandomPalette) }
load_registers_global if result_is_greaterthan_orequal(45) { goto(RandomSound) }
load_registers_global if result_is_greaterthan_orequal(30) { goto(RandomizeNpcParty) }
load_registers_global if result_is_greaterthan_orequal(10) { goto(RandomizeMainParty) }
load_registers_global if result_is_greaterthan_orequal(4) { goto(BacktrackWarp) }
load_registers_global if result_is_greaterthan_orequal(3) { goto(CorruptMap) }
load_registers_global if result_is_greaterthan_orequal(2) { goto(RandomDistortion) }
load_registers_global if result_is_greaterthan_orequal(1) { goto(RandomBBG) }
eob

command change_map_pal(tileset, palette, duration) "[1F E1 {byte tileset} {byte palette} {byte duration}]"
Expand Down Expand Up @@ -278,4 +279,4 @@ RandomBBG:
sprite_spawn(106, 896, 1) // Invisible camera sprite running "Cutscene On"
show_battle_bg(-1,-1,0)
sprite_spawn(106, 897, 1) // Invisible camera sprite running "Cutscene Off"
eob
eob
Loading

0 comments on commit c3e6b8a

Please sign in to comment.