Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions patches/rom_map/Bank 83.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
0000 - AD66: Used by vanilla game
AD66 - AD72: escape_autosave.asm
B000 - B700: items_disappear.asm
B000 - B700: [FREE]
B700 - B800: rng_fix.asm
B800 - BA00: Mosaic (Area FX.asm)
BA00 - BA15: vanilla_bugfixes.asm
BA15 - BB00: [free]
BA15 - BB00: [FREE]
BB00 - BC40: disableable_etanks.asm
BC40 - F000: [free space]
BC40 - E000: [FREE]
E000 - F000: item_dots_disappear.asm
F000 - end: Mosaic (FX data)
4 changes: 2 additions & 2 deletions patches/src/item_dots_disappear.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ arch snes.cpu
lorom

; Must match locations in patch/map_tiles.rs
!item_list_ptrs = $83B000
!item_list_sizes = $83B00C
!item_list_ptrs = $83E000
!item_list_sizes = $83E00C

!bank_82_freespace_start = $82FD00
!bank_82_freespace_end = $82FD80
Expand Down
11 changes: 11 additions & 0 deletions rust/data/presets/doors/Ammo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"preset": "Ammo",
"red_doors_count": 30,
"green_doors_count": 15,
"yellow_doors_count": 10,
"charge_doors_count": 0,
"ice_doors_count": 0,
"wave_doors_count": 0,
"spazer_doors_count": 0,
"plasma_doors_count": 0
}
11 changes: 11 additions & 0 deletions rust/data/presets/doors/Beam.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"preset": "Beam",
"red_doors_count": 18,
"green_doors_count": 10,
"yellow_doors_count": 7,
"charge_doors_count": 4,
"ice_doors_count": 4,
"wave_doors_count": 4,
"spazer_doors_count": 4,
"plasma_doors_count": 4
}
11 changes: 11 additions & 0 deletions rust/data/presets/doors/Blue.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"preset": "Blue",
"red_doors_count": 0,
"green_doors_count": 0,
"yellow_doors_count": 0,
"charge_doors_count": 0,
"ice_doors_count": 0,
"wave_doors_count": 0,
"spazer_doors_count": 0,
"plasma_doors_count": 0
}
12 changes: 11 additions & 1 deletion rust/data/presets/full-settings/Community Race Season 4.json
Original file line number Diff line number Diff line change
Expand Up @@ -4638,7 +4638,17 @@
"objective_screen": "Enabled"
},
"map_layout": "Standard",
"doors_mode": "Ammo",
"doors_settings": {
"preset": "Ammo",
"red_doors_count": 30,
"green_doors_count": 15,
"yellow_doors_count": 10,
"charge_doors_count": 0,
"ice_doors_count": 0,
"wave_doors_count": 0,
"spazer_doors_count": 0,
"plasma_doors_count": 0
},
"start_location_settings": {
"mode": "Random",
"room_id": null,
Expand Down
12 changes: 11 additions & 1 deletion rust/data/presets/full-settings/Default.json
Original file line number Diff line number Diff line change
Expand Up @@ -4638,7 +4638,17 @@
"objective_screen": "Enabled"
},
"map_layout": "Standard",
"doors_mode": "Ammo",
"doors_settings": {
"preset": "Ammo",
"red_doors_count": 30,
"green_doors_count": 15,
"yellow_doors_count": 10,
"charge_doors_count": 0,
"ice_doors_count": 0,
"wave_doors_count": 0,
"spazer_doors_count": 0,
"plasma_doors_count": 0
},
"start_location_settings": {
"mode": "Ship"
},
Expand Down
3 changes: 3 additions & 0 deletions rust/maprando-web/src/web/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct GenerateTemplate<'a> {
skill_presets_json: String,
item_presets_json: String,
qol_presets_json: String,
doors_presets_json: String,
objective_presets_json: String,
item_priorities: Vec<String>,
item_names_multiple: Vec<String>,
Expand Down Expand Up @@ -117,6 +118,7 @@ async fn generate(app_data: web::Data<AppData>) -> impl Responder {
serde_json::to_string(&app_data.preset_data.item_progression_presets).unwrap();
let qol_presets_json =
serde_json::to_string(&app_data.preset_data.quality_of_life_presets).unwrap();
let doors_presets_json = serde_json::to_string(&app_data.preset_data.doors_presets).unwrap();
let objective_presets_json =
serde_json::to_string(&app_data.preset_data.objective_presets).unwrap();

Expand Down Expand Up @@ -167,6 +169,7 @@ async fn generate(app_data: web::Data<AppData>) -> impl Responder {
skill_presets_json,
item_presets_json,
qol_presets_json,
doors_presets_json,
objective_presets_json,
tech_description: &app_data.game_data.tech_description,
tech_dependencies_str: &tech_dependencies_strs,
Expand Down
20 changes: 18 additions & 2 deletions rust/maprando-web/src/web/randomize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,15 @@ struct SeedData {
momentum_conservation: bool,
fanfares: String,
objectives: Vec<String>,
doors: String,
doors_preset: Option<String>,
red_doors_count: i32,
green_doors_count: i32,
yellow_doors_count: i32,
charge_doors_count: i32,
ice_doors_count: i32,
wave_doors_count: i32,
spazer_doors_count: i32,
plasma_doors_count: i32,
start_location_mode: String,
map_layout: String,
save_animals: String,
Expand Down Expand Up @@ -333,7 +341,15 @@ async fn randomize(
.iter()
.map(|x| to_variant_name(x).unwrap().to_string())
.collect(),
doors: to_variant_name(&settings.doors_mode).unwrap().to_string(),
doors_preset: settings.doors_settings.preset.clone(),
red_doors_count: settings.doors_settings.red_doors_count,
green_doors_count: settings.doors_settings.green_doors_count,
yellow_doors_count: settings.doors_settings.yellow_doors_count,
charge_doors_count: settings.doors_settings.charge_doors_count,
ice_doors_count: settings.doors_settings.ice_doors_count,
wave_doors_count: settings.doors_settings.wave_doors_count,
spazer_doors_count: settings.doors_settings.spazer_doors_count,
plasma_doors_count: settings.doors_settings.plasma_doors_count,
start_location_mode: if settings.start_location_settings.mode == StartLocationMode::Custom {
output.randomization.start_location.name.clone()
} else {
Expand Down
23 changes: 21 additions & 2 deletions rust/maprando-web/src/web/randomize/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,15 @@ pub struct SeedHeaderTemplate<'a> {
fanfares: String,
etank_refill: String,
disableable_etanks: String,
doors: String,
doors_preset: String,
red_doors_count: i32,
green_doors_count: i32,
yellow_doors_count: i32,
charge_doors_count: i32,
ice_doors_count: i32,
wave_doors_count: i32,
spazer_doors_count: i32,
plasma_doors_count: i32,
start_location_mode: String,
map_layout: String,
save_animals: String,
Expand Down Expand Up @@ -466,7 +474,18 @@ pub fn render_seed(
DisableETankSetting::Unrestricted => "Unrestricted",
}
.to_string(),
doors: seed_data.doors.clone(),
doors_preset: seed_data
.doors_preset
.clone()
.unwrap_or("Custom".to_string()),
red_doors_count: seed_data.red_doors_count,
green_doors_count: seed_data.green_doors_count,
yellow_doors_count: seed_data.yellow_doors_count,
charge_doors_count: seed_data.charge_doors_count,
ice_doors_count: seed_data.ice_doors_count,
wave_doors_count: seed_data.wave_doors_count,
spazer_doors_count: seed_data.spazer_doors_count,
plasma_doors_count: seed_data.plasma_doors_count,
start_location_mode: seed_data.start_location_mode.clone(),
map_layout: seed_data.map_layout.clone(),
save_animals: seed_data.save_animals.clone(),
Expand Down
85 changes: 85 additions & 0 deletions rust/maprando-web/templates/generate/doors.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<div class="modal" id="doorsModal" tabindex="-1">
<div class="modal-dialog modal-lg modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5">Doors</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>

<div class="modal-body p-1">
<div class="form-group row">
<div class="col-lg-3 m-2">
<label for="red_doors_count">Missile Doors:</label>
</div>
<div class="col-lg-3 m-2">
<input type="text" class="form-control door-count" name="red_doors_count" id="red_doors_count" value="0" onchange="doorsSettingsChanged()">
</div>
</div>

<div class="form-group row">
<div class="col-lg-3 m-2">
<label for="green_doors_count">Super Doors:</label>
</div>
<div class="col-lg-3 m-2">
<input type="text" class="form-control door-count" name="green_doors_count" id="green_doors_count" value="0" onchange="doorsSettingsChanged()">
</div>
</div>

<div class="form-group row">
<div class="col-lg-3 m-2">
<label for="yellow_doors_count">Power Bomb Doors:</label>
</div>
<div class="col-lg-3 m-2">
<input type="text" class="form-control door-count" name="yellow_doors_count" id="yellow_doors_count" value="0" onchange="doorsSettingsChanged()">
</div>
</div>

<div class="form-group row">
<div class="col-lg-3 m-2">
<label for="charge_doors_count">Charge Beam Doors:</label>
</div>
<div class="col-lg-3 m-2">
<input type="text" class="form-control door-count" name="charge_doors_count" id="charge_doors_count" value="0" onchange="doorsSettingsChanged()">
</div>
</div>

<div class="form-group row">
<div class="col-lg-3 m-2">
<label for="ice_doors_count">Ice Beam Doors:</label>
</div>
<div class="col-lg-3 m-2">
<input type="text" class="form-control door-count" name="ice_doors_count" id="ice_doors_count" value="0" onchange="doorsSettingsChanged()">
</div>
</div>

<div class="form-group row">
<div class="col-lg-3 m-2">
<label for="wave_doors_count">Wave Beam Doors:</label>
</div>
<div class="col-lg-3 m-2">
<input type="text" class="form-control door-count" name="wave_doors_count" id="wave_doors_count" value="0" onchange="doorsSettingsChanged()">
</div>
</div>

<div class="form-group row">
<div class="col-lg-3 m-2">
<label for="spazer_doors_count">Spazer Doors:</label>
</div>
<div class="col-lg-3 m-2">
<input type="text" class="form-control door-count" name="spazer_doors_count" id="spazer_doors_count" value="0" onchange="doorsSettingsChanged()">
</div>
</div>

<div class="form-group row">
<div class="col-lg-3 m-2">
<label for="plasma_doors_count">Plasma Beam Doors:</label>
</div>
<div class="col-lg-3 m-2">
<input type="text" class="form-control door-count" name="plasma_doors_count" id="plasma_doors_count" value="0" onchange="doorsSettingsChanged()">
</div>
</div>
</div>
</div>
</div>
</div>

6 changes: 4 additions & 2 deletions rust/maprando-web/templates/generate/help/doors.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!-- Button trigger modal -->
<button type="button" class="btn mr-1 px-2 py-1" data-bs-toggle="modal" data-bs-target="#doorsModal">
<button type="button" class="btn mr-1 px-2 py-1" data-bs-toggle="modal" data-bs-target="#doorsHelpModal">
<i class="bi bi-question-circle"></i>
</button>
<!-- Modal -->
<div class="modal" id="doorsModal" tabindex="-1">
<div class="modal" id="doorsHelpModal" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
Expand All @@ -26,6 +26,8 @@ <h1 class="modal-title fs-5">Doors</h1>
one side of the door also unlocks the other.</p>
<p>Ammo and beam doors will not be placed on or immediately connect to any special tile such as a save, map,
refill, objective "X", or a gray door.</p>
<p>Click on the gear icon to customize the number of ammo and beam doors that can appear. This sets the maximum
number of doors, and the randomizer will attempt to place that many. In certain cases, fewer doors than the maximum can be placed.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
Expand Down
27 changes: 21 additions & 6 deletions rust/maprando-web/templates/generate/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@
for (p of qolPresetsArr) {
qolPresets[p.preset] = p;
}

let doorsPresetsArr = {{ doors_presets_json|safe }};
let doorsPresets = {};
for (p of doorsPresetsArr) {
doorsPresets[p.preset] = p;
}

let objectivePresetsArr = {{ objective_presets_json|safe }};
let objectivePresets = {};
Expand Down Expand Up @@ -213,12 +219,20 @@ <h3 class="mt-3 mb-2">Generate Game</h3>
<label for="doors">Doors</label>
</div>
<div id="doors" class="col-lg-4 btn-group" role="group">
<input type="radio" class="btn-check" name="doors" id="doorsBlue" value="Blue" onchange="fullSettingsChanged()">
<label class="btn btn-outline-primary" for="doorsBlue">Blue</label>
<input type="radio" class="btn-check" name="doors" id="doorsAmmo" value="Ammo" onchange="fullSettingsChanged()" checked=true>
<label class="btn btn-outline-primary" for="doorsAmmo">Ammo</label>
<input type="radio" class="btn-check" name="doors" id="doorsBeam" value="Beam" onchange="fullSettingsChanged()">
<label class="btn btn-outline-primary" for="doorsBeam">Beam</label>
{% for preset in preset_data.doors_presets.iter() %}
{% let name = preset.preset.as_ref().unwrap() %}
<input type="radio" class="btn-check doors-preset-button" name="doors_preset" value="{{+ name}}"
id="doors{{+ name }}" autocomplete="off"
onchange="doorsPresetChanged()"
{% if loop.index0 == 1 %}
checked
{% endif %}
>
<label class="btn btn-outline-primary p-2" for="doors{{+ name }}">{{+ name }}</label>
{% endfor %}
<button type="button" style="flex:none" class="btn btn-secondary ms-1 me-0 p-2" data-bs-toggle="modal" data-bs-target="#doorsModal">
<i class="bi bi-gear"></i>
</button>
</div>
</div>

Expand Down Expand Up @@ -289,6 +303,7 @@ <h2 class="accordion-header">
{% include "item_progression.html" %}
{% include "quality_of_life.html" %}
{% include "objectives.html" %}
{% include "doors.html" %}
{% include "start_location.html" %}
</form>
</div>
Expand Down
Loading