From 6ebe8bbe85ad5f8368082dc2c51fd8f9a80a6cd3 Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+Steals-The-PRs@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:15:14 +0300 Subject: [PATCH] [MIRROR] [MODULAR] Adds mag-fed turret limitations to pneumatic cannon (#5198) * [MODULAR] Adds mag-fed turret limitations to pneumatic cannon (#4596) * FIRST TRY LETS GO - adds limits to pneumatic cannon * Update code/game/objects/items/pneumaticCannon.dm * Modularization Edit * make it parent-code friendly:tm: * comment readability * Update modular_nova/master_files/code/game/objects/items/pneumaticCannon.dm --------- Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> * [MIRROR] [MODULAR] Adds mag-fed turret limitations to pneumatic cannon --------- Co-authored-by: Zenitheevee Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> Co-authored-by: StealsThePRs --- .../game/objects/items/pneumaticCannon.dm | 23 +++++++++++++++++++ tgstation.dme | 1 + 2 files changed, 24 insertions(+) create mode 100644 modular_nova/master_files/code/game/objects/items/pneumaticCannon.dm diff --git a/modular_nova/master_files/code/game/objects/items/pneumaticCannon.dm b/modular_nova/master_files/code/game/objects/items/pneumaticCannon.dm new file mode 100644 index 00000000000..f1ad0669510 --- /dev/null +++ b/modular_nova/master_files/code/game/objects/items/pneumaticCannon.dm @@ -0,0 +1,23 @@ + +/obj/item/pneumatic_cannon/load_item(obj/item/I, mob/user) //we make this compatable with the master file incase of future updates. + if(!can_load_item(I, user)) + return FALSE + if(user) + if(istype(I, /obj/item/storage/toolbox/emergency/turret/mag_fed)) + to_chat(user, span_warning("You prepare \the [I] to load into \the [src]. This action will block other items from being loaded!")) + if(!do_after(user, 15)) //adding a warning and a delay so it cant just be invo-juggle-spammed. + return FALSE + return ..() + +/obj/item/pneumatic_cannon/can_load_item(obj/item/I, mob/user) + . = ..() + if(!.) + return + if(locate(/obj/item/storage/toolbox/emergency/turret/mag_fed) in src) //If loaded with a turret, stops more from being put in + if(user) + to_chat(user, span_warning("\The [I] is blocked from \the [src]'s loader!")) + return FALSE + if(istype(I, /obj/item/storage/toolbox/emergency/turret/mag_fed) && length(loadedItems) >= 1) + if(user) + to_chat(user, span_warning("\The [I] needs an empty cannon!")) + return FALSE diff --git a/tgstation.dme b/tgstation.dme index 25b64dc2364..3af75c0408f 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6656,6 +6656,7 @@ #include "modular_nova\master_files\code\game\objects\items\holy_weapons.dm" #include "modular_nova\master_files\code\game\objects\items\kirby_plants.dm" #include "modular_nova\master_files\code\game\objects\items\oxygen_candle.dm" +#include "modular_nova\master_files\code\game\objects\items\pneumaticCannon.dm" #include "modular_nova\master_files\code\game\objects\items\RCD.dm" #include "modular_nova\master_files\code\game\objects\items\religion.dm" #include "modular_nova\master_files\code\game\objects\items\scratchingstone.dm"