From ccdf574b755486b35f034b52341e126ae5baeaff Mon Sep 17 00:00:00 2001 From: AyyLuska Date: Sun, 3 Sep 2023 13:08:16 -0300 Subject: [PATCH 1/6] . --- code/modules/admin/verbs/adminpanelgq.dm | 12 ++++++------ code/modules/almayer/generalquarters.dm | 8 ++++++++ colonialmarines.dme | 1 + 3 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 code/modules/almayer/generalquarters.dm diff --git a/code/modules/admin/verbs/adminpanelgq.dm b/code/modules/admin/verbs/adminpanelgq.dm index 8ef1ed869661..8fa65f3de22d 100644 --- a/code/modules/admin/verbs/adminpanelgq.dm +++ b/code/modules/admin/verbs/adminpanelgq.dm @@ -2,15 +2,15 @@ set name = "Call General Quarters" set category = "Admin.Ship" - if(security_level == SEC_LEVEL_RED || security_level == SEC_LEVEL_DELTA) - tgui_alert(src, "Security is already red or above, General Quarters cannot be called.", "Acknowledge!", list("ok."), 10 SECONDS) - return FALSE + //if(security_level == SEC_LEVEL_RED || security_level == SEC_LEVEL_DELTA) + //tgui_alert(src, "Security is already red or above, General Quarters cannot be called.", "Acknowledge!", list("ok."), 10 SECONDS) + //return FALSE var/prompt = tgui_alert(src, "Are you sure you want to send General Quarters? This will force red alert.", "Choose.", list("Yes", "No"), 20 SECONDS) if(prompt != "Yes") return FALSE - var/whattoannounce = "ATTENTION! GENERAL QUARTERS. ALL HANDS, MAN YOUR BATTLESTATIONS." + //var/whattoannounce = "ATTENTION! GENERAL QUARTERS. ALL HANDS, MAN YOUR BATTLESTATIONS." var/log = "[key_name_admin(src)] Sent General Quarters!" prompt = tgui_alert(src, "Do you want to use a custom announcement?", "Choose.", list("Yes", "No"), 20 SECONDS) @@ -18,7 +18,7 @@ whattoannounce = tgui_input_text(src, "Please enter announcement text.", "what?") log = "[key_name_admin(src)] Sent General Quarters! (Using a custom announcement)" - set_security_level(SEC_LEVEL_RED, TRUE, FALSE) - shipwide_ai_announcement(whattoannounce, MAIN_AI_SYSTEM, 'sound/effects/GQfullcall.ogg') + //set_security_level(SEC_LEVEL_RED, TRUE, FALSE) + //shipwide_ai_announcement(whattoannounce, MAIN_AI_SYSTEM, 'sound/effects/GQfullcall.ogg') message_admins(log) return TRUE diff --git a/code/modules/almayer/generalquarters.dm b/code/modules/almayer/generalquarters.dm new file mode 100644 index 000000000000..6d5a384d0e6b --- /dev/null +++ b/code/modules/almayer/generalquarters.dm @@ -0,0 +1,8 @@ +/proc/generalquarters(customannouncement, customannouncementtext) + var/GQannouncement = "ATTENTION! GENERAL QUARTERS. ALL HANDS, MAN YOUR BATTLESTATIONS." + if(security_level < SEC_LEVEL_RED) + set_security_level(SEC_LEVEL_RED, TRUE, FALSE) + if(customannouncement) + shipwide_ai_announcement(customannouncementtext, MAIN_AI_SYSTEM, 'sound/effects/GQfullcall.ogg') + else + shipwide_ai_announcement(GQannouncement, MAIN_AI_SYSTEM, 'sound/effects/GQfullcall.ogg') diff --git a/colonialmarines.dme b/colonialmarines.dme index 03f1e780e4a1..c9400d2277c0 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -1380,6 +1380,7 @@ s// DM Environment file for colonialmarines.dme. #include "code\modules\admin\view_variables\topic_basic.dm" #include "code\modules\admin\view_variables\topic_list.dm" #include "code\modules\admin\view_variables\view_variables.dm" +#include "code\modules\almayer\generalquarters.dm" #include "code\modules\almayer\machinery.dm" #include "code\modules\almayer\shakeship.dm" #include "code\modules\almayer\weaponhits.dm" From c71e4de83ec4f228e5af34a8a3abecadf05bc1b1 Mon Sep 17 00:00:00 2001 From: AyyLuska Date: Sun, 3 Sep 2023 13:10:25 -0300 Subject: [PATCH 2/6] . --- code/modules/admin/verbs/adminpanelgq.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/verbs/adminpanelgq.dm b/code/modules/admin/verbs/adminpanelgq.dm index 8fa65f3de22d..7fc0f3095fe2 100644 --- a/code/modules/admin/verbs/adminpanelgq.dm +++ b/code/modules/admin/verbs/adminpanelgq.dm @@ -15,10 +15,10 @@ prompt = tgui_alert(src, "Do you want to use a custom announcement?", "Choose.", list("Yes", "No"), 20 SECONDS) if(prompt == "Yes") + var/customannouncement = TRUE whattoannounce = tgui_input_text(src, "Please enter announcement text.", "what?") log = "[key_name_admin(src)] Sent General Quarters! (Using a custom announcement)" - //set_security_level(SEC_LEVEL_RED, TRUE, FALSE) - //shipwide_ai_announcement(whattoannounce, MAIN_AI_SYSTEM, 'sound/effects/GQfullcall.ogg') + generalquarters(customannouncement, whattoannounce) message_admins(log) return TRUE From a55f0eba8c3d282f7027788293b9f7f0cdc72e24 Mon Sep 17 00:00:00 2001 From: AyyLuska Date: Sun, 3 Sep 2023 13:21:39 -0300 Subject: [PATCH 3/6] . --- code/modules/admin/verbs/adminpanelgq.dm | 5 ++++- code/modules/almayer/generalquarters.dm | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/verbs/adminpanelgq.dm b/code/modules/admin/verbs/adminpanelgq.dm index 7fc0f3095fe2..8cd60f4f5c6d 100644 --- a/code/modules/admin/verbs/adminpanelgq.dm +++ b/code/modules/admin/verbs/adminpanelgq.dm @@ -2,6 +2,9 @@ set name = "Call General Quarters" set category = "Admin.Ship" + var/customannouncement = FALSE + var/whattoannounce + //if(security_level == SEC_LEVEL_RED || security_level == SEC_LEVEL_DELTA) //tgui_alert(src, "Security is already red or above, General Quarters cannot be called.", "Acknowledge!", list("ok."), 10 SECONDS) //return FALSE @@ -15,7 +18,7 @@ prompt = tgui_alert(src, "Do you want to use a custom announcement?", "Choose.", list("Yes", "No"), 20 SECONDS) if(prompt == "Yes") - var/customannouncement = TRUE + customannouncement = TRUE whattoannounce = tgui_input_text(src, "Please enter announcement text.", "what?") log = "[key_name_admin(src)] Sent General Quarters! (Using a custom announcement)" diff --git a/code/modules/almayer/generalquarters.dm b/code/modules/almayer/generalquarters.dm index 6d5a384d0e6b..4cb75ef1395c 100644 --- a/code/modules/almayer/generalquarters.dm +++ b/code/modules/almayer/generalquarters.dm @@ -3,6 +3,6 @@ if(security_level < SEC_LEVEL_RED) set_security_level(SEC_LEVEL_RED, TRUE, FALSE) if(customannouncement) - shipwide_ai_announcement(customannouncementtext, MAIN_AI_SYSTEM, 'sound/effects/GQfullcall.ogg') + shipwide_ai_announcement(customannouncementtext, MAIN_AI_SYSTEM, 'sound/effects/GQfullcall.ogg') else shipwide_ai_announcement(GQannouncement, MAIN_AI_SYSTEM, 'sound/effects/GQfullcall.ogg') From fa30becd3477c90ea85b9d4d4b70d49abe22a621 Mon Sep 17 00:00:00 2001 From: AyyLuska Date: Sun, 3 Sep 2023 13:36:01 -0300 Subject: [PATCH 4/6] Starts porting in weapons of the old PR --- code/modules/admin/verbs/adminpanelweapons.dm | 62 ++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/code/modules/admin/verbs/adminpanelweapons.dm b/code/modules/admin/verbs/adminpanelweapons.dm index 9fde4e96ebee..5e1452728ea4 100644 --- a/code/modules/admin/verbs/adminpanelweapons.dm +++ b/code/modules/admin/verbs/adminpanelweapons.dm @@ -2,7 +2,7 @@ set name = "Weapons" set category = "Admin.Ship" - var/weapontype = tgui_alert(src, "What weapon?", "Choose wisely!", list("Missile", "Railgun"), 20 SECONDS) + var/weapontype = tgui_input_list(src, "What weapon?", "Choose wisely!", list("Missile", "Railgun", "Orb. Def. Cannon", "AA Boiler Shot"), 20 SECONDS) if(!weapontype) return var/hiteta = tgui_input_number(src, "Give an ETA for the weapon to hit.", "Don't make them wait too long!", 10, 120, 10, 20 SECONDS) @@ -97,6 +97,66 @@ addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(weaponhits), 2, picked_atom, point_defense), hiteta SECONDS) message_admins("[key_name_admin(src)] Fired a single Railgun Slug at the Almayer at a random location, [picked_atom], with the possibility of missing as [point_defense]") + if("Orb. Def. Cannon") + if(exactplace == TRUE) + shipwide_ai_announcement("DANGER: ORBITAL DEFENSES ENGAGING, INCOMING SHOT. BRACE, BRACE, BRACE. ESTIMATED TIME: [hiteta] SECONDS." , MAIN_AI_SYSTEM, 'sound/effects/missile_warning.ogg') + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(weaponhits), 3, mob.loc, point_defense), hiteta SECONDS) + message_admins("[key_name_admin(src)] Fired a single ODC Shot at the Almayer at their location, [mob.loc], with the possibility of missing as [point_defense]") + + + if(exactplace == FALSE) + if(salvo == TRUE) + shipwide_ai_announcement("DANGER: ORBITAL DEFENSES ENGAGING, SALVO INCOMING. BRACE, BRACE, BRACE. SALVO SIZE: [quantity], ESTIMATED TIME: [hiteta] SECONDS." , MAIN_AI_SYSTEM, 'sound/effects/missile_warning.ogg') + targets = shipside_random_turf_picker(quantity) + if(targets == null) + tgui_alert(src, "Uh oh! Something broke at this point! Contact the coders!", "Acknowledge!", list("ok."), 10 SECONDS) + return + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(weaponhits), 3, targets, point_defense, salvo), hiteta SECONDS) + message_admins("[key_name_admin(src)] Fired a salvo of ODC Shots at the Almayer at random places, with the possibility of missing [point_defense]") + picked_atom = null + targets = null + + if(salvo == FALSE) + prompt = tgui_alert(src, "Are you sure you want to shoot an Orbital Defense Cannon shot at the USS Almayer at a random place?", "Choose wisely!", list("Yes", "No"), 20 SECONDS) + if(prompt == "Yes") + shipwide_ai_announcement("DANGER: ORBITAL DEFENSES ENGAGING, INCOMING SHOT. BRACE, BRACE, BRACE. ESTIMATED TIME: [hiteta] SECONDS." , MAIN_AI_SYSTEM, 'sound/effects/missile_warning.ogg') + picked_atom = shipside_random_turf_picker(1) + if(picked_atom == null) + tgui_alert(src, "Uh oh! Something broke at this point! Contact the coders!", "Acknowledge!", list("ok."), 10 SECONDS) + return + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(weaponhits), 3, picked_atom, point_defense), hiteta SECONDS) + message_admins("[key_name_admin(src)] Fired a single ODC Shot at the Almayer at their location, [picked_atom], with the possibility of missing as [point_defense]") + + if("AA Boiler Shot") + if(exactplace == TRUE) + shipwide_ai_announcement("DANGER: LARGE VOLATILE BIOMASS INCOMING. BRACE, BRACE, BRACE. ESTIMATED TIME: [hiteta] SECONDS." , MAIN_AI_SYSTEM, 'sound/effects/missile_warning.ogg') + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(weaponhits), 4, mob.loc, point_defense), hiteta SECONDS) + message_admins("[key_name_admin(src)] Fired a single AA Boiler Shot at the Almayer at their location, [mob.loc], with the possibility of missing as [point_defense]") + + + if(exactplace == FALSE) + if(salvo == TRUE) + shipwide_ai_announcement("DANGER: MULTIPLE LARGE VOLATILE BIOMASS INCOMING. BRACE, BRACE, BRACE. QUANTITY: [quantity], ESTIMATED TIME: [hiteta] SECONDS." , MAIN_AI_SYSTEM, 'sound/effects/missile_warning.ogg') + targets = shipside_random_turf_picker(quantity) + if(targets == null) + tgui_alert(src, "Uh oh! Something broke at this point! Contact the coders!", "Acknowledge!", list("ok."), 10 SECONDS) + return + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(weaponhits), 4, targets, point_defense, salvo), hiteta SECONDS) + message_admins("[key_name_admin(src)] Fired a salvo of AA Boiler Shots at the Almayer at random places, with the possibility of missing [point_defense]") + picked_atom = null + targets = null + + if(salvo == FALSE) + prompt = tgui_alert(src, "Are you sure you want to attack the USS Almayer with an AA Boiler Shot at a random place?", "Choose wisely!", list("Yes", "No"), 20 SECONDS) + if(prompt == "Yes") + shipwide_ai_announcement("DANGER: LARGE VOLATILE BIOMASS INCOMING. BRACE, BRACE, BRACE. ESTIMATED TIME: [hiteta] SECONDS." , MAIN_AI_SYSTEM, 'sound/effects/missile_warning.ogg') + picked_atom = shipside_random_turf_picker(1) + if(picked_atom == null) + tgui_alert(src, "Uh oh! Something broke at this point! Contact the coders!", "Acknowledge!", list("ok."), 10 SECONDS) + return + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(weaponhits), 4, picked_atom, point_defense), hiteta SECONDS) + message_admins("[key_name_admin(src)] Fired a single AA Boiler Shot at the Almayer at their location, [picked_atom], with the possibility of missing as [point_defense]") + /proc/shipside_random_turf_picker(turfquantity) var/picked_atom From d8030baf7f6b3f3f38f67b0c93a56e73eec9f28f Mon Sep 17 00:00:00 2001 From: AyyLuska Date: Sun, 3 Sep 2023 13:37:42 -0300 Subject: [PATCH 5/6] Ditto! --- code/modules/almayer/weaponhits.dm | 136 ++++++++++++++++++++++++++++- 1 file changed, 132 insertions(+), 4 deletions(-) diff --git a/code/modules/almayer/weaponhits.dm b/code/modules/almayer/weaponhits.dm index 1f3a566ebbda..d8e604add7af 100644 --- a/code/modules/almayer/weaponhits.dm +++ b/code/modules/almayer/weaponhits.dm @@ -1,5 +1,11 @@ #define WEAPON_MISSILE 1 #define WEAPON_RAILGUN 2 +#define WEAPON_ODC 3 +#define WEAPON_AABOILER 4 +#define WEAPON_MISSILE_DAMAGE 20 +#define WEAPON_RAILGUN_DAMAGE 2 +#define WEAPON_ODC_DAMAGE 10 +#define WEAPON_AABOILER_DAMAGE 20 #define HIT_CHANCE_CHEAT 100 #define HIT_CHANCE_STANDARD 70 /** @@ -16,6 +22,7 @@ * * salvo - identifies it as a salvo or not. */ /proc/weaponhits(weaponused, location, point_defense = FALSE, salvo = FALSE) + var/logtotalhits switch(weaponused) @@ -26,14 +33,20 @@ if(salvo == TRUE) var/shotspacing for(var/turf/picked_atom in location) - addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(cell_explosion), picked_atom, 400, 10, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, null, ashm_cause_data), shotspacing SECONDS) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(cell_explosion), picked_atom, 700, 10, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, null, ashm_cause_data), shotspacing SECONDS) + GLOB.ship_health_vars["ship_hull_health"] = GLOB.ship_health_vars["ship_hull_health"] - WEAPON_MISSILE_DAMAGE shotspacing += 1 shakeship(10, 10, TRUE, FALSE) + GLOB.ship_hits_tally["times_hit_missile"] += 1 + logtotalhits += 1 weaponhits_effects(WEAPON_MISSILE) else - cell_explosion(location, 350, 1, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, null, ashm_cause_data) + cell_explosion(location, 700, 9, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, null, ashm_cause_data) + GLOB.ship_health_vars["ship_hull_health"] = GLOB.ship_health_vars["ship_hull_health"] - WEAPON_MISSILE_DAMAGE shakeship(10, 10, TRUE, FALSE) weaponhits_effects(WEAPON_MISSILE) + GLOB.ship_hits_tally["times_hit_missile"] += 1 + logtotalhits +=1 if(point_defense == TRUE) var/hitchance = HIT_CHANCE_STANDARD if(salvo == TRUE) @@ -41,21 +54,27 @@ var/shotspacing for(var/turf/picked_atom in location) if(prob(hitchance)) - addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(cell_explosion), picked_atom, 400, 10, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, null, ashm_cause_data), shotspacing SECONDS) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(cell_explosion), picked_atom, 700, 9, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, null, ashm_cause_data), shotspacing SECONDS) + GLOB.ship_health_vars["ship_hull_health"] = GLOB.ship_health_vars["ship_hull_health"] - WEAPON_MISSILE_DAMAGE shakeship(10, 10, TRUE, FALSE) confirmedhit += 1 + logtotalhits += 1 else weaponhits_effects(WEAPON_MISSILE, TRUE, shotspacing) shotspacing += 1 if(confirmedhit > 0) weaponhits_effects(WEAPON_MISSILE, FALSE) + GLOB.ship_hits_tally["times_hit_missile"] += confirmedhit confirmedhit = 0 else if(prob(hitchance)) - cell_explosion(location, 400, 10, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, null, ashm_cause_data) + cell_explosion(location, 700, 9, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, null, ashm_cause_data) + GLOB.ship_health_vars["ship_hull_health"] = GLOB.ship_health_vars["ship_hull_health"] - 10 shakeship(10, 10, TRUE, FALSE) weaponhits_effects(WEAPON_MISSILE, FALSE) + GLOB.ship_hits_tally["times_hit_missile"] += 1 + logtotalhits += 1 else weaponhits_effects(WEAPON_MISSILE, TRUE) @@ -69,21 +88,91 @@ for(var/turf/picked_atom in location) if(prob(hitchance)) cell_explosion(picked_atom, 600, 600, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, null, antishiprailgun_cause_data) + GLOB.ship_health_vars["ship_hull_health"] = GLOB.ship_health_vars["ship_hull_health"] - WEAPON_RAILGUN_DAMAGE shakeship(5, 5, FALSE, FALSE) confirmedhit += 1 + logtotalhits += 1 if(confirmedhit > 0) weaponhits_effects(WEAPON_RAILGUN) if(confirmedhit < 1) weaponhits_effects(WEAPON_RAILGUN, TRUE) + GLOB.ship_hits_tally["times_hit_railgun"] += confirmedhit else if(salvo == FALSE) if(prob(hitchance)) cell_explosion(location, 600, 600, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, null, antishiprailgun_cause_data) + GLOB.ship_health_vars["ship_hull_health"] = GLOB.ship_health_vars["ship_hull_health"] - WEAPON_RAILGUN_DAMAGE shakeship(5, 5, FALSE, FALSE) weaponhits_effects(WEAPON_RAILGUN) + GLOB.ship_hits_tally["times_hit_railgun"] += 1 + logtotalhits += 1 else weaponhits_effects(WEAPON_RAILGUN, TRUE) + if(WEAPON_ODC) + var/datum/cause_data/orbitaldefensecannon_cause_data = create_cause_data("Orbital Defense Shell") + var/hitchance = HIT_CHANCE_CHEAT + if(point_defense == TRUE) + hitchance = HIT_CHANCE_STANDARD + if(salvo == TRUE) + var/confirmedhit + for(var/turf/picked_atom in location) + if(prob(hitchance)) + cell_explosion(picked_atom, 850, 6, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, null, orbitaldefensecannon_cause_data) + GLOB.ship_health_vars["ship_hull_health"] = GLOB.ship_health_vars["ship_hull_health"] - WEAPON_ODC_DAMAGE + shakeship(10, 10, TRUE, FALSE) + confirmedhit += 1 + logtotalhits += 1 + if(confirmedhit > 0) + weaponhits_effects(WEAPON_ODC) + if(confirmedhit < 1) + weaponhits_effects(WEAPON_ODC, TRUE) + GLOB.ship_hits_tally["times_hit_odc"] += confirmedhit + + else if(salvo == FALSE) + if(prob(hitchance)) + cell_explosion(location, 850, 6, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, null, orbitaldefensecannon_cause_data) + GLOB.ship_health_vars["ship_hull_health"] = GLOB.ship_health_vars["ship_hull_health"] - WEAPON_ODC_DAMAGE + shakeship(10, 10, TRUE, FALSE) + weaponhits_effects(WEAPON_ODC) + GLOB.ship_hits_tally["times_hit_odc"] += 1 + logtotalhits += 1 + else + weaponhits_effects(WEAPON_ODC, TRUE) + + if(WEAPON_AABOILER) + var/datum/cause_data/aaboiler_cause_data = create_cause_data("AA Boiler Shot") + var/hitchance = HIT_CHANCE_CHEAT + if(point_defense == TRUE) + hitchance = HIT_CHANCE_STANDARD + if(salvo == TRUE) + var/confirmedhit + for(var/turf/picked_atom in location) + if(prob(hitchance)) + cell_explosion(picked_atom, 700, 9, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, null, aaboiler_cause_data) + GLOB.ship_health_vars["ship_hull_health"] = GLOB.ship_health_vars["ship_hull_health"] - WEAPON_AABOILER_DAMAGE + shakeship(10, 10, FALSE, FALSE) + confirmedhit += 1 + logtotalhits += 1 + if(confirmedhit > 0) + weaponhits_effects(WEAPON_AABOILER) + if(confirmedhit < 1) + weaponhits_effects(WEAPON_AABOILER, TRUE) + GLOB.ship_hits_tally["times_hit_aaboiler"] += confirmedhit + + else if(salvo == FALSE) + if(prob(hitchance)) + cell_explosion(location, 700, 9, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, null, aaboiler_cause_data) + GLOB.ship_health_vars["ship_hull_health"] = GLOB.ship_health_vars["ship_hull_health"] - WEAPON_AABOILER_DAMAGE + shakeship(10, 10, FALSE, FALSE) + weaponhits_effects(WEAPON_AABOILER) + GLOB.ship_hits_tally["times_hit_aaboiler"] += 1 + logtotalhits += 1 + else + weaponhits_effects(WEAPON_AABOILER, TRUE) + var/integerhitstally = GLOB.ship_hits_tally["times_hit_missile"] + GLOB.ship_hits_tally["times_hit_railgun"] + GLOB.ship_hits_tally["times_hit_odc"] + GLOB.ship_hits_tally["times_hit_aaboiler"] + message_admins("weaponhits concluded! Type '[weaponused]' weapon was used, and hit [logtotalhits] times. The Almayer has now suffered a total of [integerhitstally] hits from all the weapons!") + /proc/weaponhits_effects(weaponused, weaponmiss = FALSE, shotspacing = 0) switch(weaponused) if(WEAPON_MISSILE) @@ -116,8 +205,47 @@ continue playsound_client (current_mob.client, 'sound/effects/railgun_miss.ogg', 60) to_chat(current_mob.client, SPAN_DANGER("You hear railgun shots barely missing the hull!")) + + if(WEAPON_ODC) + if(!weaponmiss) + for(var/mob/living/carbon/current_mob in GLOB.living_mob_list) + if(!is_mainship_level(current_mob.z)) + continue + playsound_client(current_mob.client, 'sound/effects/metal_crash.ogg', 100 ) + playsound_client(current_mob.client, 'sound/effects/bigboom3.ogg', 100) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(playsound_client), current_mob.client, 'sound/effects/pry2.ogg', 20), 1 SECONDS) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(playsound_client), current_mob.client, 'sound/effects/double_klaxon.ogg'), 2 SECONDS) + else + for(var/mob/living/carbon/current_mob in GLOB.living_mob_list) + if(!is_mainship_level(current_mob.z)) + continue + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(playsound_client), current_mob.client, 'sound/effects/railgun_miss.ogg', 60), shotspacing SECONDS) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(to_chat), current_mob.client, SPAN_DANGER("You hear Shells barely missing the hull!")), shotspacing SECONDS) + + if(WEAPON_AABOILER) + if(!weaponmiss) + for(var/mob/living/carbon/current_mob in GLOB.living_mob_list) + if(!is_mainship_level(current_mob.z)) + continue + playsound_client(current_mob.client, 'sound/effects/metal_crash.ogg', 100 ) + playsound_client(current_mob.client, 'sound/effects/bigboom3.ogg', 100) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(playsound_client), current_mob.client, 'sound/effects/pry2.ogg', 20), 1 SECONDS) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(playsound_client), current_mob.client, 'sound/effects/double_klaxon.ogg'), 2 SECONDS) + else + for(var/mob/living/carbon/current_mob in GLOB.living_mob_list) + if(!is_mainship_level(current_mob.z)) + continue + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(playsound_client), current_mob.client, 'sound/effects/railgun_miss.ogg', 60), shotspacing SECONDS) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(to_chat), current_mob.client, SPAN_DANGER("You hear a vile mass barely missing the hull!")), shotspacing SECONDS) + +#undef WEAPON_MISSILE_DAMAGE +#undef WEAPON_RAILGUN_DAMAGE +#undef WEAPON_ODC_DAMAGE +#undef WEAPON_AABOILER_DAMAGE //REMOVE THIS WHEN WE USE THESE DEFS SOMEWHERE ELSE OR ELSE IT STRAIGHT UP WON'T WORK. #undef WEAPON_MISSILE #undef WEAPON_RAILGUN +#undef WEAPON_ODC +#undef WEAPON_AABOILER #undef HIT_CHANCE_CHEAT #undef HIT_CHANCE_STANDARD From 3a9774cafe5e635d9c6f2b9559954722fef58f19 Mon Sep 17 00:00:00 2001 From: AyyLuska Date: Sun, 3 Sep 2023 13:40:19 -0300 Subject: [PATCH 6/6] ditto --- code/_globalvars/global_lists.dm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/code/_globalvars/global_lists.dm b/code/_globalvars/global_lists.dm index 36058a44fc37..a82348da0866 100644 --- a/code/_globalvars/global_lists.dm +++ b/code/_globalvars/global_lists.dm @@ -15,6 +15,20 @@ GLOBAL_LIST_EMPTY(larva_burst_by_hive) GLOBAL_LIST_INIT_TYPED(custom_huds_list, /datum/custom_hud, setup_all_huds()) GLOBAL_LIST_INIT_TYPED(custom_human_huds, /datum/custom_hud, setup_human_huds()) +//Basically counts how many times the Almayer was hit by each weapon. Loggin' wack. +GLOBAL_LIST_INIT(ship_hits_tally, list( +"times_hit_missile" = 0, +"times_hit_railgun" = 0, +"times_hit_odc" = 0, +"times_hit_aaboiler" = 0, +)) + +//Ship's HP! ShipvsShip baybeee +GLOBAL_LIST_INIT(ship_health_vars, list( +"ship_hull_health" = 100, +"ship_systems_health" = 100, +)) + //Since it didn't really belong in any other category, I'm putting this here //This is for procs to replace all the goddamn 'in world's that are chilling around the code