From f9c1114ec1338f1da84600c1e8fa8a4dcacd2d21 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Mon, 12 Mar 2018 07:08:34 -0500 Subject: [PATCH] [MIRROR] Pacifists can no longer cause harm using mech equipment (#5921) * Pacifists can no longer cause harm using mech equipment (#36293) * Fixes pacifists from firing mech weapons that cause harm * Pacifists can still use mining equipment on non-living objects * I'm a big ol dumbo that forgot how booleans are handled * missed one * forgot to save file before commit. Now all booleans are fixed * CAPS * Pacifists can't drill, clamp, or melee hit a closed locker or crate. prevents them from killing people inside them * Pacifists now know if a container has a living being in it and will not drill, clamp, or melee it if it does. * made change as requested by duncathan * added an exception to the hydraulic clamp so that it can pick up containers with people in them. * Pacifists can no longer cause harm using mech equipment --- code/game/mecha/equipment/mecha_equipment.dm | 1 + code/game/mecha/equipment/tools/mining_tools.dm | 1 + code/game/mecha/equipment/tools/work_tools.dm | 1 + code/game/mecha/equipment/weapons/weapons.dm | 10 +++++++++- code/game/mecha/mecha.dm | 13 +++++++++++++ 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/code/game/mecha/equipment/mecha_equipment.dm b/code/game/mecha/equipment/mecha_equipment.dm index 54530d368c..06884c59b5 100644 --- a/code/game/mecha/equipment/mecha_equipment.dm +++ b/code/game/mecha/equipment/mecha_equipment.dm @@ -14,6 +14,7 @@ var/range = MELEE //bitflags var/salvageable = 1 var/selectable = 1 // Set to 0 for passive equipment such as mining scanner or armor plates + var/pacifist_safe = TRUE //Controls if equipment can be used to attack by a pacifist. /obj/item/mecha_parts/mecha_equipment/proc/update_chassis_page() if(chassis) diff --git a/code/game/mecha/equipment/tools/mining_tools.dm b/code/game/mecha/equipment/tools/mining_tools.dm index 16c0e62795..680b9fe864 100644 --- a/code/game/mecha/equipment/tools/mining_tools.dm +++ b/code/game/mecha/equipment/tools/mining_tools.dm @@ -9,6 +9,7 @@ equip_cooldown = 15 energy_drain = 10 force = 15 + pacifist_safe = FALSE /obj/item/mecha_parts/mecha_equipment/drill/Initialize() . = ..() diff --git a/code/game/mecha/equipment/tools/work_tools.dm b/code/game/mecha/equipment/tools/work_tools.dm index ac8304be39..330247f88c 100644 --- a/code/game/mecha/equipment/tools/work_tools.dm +++ b/code/game/mecha/equipment/tools/work_tools.dm @@ -10,6 +10,7 @@ energy_drain = 10 var/dam_force = 20 var/obj/mecha/working/ripley/cargo_holder + pacifist_safe = FALSE /obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/can_attach(obj/mecha/working/ripley/M as obj) if(..()) diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm index a8c799afa9..f6a05c3fa6 100644 --- a/code/game/mecha/equipment/weapons/weapons.dm +++ b/code/game/mecha/equipment/weapons/weapons.dm @@ -75,6 +75,7 @@ energy_drain = 30 projectile = /obj/item/projectile/beam/laser fire_sound = 'sound/weapons/laser.ogg' + pacifist_safe = FALSE /obj/item/mecha_parts/mecha_equipment/weapon/energy/laser/heavy equip_cooldown = 15 @@ -102,7 +103,7 @@ energy_drain = 500 projectile = /obj/item/projectile/energy/tesla/cannon fire_sound = 'sound/magic/lightningbolt.ogg' - + pacifist_safe = FALSE /obj/item/mecha_parts/mecha_equipment/weapon/energy/pulse equip_cooldown = 30 @@ -112,6 +113,7 @@ energy_drain = 120 projectile = /obj/item/projectile/beam/pulse/heavy fire_sound = 'sound/weapons/marauder.ogg' + pacifist_safe = FALSE /obj/item/mecha_parts/mecha_equipment/weapon/energy/plasma equip_cooldown = 10 @@ -124,6 +126,7 @@ energy_drain = 30 projectile = /obj/item/projectile/plasma/adv/mech fire_sound = 'sound/weapons/plasma_cutter.ogg' + pacifist_safe = FALSE /obj/item/mecha_parts/mecha_equipment/weapon/energy/plasma/can_attach(obj/mecha/working/M) if(..()) //combat mech @@ -243,6 +246,7 @@ projectile = /obj/item/projectile/bullet/incendiary/fnx99 projectiles = 24 projectile_energy_cost = 15 + pacifist_safe = FALSE /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/silenced name = "\improper S.H.H. \"Quietus\" Carbine" @@ -253,6 +257,7 @@ projectile = /obj/item/projectile/bullet/mime projectiles = 6 projectile_energy_cost = 50 + pacifist_safe = FALSE /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/scattershot name = "\improper LBX AC 10 \"Scattershot\"" @@ -264,6 +269,7 @@ projectile_energy_cost = 25 projectiles_per_shot = 4 variance = 25 + pacifist_safe = FALSE /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg name = "\improper Ultra AC 2" @@ -277,6 +283,7 @@ variance = 6 randomspread = 1 projectile_delay = 2 + pacifist_safe = FALSE /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack name = "\improper SRM-8 missile rack" @@ -287,6 +294,7 @@ projectiles = 8 projectile_energy_cost = 1000 equip_cooldown = 60 + pacifist_safe = FALSE /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index b9dcbbfd03..82394ba480 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -440,11 +440,24 @@ target = safepick(view(3,target)) if(!target) return + + var/mob/living/L = user + var/obj/structure/closet/C = target if(!Adjacent(target)) if(selected && selected.is_ranged()) + if(L.has_trait(TRAIT_PACIFISM) && !selected.pacifist_safe) + to_chat(user, "You don't want to harm other living beings!") + return if(selected.action(target,params)) selected.start_cooldown() else if(selected && selected.is_melee()) + if(isliving(target) && !selected.pacifist_safe && L.has_trait(TRAIT_PACIFISM)) + to_chat(user, "You don't want to harm other living beings!") + return + if(istype(C) && L.has_trait(TRAIT_PACIFISM) && !selected.pacifist_safe && !istype(selected,/obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/)) + for(var/mob/living/M in C) + to_chat(user, "There's someone in there! I don't want to hurt them.") + return if(selected.action(target,params)) selected.start_cooldown() else