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
4 changes: 2 additions & 2 deletions ChapterMaster.yyp
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@
{"id":{"name":"scr_add_man","path":"scripts/scr_add_man/scr_add_man.yy",},},
{"id":{"name":"scr_add_stc_fragment","path":"scripts/scr_add_stc_fragment/scr_add_stc_fragment.yy",},},
{"id":{"name":"scr_add_vehicle","path":"scripts/scr_add_vehicle/scr_add_vehicle.yy",},},
{"id":{"name":"scr_after_combat","path":"scripts/scr_after_combat/scr_after_combat.yy",},},
{"id":{"name":"scr_alert","path":"scripts/scr_alert/scr_alert.yy",},},
{"id":{"name":"scr_ancient_ruins","path":"scripts/scr_ancient_ruins/scr_ancient_ruins.yy",},},
{"id":{"name":"scr_animated_scanline","path":"scripts/scr_animated_scanline/scr_animated_scanline.yy",},},
Expand Down Expand Up @@ -707,7 +708,6 @@
{"id":{"name":"scr_dialogue","path":"scripts/scr_dialogue/scr_dialogue.yy",},},
{"id":{"name":"scr_diplomacy_helpers","path":"scripts/scr_diplomacy_helpers/scr_diplomacy_helpers.yy",},},
{"id":{"name":"scr_display_number","path":"scripts/scr_display_number/scr_display_number.yy",},},
{"id":{"name":"scr_distribute_experience","path":"scripts/scr_distribute_experience/scr_distribute_experience.yy",},},
{"id":{"name":"scr_distributions","path":"scripts/scr_distributions/scr_distributions.yy",},},
{"id":{"name":"scr_draw_armentarium","path":"scripts/scr_draw_armentarium/scr_draw_armentarium.yy",},},
{"id":{"name":"scr_draw_management_unit","path":"scripts/scr_draw_management_unit/scr_draw_management_unit.yy",},},
Expand Down Expand Up @@ -1681,4 +1681,4 @@
"TextureGroups":[
{"$GMTextureGroup":"","%Name":"Default","autocrop":true,"border":2,"compressFormat":"bz2","customOptions":"","directory":"","groupParent":null,"isScaled":false,"loadType":"default","mipsToGenerate":0,"name":"Default","resourceType":"GMTextureGroup","resourceVersion":"2.0","targets":-1,},
],
}
}
1 change: 1 addition & 0 deletions objects/obj_ncombat/Alarm_3.gml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ if ((messages>0) and (messages_shown<24)) and (messages_shown<=100){
newline=message[that];
if (message_priority[that]>0) then newline_color="bright";
if (string_count("lost",newline)>0) then newline_color="red";
if (string_count("critically injured",newline)>0) then newline_color="red";
if (string_count("^",newline)>0){
newline=string_replace(newline,"^","");
newline_color="white";
Expand Down
183 changes: 144 additions & 39 deletions objects/obj_ncombat/Alarm_5.gml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ battle_over=1;

alarm[8]=999999;
var line_break = "------------------------------------------------------------------------------";
// show_message("Final Deaths: "+string(final_deaths));
// show_message("Final Deaths: "+string(final_marine_deaths));


if (turn_count >= 50){
Expand All @@ -15,35 +15,119 @@ if (turn_count >= 50){
// check for wounded marines here to finish off, if defeated defending
var roles = obj_ini.role[100];
var ground_mission = (instance_exists(obj_ground_mission));
if (final_deaths+final_command_deaths>0){
part1+=$"Marines Lost: {final_deaths+final_command_deaths}";
if (units_saved > 0){
part1+=$" ({roles[eROLE.Apothecary]}{apothecaries_alive>1?"s":""} prevented the death of {units_saved})";
}
if (injured>0) then part8=$"Marines Critically Injured: {injured}";

with (obj_pnunit) {
after_battle_part1();
}

if (obj_ncombat.defeat == 0) {
marines_to_recover = ds_priority_create();
vehicles_to_recover = ds_priority_create();

with (obj_pnunit) {
add_marines_to_recovery();
add_vehicles_to_recovery();
}

while (!ds_priority_empty(marines_to_recover)) {
var _candidate = ds_priority_delete_max(marines_to_recover);
var _column_id = _candidate.column_id;
var _unit_id = _candidate.id;
var _unit = _candidate.unit;
var _constitution_test_mod = _unit.hp() * -1;
var _constitution_test = global.character_tester.standard_test(_unit, "constitution", _constitution_test_mod);

if (unit_recovery_score > 0) {
_unit.update_health(_constitution_test[1]);
_column_id.marine_dead[_unit_id] = false;
unit_recovery_score--;
units_saved++;
continue;
}

if (_unit.base_group == "astartes") {
if (!_unit.gene_seed_mutations[$ "membrane"]) {
var survival_mod = _unit.luck * -1;
survival_mod += _unit.hp() * -1;

var i=0;
for (var i=1;i<array_length(post_unit_lost);i++){
if (post_unit_lost[i]!="") and (post_units_lost[i]>0) and (post_unit_veh[i]=0){
part2+=$"{post_units_lost[i]}x {post_unit_lost[i]},";
var survival_test = global.character_tester.standard_test(_unit, "constitution", survival_mod);
if (survival_test[0]) {
_column_id.marine_dead[_unit_id] = false;
injured++;
}
}
}
}
part2=string_delete(part2,string_length(part2)-1,2);
part2+=".";i=0;
ds_priority_destroy(marines_to_recover);

while (!ds_priority_empty(vehicles_to_recover)) {
var _candidate = ds_priority_delete_max(vehicles_to_recover);
var _column_id = _candidate.column_id;
var _vehicle_id = _candidate.id;

if (injured>0){
newline=part8;
if (obj_controller.stc_bonus[3] = 4) {
var _survival_roll = 80 + _candidate.priority;
var _dice_roll = roll_dice(1, 100, "high");
if (_dice_roll >= _survival_roll) && (_column_id.veh_dead[_vehicle_id] != 2) {
_column_id.veh_hp[_vehicle_id] = roll_dice(1, 10, "high");
_column_id.veh_dead[_vehicle_id] = false;
vehicles_saved++;
vehicle_deaths--;
continue;
}
}

if (vehicle_recovery_score > 0) {
_column_id.veh_hp[_vehicle_id] = roll_dice(1, 10, "high");
_column_id.veh_dead[_vehicle_id] = false;
vehicle_recovery_score -= _candidate.priority;
vehicles_saved++;
vehicle_deaths--;
}
}
ds_priority_destroy(vehicles_to_recover);
}


with (obj_pnunit) {
after_battle_part2();
}

var _total_deaths = final_marine_deaths + final_command_deaths;
if (_total_deaths > 0 || injured > 0 || units_saved > 0) {
newline = $"{_total_deaths + injured + units_saved}x units were critically injured.";
newline_color = "red";
scr_newtext();

if (units_saved > 0) {
newline = $"{units_saved}x were saved by the {string_plural(roles[eROLE.Apothecary])}.";
scr_newtext();
}
if (injured > 0) {
newline = $"{injured}x survived thanks to the Sus-an Membrane.";
newline_color = "red";
scr_newtext();
}

if (_total_deaths > 0) {
newline = $"{_total_deaths}x units succumbed to their wounds!";
var _unit_roles = struct_get_names(units_lost_counts);
for (var i = 0; i < array_length(_unit_roles); i++) {
var _unit_role = _unit_roles[i];
var _lost_count = units_lost_counts[$ _unit_role];
newline += $" {_lost_count}x {_unit_role}";
if (i < array_length(_unit_roles) - 1) {
newline += ",";
} else {
newline += ".";
}
}
newline_color = "red";
scr_newtext();
}
newline=part1;
scr_newtext();
newline=part2;
newline_color="red";
scr_newtext();
newline=" ";
scr_newtext();
}


if (ground_mission){
if (apothecaries_alive < 0){
obj_ground_mission.apothecary_present = apothecaries_alive;
Expand All @@ -64,7 +148,7 @@ if (obj_ini.doomed && !apothecaries_alive){
part3=$"No able-bodied {roles[eROLE.Apothecary]}. {seed_max} Gene-Seed lost.";
newline=part3;scr_newtext();
newline=" ";scr_newtext();
}else if (apothecaries_alive>0 && final_deaths+final_command_deaths>0 && !obj_ini.doomed){
}else if (apothecaries_alive>0 && final_marine_deaths+final_command_deaths>0 && !obj_ini.doomed){
part3=$"Gene-Seed Recovered: {seed_saved}(";
part3 += seed_saved ? $"{round((seed_saved/seed_max)*100)}" : "0";
part3 += "%)";
Expand All @@ -83,29 +167,43 @@ if (red_thirst>2){

newline=voodoo;newline_color="red";
scr_newtext();
newline=" ";scr_newtext();
newline=" ";
scr_newtext();
}

newline = " ";
scr_newtext();

if (vehicle_deaths>0 || vehicles_saved>0){
part4="Vehicles Lost: "+string(vehicle_deaths);
if (techmarines_alive=1) then part4+=" ("+string(roles[16])+" prevented the destruction of "+string(vehicles_saved)+")";
if (techmarines_alive>1) then part4+=" ("+string(roles[16])+"s prevented the destruction of "+string(vehicles_saved)+")";

var i;i=0;
repeat(30){i+=1;
if (post_unit_lost[i]!="") and (post_units_lost[i]>0) and (post_unit_veh[i]=1){
part5+=string(post_units_lost[i])+"x "+string(post_unit_lost[i])+", ";


if (vehicles_saved > 0) {
newline = $"{string_plural(roles[eROLE.Techmarine], techmarines_alive)} were able to recover {vehicles_saved} vehicles.";
scr_newtext();
}

if (vehicle_deaths > 0) {
newline = $"Vehicles Lost: {vehicle_deaths}.";

var _vehicle_types = struct_get_names(vehicles_lost_counts);
for (var i = 0; i < array_length(_vehicle_types); i++) {
var _vehicle_type = _vehicle_types[i];
var _lost_count = vehicles_lost_counts[$ _vehicle_type];
newline += $" {_lost_count}x {_vehicle_type}";
if (i < array_length(_vehicle_types) - 1) {
newline += ",";
} else {
newline += ".";
}
}
part5=string_delete(part5,string_length(part5)-1,2);part5+=".";i=0;

newline=part4;scr_newtext();
newline=part5;scr_newtext();
newline=" ";scr_newtext();

newline_color="red";
scr_newtext();
newline = " ";
scr_newtext();
}



if (post_equipment_lost[1]!=""){
part6="Equipment Lost: ";

Expand All @@ -126,7 +224,13 @@ if (post_equipment_lost[1]!=""){
newline=" ";
scr_newtext();
}



if (total_battle_exp_gain>0){
with (obj_pnunit) {
assemble_alive_units();
}
average_battle_exp_gain = distribute_experience(end_alive_units, total_battle_exp_gain); // Due to cool alarm timer shitshow, I couldn't think of anything but to put it here.
newline = $"Each marine gained {average_battle_exp_gain} experience, reduced by their total experience.";
scr_newtext();
Expand All @@ -137,7 +241,7 @@ if (total_battle_exp_gain>0){
if (i > 0) {
newline += ", ";
}
newline += $"{upgraded_librarians[i].name()}";
newline += $"{upgraded_librarians[i].name_role()}";
}
newline += " learned new psychic powers after gaining enough experience."
scr_newtext();
Expand All @@ -151,6 +255,7 @@ if (ground_mission){
obj_ground_mission.post_equipment_lost = post_equipment_lost
obj_ground_mission.post_equipments_lost = post_equipments_lost
}

if (slime>0){
var compan_slime;
compan_slime=0;
Expand Down
6 changes: 3 additions & 3 deletions objects/obj_ncombat/Alarm_7.gml
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ try {
obj_controller.x=view_x;
obj_controller.y=view_y;
obj_controller.combat=0;
obj_controller.marines-=final_deaths;
obj_controller.marines-=final_marine_deaths;
obj_controller.command-=final_command_deaths;

instance_activate_all();
Expand All @@ -266,9 +266,9 @@ try {



if (defeat=1) and (final_deaths+final_command_deaths>=10) then scr_recent("battle_defeat", $"{enemy}, {final_deaths+final_command_deaths}");
if (defeat=1) and (final_marine_deaths+final_command_deaths>=10) then scr_recent("battle_defeat", $"{enemy}, {final_marine_deaths+final_command_deaths}");
} else {
scr_recent("battle_defeat",$"{enemy}, {final_deaths+final_command_deaths}");
scr_recent("battle_defeat",$"{enemy}, {final_marine_deaths+final_command_deaths}");
}


Expand Down
12 changes: 7 additions & 5 deletions objects/obj_ncombat/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ on_ship=false;
alpha_strike=0;
Warlord = 0;
total_battle_exp_gain=0;
marines_to_recover = 0;
vehicles_to_recover = 0;
end_alive_units = [];
average_battle_exp_gain=0;
upgraded_librarians=[];
Expand Down Expand Up @@ -115,6 +117,10 @@ hulk_forces=0;

i=-1;messages=0;messages_to_show=24;messages_shown=0;
largest=0;priority=0;random_messages=0;dead_enemies=0;

units_lost_counts = {};
vehicles_lost_counts = {};

repeat(70){i+=1;
lines[i]="";
lines_color[i]="";
Expand All @@ -125,9 +131,6 @@ repeat(70){i+=1;
dead_ene[i]="";
dead_ene_n[i]=0;

post_unit_lost[i]="";
post_unit_veh[i]=0;
post_units_lost[i]=0;
post_equipment_lost[i]="";
post_equipments_lost[i]=0;

Expand All @@ -147,11 +150,10 @@ seed_max=0;
units_saved=0;
command_saved=0;
vehicles_saved=0;
final_deaths=0;
final_marine_deaths=0;
final_command_deaths=0;
vehicle_deaths=0;
casualties=0;
command_casualties=0;
dead_jims=0;
newline="";
newline_color="";
Expand Down
4 changes: 0 additions & 4 deletions objects/obj_ncombat/KeyPress_13.gml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ if ((started=2) or (started=4)){
// started=3;alarm[5]=3;obj_pnunit.alarm[4]=1;obj_pnunit.alarm[5]=2;obj_enunit.alarm[1]=3;
started=3;
// obj_pnunit.alarm[4]=2;obj_pnunit.alarm[5]=3;obj_enunit.alarm[1]=1;
if (instance_exists(obj_pnunit)){
obj_pnunit.alarm[4]=2;
obj_pnunit.alarm[5]=3;
}
total_battle_exp_gain = threat * 50;
if (instance_exists(obj_enunit)){obj_enunit.alarm[1]=1;}
instance_activate_object(obj_star);
Expand Down
Loading