diff --git a/code/defines/obj.dm b/code/defines/obj.dm
index 292b3496ee1..e2b975d4d50 100644
--- a/code/defines/obj.dm
+++ b/code/defines/obj.dm
@@ -418,10 +418,6 @@
var/burning = null
var/hitsound = null
var/w_class = 3.0
- var/wielded = 0 // 1 if item is two handed and grabbed with two hands
- var/twohanded = 0 // Two handed and wielded off by default, nyoro~n -Agouri
- var/force_unwielded = 0
- var/force_wielded = 0
var/protective_temperature = 0 // Placing this here to avoid runtime errors, due to tiny items being allowed on ears and being queried for this variable
flags = FPRINT | TABLEPASS
pass_flags = PASSTABLE
diff --git a/code/defines/obj/hydro.dm b/code/defines/obj/hydro.dm
index 3fb16ec45b2..456ceddb6ec 100644
--- a/code/defines/obj/hydro.dm
+++ b/code/defines/obj/hydro.dm
@@ -1707,7 +1707,7 @@
seed = "/obj/item/seeds/towermycelium"
attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || (istype(W, /obj/item/weapon/fireaxe) && W:wielded) || istype(W, /obj/item/weapon/melee/energy))
+ if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || (istype(W, /obj/item/weapon/twohanded/fireaxe) && W:wielded) || istype(W, /obj/item/weapon/melee/energy))
user.show_message("You make planks out of the [src]!", 1)
for(var/i=0,i<2,i++)
new /obj/item/stack/sheet/wood (src.loc)
diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm
index 67ae76a5e67..0803841d5ef 100644
--- a/code/defines/obj/weapon.dm
+++ b/code/defines/obj/weapon.dm
@@ -2,12 +2,6 @@
name = "weapon"
icon = 'weapons.dmi'
-/obj/item/weapon/offhand
- name = "offhand"
- var/linked_weapon_name = ""
- w_class = 5.0
- icon_state = "offhand"
-
/obj/item/weapon/shield
name = "shield"
@@ -711,17 +705,6 @@
icon = 'items.dmi'
icon_state = "red_crowbar"
-/obj/item/weapon/fireaxe // DEM AXES MAN, marker -Agouri
- icon_state = "fireaxe0"
- name = "fire axe"
- desc = "A tool for breaking down those obstructions that stop you from fighting that fire." //Less ROBUST. --SkyMarshal
- force = 5
- w_class = 4.0
- flags = ONBACK
- twohanded = 1
- force_unwielded = 5
- force_wielded = 18
-
/obj/item/weapon/cane
name = "cane"
desc = "A cane used by a true gentlemen."
diff --git a/code/game/events/EventProcs/spacevines.dm b/code/game/events/EventProcs/spacevines.dm
index a53210ac88f..b372981383a 100644
--- a/code/game/events/EventProcs/spacevines.dm
+++ b/code/game/events/EventProcs/spacevines.dm
@@ -25,7 +25,7 @@
if(/obj/item/weapon/circular_saw) del src
if(/obj/item/weapon/kitchen/utensil/knife) del src
if(/obj/item/weapon/scalpel) del src
- if(/obj/item/weapon/fireaxe) del src
+ if(/obj/item/weapon/twohanded/fireaxe) del src
if(/obj/item/weapon/hatchet) del src
if(/obj/item/weapon/melee/energy) del src
diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm
index 46f8872c8c6..9e45fd44242 100644
--- a/code/game/machinery/deployable.dm
+++ b/code/game/machinery/deployable.dm
@@ -65,7 +65,7 @@ for reference:
var/health = 100.0
var/maxhealth = 100.0
- attackby(obj/item/weapon/W as obj, mob/user as mob)
+ attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/stack/sheet/wood))
if (src.health < src.maxhealth)
for(var/mob/O in viewers(src, null))
@@ -88,7 +88,7 @@ for reference:
else
if (src.health <= 0)
for(var/mob/O in viewers(src, null))
- O << "\red The barricade is smashed appart!"
+ O << "\red The barricade is smashed apart!"
new /obj/item/stack/sheet/wood(get_turf(src))
new /obj/item/stack/sheet/wood(get_turf(src))
new /obj/item/stack/sheet/wood(get_turf(src))
@@ -99,14 +99,14 @@ for reference:
switch(severity)
if(1.0)
for(var/mob/O in viewers(src, null))
- O << "\red The barricade is blown appart!"
+ O << "\red The barricade is blown apart!"
del(src)
return
if(2.0)
src.health -= 25
if (src.health <= 0)
for(var/mob/O in viewers(src, null))
- O << "\red The barricade is blown appart!"
+ O << "\red The barricade is blown apart!"
new /obj/item/stack/sheet/wood(get_turf(src))
new /obj/item/stack/sheet/wood(get_turf(src))
new /obj/item/stack/sheet/wood(get_turf(src))
@@ -115,7 +115,7 @@ for reference:
meteorhit()
for(var/mob/O in viewers(src, null))
- O << "\red The barricade is smashed appart!"
+ O << "\red The barricade is smashed apart!"
new /obj/item/stack/sheet/wood(get_turf(src))
new /obj/item/stack/sheet/wood(get_turf(src))
new /obj/item/stack/sheet/wood(get_turf(src))
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index cf99493deb5..9d4dc815730 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -395,13 +395,13 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
else if (istype(C, /obj/item/weapon/pai_cable)) // -- TLE
var/obj/item/weapon/pai_cable/cable = C
cable.plugin(src, user)
- else if (istype(C, /obj/item/weapon/crowbar) || istype(C, /obj/item/weapon/fireaxe) )
+ else if (istype(C, /obj/item/weapon/crowbar) || istype(C, /obj/item/weapon/twohanded/fireaxe) )
var/beingcrowbarred = null
if(istype(C, /obj/item/weapon/crowbar) )
beingcrowbarred = 1 //derp, Agouri
else
beingcrowbarred = 0
- if ( ((src.density) && ( src.welded ) && !( src.operating ) && src.p_open && (!src.arePowerSystemsOn() || (stat & NOPOWER)) && !src.locked) && beingcrowbarred == 1 )
+ if( beingcrowbarred && (density && welded && !operating && src.p_open && (!src.arePowerSystemsOn() || stat & NOPOWER) && !src.locked) )
playsound(src.loc, 'Crowbar.ogg', 100, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove electronics into the airlock assembly.")
if(do_after(user,40))
@@ -433,8 +433,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
if ((src.density) && (!( src.welded ) && !( src.operating ) && ((!src.arePowerSystemsOn()) || (stat & NOPOWER)) && !( src.locked )))
if(beingcrowbarred == 0) //being fireaxe'd
- var/obj/item/weapon/fireaxe/F = C
- if(F.wielded == 1)
+ var/obj/item/weapon/twohanded/fireaxe/F = C
+ if(F:wielded)
spawn( 0 )
src.operating = 1
animate("opening")
@@ -470,8 +470,8 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
else
if ((!src.density) && (!( src.welded ) && !( src.operating ) && !( src.locked )))
if(beingcrowbarred == 0)
- var/obj/item/weapon/fireaxe/F = C
- if(F.wielded == 1)
+ var/obj/item/weapon/twohanded/fireaxe/F = C
+ if(F:wielded)
spawn( 0 )
src.operating = 1
animate("closing")
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index 87c8051ec8d..7a23377dfe0 100644
--- a/code/game/machinery/doors/firedoor.dm
+++ b/code/game/machinery/doors/firedoor.dm
@@ -38,7 +38,7 @@
update_icon()
return
- if (istype(C, /obj/item/weapon/crowbar) || (istype(C,/obj/item/weapon/fireaxe) && C.wielded == 1))
+ if (istype(C, /obj/item/weapon/crowbar) || (istype(C,/obj/item/weapon/twohanded/fireaxe) && C:wielded == 1))
if(blocked || operating) return
if(src.density)
spawn(0)
@@ -52,7 +52,8 @@
process()
- if(operating || stat & NOPOWER || !nextstate) return
+ if(operating || stat & NOPOWER || !nextstate)
+ return
switch(nextstate)
if(OPEN)
spawn()
diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm
index 5aacc6f1f92..793eab765a1 100644
--- a/code/game/machinery/doors/poddoor.dm
+++ b/code/game/machinery/doors/poddoor.dm
@@ -14,7 +14,7 @@
/obj/machinery/door/poddoor/attackby(obj/item/weapon/C as obj, mob/user as mob)
src.add_fingerprint(user)
- if (!( istype(C, /obj/item/weapon/crowbar || istype(C, /obj/item/weapon/fireaxe) && C.wielded == 1) ))
+ if (!( istype(C, /obj/item/weapon/crowbar) || (istype(C, /obj/item/weapon/twohanded/fireaxe) && C:wielded == 1) ))
return
if ((src.density && (stat & NOPOWER) && !( src.operating )))
spawn( 0 )
diff --git a/code/game/machinery/doors/shutters.dm b/code/game/machinery/doors/shutters.dm
index 7ac0ec41fa2..8e1b9a8cae9 100644
--- a/code/game/machinery/doors/shutters.dm
+++ b/code/game/machinery/doors/shutters.dm
@@ -9,7 +9,7 @@
/obj/machinery/door/poddoor/shutters/attackby(obj/item/weapon/C as obj, mob/user as mob)
src.add_fingerprint(user)
- if (!( istype(C, /obj/item/weapon/crowbar || istype(C, /obj/item/weapon/fireaxe) && C.wielded == 1) ))
+ if (!( istype(C, /obj/item/weapon/crowbar) || (istype(C, /obj/item/weapon/twohanded/fireaxe) && C:wielded == 1) ))
return
if ((src.density && (stat & NOPOWER) && !( src.operating )))
spawn( 0 )
diff --git a/code/game/objects/closets/fireaxe.dm b/code/game/objects/closets/fireaxe.dm
index 649f2e22406..6847bf14ef8 100644
--- a/code/game/objects/closets/fireaxe.dm
+++ b/code/game/objects/closets/fireaxe.dm
@@ -2,7 +2,7 @@
/obj/structure/closet/fireaxecabinet
name = "Fire Axe Cabinet"
desc = "There is small label that reads \"For Emergency use only\" along with details for safe use of the axe. As if."
- var/obj/item/weapon/fireaxe/fireaxe = new/obj/item/weapon/fireaxe
+ var/obj/item/weapon/twohanded/fireaxe/fireaxe = new/obj/item/weapon/twohanded/fireaxe
icon_state = "fireaxe1000"
icon_closed = "fireaxe1000"
icon_opened = "fireaxe1100"
@@ -51,9 +51,9 @@
src.localopened = 1
update_icon()
return
- if (istype(O, /obj/item/weapon/fireaxe) && src.localopened)
+ if (istype(O, /obj/item/weapon/twohanded/fireaxe) && src.localopened)
if(!fireaxe)
- if(O.wielded)
+ if(O:wielded)
user << "\red Unwield the axe first."
return
fireaxe = O
diff --git a/code/game/objects/items/item.dm b/code/game/objects/items/item.dm
index 267feb8b3ef..c9b74bd6d40 100755
--- a/code/game/objects/items/item.dm
+++ b/code/game/objects/items/item.dm
@@ -12,20 +12,6 @@
..()
user.update_clothing()
- // So you can't drop the Offhand
- if(istype(src, /obj/item/weapon/offhand))
- user.drop_item(src)
-
- var/obj/item/O_r = user.r_hand
- var/obj/item/O_l = user.l_hand
- if(O_r.twohanded)
- if(O_r.wielded)
- user.drop_item(O_r)
- if(O_l.twohanded)
- if(O_l.wielded)
- user.drop_item(O_l)
- del(src)
-
// called just as an item is picked up (loc is not yet changed)
/obj/item/proc/pickup(mob/user)
return
@@ -231,38 +217,6 @@
if(istype(W, /obj/item/device/detective_scanner))
return
-/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."
-
- 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
mob/proc/flash_weak_pain()
flick("weak_pain",pain)
diff --git a/code/game/objects/items/weapons/hydroponics.dm b/code/game/objects/items/weapons/hydroponics.dm
index b80abcc2e8f..cce4a6efc76 100644
--- a/code/game/objects/items/weapons/hydroponics.dm
+++ b/code/game/objects/items/weapons/hydroponics.dm
@@ -149,7 +149,7 @@ Craftables (Cob pipes, potato batteries, pumpkinheads)
/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
- if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/fireaxe) || istype(W, /obj/item/weapon/kitchen/utensil/knife) || istype(W, /obj/item/weapon/melee/energy))
+ if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/twohanded/fireaxe) || istype(W, /obj/item/weapon/kitchen/utensil/knife) || istype(W, /obj/item/weapon/melee/energy))
user.show_message("You carve a face into [src]!", 1)
new /obj/item/clothing/head/helmet/hardhat/pumpkinhead (user.loc)
del(src)
diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm
index 8350cbcf524..b39e32a55b9 100644
--- a/code/game/objects/items/weapons/twohanded.dm
+++ b/code/game/objects/items/weapons/twohanded.dm
@@ -2,27 +2,115 @@
##################### TWO HANDED WEAPONS BE HERE~ -Agouri :3 ########
####################################################################*/
-///General Offhand object properties///
+//Rewrote TwoHanded weapons stuff and put it all here. Just copypasta fireaxe to make new ones ~Carn
+//This rewrite means we don't have two variables for EVERY item which are used only by a few weapons.
+//It also tidies stuff up elsewhere.
-////////////FIREAXE!//////////////
+/obj/item/weapon/twohanded
+ var/wielded = 0
+ var/force_unwielded = 0
+ var/force_wielded = 0
+/obj/item/weapon/twohanded/proc/unwield()
+ wielded = 0
+ force = force_unwielded
+ name = "[initial(name)]"
+ update_icon()
-/obj/item/weapon/fireaxe/update_icon() //Currently only here to fuck with the on-mob icons.
- icon_state = text("fireaxe[]",wielded)
+/obj/item/weapon/twohanded/proc/wield()
+ wielded = 1
+ force = force_wielded
+ name = "[initial(name)] (Wielded)"
+ update_icon()
+
+/obj/item/weapon/twohanded/dropped(mob/user as mob)
+ //handles unwielding a twohanded weapon when dropped as well as clearing up the offhand
+ //bit of a hack but it keeps other code pretty neat and with fewer conditionals
+ var/obj/item/weapon/twohanded/O
+ if(user)
+ if(user.l_hand)
+ O = user.l_hand
+ else
+ O = user.r_hand
+ if(O && istype(O))
+ O.unwield()
+ return unwield()
+
+/obj/item/weapon/twohanded/update_icon()
return
-/obj/item/weapon/fireaxe/pickup(mob/user)
- wielded = 0
- name = "Fire Axe (Unwielded)"
+/obj/item/weapon/twohanded/pickup(mob/user)
+ unwield()
-/obj/item/weapon/fireaxe/attack_self(mob/user as mob)
+/obj/item/weapon/twohanded/attack_self(mob/user as mob)
if( istype(user,/mob/living/carbon/monkey) )
- user << "\red It's too heavy for you to fully wield"
+ user << "It's too heavy for you to wield fully."
return
-//welp, all is good, now to see if he's trying do twohandedly wield it or unwield it
-
..()
+ if(wielded) //Trying to unwield it
+ unwield()
+ user << "You are now carrying the [name] with one hand."
-/obj/item/weapon/offhand/dropped(mob/user as mob)
- del(src)
\ No newline at end of file
+ var/obj/item/weapon/twohanded/offhand/O = user.get_inactive_hand()
+ if(O && istype(O))
+ O.unwield()
+ return
+
+ else //Trying to wield it
+ if(user.get_inactive_hand())
+ user << "You need your other hand to be empty"
+ return
+ wield()
+ user << "You grab the [initial(name)] with both hands."
+
+ var/obj/item/weapon/twohanded/offhand/O = new(user) ////Let's reserve his other hand~
+ O.name = "[initial(name)] - offhand"
+ O.desc = "Your second grip on the [initial(name)]"
+ if(user.hand)
+ user.r_hand = O ///Place dat offhand in the opposite hand
+ else
+ user.l_hand = O
+ O.layer = 20
+ return
+
+///////////OFFHAND///////////////
+/obj/item/weapon/twohanded/offhand
+ w_class = 5.0
+ icon_state = "offhand"
+ name = "offhand"
+
+ unwield()
+ del(src)
+
+ wield()
+ del(src)
+
+////////////FIREAXE!//////////////
+/obj/item/weapon/twohanded/fireaxe // DEM AXES MAN, marker -Agouri
+ icon_state = "fireaxe0"
+ name = "fire axe"
+ desc = "Truly, the weapon of a madman. Who would think to fight fire with an axe?"
+ force = 5
+ w_class = 4.0
+ flags = ONBACK
+ force_unwielded = 5
+ force_wielded = 18
+
+/obj/item/weapon/twohanded/fireaxe/update_icon() //Currently only here to fuck with the on-mob icons.
+ icon_state = "fireaxe[wielded]"
+ return
+
+/obj/item/weapon/twohanded/fireaxe/afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
+ ..()
+ if(A && wielded && (istype(A,/obj/structure/window) || istype(A,/obj/structure/grille))) //destroys windows and grilles in one hit
+ if(istype(A,/obj/structure/window)) //should just make a window.Break() proc but couldn't bother with it
+ var/obj/structure/window/W = A
+
+ new /obj/item/weapon/shard( W.loc )
+ if(W.reinf) new /obj/item/stack/rods( W.loc)
+
+ if (W.dir == SOUTHWEST)
+ new /obj/item/weapon/shard( W.loc )
+ if(W.reinf) new /obj/item/stack/rods( W.loc)
+ del(A)
\ No newline at end of file
diff --git a/code/game/objects/weapons.dm b/code/game/objects/weapons.dm
index c84aa9aa2fb..15c395310b6 100644
--- a/code/game/objects/weapons.dm
+++ b/code/game/objects/weapons.dm
@@ -203,17 +203,3 @@
for(var/mob/O in viewers(src, null))
O.show_message(text("\red The mousetrap is triggered by [A]."), 1)
src.triggered(null)
-
-/obj/item/weapon/fireaxe/afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
- ..()
- if(A && wielded && (istype(A,/obj/structure/window) || istype(A,/obj/structure/grille))) //destroys windows and grilles in one hit
- if(istype(A,/obj/structure/window)) //should just make a window.Break() proc but couldn't bother with it
- var/obj/structure/window/W = A
-
- new /obj/item/weapon/shard( W.loc )
- if(W.reinf) new /obj/item/stack/rods( W.loc)
-
- if (W.dir == SOUTHWEST)
- new /obj/item/weapon/shard( W.loc )
- if(W.reinf) new /obj/item/stack/rods( W.loc)
- del(A)
\ No newline at end of file
diff --git a/code/game/throwing.dm b/code/game/throwing.dm
index 9560bed0efd..a879f031c3c 100644
--- a/code/game/throwing.dm
+++ b/code/game/throwing.dm
@@ -33,19 +33,6 @@
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.wielded = 0
- IT.name = initial(IT.name)
u_equip(item)
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index b8f1f19aa71..b12ab65dec4 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -663,8 +663,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
W.registered_name = M.real_name
M.equip_if_possible(W, M.slot_wear_id)
- var/obj/item/weapon/fireaxe/fire_axe = new(M)
- fire_axe.name = "Fire Axe (Unwielded)"
+ var/obj/item/weapon/twohanded/fireaxe/fire_axe = new(M)
M.equip_if_possible(fire_axe, M.slot_r_hand)
if("masked killer")
@@ -679,8 +678,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_if_possible(new /obj/item/weapon/kitchenknife(M), M.slot_l_store)
M.equip_if_possible(new /obj/item/weapon/scalpel(M), M.slot_r_store)
- var/obj/item/weapon/fireaxe/fire_axe = new(M)
- fire_axe.name = "Fire Axe (Unwielded)"
+ var/obj/item/weapon/twohanded/fireaxe/fire_axe = new(M)
M.equip_if_possible(fire_axe, M.slot_r_hand)
for(var/obj/item/carried_item in M.contents)
diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
index 52e422c6285..d7588011af1 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
@@ -783,7 +783,7 @@ In all, this is a lot like the monkey code. /N
Right Hand: [(r_hand ? text("[]", r_hand) : "Nothing")]
Head: [(head ? text("[]", head) : "Nothing")]
(Exo)Suit: [(wear_suit ? text("[]", wear_suit) : "Nothing")]
-
Empty Pockets
+
Empty Pouches
Close
"}
user << browse(dat, text("window=mob[name];size=340x480"))
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index 4ca82ab7435..cb42ba9b436 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -168,9 +168,9 @@
/mob/living/carbon/proc/swap_hand()
var/obj/item/item_in_hand = src.get_active_hand()
if(item_in_hand) //this segment checks if the item in your hand is twohanded.
- if(item_in_hand.twohanded == 1)
- if(item_in_hand.wielded == 1)
- usr << text("Your other hand is too busy holding the []",item_in_hand.name)
+ if(istype(item_in_hand,/obj/item/weapon/twohanded))
+ if(item_in_hand:wielded == 1)
+ usr << "Your other hand is too busy holding the [item_in_hand.name]"
return
src.hand = !( src.hand )
if (!( src.hand ))
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 88191e94021..fceb3cce172 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -555,8 +555,8 @@
return
if (!( W.flags & ONBACK ))
return
- if(W.twohanded && W.wielded)
- usr << "Unwield the [initial(W.name)] first!"
+ if(istype(W,/obj/item/weapon/twohanded) && W:wielded)
+ usr << "Unwield the [initial(W.name)] first!"
return
u_equip(W)
back = W
@@ -1552,7 +1552,6 @@
/obj/effect/equip_e/human/process()
if (item)
item.add_fingerprint(source)
- var/item_loc = 0
if (!item)
switch(place)
if("mask")
@@ -1615,218 +1614,119 @@
//SN src = null
del(src)
return
- else
- switch(place)
- if("mask")
- if(target.wear_mask)
- item_loc = 1
- if("l_hand")
- if(target.l_hand)
- item_loc = 1
- if("r_hand")
- if(target.r_hand)
- item_loc = 1
- if("gloves")
- if(target.gloves)
- item_loc = 1
- if("eyes")
- if(target.glasses)
- item_loc = 1
- if("l_ear")
- if(target.l_ear)
- item_loc = 1
- if("r_ear")
- if(target.r_ear)
- item_loc = 1
- if("head")
- if(target.head)
- item_loc = 1
- if("shoes")
- if(target.shoes)
- item_loc = 1
- if("belt")
- if(target.belt)
- item_loc = 1
- if("suit")
- if(target.wear_suit)
- item_loc = 1
- if("back")
- if(target.back)
- item_loc = 1
- if("uniform")
- if(target.w_uniform)
- item_loc = 1
- if("s_store")
- if(target.s_store)
- item_loc = 1
- if("h_store")
- if(target.h_store)
- item_loc = 1
- if("id")
- if(target.wear_id)
- item_loc = 1
- if("internal")
- if (target.internal)
- item_loc = 1
- if("handcuff")
- if (target.handcuffed)
- item_loc = 1
var/list/L = list( "syringe", "pill", "drink", "dnainjector", "fuel")
- if (item && !L.Find(place) && !item_loc)
+ if ((item && !( L.Find(place) )))
if(isrobot(source) && place != "handcuff")
del(src)
return
for(var/mob/O in viewers(target, null))
O.show_message(text("\red [] is trying to put \a [] on []", source, item, target), 1)
else
- if (place == "syringe")
- for(var/mob/O in viewers(target, null))
- O.show_message(text("\red [] is trying to inject []!", source, target), 1)
- else
- if (place == "pill")
- for(var/mob/O in viewers(target, null))
- O.show_message(text("\red [] is trying to force [] to swallow []!", source, target, item), 1)
- else
- if(place == "fuel")
- for(var/mob/O in viewers(target, null))
- O.show_message(text("\red [source] is trying to force [target] to eat the [item:content]!"), 1)
+ var/message=null
+ switch(place)
+ if("syringe")
+ message = text("\red [] is trying to inject []!", source, target)
+ if("pill")
+ message = text("\red [] is trying to force [] to swallow []!", source, target, item)
+ if("fuel")
+ message = text("\red [source] is trying to force [target] to eat the [item:content]!")
+ if("drink")
+ message = text("\red [] is trying to force [] to swallow a gulp of []!", source, target, item)
+ if("dnainjector")
+ message = text("\red [] is trying to inject [] with the []!", source, target, item)
+ if("mask")
+ if(istype(target.wear_mask, /obj/item/clothing)&&!target.wear_mask:canremove)
+ message = text("\red [] fails to take off \a [] from []'s body!", source, target.wear_mask, target)
else
- if (place == "drink")
+ message = text("\red [] is trying to take off \a [] from []'s head!", source, target.wear_mask, target)
+/* if("headset")
+ message = text("\red [] is trying to take off \a [] from []'s face!", source, target.w_radio, target) */
+ if("l_hand")
+ message = text("\red [] is trying to take off \a [] from []'s left hand!", source, target.l_hand, target)
+ if("r_hand")
+ message = text("\red [] is trying to take off \a [] from []'s right hand!", source, target.r_hand, target)
+ if("gloves")
+ if(istype(target.gloves, /obj/item/clothing)&&!target.gloves:canremove)
+ message = text("\red [] fails to take off \a [] from []'s body!", source, target.gloves, target)
+ else
+ message = text("\red [] is trying to take off the [] from []'s hands!", source, target.gloves, target)
+ if("eyes")
+ if(istype(target.glasses, /obj/item/clothing)&&!target.glasses:canremove)
+ message = text("\red [] fails to take off \a [] from []'s body!", source, target.glasses, target)
+ else
+ message = text("\red [] is trying to take off the [] from []'s eyes!", source, target.glasses, target)
+ if("l_ear")
+ if(istype(target.l_ear, /obj/item/clothing)&&!target.l_ear:canremove)
+ message = text("\red [] fails to take off \a [] from []'s body!", source, target.l_ear, target)
+ else
+ message = text("\red [] is trying to take off the [] from []'s left ear!", source, target.l_ear, target)
+ if("r_ear")
+ if(istype(target.r_ear, /obj/item/clothing)&&!target.r_ear:canremove)
+ message = text("\red [] fails to take off \a [] from []'s body!", source, target.r_ear, target)
+ else
+ message = text("\red [] is trying to take off the [] from []'s right ear!", source, target.r_ear, target)
+ if("head")
+ if(istype(target.head, /obj/item/clothing)&&!target.head:canremove)
+ message = text("\red [] fails to take off \a [] from []'s body!", source, target.head, target)
+ else
+ message = text("\red [] is trying to take off the [] from []'s head!", source, target.head, target)
+ if("shoes")
+ if(istype(target.shoes, /obj/item/clothing)&&!target.shoes:canremove)
+ message = text("\red [] fails to take off \a [] from []'s body!", source, target.shoes, target)
+ else
+ message = text("\red [] is trying to take off the [] from []'s feet!", source, target.shoes, target)
+ if("belt")
+ message = text("\red [] is trying to take off the [] from []'s belt!", source, target.belt, target)
+ if("suit")
+ if(istype(target.wear_suit, /obj/item/clothing)&&!target.wear_suit:canremove)
+ message = text("\red [] fails to take off \a [] from []'s body!", source, target.wear_suit, target)
+ else
+ message = text("\red [] is trying to take off \a [] from []'s body!", source, target.wear_suit, target)
+ if("back")
+ message = text("\red [] is trying to take off \a [] from []'s back!", source, target.back, target)
+ if("handcuff")
+ message = text("\red [] is trying to unhandcuff []!", source, target)
+ if("uniform")
+ if(istype(target.w_uniform, /obj/item/clothing)&&!target.w_uniform:canremove)
+ message = text("\red [] fails to take off \a [] from []'s body!", source, target.w_uniform, target)
+ else
+ message = text("\red [] is trying to take off \a [] from []'s body!", source, target.w_uniform, target)
+ if("s_store")
+ message = text("\red [] is trying to take off \a [] from []'s suit!", source, target.s_store, target)
+ if("h_store")
+ message = text("\red [] is trying to empty []'s hat!", source, target)
+ if("pockets")
+ for(var/obj/item/weapon/mousetrap/MT in list(target.l_store, target.r_store))
+ if(MT.armed)
for(var/mob/O in viewers(target, null))
- O.show_message(text("\red [] is trying to force [] to swallow a gulp of []!", source, target, item), 1)
- else
- if (place == "dnainjector")
- for(var/mob/O in viewers(target, null))
- O.show_message(text("\red [] is trying to inject [] with the []!", source, target, item), 1)
- else
- var/message = null
- switch(place)
- if("mask")
- target.attack_log += text("\[[time_stamp()]\] Has had their mask removed by [source.name] ([source.ckey])")
- source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) mask")
- if(istype(target.wear_mask, /obj/item/clothing)&&!target.wear_mask:canremove)
- message = text("\red [] fails to take off \a [] from []'s body!", source, target.wear_mask, target)
- else
- message = text("\red [] is trying to take off \a [] from []'s head!", source, target.wear_mask, target)
-/* if("headset")
- message = text("\red [] is trying to take off \a [] from []'s face!", source, target.w_radio, target) */
- if("l_hand")
- target.attack_log += text("\[[time_stamp()]\] Has had their left hand item removed by [source.name] ([source.ckey])")
- source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) left hand item")
- message = text("\red [] is trying to take off \a [] from []'s left hand!", source, target.l_hand, target)
- if("r_hand")
- target.attack_log += text("\[[time_stamp()]\] Has had their right hand item removed by [source.name] ([source.ckey])")
- source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) right hand item")
- message = text("\red [] is trying to take off \a [] from []'s right hand!", source, target.r_hand, target)
- if("gloves")
- target.attack_log += text("\[[time_stamp()]\] Has had their gloves removed by [source.name] ([source.ckey])")
- source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) gloves")
- if(istype(target.gloves, /obj/item/clothing)&&!target.gloves:canremove)
- message = text("\red [] fails to take off \a [] from []'s body!", source, target.gloves, target)
- else
- message = text("\red [] is trying to take off the [] from []'s hands!", source, target.gloves, target)
- if("eyes")
- target.attack_log += text("\[[time_stamp()]\] Has had their eyewear removed by [source.name] ([source.ckey])")
- source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) eyewear")
- if(istype(target.glasses, /obj/item/clothing)&&!target.glasses:canremove)
- message = text("\red [] fails to take off \a [] from []'s body!", source, target.glasses, target)
- else
- message = text("\red [] is trying to take off the [] from []'s eyes!", source, target.glasses, target)
- if("l_ear")
- target.attack_log += text("\[[time_stamp()]\] Has had their left ear item removed by [source.name] ([source.ckey])")
- source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) left ear item")
- if(istype(target.l_ear, /obj/item/clothing)&&!target.l_ear:canremove)
- message = text("\red [] fails to take off \a [] from []'s body!", source, target.l_ear, target)
- else
- message = text("\red [] is trying to take off the [] from []'s left ear!", source, target.l_ear, target)
- if("r_ear")
- target.attack_log += text("\[[time_stamp()]\] Has had their right ear item removed by [source.name] ([source.ckey])")
- source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) right ear item")
- if(istype(target.r_ear, /obj/item/clothing)&&!target.r_ear:canremove)
- message = text("\red [] fails to take off \a [] from []'s body!", source, target.r_ear, target)
- else
- message = text("\red [] is trying to take off the [] from []'s right ear!", source, target.r_ear, target)
- if("head")
- target.attack_log += text("\[[time_stamp()]\] Has had their hat removed by [source.name] ([source.ckey])")
- source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) hat")
- if(istype(target.head, /obj/item/clothing)&&!target.head:canremove)
- message = text("\red [] fails to take off \a [] from []'s body!", source, target.head, target)
- else
- message = text("\red [] is trying to take off the [] from []'s head!", source, target.head, target)
- if("shoes")
- target.attack_log += text("\[[time_stamp()]\] Has had their shoes removed by [source.name] ([source.ckey])")
- source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) shoes")
- if(istype(target.shoes, /obj/item/clothing)&&!target.shoes:canremove)
- message = text("\red [] fails to take off \a [] from []'s body!", source, target.shoes, target)
- else
- message = text("\red [] is trying to take off the [] from []'s feet!", source, target.shoes, target)
- if("belt")
- target.attack_log += text("\[[time_stamp()]\] Has had their belt item removed by [source.name] ([source.ckey])")
- source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) belt item")
- message = text("\red [] is trying to take off the [] from []'s belt!", source, target.belt, target)
- if("suit")
- target.attack_log += text("\[[time_stamp()]\] Has had their suit removed by [source.name] ([source.ckey])")
- source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) suit")
- if(istype(target.wear_suit, /obj/item/clothing)&&!target.wear_suit:canremove)
- message = text("\red [] fails to take off \a [] from []'s body!", source, target.wear_suit, target)
- else
- message = text("\red [] is trying to take off \a [] from []'s body!", source, target.wear_suit, target)
- if("back")
- target.attack_log += text("\[[time_stamp()]\] Has had their back item removed by [source.name] ([source.ckey])")
- source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) back item")
- message = text("\red [] is trying to take off \a [] from []'s back!", source, target.back, target)
- if("handcuff")
- message = text("\red [] is trying to unhandcuff []!", source, target)
- if("uniform")
- target.attack_log += text("\[[time_stamp()]\] Has had their uniform removed by [source.name] ([source.ckey])")
- source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) uniform")
- if(istype(target.w_uniform, /obj/item/clothing)&&!target.w_uniform:canremove)
- message = text("\red [] fails to take off \a [] from []'s body!", source, target.w_uniform, target)
- else
- message = text("\red [] is trying to take off \a [] from []'s body!", source, target.w_uniform, target)
- if("s_store")
- message = text("\red [] is trying to take off \a [] from []'s suit!", source, target.s_store, target)
- if("h_store")
- message = text("\red [] is trying to empty []'s hat!", source, target)
- if("pockets")
- target.attack_log += text("\[[time_stamp()]\] Has had their pockets emptied by [source.name] ([source.ckey])")
- source.attack_log += text("\[[time_stamp()]\] Attempted to empty [target.name]'s ([target.ckey]) pockets")
- for(var/obj/item/weapon/mousetrap/MT in list(target.l_store, target.r_store))
- if(MT.armed)
- for(var/mob/O in viewers(target, null))
- if(O == source)
- O.show_message(text("\red You reach into the [target]'s pockets, but there was a live mousetrap in there!"), 1)
- else
- O.show_message(text("\red [source] reaches into [target]'s pockets and sets off a hidden mousetrap!"), 1)
- target.u_equip(MT)
- if (target.client)
- target.client.screen -= MT
- MT.loc = source.loc
- MT.triggered(source, source.hand ? "l_hand" : "r_hand")
- MT.layer = OBJ_LAYER
- return
- message = text("\red [] is trying to empty []'s pockets!!", source, target)
- if("CPR")
- if (target.cpr_time + 3 >= world.time)
- //SN src = null
- del(src)
- return
- message = text("\red [] is trying perform CPR on []!", source, target)
- if("id")
- target.attack_log += text("\[[time_stamp()]\] Has had their ID removed by [source.name] ([source.ckey])")
- source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) ID")
- message = text("\red [] is trying to take off [] from []'s uniform!", source, target.wear_id, target)
- if("internal")
- target.attack_log += text("\[[time_stamp()]\] Has had their internals toggled by [source.name] ([source.ckey])")
- source.attack_log += text("\[[time_stamp()]\] Attempted to toggle [target.name]'s ([target.ckey]) internals")
- if (target.internal)
- message = text("\red [] is trying to remove []'s internals", source, target)
- else
- message = text("\red [] is trying to set on []'s internals.", source, target)
- else
- for(var/mob/M in viewers(target, null))
- M.show_message(message, 1)
+ if(O == source)
+ O.show_message(text("\red You reach into the [target]'s pockets, but there was a live mousetrap in there!"), 1)
+ else
+ O.show_message(text("\red [source] reaches into [target]'s pockets and sets off a hidden mousetrap!"), 1)
+ target.u_equip(MT)
+ if (target.client)
+ target.client.screen -= MT
+ MT.loc = source.loc
+ MT.triggered(source, source.hand ? "l_hand" : "r_hand")
+ MT.layer = OBJ_LAYER
+ return
+ message = text("\red [] is trying to empty []'s pockets!!", source, target)
+ if("CPR")
+ if (target.cpr_time >= world.time + 3)
+ //SN src = null
+ del(src)
+ return
+ message = text("\red [] is trying perform CPR on []!", source, target)
+ if("id")
+ message = text("\red [] is trying to take off [] from []'s uniform!", source, target.wear_id, target)
+ if("internal")
+ if (target.internal)
+ message = text("\red [] is trying to remove []'s internals", source, target)
+ else
+ message = text("\red [] is trying to set on []'s internals.", source, target)
+ for(var/mob/M in viewers(target, null))
+ M.show_message(message, 1)
spawn( 40 )
done()
return
@@ -1846,7 +1746,7 @@ It can still be worn/put on as normal.
if(source.loc != s_loc) return
if(target.loc != t_loc) return
if(LinkBlocked(s_loc,t_loc)) return
- if(item && source.equipped() != item) return
+ if(item && source.equipped() != item) return
if ((source.restrained() || source.stat)) return
switch(place)
if("mask")
@@ -2856,4 +2756,4 @@ It can still be worn/put on as normal.
else
reset_view(0)
remoteobserve = null
- src.tkdisable = 0
+ src.tkdisable = 0
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index ca7176b713d..13c0be55400 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -191,28 +191,16 @@
var/obj/item/W = equipped()
if (W)
- if(W.twohanded)
- if(W.wielded)
- if(hand)
- var/obj/item/weapon/offhand/O = r_hand
- del O
- else
- 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 = "[initial(W.name)]" //name reset so people don't see world fireaxes with (unwielded) or (wielded) tags
- W.update_icon()
u_equip(W)
if (client)
client.screen -= W
if (W)
+ W.layer = initial(W.layer)
if(target)
W.loc = target.loc
else
W.loc = loc
W.dropped(src)
- if (W)
- W.layer = initial(W.layer)
var/turf/T = get_turf(loc)
if (istype(T))
T.Entered(W)
@@ -235,7 +223,7 @@
return r_hand
/mob/proc/get_inactive_hand()
- if ( ! hand)
+ if (!hand)
return l_hand
else
return r_hand