From 54101ca32be3d47a003c0da8a0d249708109a9e1 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Tue, 27 Oct 2020 18:38:03 +0100 Subject: [PATCH] [MIRROR] Fixes free Wizard spells (#1493) * Merge pull request #54606 from ATH1909/dontneedlesslyyeetspellsonawhim Fixes free Wizard spells * Fixes free Wizard spells Co-authored-by: 81Denton <32391752+81Denton@users.noreply.github.com> --- code/modules/antagonists/cult/cult_items.dm | 12 ++++++++++++ .../antagonists/wizard/equipment/spellbook.dm | 12 ++++++++++++ code/modules/projectiles/guns/ballistic/rifle.dm | 2 ++ 3 files changed, 26 insertions(+) diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm index 394c8e622ba..e21cf1bd5ab 100644 --- a/code/modules/antagonists/cult/cult_items.dm +++ b/code/modules/antagonists/cult/cult_items.dm @@ -760,6 +760,18 @@ mag_type = /obj/item/ammo_box/magazine/internal/boltaction/enchanted/arcane_barrage/blood fire_sound = 'sound/magic/wand_teleport.ogg' +/obj/item/gun/ballistic/rifle/boltaction/enchanted/arcane_barrage/blood/can_trigger_gun(mob/living/user) + . = ..() + if(!iscultist(user)) + to_chat(user, "\"Did you truly think that you could channel MY blood without my approval? Amusing, but futile.\"") + if(iscarbon(user)) + var/mob/living/carbon/C = user + if(C.active_hand_index == 1) + C.apply_damage(20, BRUTE, BODY_ZONE_L_ARM, wound_bonus = 20, sharpness = SHARP_EDGED) //oof ouch + else + C.apply_damage(20, BRUTE, BODY_ZONE_R_ARM, wound_bonus = 20, sharpness = SHARP_EDGED) + qdel(src) + return FALSE /obj/item/ammo_box/magazine/internal/boltaction/enchanted/arcane_barrage/blood ammo_type = /obj/item/ammo_casing/magic/arcane_barrage/blood diff --git a/code/modules/antagonists/wizard/equipment/spellbook.dm b/code/modules/antagonists/wizard/equipment/spellbook.dm index 0f0ee164ea3..884958a7242 100644 --- a/code/modules/antagonists/wizard/equipment/spellbook.dm +++ b/code/modules/antagonists/wizard/equipment/spellbook.dm @@ -229,12 +229,24 @@ cost = 3 no_coexistance_typecache = /obj/effect/proc_holder/spell/targeted/infinite_guns/arcane_barrage +/datum/spellbook_entry/infinite_guns/Refund(mob/living/carbon/human/user, obj/item/spellbook/book) + for (var/obj/item/currentItem in user.get_all_gear()) + if (currentItem.type == /obj/item/gun/ballistic/rifle/boltaction/enchanted) + qdel(currentItem) + return ..() + /datum/spellbook_entry/arcane_barrage name = "Arcane Barrage" spell_type = /obj/effect/proc_holder/spell/targeted/infinite_guns/arcane_barrage cost = 3 no_coexistance_typecache = /obj/effect/proc_holder/spell/targeted/infinite_guns/gun +/datum/spellbook_entry/arcane_barrage/Refund(mob/living/carbon/human/user, obj/item/spellbook/book) + for (var/obj/item/currentItem in user.get_all_gear()) + if (currentItem.type == /obj/item/gun/ballistic/rifle/boltaction/enchanted/arcane_barrage) + qdel(currentItem) + return ..() + /datum/spellbook_entry/barnyard name = "Barnyard Curse" spell_type = /obj/effect/proc_holder/spell/pointed/barnyardcurse diff --git a/code/modules/projectiles/guns/ballistic/rifle.dm b/code/modules/projectiles/guns/ballistic/rifle.dm index e6f61be9a48..c661f0189d0 100644 --- a/code/modules/projectiles/guns/ballistic/rifle.dm +++ b/code/modules/projectiles/guns/ballistic/rifle.dm @@ -102,6 +102,8 @@ /obj/item/gun/ballistic/rifle/boltaction/enchanted/dropped() . = ..() guns_left = 0 + magazine = null + chambered = null /obj/item/gun/ballistic/rifle/boltaction/enchanted/proc/discard_gun(mob/living/user) user.throw_item(pick(oview(7,get_turf(user))))