From c96adec91fa062d79efb5367f615be398860cac3 Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Thu, 11 Oct 2018 22:55:10 +0200 Subject: [PATCH] Fixed it --- code/game/objects/items.dm | 4 ++++ code/game/objects/items/weapons/twohanded.dm | 20 +++++++++++++++++++- code/game/objects/structures/flora.dm | 2 ++ code/modules/mob/living/carbon/give.dm | 1 + 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 6957f70d2b2..9af8b04580a 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -341,6 +341,10 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d /obj/item/proc/on_found(mob/finder as mob) return +// called when the giver gives it to the receiver +/obj/item/proc/on_give(mob/living/carbon/giver, mob/living/carbon/receiver) + return + // called after an item is placed in an equipment slot // user is mob that equipped it // slot uses the slot_X defines found in setup.dm diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 3e7f3eaffe3..9b50956f1af 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -147,6 +147,14 @@ wield(user) ..() +/obj/item/twohanded/required/on_give(mob/living/carbon/giver, mob/living/carbon/receiver) + var/obj/item/twohanded/required/H = receiver.get_inactive_hand() + if(H != null) //Check if he can wield it + receiver.drop_item() //Can't wear it so drop it + to_chat(receiver, "[src] is too cumbersome to carry in one hand!") + return + equipped(receiver,receiver.hand ? slot_l_hand : slot_r_hand) + /obj/item/twohanded/required/equipped(mob/user, slot) ..() if(slot == slot_l_hand || slot == slot_r_hand) @@ -438,7 +446,7 @@ if(on) playsound(loc, 'sound/weapons/chainsawstart.ogg', 50, 1) force = on ? force_on : initial(force) - throwforce = on ? force_on : initial(force) + throwforce = on ? force_on : initial(throwforce) icon_state = "gchainsaw_[on ? "on" : "off"]" if(hitsound == "swing_hit") @@ -453,6 +461,16 @@ var/datum/action/A = X A.UpdateButtonIcon() +/obj/item/twohanded/required/chainsaw/attack_hand(mob/user) + . = ..() + force = on ? force_on : initial(force) + throwforce = on ? force_on : initial(throwforce) + +/obj/item/twohanded/required/chainsaw/on_give(mob/living/carbon/giver, mob/living/carbon/receiver) + . = ..() + force = on ? force_on : initial(force) + throwforce = on ? force_on : initial(throwforce) + /obj/item/twohanded/required/chainsaw/doomslayer name = "OOOH BABY" desc = "VRRRRRRR!!!" diff --git a/code/game/objects/structures/flora.dm b/code/game/objects/structures/flora.dm index 368391874ba..33f08515132 100644 --- a/code/game/objects/structures/flora.dm +++ b/code/game/objects/structures/flora.dm @@ -211,6 +211,7 @@ layer = 5 w_class = WEIGHT_CLASS_HUGE force = 10 + force_wielded = 10 throwforce = 13 throw_speed = 2 throw_range = 4 @@ -222,6 +223,7 @@ icon_state = "plant-36" /obj/item/twohanded/required/kirbyplants/equipped(mob/living/user) + . = ..() var/image/I = image(icon = 'icons/obj/flora/plants.dmi' , icon_state = src.icon_state, loc = user) I.override = 1 user.add_alt_appearance("sneaking_mission", I, player_list) diff --git a/code/modules/mob/living/carbon/give.dm b/code/modules/mob/living/carbon/give.dm index 9dfa6efac89..55c4db791ac 100644 --- a/code/modules/mob/living/carbon/give.dm +++ b/code/modules/mob/living/carbon/give.dm @@ -56,6 +56,7 @@ target.update_inv_l_hand() target.update_inv_r_hand() target.visible_message(" [usr.name] handed \the [I.name] to [target.name].") + I.on_give(usr, target) if("No") target.visible_message(" [usr.name] tried to hand [I.name] to [target.name] but [target.name] didn't want it.") else