diff --git a/code/defines/obj.dm b/code/defines/obj.dm index 425d6592286..25124d04bab 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -347,6 +347,8 @@ var/w_class = 3.0 var/wielded = 0 var/twohanded = 0 ///Two handed and wielded off by default, nyoro~n -Agouri + var/force_unwielded = 0 + var/force_wielded = 0 flags = FPRINT | TABLEPASS pressure_resistance = 50 var/obj/item/master = null diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index 9e2f2fc7e9b..b463fdcf70d 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -514,6 +514,8 @@ force = 5 w_class = 4.0 twohanded = 1 + force_unwielded = 5 + force_wielded = 30 /obj/item/weapon/disk diff --git a/code/game/objects/items/item.dm b/code/game/objects/items/item.dm index 8c99b039095..0e9053e87fa 100644 --- a/code/game/objects/items/item.dm +++ b/code/game/objects/items/item.dm @@ -159,6 +159,38 @@ src.loc = P O.amount -= 1 +/obj/item/attack_self(mob/user as mob) + ..() + if(twohanded) + if(wielded) //Trying to unwield it + wielded = 0 + force = force_unwielded + src.name = "[initial(name)] (Unwielded)" + src.update_icon() //If needed by the particular item + user << "\blue You are now carrying the [initial(name)] with one hand." + + if(istype(user.get_inactive_hand(),/obj/item/weapon/offhand)) + del user.get_inactive_hand() + return + else //Trying to wield it + if(user.get_inactive_hand()) + user << "\red You need your other hand to be empty" + return + wielded = 1 + force = force_wielded + src.name = "[initial(name)] (Wielded)" + src.update_icon() //If needed by the particular item + user << "\blue You grab the [initial(name)] with both hands, It is ready for use." + + var/obj/item/weapon/offhand/O = new /obj/item/weapon/offhand(user) ////Let's reserve his other hand~ + O.name = text("[initial(src.name)] - Offhand") + O.desc = "Your second grip on the [initial(src.name)]" + if(user.hand) + user.r_hand = O ///Place dat offhand in the opposite hand + else + user.l_hand = O + O.layer = 20 + return /obj/item/proc/attack(mob/living/M as mob, mob/living/user as mob, def_zone) @@ -340,7 +372,6 @@ src.add_fingerprint(user) return 1 - /obj/item/proc/eyestab(mob/living/carbon/M as mob, mob/living/carbon/user as mob) var/mob/living/carbon/human/H = M diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 92edb435255..0f344b0dff5 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -25,45 +25,4 @@ //welp, all is good, now to see if he's trying do twohandedly wield it or unwield it - if(src.wielded == 0) //He's trying to wield it!! - - if( user.hand ) ///User hand appears to be 1 if you're using the Left one and 0 if you're using the right? I don't even KNOW - if(user.r_hand != null) - user << "\red You need your right hand to be empty" - return - else - if(user.l_hand != null) - user << "\red You need your left hand to be empty" - return - user << "\blue You grab the hilt of the axe and raise it to your torso, readying it for use." - src.wielded = !src.wielded - src.force = 30 - src.name = "Fire axe (Wielded)" - src.update_icon() - - var/obj/item/weapon/offhand/O = new /obj/item/weapon/offhand(user) ////Let's reserve his other hand~ - O.name = text("[]-Offhand",src.name) - O.desc = "Your second grip on the Fire axe" - - if(user.hand) - user.r_hand = O ///Place dat offhand in the opposite hand - else - user.l_hand = O - O.layer = 20 - return - - - if(src.wielded == 1) //Guy's bored of robusting and now wants to carry it - src.wielded = !src.wielded - src.force = 5 - src.name = "Fire axe (Unwielded)" - src.update_icon() - user << "\blue You are now carrying the axe with one hand." - - if(user.hand) //Now let's free up his other hand - var/obj/item/weapon/offhand/O = user.r_hand - del O - else - var/obj/item/weapon/offhand/O = user.l_hand - del O - return \ No newline at end of file + ..() \ No newline at end of file diff --git a/code/game/throwing.dm b/code/game/throwing.dm index 98b248ed804..91b56933d8d 100644 --- a/code/game/throwing.dm +++ b/code/game/throwing.dm @@ -14,6 +14,7 @@ /mob/living/carbon/proc/throw_item(atom/target) src.throw_mode_off() + if(usr.stat) return if(target.type == /obj/screen) return @@ -22,6 +23,19 @@ if(!item) return + if(istype(item,/obj/item)) + var/obj/item/IT = item + if(IT.twohanded) + if(IT.wielded) + if(hand) + var/obj/item/weapon/offhand/O = r_hand + del O + else + var/obj/item/weapon/offhand/O = l_hand + del O + IT.name = initial(IT.name) + + u_equip(item) if(src.client) src.client.screen -= item diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 6bf02955d51..0a5a612e8bc 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1134,7 +1134,7 @@ proc/isobserver(A) /mob/proc/drop_item() var/obj/item/W = equipped() - if(istype(W,/obj/item/weapon/fireaxe)) + if(W.twohanded) if(W.wielded) if(hand) var/obj/item/weapon/offhand/O = r_hand @@ -1143,7 +1143,7 @@ proc/isobserver(A) var/obj/item/weapon/offhand/O = l_hand del O W.wielded = 0 //Kinda crude, but gets the job done with minimal pain -Agouri - W.name = "Fire axe" //name reset so people don't see world fireaxes with (unwielded) or (wielded) tags + W.name = "[initial(W.name)]" //name reset so people don't see world fireaxes with (unwielded) or (wielded) tags W.update_icon() if (W)