Skip to content

Commit

Permalink
PR:Allow Tactical Bikers and Marines to sabotage when chapter are amb…
Browse files Browse the repository at this point in the history
…ushers(#365)

## Description of changes
<!--- Leverage the list functionality, if you have many changes -->
-Allows Tactical Bikers to do sabotage missions
-Allows Tactical marines to do sabotage missions for chapters with
Ambushers
## Reasons for changes
<!--- Leverage the list functionality, here as well -->
-Add more to Lightning warriors and Ambushers to make them more
competetive as advantages.

## Summary by Sourcery

New Features:
- Tactical Bikers and Tactical Marines with the "Ambushers" advantage
can now perform sabotage missions.
  • Loading branch information
KRdaMystic authored Jan 1, 2025
1 parent 92d5d9c commit a57c40d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/scr_company_struct/scr_company_struct.gml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function CompanyStruct(comp) constructor{
mission_type="garrison";
}
}
if (array_contains(current_squad.class, "scout")){
if (array_contains(current_squad.class, "scout")) || (array_contains(current_squad.class, "bike")){
tooltip_text="Sabotage";
button = draw_unit_buttons([button[2] + 4, yy+bound_height[0]+150], tooltip_text,[1,1],c_red,,,,true);
if(point_in_rectangle(mouse_x, mouse_y,xx+bound_width[0]+5+ button_row_offset, yy+bound_height[0]+150, xx+bound_width[0]+5+string_width(tooltip_text)+ button_row_offset, yy+bound_height[0]+150+string_height(tooltip_text))){
Expand Down
14 changes: 11 additions & 3 deletions scripts/scr_initialize_custom/scr_initialize_custom.gml
Original file line number Diff line number Diff line change
Expand Up @@ -1713,7 +1713,10 @@ function scr_initialize_custom() {
["type_data", {
"display_data": $"{roles.tactical} {squad_name}",
"formation_options": ["tactical", "assault", "devastator", "scout"],
}]
"class":["troop"]
}],


],

"assault_squad": [
Expand Down Expand Up @@ -1986,7 +1989,8 @@ function scr_initialize_custom() {
"role": $"{roles.tactical} Bike {roles.sergeant}"
}, ],
["type_data", {
"display_data": $"{roles.tactical} Bike {squad_name}"
"display_data": $"{roles.tactical} Bike {squad_name}",
"class":["bike"],
}]
])

Expand Down Expand Up @@ -2154,6 +2158,10 @@ function scr_initialize_custom() {
squad_types[$squad_names[st_iter]][$s_group[iter_2][0]] = s_group[iter_2][1];
}
}
if(scr_has_adv("Ambushers")){
var _class_data = squad_types.tactical_squad.type_data.class;
array_push(_class_data, "scout")
}
// show_debug_message("Squad types");
// show_debug_message(squad_types);

Expand Down Expand Up @@ -3402,4 +3410,4 @@ function DeepCloneStruct(clone_struct) {
return stc;
}
return clone_struct;
}
}

0 comments on commit a57c40d

Please sign in to comment.