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
11 changes: 11 additions & 0 deletions scripts/scr_ChapterTraits/scr_ChapterTraits.gml
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,17 @@ function generate_advantages() {
return json_to_gamemaker(working_directory + $"main/chapter_advantages.json", json_parse);
}

/// @desc Clears activated traits and shared meta so each chapter pick starts clean.
function reset_chapter_traits() {
obj_creation.chapter_trait_meta = [];
for (var i = 0; i < array_length(obj_creation.all_advantages); i++) {
obj_creation.all_advantages[i].activated = false;
}
for (var i = 0; i < array_length(obj_creation.all_disadvantages); i++) {
obj_creation.all_disadvantages[i].activated = false;
}
}

function setup_chapter_traits() {
Advantage.id_start = 1;
Disadvantage.id_start = 1;
Expand Down
1 change: 1 addition & 0 deletions scripts/scr_chapter_new/scr_chapter_new.gml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ function ChapterData() constructor {
/// @description called when a chapter's icon is clicked on the first page after the main menu.
/// used to set up initialise the data that is later fed into `scr_initialize_custom` when the game starts
function scr_chapter_new(chapter_identifier) {
reset_chapter_traits();
full_liveries = ""; // until chapter objects are in full use kicks off livery propogation

company_liveries = "";
Expand Down
1 change: 1 addition & 0 deletions scripts/scr_chapter_random/scr_chapter_random.gml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function scr_chapter_random(custom_or_random) {
found_secret = 0;
points = 0;
maxpoints = 100;
reset_chapter_traits();
fleet_type = 1;
strength = 5;
cooperation = 5;
Expand Down
Loading