From 628bc7b49c0b0c13f7af6b98452d15b85f33bed6 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sun, 15 Nov 2015 19:59:10 -0800 Subject: [PATCH] add half-broken race file creator --- Lua/addrs/M/common.lua | 8 +++- Lua/menus/progress.lua | 2 +- Lua/race.lua | 102 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 Lua/race.lua diff --git a/Lua/addrs/M/common.lua b/Lua/addrs/M/common.lua index a700584..9b029c3 100755 --- a/Lua/addrs/M/common.lua +++ b/Lua/addrs/M/common.lua @@ -99,7 +99,7 @@ function Actor(addr) end return { - link = A(link, 0x4000), + link = AL(0x00, 0x4000), exit_value = AL(0x02, 2), mask_worn = AL(0x04, 1), intro_completed = AL(0x05, 1), @@ -125,6 +125,7 @@ return { has_normal_magic = AL(0x40, 1), has_double_magic = AL(0x41, 1), owls_hit = AL(0x46, 2), + tunic_boots = AL(0x6C, 1), sword_shield = AL(0x6D, 1), inventory_items = AL(0x70, 24), inventory_masks = AL(0x88, 24), @@ -188,6 +189,11 @@ return { }, -- note: these addresses are invalid for JP10, JP11. + epona_scene = AL(0x1000, 2), -- this is where you left epona + epona_x = AL(0x1002, 2), -- NOT where she currently is + epona_y = AL(0x1004, 2), + epona_z = AL(0x1006, 2), + epona_angle = AL(0x1008, 2), checksum = AL(0x100A, 2), event_inf = AL(0x100C, 8), disable_pause = AL(0x100D, 1), diff --git a/Lua/menus/progress.lua b/Lua/menus/progress.lua index 3829fd2..6c89f06 100644 --- a/Lua/menus/progress.lua +++ b/Lua/menus/progress.lua @@ -242,7 +242,7 @@ return oot and Menu{ Oneshot("Z Targeting: Hold", Setter{[a.target_style]=1}), Text(""), Oneshot("Setup First Cycle", first_cycle), - --Oneshot("Setup Race File", race_file), + Oneshot("Setup Race File", Setter{[dofile]="race.lua"}), Text(""), Oneshot("Set Bombers Code to 12345", Setter{ [a.bombers_code[1]]=1, diff --git a/Lua/race.lua b/Lua/race.lua new file mode 100644 index 0000000..c9b6816 --- /dev/null +++ b/Lua/race.lua @@ -0,0 +1,102 @@ +require "boilerplate" +local a = require "addrs.init" +local inv = a.inventory +local masks = a.masks +local quantities = a.quantities + +local iv +if version == "M JP10" or version == "M JP11" then + iv = require "data.item values early" +elseif oot then + iv = require "data.item values oot" +else + iv = require "data.item values" +end + +require "flag manager" + +-- TODO: just force a song of time cutscene to reset most things +-- TODO: wipe flags + +for i=a.link.addr, a.link.addr + a.link.type, 4 do + W4(i, 0) +end + +a.exit_value(0xD800) +--a.mask_worn(0) +a.intro_completed(1) +a.time(0x3FFF) +--a.owl_id(0) +--a.day_night(0) +--a.time_speed(0) +--a.day(0) +--a.days_elapsed(0) +a.transformation(4) +a.have_tatl(1) +--a.owl_save(0) +a.sot_count(2) +a.max_hearts(0x30) +a.hearts(0x30) +a.magic_level(1) +a.magic(0x30) +a.magic_max(0x30) +--a.rupees(0) +a.has_normal_magic(1) +--a.has_double_magic(0) +--a.owls_hit(0) +for k, f in pairs(inv) do f(-1) end +for k, f in pairs(masks) do f(-1) end +inv.b_button_item(0x4D) -- TODO: add to item values table +inv.b_button_goron(0x4D) +inv.b_button_zora(0x4D) +inv.b_button_deku(iv.deku_nuts) +inv.c_left_item(iv.ocarina) +inv.c_down_item(-1) +inv.c_right_item(-1) +inv.c_left_slot(iv.ocarina) +inv.c_down_slot(-1) +inv.c_right_slot(-1) +--a.tunic_boots(0) +a.sword_shield(0x11) +inv.ocarina(iv.ocarina) +masks.deku(iv.deku) +--for k, f in pairs(quantities) do f(0) end +a.upgrades(0x00120000) -- deku nut 20 and deku stick 10 +a.quest_items(0x10003000) +AL(0x3D7, 5) -- unknown +scene_flag_set(9, 0, 10) +scene_flag_set(94, 2, 0) +scene_flag_set(111, 4, 10) +AL(0xE6C, 0x1D4C) -- unknown +AL(0xE70, 0x1D4C) -- unknown +AL(0xE74, 0x1DB0) -- unknown +AL(0xEE8, 0x0013000A) -- unknown +AL(0xEEC, 0x1770) -- unknown +AL(0xEF4, 0x000A0027) -- unknown +event_flag_set(2, 5) +event_flag_set(2, 4) +event_flag_set(2, 3) +event_flag_set(31, 2) +event_flag_set(59, 2) +event_flag_set(92, 7) +a.map_visited(0x20) +a.map_visible(0x00) +a.bombers_code[1](1) +a.bombers_code[2](2) +a.bombers_code[3](3) +a.bombers_code[4](4) +a.bombers_code[5](5) +a.spider_mask_order[1](0) -- red +a.spider_mask_order[2](1) -- blue +a.spider_mask_order[3](0) -- red +a.spider_mask_order[4](1) -- blue +a.spider_mask_order[5](0) -- red +a.spider_mask_order[6](1) -- blue +a.lottery_numbers[1](0x010203) +a.lottery_numbers[2](0x040506) +a.lottery_numbers[3](0x070809) +a.epona_scene(53) +a.epona_x(-1420) +a.epona_y(257) +a.epona_z(-1285) +a.epona_angle(10922)