diff --git a/baystation12.dme b/baystation12.dme
index ddd669a3c9..2ce22f1f94 100644
--- a/baystation12.dme
+++ b/baystation12.dme
@@ -30,6 +30,24 @@
#include "code\__HELPERS\time.dm"
#include "code\__HELPERS\type2type.dm"
#include "code\__HELPERS\unsorted.dm"
+#include "code\_onclick\adjacent.dm"
+#include "code\_onclick\ai.dm"
+#include "code\_onclick\click.dm"
+#include "code\_onclick\cyborg.dm"
+#include "code\_onclick\drag_drop.dm"
+#include "code\_onclick\item_attack.dm"
+#include "code\_onclick\observer.dm"
+#include "code\_onclick\other_mobs.dm"
+#include "code\_onclick\telekinesis.dm"
+#include "code\_onclick\hud\_defines.dm"
+#include "code\_onclick\hud\alien.dm"
+#include "code\_onclick\hud\alien_larva.dm"
+#include "code\_onclick\hud\hud.dm"
+#include "code\_onclick\hud\human.dm"
+#include "code\_onclick\hud\monkey.dm"
+#include "code\_onclick\hud\other_mobs.dm"
+#include "code\_onclick\hud\robot.dm"
+#include "code\_onclick\hud\screen_objects.dm"
#include "code\ATMOSPHERICS\atmospherics.dm"
#include "code\ATMOSPHERICS\datum_pipe_network.dm"
#include "code\ATMOSPHERICS\datum_pipeline.dm"
@@ -148,7 +166,6 @@
#include "code\game\atoms.dm"
#include "code\game\atoms_movable.dm"
#include "code\game\communications.dm"
-#include "code\game\hud.dm"
#include "code\game\response_team.dm"
#include "code\game\shuttle_engines.dm"
#include "code\game\skincmd.dm"
@@ -429,7 +446,6 @@
#include "code\game\objects\items\crayons.dm"
#include "code\game\objects\items\latexballoon.dm"
#include "code\game\objects\items\shooting_range.dm"
-#include "code\game\objects\items\tk_grab.dm"
#include "code\game\objects\items\toys.dm"
#include "code\game\objects\items\trash.dm"
#include "code\game\objects\items\devices\aicard.dm"
@@ -697,6 +713,7 @@
#include "code\modules\clothing\gloves\boxing.dm"
#include "code\modules\clothing\gloves\color.dm"
#include "code\modules\clothing\gloves\miscellaneous.dm"
+#include "code\modules\clothing\gloves\ninja.dm"
#include "code\modules\clothing\gloves\stungloves.dm"
#include "code\modules\clothing\head\collectable.dm"
#include "code\modules\clothing\head\hardhat.dm"
@@ -823,11 +840,9 @@
#include "code\modules\mob\mob_movement.dm"
#include "code\modules\mob\mob_transformation_simple.dm"
#include "code\modules\mob\say.dm"
-#include "code\modules\mob\screen.dm"
#include "code\modules\mob\transform_procs.dm"
#include "code\modules\mob\update_icons.dm"
#include "code\modules\mob\dead\death.dm"
-#include "code\modules\mob\dead\observer\hud.dm"
#include "code\modules\mob\dead\observer\logout.dm"
#include "code\modules\mob\dead\observer\observer.dm"
#include "code\modules\mob\dead\observer\say.dm"
@@ -853,7 +868,6 @@
#include "code\modules\mob\living\carbon\alien\humanoid\alien_powers.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\death.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\emote.dm"
-#include "code\modules\mob\living\carbon\alien\humanoid\hud.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\humanoid.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\inventory.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\life.dm"
@@ -865,7 +879,6 @@
#include "code\modules\mob\living\carbon\alien\humanoid\caste\sentinel.dm"
#include "code\modules\mob\living\carbon\alien\larva\death.dm"
#include "code\modules\mob\living\carbon\alien\larva\emote.dm"
-#include "code\modules\mob\living\carbon\alien\larva\hud.dm"
#include "code\modules\mob\living\carbon\alien\larva\inventory.dm"
#include "code\modules\mob\living\carbon\alien\larva\larva.dm"
#include "code\modules\mob\living\carbon\alien\larva\life.dm"
@@ -877,7 +890,6 @@
#include "code\modules\mob\living\carbon\brain\brain_item.dm"
#include "code\modules\mob\living\carbon\brain\death.dm"
#include "code\modules\mob\living\carbon\brain\emote.dm"
-#include "code\modules\mob\living\carbon\brain\hud.dm"
#include "code\modules\mob\living\carbon\brain\life.dm"
#include "code\modules\mob\living\carbon\brain\MMI.dm"
#include "code\modules\mob\living\carbon\brain\posibrain.dm"
@@ -885,7 +897,6 @@
#include "code\modules\mob\living\carbon\human\death.dm"
#include "code\modules\mob\living\carbon\human\emote.dm"
#include "code\modules\mob\living\carbon\human\examine.dm"
-#include "code\modules\mob\living\carbon\human\hud.dm"
#include "code\modules\mob\living\carbon\human\human.dm"
#include "code\modules\mob\living\carbon\human\human_attackalien.dm"
#include "code\modules\mob\living\carbon\human\human_attackhand.dm"
@@ -914,7 +925,6 @@
#include "code\modules\mob\living\carbon\monkey\diona.dm"
#include "code\modules\mob\living\carbon\monkey\emote.dm"
#include "code\modules\mob\living\carbon\monkey\examine.dm"
-#include "code\modules\mob\living\carbon\monkey\hud.dm"
#include "code\modules\mob\living\carbon\monkey\inventory.dm"
#include "code\modules\mob\living\carbon\monkey\life.dm"
#include "code\modules\mob\living\carbon\monkey\login.dm"
@@ -928,7 +938,6 @@
#include "code\modules\mob\living\silicon\ai\ai.dm"
#include "code\modules\mob\living\silicon\ai\death.dm"
#include "code\modules\mob\living\silicon\ai\examine.dm"
-#include "code\modules\mob\living\silicon\ai\hud.dm"
#include "code\modules\mob\living\silicon\ai\laws.dm"
#include "code\modules\mob\living\silicon\ai\life.dm"
#include "code\modules\mob\living\silicon\ai\login.dm"
@@ -955,7 +964,6 @@
#include "code\modules\mob\living\silicon\robot\death.dm"
#include "code\modules\mob\living\silicon\robot\emote.dm"
#include "code\modules\mob\living\silicon\robot\examine.dm"
-#include "code\modules\mob\living\silicon\robot\hud.dm"
#include "code\modules\mob\living\silicon\robot\inventory.dm"
#include "code\modules\mob\living\silicon\robot\laws.dm"
#include "code\modules\mob\living\silicon\robot\life.dm"
@@ -1001,7 +1009,6 @@
#include "code\modules\mob\living\simple_animal\hostile\retaliate\clown.dm"
#include "code\modules\mob\living\simple_animal\hostile\retaliate\drone.dm"
#include "code\modules\mob\living\simple_animal\hostile\retaliate\retaliate.dm"
-#include "code\modules\mob\new_player\hud.dm"
#include "code\modules\mob\new_player\login.dm"
#include "code\modules\mob\new_player\logout.dm"
#include "code\modules\mob\new_player\new_player.dm"
@@ -1285,6 +1292,7 @@
#include "code\WorkInProgress\Cael_Aislinn\Supermatter\SuperMatter.dm"
#include "code\WorkInProgress\Cael_Aislinn\Supermatter\ZeroPointLaser.dm"
#include "code\WorkInProgress\Chinsky\ashtray.dm"
+#include "code\WorkInProgress\Cib\MedicalSideEffects.dm"
#include "code\WorkInProgress\kilakk\fax.dm"
#include "code\WorkInProgress\Mini\atmos_control.dm"
#include "code\WorkInProgress\Ported\policetape.dm"
diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm
index 9590a9015e..65e0f7ff06 100644
--- a/code/ATMOSPHERICS/components/unary/vent_pump.dm
+++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm
@@ -336,3 +336,15 @@
initial_loc.air_vent_names -= id_tag
..()
return
+
+/*
+ Alt-click to ventcrawl - Monkeys, aliens, and slimes
+ This is a little buggy but somehow that just seems to plague ventcrawl.
+ I am sorry, I don't know why.
+*/
+/obj/machinery/atmospherics/unary/vent_pump/AltClick(var/mob/living/carbon/ML)
+ if(!istype(ML))
+ return
+ var/list/ventcrawl_verbs = list(/mob/living/carbon/monkey/verb/ventcrawl, /mob/living/carbon/alien/verb/ventcrawl, /mob/living/carbon/slime/verb/ventcrawl)
+ if(length(ML.verbs & ventcrawl_verbs)) // alien queens have this removed, an istype would be complicated
+ ML.handle_ventcrawl(src)
diff --git a/code/WorkInProgress/Cib/MedicalSideEffects.dm b/code/WorkInProgress/Cib/MedicalSideEffects.dm
index cf1811b9ed..4fd8670bd0 100644
--- a/code/WorkInProgress/Cib/MedicalSideEffects.dm
+++ b/code/WorkInProgress/Cib/MedicalSideEffects.dm
@@ -34,7 +34,6 @@
for(var/T in L)
var/datum/medical_effect/M = new T
if (M.manifest(src))
- log_debug ("[src], tick [life_tick] : [M] manfiested.")
src.add_side_effect(M.name)
// One full cycle(in terms of strength) every 10 minutes
diff --git a/code/WorkInProgress/buildmode.dm b/code/WorkInProgress/buildmode.dm
index 089522490a..28beed7f04 100644
--- a/code/WorkInProgress/buildmode.dm
+++ b/code/WorkInProgress/buildmode.dm
@@ -57,7 +57,7 @@
dir = NORTHWEST
if(NORTHWEST)
dir = NORTH
- return
+ return 1
/obj/effect/bmode/buildhelp
icon = 'icons/misc/buildmode.dmi'
@@ -95,7 +95,7 @@
usr << "\blue Left Mouse Button on turf/obj/mob = Select"
usr << "\blue Right Mouse Button on turf/obj/mob = Throw"
usr << "\blue ***********************************************************"
- return
+ return 1
/obj/effect/bmode/buildquit
icon_state = "buildquit"
@@ -103,6 +103,7 @@
Click()
togglebuildmode(master.cl.mob)
+ return 1
/obj/effect/bmode/buildholder
density = 0
@@ -142,7 +143,7 @@
else if(pa.Find("right"))
switch(master.cl.buildmode)
if(1)
- return
+ return 1
if(2)
objholder = input(usr,"Enter typepath:" ,"Typepath","/obj/structure/closet")
var/list/removed_paths = list("/obj/effect/bhole")
@@ -156,9 +157,9 @@
master.buildmode.varholder = input(usr,"Enter variable name:" ,"Name", "name")
if(master.buildmode.varholder in locked && !check_rights(R_DEBUG,0))
- return
+ return 1
var/thetype = input(usr,"Select variable type:" ,"Type") in list("text","number","mob-reference","obj-reference","turf-reference")
- if(!thetype) return
+ if(!thetype) return 1
switch(thetype)
if("text")
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value", "value") as text
@@ -170,9 +171,9 @@
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value") as obj in world
if("turf-reference")
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value") as turf in world
+ return 1
-
-/proc/build_click(var/mob/user, buildmode, location, control, params, var/obj/object)
+/proc/build_click(var/mob/user, buildmode, params, var/obj/object)
var/obj/effect/bmode/buildholder/holder = null
for(var/obj/effect/bmode/buildholder/H)
if(H.cl == user.client)
diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm
index 2404b33509..0b535a44c3 100644
--- a/code/__HELPERS/game.dm
+++ b/code/__HELPERS/game.dm
@@ -281,46 +281,6 @@ proc/isInSight(var/atom/A, var/atom/B)
return M
return null
-//i think this is used soley by verb/give(), cael
-proc/check_can_reach(atom/user, atom/target)
- if(!in_range(user,target))
- return 0
- return CanReachThrough(get_turf(user), get_turf(target), target)
-
-//dummy caching, used to speed up reach checks
-var/list/DummyCache = list()
-
-/proc/CanReachThrough(turf/srcturf, turf/targetturf, atom/target)
-
- var/obj/item/weapon/dummy/D = locate() in DummyCache
- if(!D)
- D = new /obj/item/weapon/dummy( srcturf )
- else
- DummyCache.Remove(D)
- D.loc = srcturf
-
- if(targetturf.density && targetturf != get_turf(target))
- return 0
-
- //Now, check objects to block exit that are on the border
- for(var/obj/border_obstacle in srcturf)
- if(border_obstacle.flags & ON_BORDER)
- if(!border_obstacle.CheckExit(D, targetturf))
- D.loc = null
- DummyCache.Add(D)
- return 0
-
- //Next, check objects to block entry that are on the border
- for(var/obj/border_obstacle in targetturf)
- if((border_obstacle.flags & ON_BORDER) && (target != border_obstacle))
- if(!border_obstacle.CanPass(D, srcturf, 1, 0))
- D.loc = null
- DummyCache.Add(D)
- return 0
-
- D.loc = null
- DummyCache.Add(D)
- return 1
// Will return a list of active candidates. It increases the buffer 5 times until it finds a candidate which is active within the buffer.
/proc/get_active_candidates(var/buffer = 1)
diff --git a/code/__HELPERS/lists.dm b/code/__HELPERS/lists.dm
index fd1bdb3465..86d1b61c38 100644
--- a/code/__HELPERS/lists.dm
+++ b/code/__HELPERS/lists.dm
@@ -290,6 +290,27 @@ proc/listclearnulls(list/list)
return (result + R.Copy(Ri, 0))
+//Mergesort: any value in a list, preserves key=value structure
+/proc/sortAssoc(var/list/L)
+ if(L.len < 2)
+ return L
+ var/middle = L.len / 2 + 1 // Copy is first,second-1
+ return mergeAssoc(sortAssoc(L.Copy(0,middle)), sortAssoc(L.Copy(middle))) //second parameter null = to end of list
+
+/proc/mergeAssoc(var/list/L, var/list/R)
+ var/Li=1
+ var/Ri=1
+ var/list/result = new()
+ while(Li <= L.len && Ri <= R.len)
+ if(sorttext(L[Li], R[Ri]) < 1)
+ result += R&R[Ri++]
+ else
+ result += L&L[Li++]
+
+ if(Li <= L.len)
+ return (result + L.Copy(Li, 0))
+ return (result + R.Copy(Ri, 0))
+
//Converts a bitfield to a list of numbers (or words if a wordlist is provided)
/proc/bitfield2list(bitfield = 0, list/wordlist)
var/list/r = list()
diff --git a/code/datums/spell.dm b/code/datums/spell.dm
index 86396e8dff..75f2d5f3e5 100644
--- a/code/datums/spell.dm
+++ b/code/datums/spell.dm
@@ -118,12 +118,9 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
charge_counter = charge_max
/obj/effect/proc_holder/spell/Click()
- ..()
-
- if(!cast_check())
- return
-
- choose_targets()
+ if(cast_check())
+ choose_targets()
+ return 1
/obj/effect/proc_holder/spell/proc/choose_targets(mob/user = usr) //depends on subtype - /targeted or /aoe_turf
return
diff --git a/code/defines/obj.dm b/code/defines/obj.dm
index e672e387f2..6c6269d301 100644
--- a/code/defines/obj.dm
+++ b/code/defines/obj.dm
@@ -262,7 +262,7 @@
throwforce = 0.0
throw_speed = 1
throw_range = 20
- flags = FPRINT | USEDELAY | TABLEPASS | CONDUCT
+ flags = FPRINT | TABLEPASS | CONDUCT
afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
user.drop_item()
src.throw_at(target, throw_range, throw_speed)
diff --git a/code/defines/obj/hydro.dm b/code/defines/obj/hydro.dm
index bfea9a3b22..7cb2439cc6 100644
--- a/code/defines/obj/hydro.dm
+++ b/code/defines/obj/hydro.dm
@@ -1293,7 +1293,7 @@
name = "weed-spray"
icon_state = "weedspray"
item_state = "spray"
- flags = TABLEPASS | OPENCONTAINER | FPRINT | USEDELAY
+ flags = TABLEPASS | OPENCONTAINER | FPRINT | NOBLUDGEON
slot_flags = SLOT_BELT
throwforce = 4
w_class = 2.0
@@ -1312,7 +1312,7 @@
name = "pest-spray"
icon_state = "pestspray"
item_state = "spray"
- flags = TABLEPASS | OPENCONTAINER | FPRINT | USEDELAY
+ flags = TABLEPASS | OPENCONTAINER | FPRINT | NOBLUDGEON
slot_flags = SLOT_BELT
throwforce = 4
w_class = 2.0
@@ -1331,7 +1331,7 @@
icon = 'icons/obj/weapons.dmi'
icon_state = "hoe"
item_state = "hoe"
- flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
+ flags = FPRINT | TABLEPASS | CONDUCT | NOBLUDGEON
force = 5.0
throwforce = 7.0
w_class = 2.0
diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm
index 5064113e15..532e84e1f7 100644
--- a/code/defines/obj/weapon.dm
+++ b/code/defines/obj/weapon.dm
@@ -188,20 +188,6 @@
item_state = "card-id"
w_class = 1.0
-//TODO: Figure out wtf this is and possibly remove it -Nodrak
-/obj/item/weapon/dummy
- name = "dummy"
- invisibility = 101.0
- anchored = 1.0
- flags = TABLEPASS
-
-/obj/item/weapon/dummy/ex_act()
- return
-
-/obj/item/weapon/dummy/blob_act()
- return
-
-
/*
/obj/item/weapon/game_kit
name = "Gaming Kit"
@@ -578,7 +564,8 @@
origin_tech = "materials=2;combat=2"
attack_verb = list("chopped", "sliced", "cut", "reaped")
-/obj/item/weapon/scythe/afterattack(atom/A, mob/user as mob)
+/obj/item/weapon/scythe/afterattack(atom/A, mob/user as mob, proximity)
+ if(!proximity) return
if(istype(A, /obj/effect/spacevine))
for(var/obj/effect/spacevine/B in orange(A,1))
if(prob(80))
@@ -612,7 +599,7 @@
icon = 'icons/obj/assemblies.dmi'
icon_state = "plastic-explosive0"
item_state = "plasticx"
- flags = FPRINT | TABLEPASS | USEDELAY
+ flags = FPRINT | TABLEPASS | NOBLUDGEON
w_class = 2.0
origin_tech = "syndicate=2"
var/timer = 10
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index 44440e8288..5d72c15022 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -222,9 +222,6 @@ its easier to just keep the beam vertical.
//usr << "[name]: Dn:[density] dir:[dir] cont:[contents] icon:[icon] is:[icon_state] loc:[loc]"
return
-/atom/proc/MouseDrop_T()
- return
-
/atom/proc/relaymove()
return
@@ -237,75 +234,9 @@ its easier to just keep the beam vertical.
/atom/proc/fire_act()
return
-/atom/proc/attack_hand(mob/user as mob)
- return
-
-/atom/proc/attack_paw(mob/user as mob)
- return
-
-/atom/proc/attack_ai(mob/user as mob)
- return
-
-/atom/proc/attack_robot(mob/user as mob)
- attack_ai(user)
- return
-
-/atom/proc/attack_animal(mob/user as mob)
- return
-
-/atom/proc/attack_ghost(mob/user as mob)
- src.examine()
- return
-
-/atom/proc/attack_admin(mob/user as mob)
- if(!user || !user.client || !user.client.holder)
- return
- attack_hand(user)
-
-//for aliens, it works the same as monkeys except for alien-> mob interactions which will be defined in the
-//appropiate mob files
-/atom/proc/attack_alien(mob/user as mob)
- src.attack_paw(user)
- return
-
-/atom/proc/attack_larva(mob/user as mob)
- return
-
-// for slimes
-/atom/proc/attack_slime(mob/user as mob)
- return
-
-/atom/proc/hand_h(mob/user as mob) //human (hand) - restrained
- return
-
-/atom/proc/hand_p(mob/user as mob) //monkey (paw) - restrained
- return
-
-/atom/proc/hand_a(mob/user as mob) //AI - restrained
- return
-
-/atom/proc/hand_r(mob/user as mob) //Cyborg (robot) - restrained
- src.hand_a(user)
- return
-
-/atom/proc/hand_al(mob/user as mob) //alien - restrained
- src.hand_p(user)
- return
-
-/atom/proc/hand_m(mob/user as mob) //slime - restrained
- return
-
-
/atom/proc/hitby(atom/movable/AM as mob|obj)
return
-/atom/proc/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if (!(istype(W, /obj/item/weapon/grab) ) && !(istype(W, /obj/item/weapon/plastique)) && !(istype(W, /obj/item/weapon/reagent_containers/spray)) && !(istype(W, /obj/item/weapon/packageWrap)) && !istype(W, /obj/item/device/detective_scanner))
- for(var/mob/O in viewers(src, null))
- if ((O.client && !( O.blinded )))
- O << "\red [src] has been hit by [user] with [W]"
- return
-
/atom/proc/add_hiddenprint(mob/living/M as mob)
if(isnull(M)) return
if(isnull(M.key)) return
@@ -457,812 +388,6 @@ its easier to just keep the beam vertical.
return 1
-
-/atom/MouseDrop(atom/over_object as mob|obj|turf|area)
- spawn(0)
- if (istype(over_object, /atom))
- over_object.MouseDrop_T(src, usr)
- return
- ..()
- return
-
-
-/atom/Click(location,control,params)
- //world << "atom.Click() on [src] by [usr] : src.type is [src.type]"
- var/acting_bad = 1 //Check for gun targeting code.
- if (istype(src,/obj/item/weapon/gun)) //Allow people to lower weapon
- acting_bad = 0
- if (istype(src, /turf) && istype(usr,/mob/living/carbon/human)) //Allow people to turn around
- var/mob/living/carbon/human/H = usr
- if (!H.equipped())
- acting_bad = 0
- if(acting_bad)
- usr.last_target_click = world.time
-
- if(usr.client.buildmode)
- build_click(usr, usr.client.buildmode, location, control, params, src)
- return
-// if(using_new_click_proc) //TODO ERRORAGE (see message below)
-// return DblClickNew()
- return DblClick(location, control, params)
-
-var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblClickNew() proc is being tested)
-
-/atom/proc/DblClickNew()
- if(!usr) return
-// TODO DOOHL: Intergrate params to new proc. Saved for another time because var/valid_place is a fucking brainfuck
-
- //Spamclick server-overloading prevention delay... THING
- if (world.time <= usr:lastDblClick+1)
- return
- else
- usr:lastDblClick = world.time
-
- //paralysis and critical condition
- if(usr.stat == 1) //Death is handled in attack_ghost()
- return
-
- if(!istype(usr, /mob/living/silicon/ai))
- if (usr.paralysis || usr.stunned || usr.weakened)
- return
-
- //handle the hud separately
- if(istype(src,/obj/screen))
- if( usr.restrained() )
- if(ishuman(usr))
- src.attack_hand(usr)
- else if(isAI(usr))
- src.attack_ai(usr)
- else if(isrobot(usr))
- src.attack_ai(usr)
- else if(isobserver(usr))
- src.attack_ghost(usr)
- else if(ismonkey(usr))
- src.attack_paw(usr)
- else if(isalienadult(usr))
- src.attack_alien(usr)
- else if(isslime(usr))
- src.attack_slime(usr)
- else if(isanimal(usr))
- src.attack_animal(usr)
- else
- usr << "This mob type does not support clicks to the HUD. Contact a coder."
- else
- if(ishuman(usr))
- src.hand_h(usr, usr.hand)
- else if(isAI(usr))
- src.hand_a(usr, usr.hand)
- else if(isrobot(usr))
- src.hand_a(usr, usr.hand)
- else if(isobserver(usr))
- return
- else if(ismonkey(usr))
- src.hand_p(usr, usr.hand)
- else if(isalienadult(usr))
- src.hand_al(usr, usr.hand)
- else if(isslime(usr))
- return
- else if(isanimal(usr))
- return
- else
- usr << "This mob type does not support restrained clicks to the HUD. Contact a coder."
- return
-
- //Gets equipped item or used module of robots
- var/obj/item/W = usr.get_active_hand()
-
- //Attack self
- if (W == src && usr.stat == 0)
-// spawn (0) //causes runtimes under heavy lag
- W.attack_self(usr)
- return
-
- //Attackby, attack_hand, afterattack, etc. can only be done once every 1 second, unless an object has the NODELAY or USEDELAY flags set
- //This segment of code determins this.
- if(W)
- if( !( (src.loc && src.loc == usr) || (src.loc.loc && src.loc.loc == usr) ) )
- //The check above checks that you are not targeting an item which you are holding.
- //If you are, (example clicking a backpack), the delays are ignored.
- if(W.flags & USEDELAY)
- //Objects that use the USEDELAY flag can only attack once every 2 seconds
- if (usr.next_move < world.time)
- usr.prev_move = usr.next_move
- usr.next_move = world.time + 20
- else
- return //A click has recently been handled already, you need to wait until the anti-spam delay between clicks passes
- else if(!(W.flags & NODELAY))
- //Objects with NODELAY don't have a delay between uses, while most objects have the standard 1 second delay.
- if (usr.next_move < world.time)
- usr.prev_move = usr.next_move
- usr.next_move = world.time + 10
- else
- return //A click has recently been handled already, you need to wait until the anti-spam delay between clicks passes
- else
- //Empty hand
- if (usr.next_move < world.time)
- usr.prev_move = usr.next_move
- usr.next_move = world.time + 10
- else
- return //A click has recently been handled already, you need to wait until the anti-spam delay between clicks passes
-
- //Is the object in a valid place?
- var/valid_place = 0
- if ( isturf(src) || ( src.loc && isturf(src.loc) ) || ( src.loc.loc && isturf(src.loc.loc) ) )
- //Object is either a turf of placed on a turf, thus valid.
- //The third one is that it is in a container, which is on a turf, like a box,
- //which you mouse-drag opened. Also a valid location.
- valid_place = 1
-
- if ( ( src.loc && (src.loc == usr) ) || ( src.loc.loc && (src.loc.loc == usr) ) )
- //User has the object on them (in their inventory) and it is thus valid
- valid_place = 1
-
- //Afterattack gets performed every time you click, no matter if it's in range or not. It's used when
- //clicking targets for guns and such. If you are clicking on a target that's not in range
- //with an item in your hands only afterattack() needs to be performed.
- //If the range is valid, afterattack() will be handled in the separate mob-type
- //sections below, however only after attackby(). Attack_hand and simmilar procs are handled
- //in the mob-type sections below, as some require you to be in range to work (human, monkey..) while others don't (ai, cyborg)
- //Also note that afterattack does not differentiate between the holder/attacker's mob-type.
- if( W && !valid_place)
- W.afterattack(src, usr, (valid_place ? 1 : 0))
- return
-
- if(ishuman(usr))
- var/mob/living/carbon/human/human = usr
- //-human stuff-
-
- if(human.stat)
- return
-
- if(human.in_throw_mode)
- return human.throw_item(src)
-
- var/in_range = in_range(src, human) || src.loc == human
-
- if (in_range)
- if (!( human.restrained() || human.lying ))
- if (W)
- var/was_used = 0
- if(W)
- was_used = W.is_used_on(src, human)
- if(!was_used)
- attackby(W,human)
- if (W)
- W.afterattack(src, human)
- else
- attack_hand(human)
- else
- hand_h(human, human.hand)
- else
- if ( (W) && !human.restrained() )
- W.afterattack(src, human)
-
-
- else if(isAI(usr))
- var/mob/living/silicon/ai/ai = usr
- //-ai stuff-
-
- if(ai.stat)
- return
-
- if (ai.control_disabled)
- return
-
- if( !ai.restrained() )
- attack_ai(ai)
- else
- hand_a(ai, ai.hand)
-
- else if(isrobot(usr))
- var/mob/living/silicon/robot/robot = usr
- //-cyborg stuff-
-
- if(robot.stat)
- return
-
- if (robot.lockcharge)
- return
-
-
-
- if(W)
- var/in_range = in_range(src, robot) || src.loc == robot
- if(in_range)
- attackby(W,robot)
- if (W)
- W.afterattack(src, robot)
- else
- if( !robot.restrained() )
- attack_robot(robot)
- else
- hand_r(robot, robot.hand)
-
- else if(isobserver(usr))
- var/mob/dead/observer/ghost = usr
- //-ghost stuff-
-
- if(ghost)
- if(W)
- if(usr.client && usr.client.holder)
- src.attackby(W, ghost) //This is so admins can interact with things ingame.
- else
- src.attack_ghost(ghost) //Something's gone wrong, non-admin ghosts shouldn't be able to hold things.
- else
- if(usr.client && usr.client.holder)
- src.attack_admin(ghost) //This is so admins can interact with things ingame.
- else
- src.attack_ghost(ghost) //Standard click as ghost
-
-
- else if(ismonkey(usr))
- var/mob/living/carbon/monkey/monkey = usr
- //-monkey stuff-
-
- if(monkey.stat)
- return
-
- if(monkey.in_throw_mode)
- return monkey.throw_item(src)
-
- var/in_range = in_range(src, monkey) || src.loc == monkey
-
- if (in_range)
- if ( !monkey.restrained() )
- if (W)
- attackby(W,monkey)
- if (W)
- W.afterattack(src, monkey)
- else
- attack_paw(monkey)
- else
- hand_p(monkey, monkey.hand)
- else
- if ( (W) && !monkey.restrained() )
- W.afterattack(src, monkey)
-
- else if(isalienadult(usr))
- var/mob/living/carbon/alien/humanoid/alien = usr
- //-alien stuff-
-
- if(alien.stat)
- return
-
- var/in_range = in_range(src, alien) || src.loc == alien
-
- if (in_range)
- if ( !alien.restrained() )
- if (W)
- attackby(W,alien)
- if (W)
- W.afterattack(src, alien)
- else
- attack_alien(alien)
- else
- hand_al(alien, alien.hand)
- else
- if ( (W) && !alien.restrained() )
- W.afterattack(src, alien)
-
- else if(islarva(usr))
- var/mob/living/carbon/alien/larva/alien = usr
- if(alien.stat)
- return
-
- var/in_range = in_range(src, alien) || src.loc == alien
-
- if (in_range)
- if ( !alien.restrained() )
- attack_larva(alien)
-
- else if(isslime(usr))
- var/mob/living/carbon/slime/slime = usr
- //-slime stuff-
-
- if(slime.stat)
- return
-
- var/in_range = in_range(src, slime) || src.loc == slime
-
- if (in_range)
- if ( !slime.restrained() )
- if (W)
- attackby(W,slime)
- if (W)
- W.afterattack(src, slime)
- else
- attack_slime(slime)
- else
- hand_m(slime, slime.hand)
- else
- if ( (W) && !slime.restrained() )
- W.afterattack(src, slime)
-
-
- else if(isanimal(usr))
- var/mob/living/simple_animal/animal = usr
- //-simple animal stuff-
-
- if(animal.stat)
- return
-
- var/in_range = in_range(src, animal) || src.loc == animal
-
- if (in_range)
- if ( !animal.restrained() )
- attack_animal(animal)
-
-/atom/DblClick(location, control, params) //TODO: DEFERRED: REWRITE
- if(!usr) return
-
- // ------- TIME SINCE LAST CLICK -------
- if (world.time <= usr:lastDblClick+1)
-// world << "BLOCKED atom.DblClick() on [src] by [usr] : src.type is [src.type]"
- return
- else
-// world << "atom.DblClick() on [src] by [usr] : src.type is [src.type]"
- usr:lastDblClick = world.time
-
- //Putting it here for now. It diverts stuff to the mech clicking procs. Putting it here stops us drilling items in our inventory Carn
- if(istype(usr.loc,/obj/mecha))
- if(usr.client && (src in usr.client.screen))
- return
- var/obj/mecha/Mech = usr.loc
- Mech.click_action(src,usr)
- return
-
- // ------- DIR CHANGING WHEN CLICKING ------
- if( iscarbon(usr) && !usr.buckled )
- if( src.x && src.y && usr.x && usr.y )
- var/dx = src.x - usr.x
- var/dy = src.y - usr.y
-
- if(dy || dx)
- if(abs(dx) < abs(dy))
- if(dy > 0) usr.dir = NORTH
- else usr.dir = SOUTH
- else
- if(dx > 0) usr.dir = EAST
- else usr.dir = WEST
- else
- if(pixel_y > 16) usr.dir = NORTH
- else if(pixel_y < -16) usr.dir = SOUTH
- else if(pixel_x > 16) usr.dir = EAST
- else if(pixel_x < -16) usr.dir = WEST
-
-
-
-
- // ------- AI -------
- else if (istype(usr, /mob/living/silicon/ai))
- var/mob/living/silicon/ai/ai = usr
- if (ai.control_disabled)
- return
-
- // ------- CYBORG -------
- else if (istype(usr, /mob/living/silicon/robot))
- var/mob/living/silicon/robot/bot = usr
- if (bot.lockcharge) return
- ..()
-
-
- // ------- SHIFT-CLICK -------
-
- if(params)
- var/parameters = params2list(params)
-
- if(parameters["shift"]){
- if(!isAI(usr))
- ShiftClick(usr)
- else
- AIShiftClick(usr)
- return
- }
-
- // ------- ALT-CLICK -------
-
- if(parameters["alt"]){
- if(!isAI(usr))
- AltClick(usr)
- else
- AIAltClick(usr)
- return
- }
-
- // ------- CTRL-CLICK -------
-
- if(parameters["ctrl"]){
- if(!isAI(usr))
- CtrlClick(usr)
- else
- AICtrlClick(usr)
- return
- }
-
- // ------- MIDDLE-CLICK -------
-
- if(parameters["middle"]){
- if(!isAI(usr))
- MiddleClick(usr)
- return
- }
-
- // ------- THROW -------
- if(usr.in_throw_mode)
- return usr:throw_item(src)
-
- // ------- ITEM IN HAND DEFINED -------
- var/obj/item/W = usr.get_active_hand()
-/* Now handled by get_active_hand()
- // ------- ROBOT -------
- if(istype(usr, /mob/living/silicon/robot))
- if(!isnull(usr:module_active))
- W = usr:module_active
- else
- W = null
-*/
- // ------- ATTACK SELF -------
- if (W == src && usr.stat == 0)
- W.attack_self(usr)
- if(usr.hand)
- usr.update_inv_l_hand() //update in-hand overlays
- else
- usr.update_inv_r_hand()
- return
-
- // ------- PARALYSIS, STUN, WEAKENED, DEAD, (And not AI) -------
- if (((usr.paralysis || usr.stunned || usr.weakened) && !istype(usr, /mob/living/silicon/ai)) || usr.stat != 0)
- return
-
- // ------- CLICKING STUFF IN CONTAINERS -------
- if ((!( src in usr.contents ) && (((!( isturf(src) ) && (!( isturf(src.loc) ) && (src.loc && !( isturf(src.loc.loc) )))) || !( isturf(usr.loc) )) && (src.loc != usr.loc && (!( istype(src, /obj/screen) ) && !( usr.contents.Find(src.loc) ))))))
- if (istype(usr, /mob/living/silicon/ai))
- var/mob/living/silicon/ai/ai = usr
- if (ai.control_disabled || ai.malfhacking)
- return
- else
- return
-
- // ------- 1 TILE AWAY -------
- var/t5
- // ------- AI CAN CLICK ANYTHING -------
- if(istype(usr, /mob/living/silicon/ai))
- t5 = 1
- // ------- CYBORG CAN CLICK ANYTHING WHEN NOT HOLDING STUFF -------
- else if(istype(usr, /mob/living/silicon/robot) && !W)
- t5 = 1
- else
- t5 = in_range(src, usr) || src.loc == usr
-
-// world << "according to dblclick(), t5 is [t5]"
-
- // ------- ACTUALLY DETERMINING STUFF -------
- if (((t5 || (W && (W.flags & USEDELAY))) && !( istype(src, /obj/screen) )))
-
- // ------- ( CAN USE ITEM OR HAS 1 SECOND USE DELAY ) AND NOT CLICKING ON SCREEN -------
-
- if (usr.next_move < world.time)
- usr.prev_move = usr.next_move
- usr.next_move = world.time + 10
- else
- // ------- ALREADY USED ONE ITEM WITH USE DELAY IN THE PREVIOUS SECOND -------
- return
-
- // ------- DELAY CHECK PASSED -------
-
- if ((src.loc && (get_dist(src, usr) < 2 || src.loc == usr.loc)))
-
- // ------- CLICKED OBJECT EXISTS IN GAME WORLD, DISTANCE FROM PERSON TO OBJECT IS 1 SQUARE OR THEY'RE ON THE SAME SQUARE -------
-
- var/direct = get_dir(usr, src)
- var/obj/item/weapon/dummy/D = new /obj/item/weapon/dummy( usr.loc )
- var/ok = 0
- if ( (direct - 1) & direct)
-
- // ------- CLICKED OBJECT IS LOCATED IN A DIAGONAL POSITION FROM THE PERSON -------
-
- var/turf/Step_1
- var/turf/Step_2
- switch(direct)
- if(5.0)
- Step_1 = get_step(usr, NORTH)
- Step_2 = get_step(usr, EAST)
-
- if(6.0)
- Step_1 = get_step(usr, SOUTH)
- Step_2 = get_step(usr, EAST)
-
- if(9.0)
- Step_1 = get_step(usr, NORTH)
- Step_2 = get_step(usr, WEST)
-
- if(10.0)
- Step_1 = get_step(usr, SOUTH)
- Step_2 = get_step(usr, WEST)
-
- else
- if(Step_1 && Step_2)
-
- // ------- BOTH CARDINAL DIRECTIONS OF THE DIAGONAL EXIST IN THE GAME WORLD -------
-
- var/check_1 = 0
- var/check_2 = 0
- if(step_to(D, Step_1))
- check_1 = 1
- for(var/obj/border_obstacle in Step_1)
- if(border_obstacle.flags & ON_BORDER)
- if(!border_obstacle.CheckExit(D, src))
- check_1 = 0
- // ------- YOU TRIED TO CLICK ON AN ITEM THROUGH A WINDOW (OR SIMILAR THING THAT LIMITS ON BORDERS) ON ONE OF THE DIRECITON TILES -------
- for(var/obj/border_obstacle in get_turf(src))
- if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
- if(!border_obstacle.CanPass(D, D.loc, 1, 0))
- // ------- YOU TRIED TO CLICK ON AN ITEM THROUGH A WINDOW (OR SIMILAR THING THAT LIMITS ON BORDERS) ON THE TILE YOU'RE ON -------
- check_1 = 0
-
- D.loc = usr.loc
- if(step_to(D, Step_2))
- check_2 = 1
-
- for(var/obj/border_obstacle in Step_2)
- if(border_obstacle.flags & ON_BORDER)
- if(!border_obstacle.CheckExit(D, src))
- check_2 = 0
- for(var/obj/border_obstacle in get_turf(src))
- if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
- if(!border_obstacle.CanPass(D, D.loc, 1, 0))
- check_2 = 0
-
-
- if(check_1 || check_2)
- ok = 1
- // ------- YOU CAN REACH THE ITEM THROUGH AT LEAST ONE OF THE TWO DIRECTIONS. GOOD. -------
-
- /*
- More info:
- If you're trying to click an item in the north-east of your mob, the above section of code will first check if tehre's a tile to the north or you and to the east of you
- These two tiles are Step_1 and Step_2. After this, a new dummy object is created on your location. It then tries to move to Step_1, If it succeeds, objects on the turf you're on and
- the turf that Step_1 is are checked for items which have the ON_BORDER flag set. These are itmes which limit you on only one tile border. Windows, for the most part.
- CheckExit() and CanPass() are use to determine this. The dummy object is then moved back to your location and it tries to move to Step_2. Same checks are performed here.
- If at least one of the two checks succeeds, it means you can reach the item and ok is set to 1.
- */
- else
- // ------- OBJECT IS ON A CARDINAL TILE (NORTH, SOUTH, EAST OR WEST OR THE TILE YOU'RE ON) -------
- if(loc == usr.loc)
- ok = 1
- // ------- OBJECT IS ON THE SAME TILE AS YOU -------
- else
- ok = 1
-
- //Now, check objects to block exit that are on the border
- for(var/obj/border_obstacle in usr.loc)
- if(border_obstacle.flags & ON_BORDER)
- if(!border_obstacle.CheckExit(D, src))
- ok = 0
-
- //Next, check objects to block entry that are on the border
- for(var/obj/border_obstacle in get_turf(src))
- if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
- if(!border_obstacle.CanPass(D, D.loc, 1, 0))
- ok = 0
- /*
- See the previous More info, for... more info...
- */
-
- //del(D)
- // Garbage Collect Dummy
- D.loc = null
- D = null
-
- // ------- DUMMY OBJECT'S SERVED IT'S PURPOSE, IT'S REWARDED WITH A SWIFT DELETE -------
- if (!( ok ))
- // ------- TESTS ABOVE DETERMINED YOU CANNOT REACH THE TILE -------
- return 0
-
- if (!( usr.restrained() || (usr.lying && usr.buckled!=src) ))
- // ------- YOU ARE NOT REASTRAINED -------
-
- if (W)
- // ------- YOU HAVE AN ITEM IN YOUR HAND - HANDLE ATTACKBY AND AFTERATTACK -------
- if (t5)
- src.attackby(W, usr)
- if (W)
- W.afterattack(src, usr, (t5 ? 1 : 0), params)
-
- else
- // ------- YOU DO NOT HAVE AN ITEM IN YOUR HAND -------
- if (istype(usr, /mob/living/carbon/human))
- // ------- YOU ARE HUMAN -------
- src.attack_hand(usr, usr.hand)
- else
- // ------- YOU ARE NOT HUMAN. WHAT ARE YOU - DETERMINED HERE AND PROPER ATTACK_MOBTYPE CALLED -------
- if (istype(usr, /mob/living/carbon/monkey))
- src.attack_paw(usr, usr.hand)
- else if (istype(usr, /mob/living/carbon/alien/humanoid))
- if(usr.m_intent == "walk" && istype(usr, /mob/living/carbon/alien/humanoid/hunter))
- usr.m_intent = "run"
- usr.hud_used.move_intent.icon_state = "running"
- usr.update_icons()
- src.attack_alien(usr, usr.hand)
- else if (istype(usr, /mob/living/carbon/alien/larva))
- src.attack_larva(usr)
- else if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
- src.attack_ai(usr, usr.hand)
- else if(istype(usr, /mob/living/carbon/slime))
- src.attack_slime(usr)
- else if(istype(usr, /mob/living/simple_animal))
- src.attack_animal(usr)
- else
- // ------- YOU ARE RESTRAINED. DETERMINE WHAT YOU ARE AND ATTACK WITH THE PROPER HAND_X PROC -------
- if (istype(usr, /mob/living/carbon/human))
- src.hand_h(usr, usr.hand)
- else if (istype(usr, /mob/living/carbon/monkey))
- src.hand_p(usr, usr.hand)
- else if (istype(usr, /mob/living/carbon/alien/humanoid))
- src.hand_al(usr, usr.hand)
- else if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
- src.hand_a(usr, usr.hand)
-
- else
- // ------- ITEM INACESSIBLE OR CLICKING ON SCREEN -------
- if (istype(src, /obj/screen))
- // ------- IT'S THE HUD YOU'RE CLICKING ON -------
- usr.prev_move = usr.next_move
- usr:lastDblClick = world.time + 2
- if (usr.next_move < world.time)
- usr.next_move = world.time + 2
- else
- return
-
- // ------- 2 DECISECOND DELAY FOR CLICKING PASSED -------
-
- if (!( usr.restrained() ))
-
- // ------- YOU ARE NOT RESTRAINED -------
- if ((W && !( istype(src, /obj/screen) )))
- // ------- IT SHOULD NEVER GET TO HERE, DUE TO THE ISTYPE(SRC, /OBJ/SCREEN) FROM PREVIOUS IF-S - I TESTED IT WITH A DEBUG OUTPUT AND I COULDN'T GET THIST TO SHOW UP. -------
- src.attackby(W, usr)
- if (W)
- W.afterattack(src, usr,, params)
- else
- // ------- YOU ARE NOT RESTRAINED, AND ARE CLICKING A HUD OBJECT -------
- if (istype(usr, /mob/living/carbon/human))
- src.attack_hand(usr, usr.hand)
- else if (istype(usr, /mob/living/carbon/monkey))
- src.attack_paw(usr, usr.hand)
- else if (istype(usr, /mob/living/carbon/alien/humanoid))
- src.attack_alien(usr, usr.hand)
- else
- // ------- YOU ARE RESTRAINED CLICKING ON A HUD OBJECT -------
- if (istype(usr, /mob/living/carbon/human))
- src.hand_h(usr, usr.hand)
- else if (istype(usr, /mob/living/carbon/monkey))
- src.hand_p(usr, usr.hand)
- else if (istype(usr, /mob/living/carbon/alien/humanoid))
- src.hand_al(usr, usr.hand)
- else
- // ------- YOU ARE CLICKING ON AN OBJECT THAT'S INACCESSIBLE TO YOU AND IS NOT YOUR HUD -------
- if((LASER in usr:mutations) && usr:a_intent == "hurt" && world.time >= usr.next_move)
- // ------- YOU HAVE THE LASER MUTATION, YOUR INTENT SET TO HURT AND IT'S BEEN MORE THAN A DECISECOND SINCE YOU LAS TATTACKED -------
-
- var/turf/T = get_turf(usr)
- var/turf/U = get_turf(src)
-
-
- if(istype(usr, /mob/living/carbon/human))
- usr:nutrition -= rand(1,5)
- usr:handle_regular_hud_updates()
-
- var/obj/item/projectile/beam/A = new /obj/item/projectile/beam( usr.loc )
- A.icon = 'icons/effects/genetics.dmi'
- A.icon_state = "eyelasers"
- playsound(usr.loc, 'sound/weapons/taser2.ogg', 75, 1)
-
- A.firer = usr
- A.def_zone = usr:get_organ_target()
- A.original = src
- A.current = T
- A.yo = U.y - T.y
- A.xo = U.x - T.x
- spawn( 1 )
- A.process()
-
- usr.next_move = world.time + 6
- return
-
-/atom/proc/ShiftClick(var/mob/M as mob)
-
- if(istype(M.machine, /obj/machinery/computer/security)) //No examining by looking through cameras
- return
-
- //I dont think this was ever really a problem and it's only creating more bugs...
-// if(( abs(src.x-M.x)<8 || abs(src.y-M.y)<8 ) && src.z == M.z ) //This should prevent non-observers to examine stuff from outside their view.
- examine()
-
- return
-
-/atom/proc/AltClick()
-
- /* // NOT UNTIL I FIGURE OUT A GOOD WAY TO DO THIS SHIT
- if((HULK in usr.mutations) || (SUPRSTR in usr.augmentations))
- if(!istype(src, /obj/item) && !istype(src, /mob) && !istype(src, /turf))
- if(!usr.get_active_hand())
-
- var/liftable = 0
- for(var/x in liftable_structures)
- if(findtext("[src.type]", "[x]"))
- liftable = 1
- break
-
- if(liftable)
-
- add_fingerprint(usr)
- var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(usr)
- G.assailant = usr
- usr.put_in_active_hand(G)
- G.structure = src
- G.synch()
-
- visible_message("\red [usr] has picked up [src]!")
-
- return
- else
- usr << "\red You can't pick this up!"
- */
-
- return
-
-/atom/proc/CtrlClick()
- if(hascall(src,"pull"))
- src:pull()
- return
-
-/atom/proc/AIShiftClick() // Opens and closes doors!
- if(istype(src , /obj/machinery/door/airlock))
- if(src:density)
- var/nhref = "src=\ref[src];aiEnable=7"
- src.Topic(nhref, params2list(nhref), src, 1)
- else
- var/nhref = "src=\ref[src];aiDisable=7"
- src.Topic(nhref, params2list(nhref), src, 1)
-
- return
-
-/atom/proc/AIAltClick() // Eletrifies doors.
- if(istype(src , /obj/machinery/door/airlock))
- if(!src:secondsElectrified)
- var/nhref = "src=\ref[src];aiEnable=6"
- src.Topic(nhref, params2list(nhref), src, 1)
- else
- var/nhref = "src=\ref[src];aiDisable=5"
- src.Topic(nhref, params2list(nhref), src, 1)
-
-
- return
-
-/atom/proc/AICtrlClick() // Bolts doors, turns off APCs.
- if(istype(src , /obj/machinery/door/airlock))
- if(src:locked)
- var/nhref = "src=\ref[src];aiEnable=4"
- src.Topic(nhref, params2list(nhref), src, 1)
- else
- var/nhref = "src=\ref[src];aiDisable=4"
- src.Topic(nhref, params2list(nhref), src, 1)
-
- else if (istype(src , /obj/machinery/power/apc/))
- var/nhref = "src=\ref[src];breaker=1"
- src.Topic(nhref, params2list(nhref), 0)
-
-
-
- return
-
-/atom/proc/MiddleClick(var/mob/M as mob) // switch hands
- if(istype(M, /mob/living/carbon))
- var/mob/living/carbon/U = M
- U.swap_hand()
-
-
/atom/proc/get_global_map_pos()
if(!islist(global_map) || isemptylist(global_map)) return
var/cur_x = null
@@ -1281,16 +406,3 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
/atom/proc/checkpass(passflag)
return pass_flags&passflag
-
-/*
-/client/verb/check_dummy()
- set name = "List Dummies"
- set category = "Debug"
-
- var/list/dummies = list()
- for(var/obj/item/weapon/dummy/D in world)
- usr << "[D] - [D.x], [D.y], [D.z] - [D.loc]"
- dummies += D
- usr << "[dummies.len] found!"
-*/
-
diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm
index 8f4e6dba66..1326e65e5e 100644
--- a/code/game/atoms_movable.dm
+++ b/code/game/atoms_movable.dm
@@ -150,7 +150,7 @@
//done throwing, either because it hit something or it finished moving
src.throwing = 0
- if(isobj(src)) src:throw_impact(get_turf(src),speed)
+ if(isobj(src)) src.throw_impact(get_turf(src),speed)
//Overlays
diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm
index 29dcc13a03..3ac34da573 100644
--- a/code/game/gamemodes/changeling/changeling_powers.dm
+++ b/code/game/gamemodes/changeling/changeling_powers.dm
@@ -86,7 +86,7 @@
src << "This creature's DNA is ruined beyond useability!"
return
- if(!G.killing)
+ if(!G.state == GRAB_KILL)
src << "We must have a tighter grip to absorb this creature."
return
diff --git a/code/game/hud.dm b/code/game/hud.dm
deleted file mode 100644
index 99042bdef9..0000000000
--- a/code/game/hud.dm
+++ /dev/null
@@ -1,291 +0,0 @@
-//Upper left action buttons, displayed when you pick up an item that has this enabled.
-#define ui_action_slot1 "1:6,14:26"
-#define ui_action_slot2 "2:8,14:26"
-#define ui_action_slot3 "3:10,14:26"
-#define ui_action_slot4 "4:12,14:26"
-#define ui_action_slot5 "5:14,14:26"
-
-//Lower left, persistant menu
-#define ui_inventory "1:6,1:5"
-
-//Lower center, persistant menu
-#define ui_sstore1 "3:10,1:5"
-#define ui_id "4:12,1:5"
-#define ui_belt "5:14,1:5"
-#define ui_back "6:14,1:5"
-#define ui_rhand "7:16,1:5"
-#define ui_lhand "8:16,1:5"
-#define ui_equip "7:16,2:5"
-#define ui_swaphand1 "7:16,2:5"
-#define ui_swaphand2 "8:16,2:5"
-#define ui_storage1 "9:18,1:5"
-#define ui_storage2 "10:20,1:5"
-
-#define ui_alien_head "4:12,1:5" //aliens
-#define ui_alien_oclothing "5:14,1:5" //aliens
-
-#define ui_inv1 "6:16,1:5" //borgs
-#define ui_inv2 "7:16,1:5" //borgs
-#define ui_inv3 "8:16,1:5" //borgs
-#define ui_borg_store "9:16,1:5" //borgs
-
-#define ui_monkey_mask "5:14,1:5" //monkey
-#define ui_monkey_back "6:14,1:5" //monkey
-
-//Lower right, persistant menu
-#define ui_dropbutton "11:22,1:5"
-#define ui_drop_throw "14:28,2:7"
-#define ui_pull_resist "13:26,2:7"
-#define ui_acti "13:26,1:5"
-#define ui_movi "12:24,1:5"
-#define ui_zonesel "14:28,1:5"
-#define ui_acti_alt "14:28,1:5" //alternative intent switcher for when the interface is hidden (F12)
-
-#define ui_borg_pull "12:24,2:7"
-#define ui_borg_module "13:26,2:7"
-#define ui_borg_panel "14:28,2:7"
-
-//Gun buttons
-#define ui_gun1 "13:26,3:7"
-#define ui_gun2 "14:28, 4:7"
-#define ui_gun3 "13:26,4:7"
-#define ui_gun_select "14:28,3:7"
-
-//Upper-middle right (damage indicators)
-#define ui_toxin "14:28,13:27"
-#define ui_fire "14:28,12:25"
-#define ui_oxygen "14:28,11:23"
-#define ui_pressure "14:28,10:21"
-
-#define ui_alien_toxin "14:28,13:25"
-#define ui_alien_fire "14:28,12:25"
-#define ui_alien_oxygen "14:28,11:25"
-
-//Middle right (status indicators)
-#define ui_nutrition "14:28,5:11"
-#define ui_temp "14:28,6:13"
-#define ui_health "14:28,7:15"
-#define ui_internal "14:28,8:17"
- //borgs
-#define ui_borg_health "14:28,6:13" //borgs have the health display where humans have the pressure damage indicator.
-#define ui_alien_health "14:28,6:13" //aliens have the health display where humans have the pressure damage indicator.
-
-//Pop-up inventory
-#define ui_shoes "2:8,1:5"
-
-#define ui_iclothing "1:6,2:7"
-#define ui_oclothing "2:8,2:7"
-#define ui_gloves "3:10,2:7"
-
-#define ui_glasses "1:6,3:9"
-#define ui_mask "2:8,3:9"
-#define ui_l_ear "3:10,3:9"
-#define ui_r_ear "3:10,4:11"
-
-#define ui_head "2:8,4:11"
-
-//Intent small buttons
-#define ui_help_small "12:8,1:1"
-#define ui_disarm_small "12:15,1:18"
-#define ui_grab_small "12:32,1:18"
-#define ui_harm_small "12:39,1:1"
-
-//#define ui_swapbutton "6:-16,1:5" //Unused
-
-//#define ui_headset "SOUTH,8"
-#define ui_hand "6:14,1:5"
-#define ui_hstore1 "5,5"
-//#define ui_resist "EAST+1,SOUTH-1"
-#define ui_sleep "EAST+1, NORTH-13"
-#define ui_rest "EAST+1, NORTH-14"
-
-
-#define ui_iarrowleft "SOUTH-1,11"
-#define ui_iarrowright "SOUTH-1,13"
-
-var/datum/global_hud/global_hud = new()
-
-/datum/global_hud
- var/obj/screen/druggy
- var/obj/screen/blurry
- var/list/vimpaired
- var/list/darkMask
-
- New()
- //420erryday psychedellic colours screen overlay for when you are high
- druggy = new /obj/screen()
- druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
- druggy.icon_state = "druggy"
- druggy.layer = 17
- druggy.mouse_opacity = 0
-
- //that white blurry effect you get when you eyes are damaged
- blurry = new /obj/screen()
- blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
- blurry.icon_state = "blurry"
- blurry.layer = 17
- blurry.mouse_opacity = 0
-
- var/obj/screen/O
- var/i
- //that nasty looking dither you get when you're short-sighted
- vimpaired = newlist(/obj/screen,/obj/screen,/obj/screen,/obj/screen)
- O = vimpaired[1]
- O.screen_loc = "1,1 to 5,15"
- O = vimpaired[2]
- O.screen_loc = "5,1 to 10,5"
- O = vimpaired[3]
- O.screen_loc = "6,11 to 10,15"
- O = vimpaired[4]
- O.screen_loc = "11,1 to 15,15"
-
- //welding mask overlay black/dither
- darkMask = newlist(/obj/screen,/obj/screen,/obj/screen,/obj/screen,/obj/screen,/obj/screen,/obj/screen,/obj/screen)
- O = darkMask[1]
- O.screen_loc = "3,3 to 5,13"
- O = darkMask[2]
- O.screen_loc = "5,3 to 10,5"
- O = darkMask[3]
- O.screen_loc = "6,11 to 10,13"
- O = darkMask[4]
- O.screen_loc = "11,3 to 13,13"
- O = darkMask[5]
- O.screen_loc = "1,1 to 15,2"
- O = darkMask[6]
- O.screen_loc = "1,3 to 2,15"
- O = darkMask[7]
- O.screen_loc = "14,3 to 15,15"
- O = darkMask[8]
- O.screen_loc = "3,14 to 13,15"
-
- for(i=1,i<=4,i++)
- O = vimpaired[i]
- O.icon_state = "dither50"
- O.layer = 17
- O.mouse_opacity = 0
-
- O = darkMask[i]
- O.icon_state = "dither50"
- O.layer = 17
- O.mouse_opacity = 0
-
- for(i=5,i<=8,i++)
- O = darkMask[i]
- O.icon_state = "black"
- O.layer = 17
- O.mouse_opacity = 0
-
-
-/datum/hud/var/obj/screen/grab_intent
-/datum/hud/var/obj/screen/hurt_intent
-/datum/hud/var/obj/screen/disarm_intent
-/datum/hud/var/obj/screen/help_intent
-
-/datum/hud
- var/mob/mymob
-
- var/hud_shown = 1 //Used for the HUD toggle (F12)
- var/inventory_shown = 1 //the inventory
- var/show_intent_icons = 0
- var/hotkey_ui_hidden = 0 //This is to hide the buttons that can be used via hotkeys. (hotkeybuttons list of buttons)
-
- var/obj/screen/r_hand_hud_object
- var/obj/screen/l_hand_hud_object
- var/obj/screen/action_intent
- var/obj/screen/move_intent
-
- var/list/adding
- var/list/other
- var/list/obj/screen/hotkeybuttons
-
- var/list/obj/screen/item_action/item_action_list //Used for the item action ui buttons.
-
-
-datum/hud/New(mob/owner)
- mymob = owner
- instantiate()
- ..()
- return
-
-
-/datum/hud/proc/hidden_inventory_update()
- if(!mymob) return
- if(ishuman(mymob))
- var/mob/living/carbon/human/H = mymob
- if(inventory_shown && hud_shown)
- if(H.shoes) H.shoes.screen_loc = ui_shoes
- if(H.gloves) H.gloves.screen_loc = ui_gloves
- if(H.l_ear) H.l_ear.screen_loc = ui_l_ear
- if(H.r_ear) H.r_ear.screen_loc = ui_r_ear
- if(H.glasses) H.glasses.screen_loc = ui_glasses
- if(H.w_uniform) H.w_uniform.screen_loc = ui_iclothing
- if(H.wear_suit) H.wear_suit.screen_loc = ui_oclothing
- if(H.wear_mask) H.wear_mask.screen_loc = ui_mask
- if(H.head) H.head.screen_loc = ui_head
- else
- if(H.shoes) H.shoes.screen_loc = null
- if(H.gloves) H.gloves.screen_loc = null
- if(H.l_ear) H.l_ear.screen_loc = null
- if(H.r_ear) H.r_ear.screen_loc = null
- if(H.glasses) H.glasses.screen_loc = null
- if(H.w_uniform) H.w_uniform.screen_loc = null
- if(H.wear_suit) H.wear_suit.screen_loc = null
- if(H.wear_mask) H.wear_mask.screen_loc = null
- if(H.head) H.head.screen_loc = null
-
-/datum/hud/proc/persistant_inventory_update()
- if(!mymob) return
- if(ishuman(mymob))
- var/mob/living/carbon/human/H = mymob
- if(hud_shown)
- if(H.s_store) H.s_store.screen_loc = ui_sstore1
- if(H.wear_id) H.wear_id.screen_loc = ui_id
- if(H.belt) H.belt.screen_loc = ui_belt
- if(H.back) H.back.screen_loc = ui_back
- if(H.l_store) H.l_store.screen_loc = ui_storage1
- if(H.r_store) H.r_store.screen_loc = ui_storage2
- else
- if(H.s_store) H.s_store.screen_loc = null
- if(H.wear_id) H.wear_id.screen_loc = null
- if(H.belt) H.belt.screen_loc = null
- if(H.back) H.back.screen_loc = null
- if(H.l_store) H.l_store.screen_loc = null
- if(H.r_store) H.r_store.screen_loc = null
-
-
-/datum/hud/proc/instantiate()
- if(!ismob(mymob)) return 0
- if(!mymob.client) return 0
- var/ui_style = ui_style2icon(mymob.client.prefs.UI_style)
-
- if(ishuman(mymob))
- human_hud(ui_style) // Pass the player the UI style chosen in preferences
-
- else if(ismonkey(mymob))
- monkey_hud(ui_style)
-
- else if(isbrain(mymob))
- brain_hud(ui_style)
-
- else if(islarva(mymob))
- larva_hud()
-
- else if(isalien(mymob))
- alien_hud()
-
- else if(isAI(mymob))
- ai_hud()
-
- else if(isrobot(mymob))
- robot_hud()
-
-// else if(ishivebot(mymob))
-// hivebot_hud()
-
-// else if(ishivemainframe(mymob))
-// hive_mainframe_hud()
-
- else if(isobserver(mymob))
- ghost_hud()
-
- return
diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm
index 5a2fee1f86..05746ec524 100644
--- a/code/game/machinery/OpTable.dm
+++ b/code/game/machinery/OpTable.dm
@@ -45,11 +45,6 @@
if(prob(75))
del(src)
-/obj/machinery/optable/hand_p(mob/user as mob)
-
- return src.attack_paw(user)
- return
-
/obj/machinery/optable/attack_paw(mob/user as mob)
if ((HULK in usr.mutations))
usr << text("\blue You destroy the operating table.")
diff --git a/code/game/machinery/computer/HolodeckControl.dm b/code/game/machinery/computer/HolodeckControl.dm
index c6233845bc..0252f69765 100644
--- a/code/game/machinery/computer/HolodeckControl.dm
+++ b/code/game/machinery/computer/HolodeckControl.dm
@@ -564,7 +564,7 @@
/obj/structure/holohoop/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if (istype(mover,/obj/item) && mover.throwing)
var/obj/item/I = mover
- if(istype(I, /obj/item/weapon/dummy) || istype(I, /obj/item/projectile))
+ if(istype(I, /obj/item/projectile))
return
if(prob(50))
I.loc = src.loc
diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm
index f24d0ce2b8..2fcdf33379 100644
--- a/code/game/machinery/computer/ai_core.dm
+++ b/code/game/machinery/computer/ai_core.dm
@@ -179,15 +179,6 @@
A.transfer_ai("INACTIVE","AICARD",src,user)
return
- attack_hand(var/mob/user as mob)
- if(ishuman(user))//Checks to see if they are ninja
- if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
- if(user:wear_suit:s_control)
- user:wear_suit:transfer_ai("INACTIVE","NINJASUIT",src,user)
- else
- user << "\red ERROR: \black Remote access channel disabled."
- return
-
/*
This is a good place for AI-related object verbs so I'm sticking it here.
If adding stuff to this, don't forget that an AI need to cancel_camera() whenever it physically moves to a different location.
diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm
index 7e183ee39f..98548372af 100644
--- a/code/game/machinery/computer/aifixer.dm
+++ b/code/game/machinery/computer/aifixer.dm
@@ -60,14 +60,6 @@
if(..())
return
- if(ishuman(user))//Checks to see if they are ninja
- if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
- if(user:wear_suit:s_control)
- user:wear_suit.transfer_ai("AIFIXER","NINJASUIT",src,user)
- else
- user << "\red ERROR: \black Remote access channel disabled."
- return
-
user.set_machine(src)
var/dat = "
AI System Integrity Restorer
"
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index c8f265052e..d3f276abe0 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -120,12 +120,18 @@
/obj/machinery/door/attack_hand(mob/user as mob)
return src.attackby(user, user)
+/obj/machinery/door/attack_tk(mob/user as mob)
+ if(requiresID() && !allowed(null))
+ return
+ ..()
/obj/machinery/door/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/device/detective_scanner))
return
if(src.operating || isrobot(user)) return //borgs can't attack doors open because it conflicts with their AI-like interaction with them.
src.add_fingerprint(user)
+ if(!Adjacent(user))
+ user = null
if(!src.requiresID())
user = null
if(src.density && (istype(I, /obj/item/weapon/card/emag)||istype(I, /obj/item/weapon/melee/energy/blade)))
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index ef85539946..1b47d6f9a9 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -418,11 +418,6 @@
/obj/mecha/attack_hand(mob/user as mob)
src.log_message("Attack by hand/paw. Attacker - [user].",1)
- if(ishuman(user))
- if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
- call(/obj/item/clothing/gloves/space_ninja/proc/drain)("MECHA",src,user:wear_suit)
- return
-
if ((HULK in user.mutations) && !prob(src.deflect_chance))
src.take_damage(15)
src.check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST))
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index b08ee78016..dd445337b7 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -131,8 +131,7 @@
else
if(isliving(src.loc))
return
- user.lastDblClick = world.time + 2
- user.next_move = world.time + 2
+ user.next_move = max(user.next_move+2,world.time + 2)
src.pickup(user)
add_fingerprint(user)
user.put_in_active_hand(src)
@@ -166,8 +165,7 @@
if(istype(src.loc, /mob/living))
return
src.pickup(user)
- user.lastDblClick = world.time + 2
- user.next_move = world.time + 2
+ user.next_move = max(user.next_move+2,world.time + 2)
user.put_in_active_hand(src)
return
@@ -205,156 +203,6 @@
return
-/obj/item/proc/attack(mob/living/M as mob, mob/living/user as mob, def_zone)
-
- if (!istype(M)) // not sure if this is the right thing...
- return
-
- if (can_operate(M)) //Checks if mob is lying down on table for surgery
- if (do_surgery(M,user,src))
- return
-
- var/messagesource = M
-
- if (istype(M,/mob/living/carbon/brain))
- messagesource = M:container
- if (src.hitsound)
- playsound(src.loc, hitsound, 50, 1, -1)
- /////////////////////////
- user.lastattacked = M
- M.lastattacker = user
-
- M.attack_log += "\[[time_stamp()]\] Attacked by [user.name] ([user.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(src.damtype)])"
- user.attack_log += "\[[time_stamp()]\] Attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(src.damtype)])"
- msg_admin_attack("[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(src.damtype)]) (JMP)") //BS12 EDIT ALG
-
- //spawn(1800) // this wont work right
- // M.lastattacker = null
- /////////////////////////
-
- var/power = src.force
- if(HULK in user.mutations)
- power *= 2
-
- if(!istype(M, /mob/living/carbon/human))
- if(istype(M, /mob/living/carbon/slime))
- var/mob/living/carbon/slime/slime = M
- if(prob(25))
- user << "\red [src] passes right through [M]!"
- return
-
- if(power > 0)
- slime.attacked += 10
-
- if(slime.Discipline && prob(50)) // wow, buddy, why am I getting attacked??
- slime.Discipline = 0
-
- if(power >= 3)
- if(istype(slime, /mob/living/carbon/slime/adult))
- if(prob(5 + round(power/2)))
-
- if(slime.Victim)
- if(prob(80) && !slime.client)
- slime.Discipline++
- slime.Victim = null
- slime.anchored = 0
-
- spawn()
- if(slime)
- slime.SStun = 1
- sleep(rand(5,20))
- if(slime)
- slime.SStun = 0
-
- spawn(0)
- if(slime)
- slime.canmove = 0
- step_away(slime, user)
- if(prob(25 + power))
- sleep(2)
- if(slime && user)
- step_away(slime, user)
- slime.canmove = 1
-
- else
- if(prob(10 + power*2))
- if(slime)
- if(slime.Victim)
- if(prob(80) && !slime.client)
- slime.Discipline++
-
- if(slime.Discipline == 1)
- slime.attacked = 0
-
- spawn()
- if(slime)
- slime.SStun = 1
- sleep(rand(5,20))
- if(slime)
- slime.SStun = 0
-
- slime.Victim = null
- slime.anchored = 0
-
-
- spawn(0)
- if(slime && user)
- step_away(slime, user)
- slime.canmove = 0
- if(prob(25 + power*4))
- sleep(2)
- if(slime && user)
- step_away(slime, user)
- slime.canmove = 1
-
-
- var/showname = "."
- if(user)
- showname = " by [user]."
- if(!(user in viewers(M, null)))
- showname = "."
-
- for(var/mob/O in viewers(messagesource, null))
- if(src.attack_verb.len)
- O.show_message("\red [M] has been [pick(src.attack_verb)] with [src][showname] ", 1)
- else
- O.show_message("\red [M] has been attacked with [src][showname] ", 1)
-
- if(!showname && user)
- if(user.client)
- user << "\red You attack [M] with [src]. "
-
-
-
- if(istype(M, /mob/living/carbon/human))
- M:attacked_by(src, user, def_zone)
- else
- switch(src.damtype)
- if("brute")
- if(istype(src, /mob/living/carbon/slime))
- M.adjustBrainLoss(power)
-
- else
-
- M.take_organ_damage(power)
- if (prob(33)) // Added blood for whacking non-humans too
- var/turf/simulated/location = M.loc
- if (istype(location))
- location.add_blood_floor(M)
- if("fire")
- if (!(COLD_RESISTANCE in M.mutations))
- M.take_organ_damage(0, power)
- M << "Aargh it burns!"
- M.updatehealth()
- src.add_fingerprint(user)
- return 1
-
-/obj/item/proc/attack_self()
- return
-
-/obj/item/proc/afterattack()
- return
-
/obj/item/proc/talk_into(mob/M as mob, text)
return
@@ -590,6 +438,8 @@
if(!(usr)) //BS12 EDIT
return
+ if(!usr.canmove || usr.stat || usr.restrained() || !Adjacent(usr))
+ return
if((!istype(usr, /mob/living/carbon)) || (istype(usr, /mob/living/carbon/brain)))//Is humanoid, and is not a brain
usr << "\red You can't pick things up!"
return
@@ -609,12 +459,7 @@
usr << "\red You can't pick that up!"
return
//All checks are done, time to pick it up!
- if(istype(usr, /mob/living/carbon/human))
- src.attack_hand(usr)
- if(istype(usr, /mob/living/carbon/alien))
- src.attack_alien(usr)
- if(istype(usr, /mob/living/carbon/monkey))
- src.attack_paw(usr)
+ usr.UnarmedAttack(src)
return
diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm
index 27b38ac5f0..ad757325b9 100644
--- a/code/game/objects/items/crayons.dm
+++ b/code/game/objects/items/crayons.dm
@@ -65,7 +65,8 @@
shadeColour = input(user, "Please select the shade colour.", "Crayon colour") as color
return
-/obj/item/toy/crayon/afterattack(atom/target, mob/user as mob)
+/obj/item/toy/crayon/afterattack(atom/target, mob/user as mob, proximity)
+ if(!proximity) return
if(istype(target,/turf/simulated/floor))
var/drawtype = input("Choose what you'd like to draw.", "Crayon scribbles") in list("graffiti","rune","letter")
switch(drawtype)
diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm
index 96bb3cc002..1cdd99d133 100755
--- a/code/game/objects/items/devices/PDA/PDA.dm
+++ b/code/game/objects/items/devices/PDA/PDA.dm
@@ -1018,7 +1018,8 @@ var/global/list/obj/item/device/pda/PDAs = list()
else
user.show_message("\blue No radiation detected.")
-/obj/item/device/pda/afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
+/obj/item/device/pda/afterattack(atom/A as mob|obj|turf|area, mob/user as mob, proximity)
+ if(!proximity) return
switch(scanmode)
if(3)
diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm
index 43d19213c8..4f70aa1024 100644
--- a/code/game/objects/items/devices/chameleonproj.dm
+++ b/code/game/objects/items/devices/chameleonproj.dm
@@ -1,7 +1,7 @@
/obj/item/device/chameleon
name = "chameleon-projector"
icon_state = "shield0"
- flags = FPRINT | TABLEPASS| CONDUCT | USEDELAY
+ flags = FPRINT | TABLEPASS| CONDUCT
slot_flags = SLOT_BELT
item_state = "electronic"
throwforce = 5.0
@@ -19,7 +19,8 @@
attack_self()
toggle()
- afterattack(atom/target, mob/user , flag)
+ afterattack(atom/target, mob/user, proximity)
+ if(!proximity) return
if(istype(target,/obj/item))
playsound(src, 'sound/weapons/flash.ogg', 100, 1, 1)
user << "\blue Scanned [target]."
diff --git a/code/game/objects/items/tk_grab.dm b/code/game/objects/items/tk_grab.dm
deleted file mode 100644
index 1839460d92..0000000000
--- a/code/game/objects/items/tk_grab.dm
+++ /dev/null
@@ -1,128 +0,0 @@
-//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
-
-/obj/item/tk_grab
- name = "Telekinetic Grab"
- desc = "Magic"
- icon = 'icons/obj/magic.dmi'//Needs sprites
- icon_state = "2"
- flags = USEDELAY
- //item_state = null
- w_class = 10.0
- layer = 20
-
- var/last_throw = 0
- var/obj/focus = null
- var/mob/living/host = null
-
-
- dropped(mob/user as mob)
- del(src)
- return
-
-
- //stops TK grabs being equipped anywhere but into hands
- equipped(var/mob/user, var/slot)
- if( (slot == slot_l_hand) || (slot== slot_r_hand) ) return
- del(src)
- return
-
-/*
- attack_self(mob/user as mob)
- if(!istype(focus,/obj/item)) return
- if(!check_path()) return//No clear path
-
- user.put_in_hands(focus)
- add_fingerprint(user)
- user.update_inv_l_hand(0)
- user.update_inv_r_hand()
- spawn(0)
- del(src)
- return
-*/
-
- afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag)//TODO: go over this
- if(!target || !user) return
- if(last_throw+3 > world.time) return
- if(!host)
- del(src)
- return
- if(!(TK in host.mutations))
- del(src)
- return
- if(isobj(target))
- if(!target.loc || !isturf(target.loc))
- del(src)
- return
- if(!focus)
- focus_object(target, user)
- return
- var/focusturf = get_turf(focus)
- if(get_dist(focusturf, target) <= 1 && !istype(target, /turf))
- target.attackby(focus, user, user:get_organ_target())
-
- else if(get_dist(focusturf, target) <= 16)
- apply_focus_overlay()
- focus.throw_at(target, 10, 1)
- last_throw = world.time
- return
-
-
- proc/focus_object(var/obj/target, var/mob/living/user)
- if(!istype(target,/obj)) return//Cant throw non objects atm might let it do mobs later
- if(target.anchored)
- target.attack_hand(user) // you can use shit now!
- return//No throwing anchored things
- if(!isturf(target.loc))
- return
- focus = target
- update_icon()
- apply_focus_overlay()
- return
-
-
- proc/apply_focus_overlay()
- if(!focus) return
- var/obj/effect/overlay/O = new /obj/effect/overlay(locate(focus.x,focus.y,focus.z))
- O.name = "sparkles"
- O.anchored = 1
- O.density = 0
- O.layer = FLY_LAYER
- O.dir = pick(cardinal)
- O.icon = 'icons/effects/effects.dmi'
- O.icon_state = "nothing"
- flick("empdisable",O)
- spawn(5)
- O.delete()
- return
-
-
- update_icon()
- overlays.Cut()
- if(focus && focus.icon && focus.icon_state)
- overlays += icon(focus.icon,focus.icon_state)
- return
-
-/*Not quite done likely needs to use something thats not get_step_to
- proc/check_path()
- var/turf/ref = get_turf(src.loc)
- var/turf/target = get_turf(focus.loc)
- if(!ref || !target) return 0
- var/distance = get_dist(ref, target)
- if(distance >= 10) return 0
- for(var/i = 1 to distance)
- ref = get_step_to(ref, target, 0)
- if(ref != target) return 0
- return 1
-*/
-
-//equip_to_slot_or_del(obj/item/W, slot, del_on_fail = 1)
-/*
- if(istype(user, /mob/living/carbon))
- if(user:mutations & TK && get_dist(source, user) <= 7)
- if(user:get_active_hand()) return 0
- var/X = source:x
- var/Y = source:y
- var/Z = source:z
-
-*/
-
diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm
index bd3673719f..c4578808cf 100644
--- a/code/game/objects/items/toys.dm
+++ b/code/game/objects/items/toys.dm
@@ -37,7 +37,8 @@
/obj/item/toy/balloon/attack(mob/living/carbon/human/M as mob, mob/user as mob)
return
-/obj/item/toy/balloon/afterattack(atom/A as mob|obj, mob/user as mob)
+/obj/item/toy/balloon/afterattack(atom/A as mob|obj, mob/user as mob, proximity)
+ if(!proximity) return
if (istype(A, /obj/structure/reagent_dispensers/watertank) && get_dist(src,A) <= 1)
A.reagents.trans_to(src, 10)
user << "\blue You fill the balloon with the contents of [A]."
@@ -122,7 +123,7 @@
icon = 'icons/obj/gun.dmi'
icon_state = "revolver"
item_state = "gun"
- flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
+ flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT
w_class = 3.0
g_amt = 10
@@ -200,7 +201,7 @@
icon = 'icons/obj/gun.dmi'
icon_state = "crossbow"
item_state = "crossbow"
- flags = FPRINT | TABLEPASS | USEDELAY
+ flags = FPRINT | TABLEPASS
w_class = 2.0
attack_verb = list("attacked", "struck", "hit")
var/bullets = 5
@@ -417,7 +418,7 @@
icon_state = "sunflower"
item_state = "sunflower"
var/empty = 0
- flags = USEDELAY
+ flags
/obj/item/toy/waterflower/New()
var/datum/reagents/R = new/datum/reagents(10)
diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm
index a80a892af6..4c11fa9d34 100644
--- a/code/game/objects/items/weapons/RCD.dm
+++ b/code/game/objects/items/weapons/RCD.dm
@@ -78,7 +78,8 @@ RCD
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
- afterattack(atom/A, mob/user)
+ afterattack(atom/A, mob/user, proximity)
+ if(!proximity) return
if(disabled && !isrobot(user))
return 0
if(istype(A,/area/shuttle)||istype(A,/turf/space/transit))
diff --git a/code/game/objects/items/weapons/RSF.dm b/code/game/objects/items/weapons/RSF.dm
index 5ffed7b6d1..fa55fc8e62 100644
--- a/code/game/objects/items/weapons/RSF.dm
+++ b/code/game/objects/items/weapons/RSF.dm
@@ -61,7 +61,8 @@ RSF
return
// Change mode
-/obj/item/weapon/rsf/afterattack(atom/A, mob/user as mob)
+/obj/item/weapon/rsf/afterattack(atom/A, mob/user as mob, proximity)
+ if(!proximity) return
if (!(istype(A, /obj/structure/table) || istype(A, /turf/simulated/floor)))
return
diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm
index 068dece3bb..c033963995 100644
--- a/code/game/objects/items/weapons/cards_ids.dm
+++ b/code/game/objects/items/weapons/cards_ids.dm
@@ -200,7 +200,8 @@
access = list(access_maint_tunnels, access_syndicate, access_external_airlocks)
origin_tech = "syndicate=3"
-/obj/item/weapon/card/id/syndicate/afterattack(var/obj/item/weapon/O as obj, mob/user as mob)
+/obj/item/weapon/card/id/syndicate/afterattack(var/obj/item/weapon/O as obj, mob/user as mob, proximity)
+ if(!proximity) return
if(istype(O, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/I = O
src.access |= I.access
diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm
index dff332f2a6..43e0f8caef 100644
--- a/code/game/objects/items/weapons/cigs_lighters.dm
+++ b/code/game/objects/items/weapons/cigs_lighters.dm
@@ -114,8 +114,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM
return
-/obj/item/clothing/mask/cigarette/afterattack(obj/item/weapon/reagent_containers/glass/glass, mob/user as mob)
+/obj/item/clothing/mask/cigarette/afterattack(obj/item/weapon/reagent_containers/glass/glass, mob/user as mob, proximity)
..()
+ if(!proximity) return
if(istype(glass)) //you can dip cigarettes into beakers
var/transfered = glass.reagents.trans_to(src, chem_volume)
if(transfered) //if reagents were transfered, show the message
diff --git a/code/game/objects/items/weapons/clown_items.dm b/code/game/objects/items/weapons/clown_items.dm
index 1f3b451e62..49f0b2e45f 100644
--- a/code/game/objects/items/weapons/clown_items.dm
+++ b/code/game/objects/items/weapons/clown_items.dm
@@ -35,7 +35,8 @@
M.Stun(3)
M.Weaken(2)
-/obj/item/weapon/soap/afterattack(atom/target, mob/user as mob)
+/obj/item/weapon/soap/afterattack(atom/target, mob/user as mob, proximity)
+ if(!proximity) return
//I couldn't feasibly fix the overlay bugs caused by cleaning items we are wearing.
//So this is a workaround. This also makes more sense from an IC standpoint. ~Carn
if(user.client && (target in user.client.screen))
diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm
index 77cf343de2..0db404c021 100644
--- a/code/game/objects/items/weapons/extinguisher.dm
+++ b/code/game/objects/items/weapons/extinguisher.dm
@@ -5,7 +5,7 @@
icon_state = "fire_extinguisher0"
item_state = "fire_extinguisher"
hitsound = 'sound/weapons/smash.ogg'
- flags = FPRINT | USEDELAY | TABLEPASS | CONDUCT
+ flags = FPRINT | TABLEPASS | CONDUCT
throwforce = 10
w_class = 3.0
throw_speed = 2
@@ -24,7 +24,7 @@
icon_state = "miniFE0"
item_state = "miniFE"
hitsound = null //it is much lighter, after all.
- flags = FPRINT | USEDELAY | TABLEPASS
+ flags = FPRINT | TABLEPASS
throwforce = 2
w_class = 2.0
force = 3.0
diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm
index 8639477ce4..b9321ec9b4 100644
--- a/code/game/objects/items/weapons/flamethrower.dm
+++ b/code/game/objects/items/weapons/flamethrower.dm
@@ -4,7 +4,7 @@
icon = 'icons/obj/flamethrower.dmi'
icon_state = "flamethrowerbase"
item_state = "flamethrower_0"
- flags = FPRINT | TABLEPASS| CONDUCT | USEDELAY // USEDELAY flag needed in order to use afterattack() for things that are not in reach. I.E: Shooting flames.
+ flags = FPRINT | TABLEPASS| CONDUCT
force = 3.0
throwforce = 10.0
throw_speed = 1
@@ -60,7 +60,8 @@
item_state = "flamethrower_0"
return
-/obj/item/weapon/flamethrower/afterattack(atom/target, mob/user, flag)
+/obj/item/weapon/flamethrower/afterattack(atom/target, mob/user, proximity)
+ if(!proximity) return
// Make sure our user is still holding us
if(user && user.get_active_hand() == src)
var/turf/target_turf = get_turf(target)
diff --git a/code/game/objects/items/weapons/grenades/smokebomb.dm b/code/game/objects/items/weapons/grenades/smokebomb.dm
index ea6ab037bc..27a2d0580e 100644
--- a/code/game/objects/items/weapons/grenades/smokebomb.dm
+++ b/code/game/objects/items/weapons/grenades/smokebomb.dm
@@ -5,7 +5,7 @@
icon_state = "flashbang"
det_time = 20
item_state = "flashbang"
- flags = FPRINT | TABLEPASS | USEDELAY
+ flags = FPRINT | TABLEPASS
slot_flags = SLOT_BELT
var/datum/effect/effect/system/bad_smoke_spread/smoke
diff --git a/code/game/objects/items/weapons/hydroponics.dm b/code/game/objects/items/weapons/hydroponics.dm
index b18766b09a..054e2b217a 100644
--- a/code/game/objects/items/weapons/hydroponics.dm
+++ b/code/game/objects/items/weapons/hydroponics.dm
@@ -145,7 +145,8 @@
else
user.take_organ_damage(0,force)
-/obj/item/weapon/grown/nettle/afterattack(atom/A as mob|obj, mob/user as mob)
+/obj/item/weapon/grown/nettle/afterattack(atom/A as mob|obj, mob/user as mob, proximity)
+ if(!proximity) return
if(force > 0)
force -= rand(1,(force/3)+1) // When you whack someone with it, leaves fall off
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
@@ -191,7 +192,8 @@
M.Weaken(force/15)
M.drop_item()
-/obj/item/weapon/grown/deathnettle/afterattack(atom/A as mob|obj, mob/user as mob)
+/obj/item/weapon/grown/deathnettle/afterattack(atom/A as mob|obj, mob/user as mob, proximity)
+ if(!proximity) return
if (force > 0)
force -= rand(1,(force/3)+1) // When you whack someone with it, leaves fall off
diff --git a/code/game/objects/items/weapons/mop.dm b/code/game/objects/items/weapons/mop.dm
index fd3f2e8c7f..27935c4f87 100644
--- a/code/game/objects/items/weapons/mop.dm
+++ b/code/game/objects/items/weapons/mop.dm
@@ -28,7 +28,8 @@ obj/item/weapon/mop/proc/clean(turf/simulated/A)
reagents.remove_any(1) //reaction() doesn't use up the reagents
-/obj/item/weapon/mop/afterattack(atom/A, mob/user)
+/obj/item/weapon/mop/afterattack(atom/A, mob/user, proximity)
+ if(!proximity) return
if(istype(A, /turf/simulated) || istype(A, /obj/effect/decal/cleanable) || istype(A, /obj/effect/overlay) || istype(A, /obj/effect/rune))
if(reagents.total_volume < 1)
user << "Your mop is dry!"
diff --git a/code/game/objects/items/weapons/paint.dm b/code/game/objects/items/weapons/paint.dm
index 33c511bacb..13fb8a9d12 100644
--- a/code/game/objects/items/weapons/paint.dm
+++ b/code/game/objects/items/weapons/paint.dm
@@ -17,7 +17,8 @@ var/global/list/cached_icons = list()
flags = FPRINT | OPENCONTAINER
var/paint_type = ""
- afterattack(turf/simulated/target, mob/user , flag)
+ afterattack(turf/simulated/target, mob/user, proximity)
+ if(!proximity) return
if(istype(target) && reagents.total_volume > 5)
for(var/mob/O in viewers(user))
O.show_message("\red \The [target] has been splashed with something by [user]!", 1)
@@ -139,7 +140,8 @@ var/global/list/cached_icons = list()
return
-/obj/item/weapon/paint/afterattack(turf/target, mob/user as mob)
+/obj/item/weapon/paint/afterattack(turf/target, mob/user as mob, proximity)
+ if(!proximity) return
if(!istype(target) || istype(target, /turf/space))
return
var/ind = "[initial(target.icon)][color]"
diff --git a/code/game/objects/items/weapons/storage/bible.dm b/code/game/objects/items/weapons/storage/bible.dm
index f5b63f677c..e1ed768593 100644
--- a/code/game/objects/items/weapons/storage/bible.dm
+++ b/code/game/objects/items/weapons/storage/bible.dm
@@ -88,7 +88,8 @@
playsound(src.loc, "punch", 25, 1, -1)
return
*/
-/obj/item/weapon/storage/bible/afterattack(atom/A, mob/user as mob)
+/obj/item/weapon/storage/bible/afterattack(atom/A, mob/user as mob, proximity)
+ if(!proximity) return
/* if (istype(A, /turf/simulated/floor))
user << "\blue You hit the floor with the bible."
if(user.mind && (user.mind.assigned_role == "Chaplain"))
diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm
index c6dbead891..5fea401da1 100644
--- a/code/game/objects/items/weapons/storage/storage.dm
+++ b/code/game/objects/items/weapons/storage/storage.dm
@@ -26,6 +26,14 @@
/obj/item/weapon/storage/MouseDrop(obj/over_object as obj)
if (ishuman(usr) || ismonkey(usr)) //so monkeys can take off their backpacks -- Urist
var/mob/M = usr
+
+ if(over_object == M && Adjacent(M)) // this must come before the screen objects only block
+ orient2hud(M) // dunno why it wasn't before
+ if(M.s_active)
+ M.s_active.close(M)
+ show_to(M)
+ return
+
if (!( istype(over_object, /obj/screen) ))
return ..()
if (!(src.loc == usr) || (src.loc && src.loc.loc == usr))
@@ -300,17 +308,17 @@
if(isrobot(user))
user << "\blue You're a robot. No."
- return //Robots can't interact with storage items.
+ return 1 //Robots can't interact with storage items.
if(!can_be_inserted(W))
- return
+ return 1
if(istype(W, /obj/item/weapon/tray))
var/obj/item/weapon/tray/T = W
if(T.calc_carry() > 0)
if(prob(85))
user << "\red The tray won't fit in [src]."
- return
+ return 1
else
W.loc = user.loc
if ((user.client && user.s_active != src))
@@ -319,20 +327,11 @@
user << "\red God damnit!"
handle_item_insertion(W)
- return
+ return 1
/obj/item/weapon/storage/dropped(mob/user as mob)
return
-/obj/item/weapon/storage/MouseDrop(over_object, src_location, over_location)
- ..()
- orient2hud(usr)
- if ((over_object == usr && (in_range(src, usr) || usr.contents.Find(src))))
- if (usr.s_active)
- usr.s_active.close(usr)
- src.show_to(usr)
- return
-
/obj/item/weapon/storage/attack_hand(mob/user as mob)
playsound(src.loc, "rustle", 50, 1, -5)
diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm
index d14e54f10e..90da67076b 100644
--- a/code/game/objects/items/weapons/tools.dm
+++ b/code/game/objects/items/weapons/tools.dm
@@ -243,7 +243,8 @@
location.hotspot_expose(700, 5)
-/obj/item/weapon/weldingtool/afterattack(obj/O as obj, mob/user as mob)
+/obj/item/weapon/weldingtool/afterattack(obj/O as obj, mob/user as mob, proximity)
+ if(!proximity) return
if (istype(O, /obj/structure/reagent_dispensers/fueltank) && get_dist(src,O) <= 1 && !src.welding)
O.reagents.trans_to(src, max_fuel)
user << "\blue Welder refueled"
diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm
index 6b43ee2d44..2e4d7ed311 100644
--- a/code/game/objects/items/weapons/twohanded.dm
+++ b/code/game/objects/items/weapons/twohanded.dm
@@ -119,7 +119,8 @@
icon_state = "fireaxe[wielded]"
return
-/obj/item/weapon/twohanded/fireaxe/afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
+/obj/item/weapon/twohanded/fireaxe/afterattack(atom/A as mob|obj|turf|area, mob/user as mob, proximity)
+ if(!proximity) return
..()
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
diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm
index af55feb05a..4ea23ec085 100644
--- a/code/game/objects/structures/bedsheet_bin.dm
+++ b/code/game/objects/structures/bedsheet_bin.dm
@@ -165,4 +165,27 @@ LINEN BINS
hidden = null
+ add_fingerprint(user)
+
+/obj/structure/bedsheetbin/attack_tk(mob/user as mob)
+ if(amount >= 1)
+ amount--
+
+ var/obj/item/weapon/bedsheet/B
+ if(sheets.len > 0)
+ B = sheets[sheets.len]
+ sheets.Remove(B)
+
+ else
+ B = new /obj/item/weapon/bedsheet(loc)
+
+ B.loc = loc
+ user << "You telekinetically remove [B] from [src]."
+ update_icon()
+
+ if(hidden)
+ hidden.loc = loc
+ hidden = null
+
+
add_fingerprint(user)
\ No newline at end of file
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index 3e23be3bfe..4951efe039 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -181,6 +181,8 @@
if(src.opened)
if(istype(W, /obj/item/weapon/grab))
src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet
+ if(istype(W,/obj/item/tk_grab))
+ return 0
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(!WT.remove_fuel(0,user))
@@ -194,8 +196,6 @@
if(isrobot(user))
return
usr.drop_item()
- if(W)
- W.loc = src.loc
else if(istype(W, /obj/item/weapon/packageWrap))
return
else if(istype(W, /obj/item/weapon/weldingtool))
@@ -255,6 +255,12 @@
src.add_fingerprint(user)
src.toggle(user)
+// tk grab then use on self
+/obj/structure/closet/attack_self_tk(mob/user as mob)
+ src.add_fingerprint(user)
+ if(!src.toggle())
+ usr << "It won't budge!"
+
/obj/structure/closet/verb/verb_toggleopen()
set src in oview(1)
set category = "Object"
diff --git a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm
index b193e520a5..2090d76af5 100644
--- a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm
+++ b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm
@@ -137,6 +137,15 @@
src.icon_state = text("fireaxe[][][][]closing",hasaxe,src.localopened,src.hitstaken,src.smashed)
spawn(10) update_icon()
+ attack_tk(mob/user as mob)
+ if(localopened && fireaxe)
+ fireaxe.loc = loc
+ user << "\blue You telekinetically remove the fire axe."
+ fireaxe = null
+ update_icon()
+ return
+ attack_hand(user)
+
verb/toggle_openness() //nice name, huh? HUH?! -Erro //YEAH -Agouri
set name = "Open/Close"
set category = "Object"
diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm
index a7cfed611c..9713c7c9eb 100644
--- a/code/game/objects/structures/extinguisher.dm
+++ b/code/game/objects/structures/extinguisher.dm
@@ -37,6 +37,15 @@
opened = !opened
update_icon()
+/obj/structure/extinguisher_cabinet/attack_tk(mob/user)
+ if(has_extinguisher)
+ has_extinguisher.loc = loc
+ user << "You telekinetically remove [has_extinguisher] from [src]."
+ has_extinguisher = null
+ opened = 1
+ else
+ opened = !opened
+ update_icon()
/obj/structure/extinguisher_cabinet/attack_paw(mob/user)
attack_hand(user)
diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm
index 1c90d07a1a..7cd5219528 100644
--- a/code/game/objects/structures/morgue.dm
+++ b/code/game/objects/structures/morgue.dm
@@ -134,13 +134,8 @@
density = 1
layer = 2.0
var/obj/structure/morgue/connected = null
- anchored = 1.0
-
-/obj/structure/m_tray/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
- if (istype(mover, /obj/item/weapon/dummy))
- return 1
- else
- return ..()
+ anchored = 1
+ throwpass = 1
/obj/structure/m_tray/attack_paw(mob/user as mob)
return src.attack_hand(user)
@@ -353,13 +348,8 @@
density = 1
layer = 2.0
var/obj/structure/crematorium/connected = null
- anchored = 1.0
-
-/obj/structure/c_tray/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
- if (istype(mover, /obj/item/weapon/dummy))
- return 1
- else
- return ..()
+ anchored = 1
+ throwpass = 1
/obj/structure/c_tray/attack_paw(mob/user as mob)
return src.attack_hand(user)
diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm
index adc1e637a7..6aa93d8b3b 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm
@@ -30,6 +30,13 @@
SK.master = E
del(src)
+/obj/structure/stool/bed/chair/attack_tk(mob/user as mob)
+ if(buckled_mob)
+ ..()
+ else
+ rotate()
+ return
+
/obj/structure/stool/bed/chair/proc/handle_rotation() //making this into a seperate proc so office chairs can call it on Move()
if(src.dir == NORTH)
src.layer = FLY_LAYER
diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm
index f74740485d..a43a5d81d3 100644
--- a/code/game/objects/structures/tables_racks.dm
+++ b/code/game/objects/structures/tables_racks.dm
@@ -235,11 +235,6 @@
if(prob(75))
destroy()
-
-/obj/structure/table/hand_p(mob/user as mob)
- return src.attack_paw(user)
-
-
/obj/structure/table/attack_paw(mob/user)
if(HULK in user.mutations)
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
@@ -263,6 +258,8 @@
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
destroy()
+/obj/structure/table/attack_tk() // no telehulk sorry
+ return
/obj/structure/table/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0)) return 1
@@ -285,7 +282,7 @@
return
-/obj/structure/table/attackby(obj/item/weapon/W as obj, mob/user as mob)
+/obj/structure/table/attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2)
var/obj/item/weapon/grab/G = W
if (istype(G.affecting, /mob/living))
@@ -478,3 +475,6 @@
new /obj/item/weapon/rack_parts(loc)
density = 0
del(src)
+
+/obj/structure/rack/attack_tk() // no telehulk sorry
+ return
diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm
index 08fdd3c675..37e019963f 100644
--- a/code/game/objects/structures/tank_dispenser.dm
+++ b/code/game/objects/structures/tank_dispenser.dm
@@ -77,7 +77,7 @@
/obj/structure/dispenser/Topic(href, href_list)
if(usr.stat || usr.restrained())
return
- if(get_dist(src, usr) <= 1)
+ if(Adjacent(usr))
usr.set_machine(src)
if(href_list["oxygen"])
if(oxygentanks > 0)
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index 9d6cab7723..ab8884d96c 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -324,19 +324,20 @@
if(isrobot(M) || isAI(M))
return
+ if(!Adjacent(M))
+ return
+
if(busy)
M << "\red Someone's already washing here."
return
- var/turf/location = M.loc
- if(!isturf(location)) return
usr << "\blue You start washing your hands."
busy = 1
sleep(40)
busy = 0
- if(M.loc != location) return //Person has moved away from the sink
+ if(!Adjacent(M)) return //Person has moved away from the sink
M.clean_blood()
if(ishuman(M))
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index 60799f618e..24a9866a54 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -96,6 +96,9 @@
if(reinf) new /obj/item/stack/rods(loc)
del(src)
+/obj/structure/window/attack_tk(mob/user as mob)
+ user.visible_message("Something knocks on [src].")
+ playsound(loc, 'sound/effects/Glasshit.ogg', 50, 1)
/obj/structure/window/attack_hand(mob/user as mob)
if(HULK in user.mutations)
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index 1a5675609c..db10c71214 100644
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -30,17 +30,6 @@
return
return
-/turf/DblClick()
- if(istype(usr, /mob/living/silicon/ai))
- return move_camera_by_click()
- if(usr.stat || usr.restrained() || usr.lying)
- return ..()
- return ..()
-
-/turf/Click()
- if(!isAI(usr))
- ..()
-
/turf/ex_act(severity)
return 0
diff --git a/code/game/verbs/atom_verbs.dm b/code/game/verbs/atom_verbs.dm
index 08183ef0c1..bac2d2b5f3 100644
--- a/code/game/verbs/atom_verbs.dm
+++ b/code/game/verbs/atom_verbs.dm
@@ -1,9 +1,10 @@
/atom/movable/verb/pull()
set name = "Pull"
- set category = "IC"
+ set category = "Object"
set src in oview(1)
- usr.start_pulling(src)
+ if(Adjacent(usr))
+ usr.start_pulling(src)
return
/atom/verb/point()
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index c7168d93af..e27bbfb89f 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -591,15 +591,6 @@ var/list/admin_verbs_mod = list(
log_admin("[key_name(usr)] used 'kill air'.")
message_admins("\blue [key_name_admin(usr)] used 'kill air'.", 1)
-/client/proc/toggle_clickproc() //TODO ERRORAGE (This is a temporary verb here while I test the new clicking proc)
- set name = "Toggle NewClickProc"
- set category = "Debug"
-
- if(!holder) return
- using_new_click_proc = !using_new_click_proc
- world << "Testing of new click proc [using_new_click_proc ? "enabled" : "disabled"]"
- feedback_add_details("admin_verb","TNCP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
-
/client/proc/deadmin_self()
set name = "De-admin self"
set category = "Admin"
diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm
index f7a0025621..29840d0e61 100644
--- a/code/modules/admin/verbs/diagnostics.dm
+++ b/code/modules/admin/verbs/diagnostics.dm
@@ -78,15 +78,15 @@
largest_move_time = M.next_move - world.time
else
largest_move_time = 1
- if(M.lastDblClick >= largest_click_time)
+ if(M.next_click >= largest_click_time)
largest_click_mob = M
- if(M.lastDblClick > world.time)
- largest_click_time = M.lastDblClick - world.time
+ if(M.next_click > world.time)
+ largest_click_time = M.next_click - world.time
else
largest_click_time = 0
- log_admin("DEBUG: [key_name(M)] next_move = [M.next_move] lastDblClick = [M.lastDblClick] world.time = [world.time]")
+ log_admin("DEBUG: [key_name(M)] next_move = [M.next_move] next_click = [M.next_click] world.time = [world.time]")
M.next_move = 1
- M.lastDblClick = 0
+ M.next_click = 0
message_admins("[key_name_admin(largest_move_mob)] had the largest move delay with [largest_move_time] frames / [largest_move_time/10] seconds!", 1)
message_admins("[key_name_admin(largest_click_mob)] had the largest click delay with [largest_click_time] frames / [largest_click_time/10] seconds!", 1)
message_admins("world.time = [world.time]", 1)
diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm
index a02616b556..00129e936f 100644
--- a/code/modules/clothing/clothing.dm
+++ b/code/modules/clothing/clothing.dm
@@ -141,6 +141,9 @@ BLIND // can't see anything
cell.reliability -= 10 / severity
..()
+// Called just before an attack_hand(), in mob/UnarmedAttack()
+/obj/item/clothing/gloves/proc/Touch(var/atom/A, var/proximity)
+ return 0 // return 1 to cancel attack_hand()
//Head
/obj/item/clothing/head
diff --git a/code/modules/clothing/gloves/miscellaneous.dm b/code/modules/clothing/gloves/miscellaneous.dm
index bee6ae0eab..fc9d58cefe 100644
--- a/code/modules/clothing/gloves/miscellaneous.dm
+++ b/code/modules/clothing/gloves/miscellaneous.dm
@@ -1,14 +1,3 @@
-/obj/item/clothing/gloves/space_ninja
- desc = "These nano-enhanced gloves insulate from electricity and provide fire resistance."
- name = "ninja gloves"
- icon_state = "s-ninja"
- item_state = "s-ninja"
- siemens_coefficient = 0.2
- var/draining = 0
- var/candrain = 0
- var/mindrain = 200
- var/maxdrain = 400
-
/obj/item/clothing/gloves/captain
desc = "Regal blue gloves, with a nice gold trim. Swanky."
name = "captain's gloves"
diff --git a/code/modules/detectivework/evidence.dm b/code/modules/detectivework/evidence.dm
index 80955a8214..0c41441781 100644
--- a/code/modules/detectivework/evidence.dm
+++ b/code/modules/detectivework/evidence.dm
@@ -8,16 +8,14 @@
item_state = ""
w_class = 1
-/obj/item/weapon/evidencebag/afterattack(obj/item/I, mob/user as mob)
+/obj/item/weapon/evidencebag/afterattack(obj/item/I, mob/user as mob, proximity)
+ if(!proximity) return
if(!in_range(I, user))
return
if(!istype(I) || I.anchored == 1)
return ..()
- if(istype(I, /obj/item/weapon/storage))
- return ..()
-
if(istype(I, /obj/item/weapon/evidencebag))
user << "You find putting an evidence bag in another evidence bag to be slightly absurd."
return
diff --git a/code/modules/detectivework/footprints_and_rag.dm b/code/modules/detectivework/footprints_and_rag.dm
index eb4e2d3970..efe2ebfa52 100644
--- a/code/modules/detectivework/footprints_and_rag.dm
+++ b/code/modules/detectivework/footprints_and_rag.dm
@@ -35,7 +35,8 @@
else
..()
-/obj/item/weapon/reagent_containers/glass/rag/afterattack(atom/A as obj|turf|area, mob/user as mob)
+/obj/item/weapon/reagent_containers/glass/rag/afterattack(atom/A as obj|turf|area, mob/user as mob, proximity)
+ if(!proximity) return
if(istype(A) && src in user)
user.visible_message("[user] starts to wipe down [A] with [src]!")
if(do_after(user,30))
diff --git a/code/modules/detectivework/scanner.dm b/code/modules/detectivework/scanner.dm
index 448425e454..52568ad005 100644
--- a/code/modules/detectivework/scanner.dm
+++ b/code/modules/detectivework/scanner.dm
@@ -9,7 +9,7 @@
var/list/stored = list()
w_class = 3.0
item_state = "electronic"
- flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
+ flags = FPRINT | TABLEPASS | CONDUCT | NOBLUDGEON
slot_flags = SLOT_BELT
attackby(obj/item/weapon/f_card/W as obj, mob/user as mob)
@@ -64,9 +64,8 @@
user << "\blue Blood type: [M.blood_DNA[blood]]\nDNA: [blood]"
return
- afterattack(atom/A as obj|turf|area, mob/user as mob)
- if(!in_range(A,user))
- return
+ afterattack(atom/A as obj|turf|area, mob/user as mob, proximity)
+ if(!proximity) return
if(loc != user)
return
if(istype(A,/obj/machinery/computer/forensic_scanning)) //breaks shit.
diff --git a/code/modules/mob/dead/observer/hud.dm b/code/modules/mob/dead/observer/hud.dm
deleted file mode 100644
index 4290ca5d3a..0000000000
--- a/code/modules/mob/dead/observer/hud.dm
+++ /dev/null
@@ -1,3 +0,0 @@
-
-/datum/hud/proc/ghost_hud()
- return
\ No newline at end of file
diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm
index 0bcf1b9244..09c0e0e4cb 100644
--- a/code/modules/mob/inventory.dm
+++ b/code/modules/mob/inventory.dm
@@ -89,6 +89,7 @@
if(W)
if(client) client.screen -= W
u_equip(W)
+ if(!W) return 1 // self destroying objects (tk, grabs)
W.layer = initial(W.layer)
W.loc = loc
diff --git a/code/modules/mob/living/carbon/alien/humanoid/hud.dm b/code/modules/mob/living/carbon/alien/humanoid/hud.dm
deleted file mode 100644
index 9968b6496c..0000000000
--- a/code/modules/mob/living/carbon/alien/humanoid/hud.dm
+++ /dev/null
@@ -1,242 +0,0 @@
-/datum/hud/proc/alien_hud()
-
- src.adding = list( )
- src.other = list( )
-
- var/obj/screen/using
- var/obj/screen/inventory/inv_box
-
- using = new /obj/screen()
- using.name = "act_intent"
- using.dir = SOUTHWEST
- using.icon = 'icons/mob/screen1_alien.dmi'
- using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
- using.screen_loc = ui_acti
- using.layer = 20
- src.adding += using
- action_intent = using
-
-//intent small hud objects
- var/icon/ico
-
- ico = new('icons/mob/screen1_alien.dmi', "black")
- ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
- ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height())
- using = new /obj/screen( src )
- using.name = "help"
- using.icon = ico
- using.screen_loc = ui_acti
- using.layer = 21
- src.adding += using
- help_intent = using
-
- ico = new('icons/mob/screen1_alien.dmi', "black")
- ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
- ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height())
- using = new /obj/screen( src )
- using.name = "disarm"
- using.icon = ico
- using.screen_loc = ui_acti
- using.layer = 21
- src.adding += using
- disarm_intent = using
-
- ico = new('icons/mob/screen1_alien.dmi', "black")
- ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
- ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2)
- using = new /obj/screen( src )
- using.name = "grab"
- using.icon = ico
- using.screen_loc = ui_acti
- using.layer = 21
- src.adding += using
- grab_intent = using
-
- ico = new('icons/mob/screen1_alien.dmi', "black")
- ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
- ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
- using = new /obj/screen( src )
- using.name = "harm"
- using.icon = ico
- using.screen_loc = ui_acti
- using.layer = 21
- src.adding += using
- hurt_intent = using
-
-//end intent small hud objects
-
- using = new /obj/screen()
- using.name = "mov_intent"
- using.dir = SOUTHWEST
- using.icon = 'icons/mob/screen1_alien.dmi'
- using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
- using.screen_loc = ui_movi
- using.layer = 20
- src.adding += using
- move_intent = using
-
- using = new /obj/screen()
- using.name = "drop"
- using.icon = 'icons/mob/screen1_alien.dmi'
- using.icon_state = "act_drop"
- using.screen_loc = ui_drop_throw
- using.layer = 19
- src.adding += using
-
-//equippable shit
- //suit
- inv_box = new /obj/screen/inventory()
- inv_box.name = "o_clothing"
- inv_box.dir = SOUTH
- inv_box.icon = 'icons/mob/screen1_alien.dmi'
- inv_box.icon_state = "equip"
- inv_box.screen_loc = ui_alien_oclothing
- inv_box.slot_id = slot_wear_suit
- inv_box.layer = 19
- src.adding += inv_box
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "r_hand"
- inv_box.dir = WEST
- inv_box.icon = 'icons/mob/screen1_alien.dmi'
- inv_box.icon_state = "hand_inactive"
- if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
- using.icon_state = "hand_active"
- inv_box.screen_loc = ui_rhand
- inv_box.layer = 19
- src.r_hand_hud_object = inv_box
- inv_box.slot_id = slot_r_hand
- src.adding += inv_box
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "l_hand"
- inv_box.dir = EAST
- inv_box.icon = 'icons/mob/screen1_alien.dmi'
- inv_box.icon_state = "hand_inactive"
- if(mymob && mymob.hand) //This being 1 means the left hand is in use
- inv_box.icon_state = "hand_active"
- inv_box.screen_loc = ui_lhand
- inv_box.layer = 19
- inv_box.slot_id = slot_l_hand
- src.l_hand_hud_object = inv_box
- src.adding += inv_box
-
- using = new /obj/screen/inventory()
- using.name = "hand"
- using.dir = SOUTH
- using.icon = 'icons/mob/screen1_alien.dmi'
- using.icon_state = "hand1"
- using.screen_loc = ui_swaphand1
- using.layer = 19
- src.adding += using
-
- using = new /obj/screen/inventory()
- using.name = "hand"
- using.dir = SOUTH
- using.icon = 'icons/mob/screen1_alien.dmi'
- using.icon_state = "hand2"
- using.screen_loc = ui_swaphand2
- using.layer = 19
- src.adding += using
-
- //pocket 1
- inv_box = new /obj/screen/inventory()
- inv_box.name = "storage1"
- inv_box.icon = 'icons/mob/screen1_alien.dmi'
- inv_box.icon_state = "pocket"
- inv_box.screen_loc = ui_storage1
- inv_box.slot_id = slot_l_store
- inv_box.layer = 19
- src.adding += inv_box
-
- //pocket 2
- inv_box = new /obj/screen/inventory()
- inv_box.name = "storage2"
- inv_box.icon = 'icons/mob/screen1_alien.dmi'
- inv_box.icon_state = "pocket"
- inv_box.screen_loc = ui_storage2
- inv_box.slot_id = slot_r_store
- inv_box.layer = 19
- src.adding += inv_box
-
- //head
- inv_box = new /obj/screen/inventory()
- inv_box.name = "head"
- inv_box.icon = 'icons/mob/screen1_alien.dmi'
- inv_box.icon_state = "hair"
- inv_box.screen_loc = ui_alien_head
- inv_box.slot_id = slot_head
- inv_box.layer = 19
- src.adding += inv_box
-//end of equippable shit
-
-/*
- using = new /obj/screen()
- using.name = "resist"
- using.icon = 'icons/mob/screen1_alien.dmi'
- using.icon_state = "act_resist"
- using.screen_loc = ui_resist
- using.layer = 19
- src.adding += using
-*/
-
- mymob.throw_icon = new /obj/screen()
- mymob.throw_icon.icon = 'icons/mob/screen1_alien.dmi'
- mymob.throw_icon.icon_state = "act_throw_off"
- mymob.throw_icon.name = "throw"
- mymob.throw_icon.screen_loc = ui_drop_throw
-
- mymob.oxygen = new /obj/screen()
- mymob.oxygen.icon = 'icons/mob/screen1_alien.dmi'
- mymob.oxygen.icon_state = "oxy0"
- mymob.oxygen.name = "oxygen"
- mymob.oxygen.screen_loc = ui_alien_oxygen
-
- mymob.toxin = new /obj/screen()
- mymob.toxin.icon = 'icons/mob/screen1_alien.dmi'
- mymob.toxin.icon_state = "tox0"
- mymob.toxin.name = "toxin"
- mymob.toxin.screen_loc = ui_alien_toxin
-
- mymob.fire = new /obj/screen()
- mymob.fire.icon = 'icons/mob/screen1_alien.dmi'
- mymob.fire.icon_state = "fire0"
- mymob.fire.name = "fire"
- mymob.fire.screen_loc = ui_alien_fire
-
- mymob.healths = new /obj/screen()
- mymob.healths.icon = 'icons/mob/screen1_alien.dmi'
- mymob.healths.icon_state = "health0"
- mymob.healths.name = "health"
- mymob.healths.screen_loc = ui_alien_health
-
- mymob.pullin = new /obj/screen()
- mymob.pullin.icon = 'icons/mob/screen1_alien.dmi'
- mymob.pullin.icon_state = "pull0"
- mymob.pullin.name = "pull"
- mymob.pullin.screen_loc = ui_pull_resist
-
- mymob.blind = new /obj/screen()
- mymob.blind.icon = 'icons/mob/screen1_full.dmi'
- mymob.blind.icon_state = "blackimageoverlay"
- mymob.blind.name = " "
- mymob.blind.screen_loc = "1,1"
- mymob.blind.layer = 0
-
- mymob.flash = new /obj/screen()
- mymob.flash.icon = 'icons/mob/screen1_alien.dmi'
- mymob.flash.icon_state = "blank"
- mymob.flash.name = "flash"
- mymob.flash.screen_loc = "1,1 to 15,15"
- mymob.flash.layer = 17
-
- mymob.zone_sel = new /obj/screen/zone_sel()
- mymob.zone_sel.icon = 'icons/mob/screen1_alien.dmi'
- mymob.zone_sel.overlays.Cut()
- mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
-
- mymob.client.screen = null
-
- mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
- mymob.client.screen += src.adding + src.other
-
diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
index 6188f88827..d419a7cf70 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
@@ -133,24 +133,6 @@
updatehealth()
return
-
-/mob/living/carbon/alien/humanoid/hand_p(mob/M as mob)
- if (!ticker)
- M << "You cannot attack people before the game has started."
- return
-
- if (M.a_intent == "hurt")
- if (istype(M.wear_mask, /obj/item/clothing/mask/muzzle))
- return
- if (health > 0)
- for(var/mob/O in viewers(src, null))
- if ((O.client && !( O.blinded )))
- O.show_message(text("\red [M.name] has bit []!", src), 1)
- adjustBruteLoss(rand(1, 3))
-
- updatehealth()
- return
-
/mob/living/carbon/alien/humanoid/attack_paw(mob/living/carbon/monkey/M as mob)
if(!ismonkey(M)) return//Fix for aliens receiving double messages when attacking other aliens.
@@ -305,9 +287,9 @@
return
if ("grab")
- if (M == src)
+ if (M == src || anchored)
return
- var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, M, src)
+ var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src)
M.put_in_active_hand(G)
diff --git a/code/modules/mob/living/carbon/alien/larva/hud.dm b/code/modules/mob/living/carbon/alien/larva/hud.dm
deleted file mode 100644
index 25543eb5ac..0000000000
--- a/code/modules/mob/living/carbon/alien/larva/hud.dm
+++ /dev/null
@@ -1,85 +0,0 @@
-
-/datum/hud/proc/larva_hud()
-
- src.adding = list()
- src.other = list()
-
- var/obj/screen/using
-
- using = new /obj/screen()
- using.name = "act_intent"
- using.dir = SOUTHWEST
- using.icon = 'icons/mob/screen1_alien.dmi'
- using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
- using.screen_loc = ui_acti
- using.layer = 20
- src.adding += using
- action_intent = using
-
- using = new /obj/screen()
- using.name = "mov_intent"
- using.dir = SOUTHWEST
- using.icon = 'icons/mob/screen1_alien.dmi'
- using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
- using.screen_loc = ui_movi
- using.layer = 20
- src.adding += using
- move_intent = using
-
- mymob.oxygen = new /obj/screen()
- mymob.oxygen.icon = 'icons/mob/screen1_alien.dmi'
- mymob.oxygen.icon_state = "oxy0"
- mymob.oxygen.name = "oxygen"
- mymob.oxygen.screen_loc = ui_alien_oxygen
-
- mymob.toxin = new /obj/screen()
- mymob.toxin.icon = 'icons/mob/screen1_alien.dmi'
- mymob.toxin.icon_state = "tox0"
- mymob.toxin.name = "toxin"
- mymob.toxin.screen_loc = ui_alien_toxin
-
-
- mymob.fire = new /obj/screen()
- mymob.fire.icon = 'icons/mob/screen1_alien.dmi'
- mymob.fire.icon_state = "fire0"
- mymob.fire.name = "fire"
- mymob.fire.screen_loc = ui_alien_fire
-
-
- mymob.healths = new /obj/screen()
- mymob.healths.icon = 'icons/mob/screen1_alien.dmi'
- mymob.healths.icon_state = "health0"
- mymob.healths.name = "health"
- mymob.healths.screen_loc = ui_alien_health
-
- mymob.pullin = new /obj/screen()
- mymob.pullin.icon = 'icons/mob/screen1_alien.dmi'
- mymob.pullin.icon_state = "pull0"
- mymob.pullin.name = "pull"
- mymob.pullin.screen_loc = ui_pull_resist
-
- mymob.blind = new /obj/screen()
- mymob.blind.icon = 'icons/mob/screen1_full.dmi'
- mymob.blind.icon_state = "blackimageoverlay"
- mymob.blind.name = " "
- mymob.blind.screen_loc = "1,1"
- mymob.blind.layer = 0
-
- mymob.flash = new /obj/screen()
- mymob.flash.icon = 'icons/mob/screen1_alien.dmi'
- mymob.flash.icon_state = "blank"
- mymob.flash.name = "flash"
- mymob.flash.screen_loc = "1,1 to 15,15"
- mymob.flash.layer = 17
-
- mymob.zone_sel = new /obj/screen/zone_sel()
- mymob.zone_sel.overlays.Cut()
- mymob.zone_sel.overlays += image("icon" = 'icons/mob/zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
-
- mymob.client.screen = null
-
- mymob.client.screen += list( mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash) //, mymob.rest, mymob.sleep, mymob.mach )
- mymob.client.screen += src.adding + src.other
-
-
-
diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm
index 2a4886206f..043b60bae2 100644
--- a/code/modules/mob/living/carbon/alien/larva/larva.dm
+++ b/code/modules/mob/living/carbon/alien/larva/larva.dm
@@ -140,28 +140,6 @@
return
-/mob/living/carbon/alien/larva/hand_p(mob/M as mob)
- if (!ticker)
- M << "You cannot attack people before the game has started."
- return
-
- if (M.a_intent == "hurt")
- if (istype(M.wear_mask, /obj/item/clothing/mask/muzzle))
- return
- if (health > 0)
-
- for(var/mob/O in viewers(src, null))
- if ((O.client && !( O.blinded )))
- O.show_message(text("\red [M.name] has bit []!", src), 1)
- var/damage = rand(1, 3)
-
- adjustBruteLoss(damage)
-
- updatehealth()
-
- return
-
-
/mob/living/carbon/alien/larva/attack_animal(mob/living/simple_animal/M as mob)
if(M.melee_damage_upper == 0)
M.emote("[M.friendly] [src]")
diff --git a/code/modules/mob/living/carbon/brain/hud.dm b/code/modules/mob/living/carbon/brain/hud.dm
deleted file mode 100644
index b9f455b53e..0000000000
--- a/code/modules/mob/living/carbon/brain/hud.dm
+++ /dev/null
@@ -1,10 +0,0 @@
-/datum/hud/proc/brain_hud(var/ui_style='icons/mob/screen1_old.dmi')
-
- //ui_style='icons/mob/screen1_old.dmi' //Overriding the parameter. Only this UI style is acceptable with the 'sleek' layout.
-
- mymob.blind = new /obj/screen()
- mymob.blind.icon = 'icons/mob/screen1_full.dmi'
- mymob.blind.icon_state = "blackimageoverlay"
- mymob.blind.name = " "
- mymob.blind.screen_loc = "1,1"
- mymob.blind.layer = 0
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index c7469e678c..726d283c42 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -135,10 +135,10 @@
if(istext(selhand))
selhand = lowertext(selhand)
- if(selhand == "right" || selhand == "r")
- selhand = 0
- if(selhand == "left" || selhand == "l")
- selhand = 1
+ if(selhand == "right" || selhand == "r")
+ selhand = 0
+ if(selhand == "left" || selhand == "l")
+ selhand = 1
if(selhand != src.hand)
swap_hand()
@@ -221,95 +221,97 @@
// ++++ROCKDTBEN++++ MOB PROCS //END
-/mob/living/carbon/proc/handle_ventcrawl() // -- TLE -- Merged by Carn
-
- if(!stat)
- if(!lying)
-
- var/obj/machinery/atmospherics/unary/vent_pump/vent_found
- for(var/obj/machinery/atmospherics/unary/vent_pump/v in range(1,src))
- if(!v.welded)
- vent_found = v
- else
- src << "\red That vent is welded."
-
- if(vent_found)
- if(vent_found.network&&vent_found.network.normal_members.len)
- var/list/vents[0]
- for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in vent_found.network.normal_members)
- if(temp_vent.loc == loc)
- continue
- if(temp_vent.welded)
- continue
- var/turf/T = get_turf(temp_vent)
-
- if(!T || T.z != loc.z)
- continue
-
- var/i = 1
- var/index = "[T.loc.name]\[[i]\]"
- while(index in vents)
- i++
- index = "[T.loc.name]\[[i]\]"
- vents[index] = temp_vent
-
- var/turf/startloc = loc
- var/obj/selection = input("Select a destination.", "Duct System") as null|anything in sortList(vents)
-
- if(!selection)
- return
-
- if(!do_after(src, 45))
- return
-
- if(!src||!selection)
- return
-
- if(loc==startloc)
- if(contents.len)
- for(var/obj/item/carried_item in contents)//If the monkey got on objects.
- if( !istype(carried_item, /obj/item/weapon/implant) && !istype(carried_item, /obj/item/clothing/mask/facehugger) )//If it's not an implant or a facehugger
- src << "\red You can't be carrying items or have items equipped when vent crawling!"
- return
- var/obj/machinery/atmospherics/unary/vent_pump/target_vent = vents[selection]
- if(target_vent)
- for(var/mob/O in viewers(src, null))
- O.show_message(text("[src] scrambles into the ventillation ducts!"), 1)
- loc = target_vent
-
- var/travel_time = round(get_dist(loc, target_vent.loc) / 2)
-
- spawn(travel_time)
-
- if(!target_vent) return
- for(var/mob/O in hearers(target_vent,null))
- O.show_message("You hear something squeezing through the ventilation ducts.",2)
-
- sleep(travel_time)
-
- if(!target_vent) return
- if(target_vent.welded) //the vent can be welded while alien scrolled through the list or travelled.
- target_vent = vent_found //travel back. No additional time required.
- src << "\red The vent you were heading to appears to be welded."
- loc = target_vent.loc
- var/area/new_area = get_area(loc)
- if(new_area)
- new_area.Entered(src)
-
- else
- src << "You need to remain still while entering a vent."
- else
- src << "This vent is not connected to anything."
-
- else
- src << "You must be standing on or beside an air vent to enter it."
-
- else
- src << "You can't vent crawl while you're stunned!"
-
- else
+/mob/living/carbon/proc/handle_ventcrawl(var/obj/machinery/atmospherics/unary/vent_pump/vent_found = null) // -- TLE -- Merged by Carn
+ if(stat)
src << "You must be conscious to do this!"
- return
+ return
+ if(lying)
+ src << "You can't vent crawl while you're stunned!"
+ return
+
+ if(vent_found) // one was passed in, probably from vent/AltClick()
+ if(vent_found.welded)
+ src << "That vent is welded shut."
+ return
+ if(!vent_found.Adjacent(src))
+ return // don't even acknowledge that
+ else
+ for(var/obj/machinery/atmospherics/unary/vent_pump/v in range(1,src))
+ if(!v.welded)
+ if(v.Adjacent(src))
+ vent_found = v
+ if(!vent_found)
+ src << "You'll need a non-welded vent to crawl into!"
+ return
+
+ if(!vent_found.network || !vent_found.network.normal_members.len)
+ src << "This vent is not connected to anything."
+ return
+
+ var/list/vents = list()
+ for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in vent_found.network.normal_members)
+ if(temp_vent.welded)
+ continue
+ if(temp_vent in loc)
+ continue
+ var/turf/T = get_turf(temp_vent)
+
+ if(!T || T.z != loc.z)
+ continue
+
+ var/i = 1
+ var/index = "[T.loc.name]\[[i]\]"
+ while(index in vents)
+ i++
+ index = "[T.loc.name]\[[i]\]"
+ vents[index] = temp_vent
+ if(!vents.len)
+ src << "\red There are no available vents to travel to, they could be welded."
+ return
+
+ var/obj/selection = input("Select a destination.", "Duct System") as null|anything in sortAssoc(vents)
+ if(!selection) return
+
+ if(!vent_found.Adjacent(src))
+ src << "Never mind, you left."
+ return
+
+ for(var/obj/item/carried_item in contents)//If the monkey got on objects.
+ if( !istype(carried_item, /obj/item/weapon/implant) && !istype(carried_item, /obj/item/clothing/mask/facehugger) )//If it's not an implant or a facehugger
+ src << "\red You can't be carrying items or have items equipped when vent crawling!"
+ return
+ if(isslime(src))
+ var/mob/living/carbon/slime/S = src
+ if(S.Victim)
+ src << "\red You'll have to let [S.Victim] go or finish eating \him first."
+ return
+
+ var/obj/machinery/atmospherics/unary/vent_pump/target_vent = vents[selection]
+ if(!target_vent)
+ return
+
+ for(var/mob/O in viewers(src, null))
+ O.show_message(text("[src] scrambles into the ventillation ducts!"), 1)
+ loc = target_vent
+
+ var/travel_time = round(get_dist(loc, target_vent.loc) / 2)
+
+ spawn(travel_time)
+
+ if(!target_vent) return
+ for(var/mob/O in hearers(target_vent,null))
+ O.show_message("You hear something squeezing through the ventilation ducts.",2)
+
+ sleep(travel_time)
+
+ if(!target_vent) return
+ if(target_vent.welded) //the vent can be welded while alien scrolled through the list or travelled.
+ target_vent = vent_found //travel back. No additional time required.
+ src << "\red The vent you were heading to appears to be welded."
+ loc = target_vent.loc
+ var/area/new_area = get_area(loc)
+ if(new_area)
+ new_area.Entered(src)
/mob/living/carbon/clean_blood()
@@ -331,19 +333,6 @@
//Throwing stuff
/mob/living/carbon/proc/toggle_throw_mode()
- var/obj/item/W = get_active_hand()
- if( !W )//Not holding anything
- if( client && (TK in mutations) )
- var/obj/item/tk_grab/O = new(src)
- put_in_active_hand(O)
- O.host = src
- return
-
- if( istype(W,/obj/item/tk_grab) )
- if(hand) del(l_hand)
- else del(r_hand)
- return
-
if (src.in_throw_mode)
throw_mode_off()
else
@@ -357,7 +346,10 @@
src.in_throw_mode = 1
src.throw_icon.icon_state = "act_throw_on"
-/mob/living/carbon/proc/throw_item(atom/target)
+/mob/proc/throw_item(atom/target)
+ return
+
+/mob/living/carbon/throw_item(atom/target)
src.throw_mode_off()
if(usr.stat || !target)
return
diff --git a/code/modules/mob/living/carbon/give.dm b/code/modules/mob/living/carbon/give.dm
index bdad53f2ca..47e4282424 100644
--- a/code/modules/mob/living/carbon/give.dm
+++ b/code/modules/mob/living/carbon/give.dm
@@ -1,18 +1,18 @@
-mob/living/carbon/verb/give()
+/mob/living/carbon/verb/give()
set category = "IC"
set name = "Give"
set src in view(1)
- if(src.stat == 2 || usr.stat == 2|| src.client == null)
+ if(src.stat == 2 || usr.stat == 2 || src.client == null)
return
if(src == usr)
- usr << "I feel stupider, suddenly."
+ usr << "\red I feel stupider, suddenly."
return
var/obj/item/I
if(!usr.hand && usr.r_hand == null)
- usr << "You don't have anything in your right hand to give to [src.name]"
+ usr << "\red You don't have anything in your right hand to give to [src.name]"
return
if(usr.hand && usr.l_hand == null)
- usr << "You don't have anything in your left hand to give to [src.name]"
+ usr << "\red You don't have anything in your left hand to give to [src.name]"
return
if(usr.hand)
I = usr.l_hand
@@ -20,64 +20,29 @@ mob/living/carbon/verb/give()
I = usr.r_hand
if(!I)
return
- if(src.r_hand == null)
+ if(src.r_hand == null || src.l_hand == null)
switch(alert(src,"[usr] wants to give you \a [I]?",,"Yes","No"))
if("Yes")
if(!I)
return
- if(!check_can_reach(usr,src))
- usr << "You need to keep in reaching distance."
- src << "[usr.name] moved too far away."
+ if(!Adjacent(usr))
+ usr << "\red You need to stay in reaching distance while giving an object."
+ src << "\red [usr.name] moved too far away."
return
if((usr.hand && usr.l_hand != I) || (!usr.hand && usr.r_hand != I))
- usr << "You need to keep the item in your active hand."
- src << "[usr.name] seem to have given up on giving \the [I.name] to you."
+ usr << "\red You need to keep the item in your active hand."
+ src << "\red [usr.name] seem to have given up on giving \the [I.name] to you."
+ return
+ if(src.r_hand != null && src.l_hand != null)
+ src << "\red Your hands are full."
+ usr << "\red Their hands are full."
return
- if(src.r_hand != null)
- if(src.l_hand == null)
- usr.drop_item()
- src.l_hand = I
- else
- src << "Your hands are full."
- usr << "Their hands are full."
- return
else
usr.drop_item()
- src.r_hand = I
- I.loc = src
- I.layer = 20
- I.add_fingerprint(src)
- src.update_inv_l_hand()
- src.update_inv_r_hand()
- usr.update_inv_l_hand()
- usr.update_inv_r_hand()
- src.visible_message("[usr.name] handed \the [I.name] to [src.name].")
- if("No")
- src.visible_message("[usr.name] tried to hand [I.name] to [src.name] but [src.name] didn't want it.")
- else if(src.l_hand == null)
- switch(alert(src,"[usr] wants to give you \a [I]?",,"Yes","No"))
- if("Yes")
- if(!I)
- return
- if(!check_can_reach(usr,src))
- usr << "You need to keep in reaching distance."
- src << "[usr.name] moved too far away."
- return
- if((usr.hand && usr.l_hand != I) || (!usr.hand && usr.r_hand != I))
- usr << "You need to keep the item in your active hand."
- src << "[usr.name] seem to have given up on giving \the [I.name] to you."
- return
- if(src.l_hand != null)
if(src.r_hand == null)
- usr.drop_item()
src.r_hand = I
else
- src << "Your hands are full."
- usr << "Their hands are full."
- return
- else
- usr.drop_item()
- src.l_hand = I
+ src.l_hand = I
I.loc = src
I.layer = 20
I.add_fingerprint(src)
@@ -85,8 +50,8 @@ mob/living/carbon/verb/give()
src.update_inv_r_hand()
usr.update_inv_l_hand()
usr.update_inv_r_hand()
- src.visible_message("[usr.name] handed \the [I.name] to [src.name].")
+ src.visible_message("\blue [usr.name] handed \the [I.name] to [src.name].")
if("No")
- src.visible_message("[usr.name] tried to hand [I.name] to [src.name] but [src.name] didn't want it.")
+ src.visible_message("\red [usr.name] tried to hand [I.name] to [src.name] but [src.name] didn't want it.")
else
- usr << "[src.name]'s hands are full."
\ No newline at end of file
+ usr << "\red [src.name]'s hands are full."
diff --git a/code/modules/mob/living/carbon/human/hud.dm b/code/modules/mob/living/carbon/human/hud.dm
deleted file mode 100644
index 70f204bbc4..0000000000
--- a/code/modules/mob/living/carbon/human/hud.dm
+++ /dev/null
@@ -1,576 +0,0 @@
-/datum/hud/proc/human_hud(var/ui_style='icons/mob/screen1_old.dmi')
-
- src.adding = list()
- src.other = list()
- src.hotkeybuttons = list() //These can be disabled for hotkey usersx
-
- var/obj/screen/using
- var/obj/screen/inventory/inv_box
-
- using = new /obj/screen()
- using.name = "act_intent"
- using.dir = SOUTHWEST
- using.icon = ui_style
- using.icon_state = "intent_"+mymob.a_intent
- using.screen_loc = ui_acti
- using.layer = 20
- src.adding += using
- action_intent = using
-
-//intent small hud objects
- var/icon/ico
-
- ico = new(ui_style, "black")
- ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
- ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height())
- using = new /obj/screen( src )
- using.name = "help"
- using.icon = ico
- using.screen_loc = ui_acti
- using.layer = 21
- src.adding += using
- help_intent = using
-
- ico = new(ui_style, "black")
- ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
- ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height())
- using = new /obj/screen( src )
- using.name = "disarm"
- using.icon = ico
- using.screen_loc = ui_acti
- using.layer = 21
- src.adding += using
- disarm_intent = using
-
- ico = new(ui_style, "black")
- ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
- ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2)
- using = new /obj/screen( src )
- using.name = "grab"
- using.icon = ico
- using.screen_loc = ui_acti
- using.layer = 21
- src.adding += using
- grab_intent = using
-
- ico = new(ui_style, "black")
- ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
- ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
- using = new /obj/screen( src )
- using.name = "harm"
- using.icon = ico
- using.screen_loc = ui_acti
- using.layer = 21
- src.adding += using
- hurt_intent = using
-
-//end intent small hud objects
-
- using = new /obj/screen()
- using.name = "mov_intent"
- using.dir = SOUTHWEST
- using.icon = ui_style
- using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
- using.screen_loc = ui_movi
- using.layer = 20
- src.adding += using
- move_intent = using
-
- using = new /obj/screen()
- using.name = "drop"
- using.icon = ui_style
- using.icon_state = "act_drop"
- using.screen_loc = ui_drop_throw
- using.layer = 19
- src.hotkeybuttons += using
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "i_clothing"
- inv_box.dir = SOUTH
- inv_box.icon = ui_style
- inv_box.slot_id = slot_w_uniform
- inv_box.icon_state = "center"
- inv_box.screen_loc = ui_iclothing
- inv_box.layer = 19
- src.other += inv_box
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "o_clothing"
- inv_box.dir = SOUTH
- inv_box.icon = ui_style
- inv_box.slot_id = slot_wear_suit
- inv_box.icon_state = "equip"
- inv_box.screen_loc = ui_oclothing
- inv_box.layer = 19
- src.other += inv_box
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "r_hand"
- inv_box.dir = WEST
- inv_box.icon = ui_style
- inv_box.icon_state = "hand_inactive"
- if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
- inv_box.icon_state = "hand_active"
- inv_box.screen_loc = ui_rhand
- inv_box.slot_id = slot_r_hand
- inv_box.layer = 19
- src.r_hand_hud_object = inv_box
- src.adding += inv_box
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "l_hand"
- inv_box.dir = EAST
- inv_box.icon = ui_style
- inv_box.icon_state = "hand_inactive"
- if(mymob && mymob.hand) //This being 1 means the left hand is in use
- inv_box.icon_state = "hand_active"
- inv_box.screen_loc = ui_lhand
- inv_box.slot_id = slot_l_hand
- inv_box.layer = 19
- src.l_hand_hud_object = inv_box
- src.adding += inv_box
-
- using = new /obj/screen/inventory()
- using.name = "hand"
- using.dir = SOUTH
- using.icon = ui_style
- using.icon_state = "hand1"
- using.screen_loc = ui_swaphand1
- using.layer = 19
- src.adding += using
-
- using = new /obj/screen/inventory()
- using.name = "hand"
- using.dir = SOUTH
- using.icon = ui_style
- using.icon_state = "hand2"
- using.screen_loc = ui_swaphand2
- using.layer = 19
- src.adding += using
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "id"
- inv_box.dir = NORTH
- inv_box.icon = ui_style
- inv_box.icon_state = "id"
- inv_box.screen_loc = ui_id
- inv_box.slot_id = slot_wear_id
- inv_box.layer = 19
- src.adding += inv_box
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "mask"
- inv_box.dir = NORTH
- inv_box.icon = ui_style
- inv_box.icon_state = "equip"
- inv_box.screen_loc = ui_mask
- inv_box.slot_id = slot_wear_mask
- inv_box.layer = 19
- src.other += inv_box
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "back"
- inv_box.dir = NORTH
- inv_box.icon = ui_style
- inv_box.icon_state = "back"
- inv_box.screen_loc = ui_back
- inv_box.slot_id = slot_back
- inv_box.layer = 19
- src.adding += inv_box
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "storage1"
- inv_box.icon = ui_style
- inv_box.icon_state = "pocket"
- inv_box.screen_loc = ui_storage1
- inv_box.slot_id = slot_l_store
- inv_box.layer = 19
- src.adding += inv_box
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "storage2"
- inv_box.icon = ui_style
- inv_box.icon_state = "pocket"
- inv_box.screen_loc = ui_storage2
- inv_box.slot_id = slot_r_store
- inv_box.layer = 19
- src.adding += inv_box
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "suit storage"
- inv_box.icon = ui_style
- inv_box.dir = 8 //The sprite at dir=8 has the background whereas the others don't.
- inv_box.icon_state = "belt"
- inv_box.screen_loc = ui_sstore1
- inv_box.slot_id = slot_s_store
- inv_box.layer = 19
- src.adding += inv_box
-
- using = new /obj/screen()
- using.name = "resist"
- using.icon = ui_style
- using.icon_state = "act_resist"
- using.screen_loc = ui_pull_resist
- using.layer = 19
- src.hotkeybuttons += using
-
- using = new /obj/screen()
- using.name = "other"
- using.icon = ui_style
- using.icon_state = "other"
- using.screen_loc = ui_inventory
- using.layer = 20
- src.adding += using
-
- using = new /obj/screen()
- using.name = "equip"
- using.icon = ui_style
- using.icon_state = "act_equip"
- using.screen_loc = ui_equip
- using.layer = 20
- src.adding += using
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "gloves"
- inv_box.icon = ui_style
- inv_box.icon_state = "gloves"
- inv_box.screen_loc = ui_gloves
- inv_box.slot_id = slot_gloves
- inv_box.layer = 19
- src.other += inv_box
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "eyes"
- inv_box.icon = ui_style
- inv_box.icon_state = "glasses"
- inv_box.screen_loc = ui_glasses
- inv_box.slot_id = slot_glasses
- inv_box.layer = 19
- src.other += inv_box
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "l_ear"
- inv_box.icon = ui_style
- inv_box.icon_state = "ears"
- inv_box.screen_loc = ui_l_ear
- inv_box.slot_id = slot_l_ear
- inv_box.layer = 19
- src.other += inv_box
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "r_ear"
- inv_box.icon = ui_style
- inv_box.icon_state = "ears"
- inv_box.screen_loc = ui_r_ear
- inv_box.slot_id = slot_r_ear
- inv_box.layer = 19
- src.other += inv_box
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "head"
- inv_box.icon = ui_style
- inv_box.icon_state = "hair"
- inv_box.screen_loc = ui_head
- inv_box.slot_id = slot_head
- inv_box.layer = 19
- src.other += inv_box
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "shoes"
- inv_box.icon = ui_style
- inv_box.icon_state = "shoes"
- inv_box.screen_loc = ui_shoes
- inv_box.slot_id = slot_shoes
- inv_box.layer = 19
- src.other += inv_box
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "belt"
- inv_box.icon = ui_style
- inv_box.icon_state = "belt"
- inv_box.screen_loc = ui_belt
- inv_box.slot_id = slot_belt
- inv_box.layer = 19
- src.adding += inv_box
-
- mymob.throw_icon = new /obj/screen()
- mymob.throw_icon.icon = ui_style
- mymob.throw_icon.icon_state = "act_throw_off"
- mymob.throw_icon.name = "throw"
- mymob.throw_icon.screen_loc = ui_drop_throw
- src.hotkeybuttons += mymob.throw_icon
-
- mymob.oxygen = new /obj/screen()
- mymob.oxygen.icon = ui_style
- mymob.oxygen.icon_state = "oxy0"
- mymob.oxygen.name = "oxygen"
- mymob.oxygen.screen_loc = ui_oxygen
-
- mymob.pressure = new /obj/screen()
- mymob.pressure.icon = ui_style
- mymob.pressure.icon_state = "pressure0"
- mymob.pressure.name = "pressure"
- mymob.pressure.screen_loc = ui_pressure
-
- mymob.toxin = new /obj/screen()
- mymob.toxin.icon = ui_style
- mymob.toxin.icon_state = "tox0"
- mymob.toxin.name = "toxin"
- mymob.toxin.screen_loc = ui_toxin
-
- mymob.internals = new /obj/screen()
- mymob.internals.icon = ui_style
- mymob.internals.icon_state = "internal0"
- mymob.internals.name = "internal"
- mymob.internals.screen_loc = ui_internal
-
- mymob.fire = new /obj/screen()
- mymob.fire.icon = ui_style
- mymob.fire.icon_state = "fire0"
- mymob.fire.name = "fire"
- mymob.fire.screen_loc = ui_fire
-
- mymob.bodytemp = new /obj/screen()
- mymob.bodytemp.icon = ui_style
- mymob.bodytemp.icon_state = "temp1"
- mymob.bodytemp.name = "body temperature"
- mymob.bodytemp.screen_loc = ui_temp
-
- mymob.healths = new /obj/screen()
- mymob.healths.icon = ui_style
- mymob.healths.icon_state = "health0"
- mymob.healths.name = "health"
- mymob.healths.screen_loc = ui_health
-
- mymob.nutrition_icon = new /obj/screen()
- mymob.nutrition_icon.icon = ui_style
- mymob.nutrition_icon.icon_state = "nutrition0"
- mymob.nutrition_icon.name = "nutrition"
- mymob.nutrition_icon.screen_loc = ui_nutrition
-
- mymob.pullin = new /obj/screen()
- mymob.pullin.icon = ui_style
- mymob.pullin.icon_state = "pull0"
- mymob.pullin.name = "pull"
- mymob.pullin.screen_loc = ui_pull_resist
- src.hotkeybuttons += mymob.pullin
-
- mymob.blind = new /obj/screen()
- mymob.blind.icon = 'icons/mob/screen1_full.dmi'
- mymob.blind.icon_state = "blackimageoverlay"
- mymob.blind.name = " "
- mymob.blind.screen_loc = "1,1"
- mymob.blind.mouse_opacity = 0
- mymob.blind.layer = 0
-
- mymob.damageoverlay = new /obj/screen()
- mymob.damageoverlay.icon = 'icons/mob/screen1_full.dmi'
- mymob.damageoverlay.icon_state = "oxydamageoverlay0"
- mymob.damageoverlay.name = "dmg"
- mymob.damageoverlay.screen_loc = "1,1"
- mymob.damageoverlay.mouse_opacity = 0
- mymob.damageoverlay.layer = 18.1 //The black screen overlay sets layer to 18 to display it, this one has to be just on top.
-
- mymob.flash = new /obj/screen()
- mymob.flash.icon = ui_style
- mymob.flash.icon_state = "blank"
- mymob.flash.name = "flash"
- mymob.flash.screen_loc = "1,1 to 15,15"
- mymob.flash.layer = 17
-
- mymob.pain = new /obj/screen( null )
-
-/*
- mymob.hands = new /obj/screen( null )
- mymob.hands.icon = ui_style
- mymob.hands.icon_state = "hand"
- mymob.hands.name = "hand"
- mymob.hands.screen_loc = ui_hand
- mymob.hands.dir = NORTH
-
- mymob.sleep = new /obj/screen( null )
- mymob.sleep.icon = ui_style
- mymob.sleep.icon_state = "sleep0"
- mymob.sleep.name = "sleep"
- mymob.sleep.screen_loc = ui_sleep
-
- mymob.rest = new /obj/screen( null )
- mymob.rest.icon = ui_style
- mymob.rest.icon_state = "rest0"
- mymob.rest.name = "rest"
- mymob.rest.screen_loc = ui_rest
-*/
-
- /*/Monkey blockers
-
- using = new /obj/screen( src )
- using.name = "blocked"
- using.icon_state = "blocked"
- using.screen_loc = ui_ears
- using.layer = 20
- src.mon_blo += using
-
- using = new /obj/screen( src )
- using.name = "blocked"
- using.icon_state = "blocked"
- using.screen_loc = ui_belt
- using.layer = 20
- src.mon_blo += using
-
- using = new /obj/screen( src )
- using.name = "blocked"
- using.icon_state = "blocked"
- using.screen_loc = ui_shoes
- using.layer = 20
- src.mon_blo += using
-
- using = new /obj/screen( src )
- using.name = "blocked"
- using.icon_state = "blocked"
- using.screen_loc = ui_storage2
- using.layer = 20
- src.mon_blo += using
-
- using = new /obj/screen( src )
- using.name = "blocked"
- using.icon_state = "blocked"
- using.screen_loc = ui_glasses
- using.layer = 20
- src.mon_blo += using
-
- using = new /obj/screen( src )
- using.name = "blocked"
- using.icon_state = "blocked"
- using.screen_loc = ui_gloves
- using.layer = 20
- src.mon_blo += using
-
- using = new /obj/screen( src )
- using.name = "blocked"
- using.icon_state = "blocked"
- using.screen_loc = ui_storage1
- using.layer = 20
- src.mon_blo += using
-
- using = new /obj/screen( src )
- using.name = "blocked"
- using.icon_state = "blocked"
- using.screen_loc = ui_headset
- using.layer = 20
- src.mon_blo += using
-
- using = new /obj/screen( src )
- using.name = "blocked"
- using.icon_state = "blocked"
- using.screen_loc = ui_oclothing
- using.layer = 20
- src.mon_blo += using
-
- using = new /obj/screen( src )
- using.name = "blocked"
- using.icon_state = "blocked"
- using.screen_loc = ui_iclothing
- using.layer = 20
- src.mon_blo += using
-
- using = new /obj/screen( src )
- using.name = "blocked"
- using.icon_state = "blocked"
- using.screen_loc = ui_id
- using.layer = 20
- src.mon_blo += using
-
- using = new /obj/screen( src )
- using.name = "blocked"
- using.icon_state = "blocked"
- using.screen_loc = ui_head
- using.layer = 20
- src.mon_blo += using
-//Monkey blockers
-*/
-
- mymob.zone_sel = new /obj/screen/zone_sel( null )
- mymob.zone_sel.icon = ui_style
- mymob.zone_sel.overlays.Cut()
- mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
-
- //Handle the gun settings buttons
- mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
- if (mymob.client)
- if (mymob.client.gun_mode) // If in aim mode, correct the sprite
- mymob.gun_setting_icon.dir = 2
- for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
- if (G.target)
- mymob.item_use_icon = new /obj/screen/gun/item(null)
- if (mymob.client.target_can_click)
- mymob.item_use_icon.dir = 1
- src.adding += mymob.item_use_icon
- mymob.gun_move_icon = new /obj/screen/gun/move(null)
- if (mymob.client.target_can_move)
- mymob.gun_move_icon.dir = 1
- mymob.gun_run_icon = new /obj/screen/gun/run(null)
- if (mymob.client.target_can_run)
- mymob.gun_run_icon.dir = 1
- src.adding += mymob.gun_run_icon
- src.adding += mymob.gun_move_icon
-
-
- mymob.client.screen = null
-
- mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.nutrition_icon, mymob.pullin, mymob.blind, mymob.flash, mymob.damageoverlay, mymob.gun_setting_icon) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach )
- mymob.client.screen += src.adding + src.hotkeybuttons
- inventory_shown = 0;
-
- return
-
-
-/mob/living/carbon/human/verb/toggle_hotkey_verbs()
- set category = "OOC"
- set name = "Toggle hotkey buttons"
- set desc = "This disables or enables the user interface buttons which can be used with hotkeys."
-
- if(hud_used.hotkey_ui_hidden)
- client.screen += src.hud_used.hotkeybuttons
- src.hud_used.hotkey_ui_hidden = 0
- else
- client.screen -= src.hud_used.hotkeybuttons
- src.hud_used.hotkey_ui_hidden = 1
-
-
-/mob/living/carbon/human/update_action_buttons()
- var/num = 1
- if(!src.hud_used) return
- if(!src.client) return
-
- if(!hud_used.hud_shown) //Hud toggled to minimal
- return
-
- src.client.screen -= src.hud_used.item_action_list
- hud_used.item_action_list = list()
-
- for(var/obj/item/I in src)
- if(I.icon_action_button)
- var/obj/screen/item_action/A = new(src.hud_used)
- A.icon = 'icons/mob/screen1_action.dmi'
- A.icon_state = I.icon_action_button
- if(I.action_button_name)
- A.name = I.action_button_name
- else
- A.name = "Use [I.name]"
- A.owner = I
- hud_used.item_action_list += A
- switch(num)
- if(1)
- A.screen_loc = ui_action_slot1
- if(2)
- A.screen_loc = ui_action_slot2
- if(3)
- A.screen_loc = ui_action_slot3
- if(4)
- A.screen_loc = ui_action_slot4
- if(5)
- A.screen_loc = ui_action_slot5
- break //5 slots available, so no more can be added.
- num++
-
- src.client.screen += src.hud_used.item_action_list
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index dfe16511b6..1957fb2976 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -278,23 +278,6 @@
return
-/mob/living/carbon/human/hand_p(mob/M as mob)
- var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
- var/datum/organ/external/affecting = get_organ(ran_zone(dam_zone))
- var/armor = run_armor_check(affecting, "melee")
- apply_damage(rand(1,2), BRUTE, affecting, armor)
- if(armor >= 2) return
-
- for(var/datum/disease/D in M.viruses)
- if(istype(D, /datum/disease/jungle_fever))
- var/mob/living/carbon/human/H = src
- src = null
- src = H.monkeyize()
- contract_disease(D,1,0)
- return
-
-
-
/mob/living/carbon/human/attack_animal(mob/living/simple_animal/M as mob)
if(M.melee_damage_upper == 0)
M.emote("[M.friendly] [src]")
diff --git a/code/modules/mob/living/carbon/human/human_attackalien.dm b/code/modules/mob/living/carbon/human/human_attackalien.dm
index 76c5012ee1..ea73d63f8d 100644
--- a/code/modules/mob/living/carbon/human/human_attackalien.dm
+++ b/code/modules/mob/living/carbon/human/human_attackalien.dm
@@ -7,10 +7,11 @@
if ("help")
visible_message(text("\blue [M] caresses [src] with its scythe like arm."))
if ("grab")
- if(M == src) return
+ if(M == src || anchored)
+ return
if (w_uniform)
w_uniform.add_fingerprint(M)
- var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, M, src)
+ var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src)
M.put_in_active_hand(G)
diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm
index b7ef335272..a085a88b34 100644
--- a/code/modules/mob/living/carbon/human/human_attackhand.dm
+++ b/code/modules/mob/living/carbon/human/human_attackhand.dm
@@ -91,18 +91,23 @@
return 1
if("grab")
- if(M == src) return 0
- if(w_uniform) w_uniform.add_fingerprint(M)
- var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, M, src)
+ if(M == src || anchored)
+ return 0
+ if(w_uniform)
+ w_uniform.add_fingerprint(M)
+ var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src)
+ if(buckled)
+ M << "You cannot grab [src], \he is buckled in!"
+ if(!G) //the grab will delete itself in New if affecting is anchored
+ return
M.put_in_active_hand(G)
-
grabbed_by += G
G.synch()
LAssailant = M
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
- visible_message("\red [M] has grabbed [src] passively!")
+ visible_message("[M] has grabbed [src] passively!")
return 1
if("hurt")
diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm
index f1e9f3a76a..2ccf4f3740 100644
--- a/code/modules/mob/living/carbon/human/inventory.dm
+++ b/code/modules/mob/living/carbon/human/inventory.dm
@@ -1,3 +1,21 @@
+/mob/living/carbon/human/verb/quick_equip()
+ set name = "quick-equip"
+ set hidden = 1
+
+ if(ishuman(src))
+ var/mob/living/carbon/human/H = src
+ var/obj/item/I = H.get_active_hand()
+ if(!I)
+ H << "You are not holding anything to equip."
+ return
+ if(H.equip_to_appropriate_slot(I))
+ if(hand)
+ update_inv_l_hand(0)
+ else
+ update_inv_r_hand(0)
+ else
+ H << "\red You are unable to equip that."
+
/mob/living/carbon/human/proc/equip_in_one_of_slots(obj/item/W, list/slots, del_on_fail = 1)
for (var/slot in slots)
if (equip_to_slot_if_possible(W, slots[slot], del_on_fail = 0))
diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm
index ea99e7b329..47e9f6c675 100644
--- a/code/modules/mob/living/carbon/metroid/life.dm
+++ b/code/modules/mob/living/carbon/metroid/life.dm
@@ -103,7 +103,7 @@
sleep(15)
Atkcool = 0
- if(get_obstacle_ok(Target))
+ if(Target.Adjacent(src))
Target.attack_slime(src)
//world << "retrun 1"
return
@@ -116,7 +116,7 @@
sleep(25)
Atkcool = 0
- if(get_obstacle_ok(Target))
+ if(Target.Adjacent(src))
Target.attack_slime(src)
@@ -124,16 +124,16 @@
step_to(src, Target)
else
- if(!Atkcool && get_obstacle_ok(Target))
+ if(!Atkcool && Target.Adjacent(src))
Feedon(Target)
else
- if(!Atkcool && get_obstacle_ok(Target))
+ if(!Atkcool && Target.Adjacent(src))
Feedon(Target)
else
if(Target in view(7, src))
- if(get_obstacle_ok(Target))
+ if(Target.Adjacent(src))
step_to(src, Target)
else
diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm
index ceb4617390..1f22ae1265 100644
--- a/code/modules/mob/living/carbon/metroid/metroid.dm
+++ b/code/modules/mob/living/carbon/metroid/metroid.dm
@@ -636,88 +636,6 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
health = 150 - (getOxyLoss() + getToxLoss() + getFireLoss() + getBruteLoss() + getCloneLoss())
-/mob/living/carbon/slime/proc/get_obstacle_ok(atom/A)
- var/direct = get_dir(src, A)
- var/obj/item/weapon/dummy/D = new /obj/item/weapon/dummy( src.loc )
- var/ok = 0
- if ( (direct - 1) & direct)
- var/turf/Step_1
- var/turf/Step_2
- switch(direct)
- if(5.0)
- Step_1 = get_step(src, NORTH)
- Step_2 = get_step(src, EAST)
-
- if(6.0)
- Step_1 = get_step(src, SOUTH)
- Step_2 = get_step(src, EAST)
-
- if(9.0)
- Step_1 = get_step(src, NORTH)
- Step_2 = get_step(src, WEST)
-
- if(10.0)
- Step_1 = get_step(src, SOUTH)
- Step_2 = get_step(src, WEST)
-
- else
- if(Step_1 && Step_2)
- var/check_1 = 0
- var/check_2 = 0
- if(step_to(D, Step_1))
- check_1 = 1
- for(var/obj/border_obstacle in Step_1)
- if(border_obstacle.flags & ON_BORDER)
- if(!border_obstacle.CheckExit(D, A))
- check_1 = 0
- for(var/obj/border_obstacle in get_turf(A))
- if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
- if(!border_obstacle.CanPass(D, D.loc, 1, 0))
- check_1 = 0
-
- D.loc = src.loc
- if(step_to(D, Step_2))
- check_2 = 1
-
- for(var/obj/border_obstacle in Step_2)
- if(border_obstacle.flags & ON_BORDER)
- if(!border_obstacle.CheckExit(D, A))
- check_2 = 0
- for(var/obj/border_obstacle in get_turf(A))
- if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
- if(!border_obstacle.CanPass(D, D.loc, 1, 0))
- check_2 = 0
- if(check_1 || check_2)
- ok = 1
- else
- if(loc == src.loc)
- ok = 1
- else
- ok = 1
-
- //Now, check objects to block exit that are on the border
- for(var/obj/border_obstacle in src.loc)
- if(border_obstacle.flags & ON_BORDER)
- if(!border_obstacle.CheckExit(D, A))
- ok = 0
-
- //Next, check objects to block entry that are on the border
- for(var/obj/border_obstacle in get_turf(A))
- if((border_obstacle.flags & ON_BORDER) && (A != border_obstacle))
- if(!border_obstacle.CanPass(D, D.loc, 1, 0))
- ok = 0
-
- //del(D)
- //Garbage Collect Dummy
- D.loc = null
- D = null
- if (!( ok ))
-
- return 0
-
- return 1
-
-
/obj/item/slime_extract
name = "slime extract"
desc = "Goo extracted from a slime. Legends claim these to have \"magical powers\"."
diff --git a/code/modules/mob/living/carbon/monkey/hud.dm b/code/modules/mob/living/carbon/monkey/hud.dm
deleted file mode 100644
index 35f86d2e6b..0000000000
--- a/code/modules/mob/living/carbon/monkey/hud.dm
+++ /dev/null
@@ -1,249 +0,0 @@
-/datum/hud/proc/monkey_hud(var/ui_style='icons/mob/screen1_old.dmi')
-
- src.adding = list()
- src.other = list()
-
- var/obj/screen/using
- var/obj/screen/inventory/inv_box
-
- using = new /obj/screen()
- using.name = "act_intent"
- using.dir = SOUTHWEST
- using.icon = ui_style
- using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
- using.screen_loc = ui_acti
- using.layer = 20
- src.adding += using
- action_intent = using
-
-//intent small hud objects
- var/icon/ico
-
- ico = new(ui_style, "black")
- ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
- ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height())
- using = new /obj/screen( src )
- using.name = "help"
- using.icon = ico
- using.screen_loc = ui_acti
- using.layer = 21
- src.adding += using
- help_intent = using
-
- ico = new(ui_style, "black")
- ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
- ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height())
- using = new /obj/screen( src )
- using.name = "disarm"
- using.icon = ico
- using.screen_loc = ui_acti
- using.layer = 21
- src.adding += using
- disarm_intent = using
-
- ico = new(ui_style, "black")
- ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
- ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2)
- using = new /obj/screen( src )
- using.name = "grab"
- using.icon = ico
- using.screen_loc = ui_acti
- using.layer = 21
- src.adding += using
- grab_intent = using
-
- ico = new(ui_style, "black")
- ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
- ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
- using = new /obj/screen( src )
- using.name = "harm"
- using.icon = ico
- using.screen_loc = ui_acti
- using.layer = 21
- src.adding += using
- hurt_intent = using
-
-//end intent small hud objects
-
- using = new /obj/screen()
- using.name = "mov_intent"
- using.dir = SOUTHWEST
- using.icon = ui_style
- using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
- using.screen_loc = ui_movi
- using.layer = 20
- src.adding += using
- move_intent = using
-
- using = new /obj/screen()
- using.name = "drop"
- using.icon = ui_style
- using.icon_state = "act_drop"
- using.screen_loc = ui_drop_throw
- using.layer = 19
- src.adding += using
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "r_hand"
- inv_box.dir = WEST
- inv_box.icon = ui_style
- inv_box.icon_state = "hand_inactive"
- if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
- inv_box.icon_state = "hand_active"
- inv_box.screen_loc = ui_rhand
- inv_box.slot_id = slot_r_hand
- inv_box.layer = 19
- src.r_hand_hud_object = inv_box
- src.adding += inv_box
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "l_hand"
- inv_box.dir = EAST
- inv_box.icon = ui_style
- inv_box.icon_state = "hand_inactive"
- if(mymob && mymob.hand) //This being 1 means the left hand is in use
- inv_box.icon_state = "hand_active"
- inv_box.screen_loc = ui_lhand
- inv_box.slot_id = slot_l_hand
- inv_box.layer = 19
- src.l_hand_hud_object = inv_box
- src.adding += inv_box
-
- using = new /obj/screen()
- using.name = "hand"
- using.dir = SOUTH
- using.icon = ui_style
- using.icon_state = "hand1"
- using.screen_loc = ui_swaphand1
- using.layer = 19
- src.adding += using
-
- using = new /obj/screen()
- using.name = "hand"
- using.dir = SOUTH
- using.icon = ui_style
- using.icon_state = "hand2"
- using.screen_loc = ui_swaphand2
- using.layer = 19
- src.adding += using
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "mask"
- inv_box.dir = NORTH
- inv_box.icon = ui_style
- inv_box.icon_state = "equip"
- inv_box.screen_loc = ui_monkey_mask
- inv_box.slot_id = slot_wear_mask
- inv_box.layer = 19
- src.adding += inv_box
-
- inv_box = new /obj/screen/inventory()
- inv_box.name = "back"
- inv_box.dir = NORTHEAST
- inv_box.icon = ui_style
- inv_box.icon_state = "equip"
- inv_box.screen_loc = ui_back
- inv_box.slot_id = slot_back
- inv_box.layer = 19
- src.adding += inv_box
-
- mymob.throw_icon = new /obj/screen()
- mymob.throw_icon.icon = ui_style
- mymob.throw_icon.icon_state = "act_throw_off"
- mymob.throw_icon.name = "throw"
- mymob.throw_icon.screen_loc = ui_drop_throw
-
- mymob.oxygen = new /obj/screen()
- mymob.oxygen.icon = ui_style
- mymob.oxygen.icon_state = "oxy0"
- mymob.oxygen.name = "oxygen"
- mymob.oxygen.screen_loc = ui_oxygen
-
- mymob.pressure = new /obj/screen()
- mymob.pressure.icon = ui_style
- mymob.pressure.icon_state = "pressure0"
- mymob.pressure.name = "pressure"
- mymob.pressure.screen_loc = ui_pressure
-
- mymob.toxin = new /obj/screen()
- mymob.toxin.icon = ui_style
- mymob.toxin.icon_state = "tox0"
- mymob.toxin.name = "toxin"
- mymob.toxin.screen_loc = ui_toxin
-
- mymob.internals = new /obj/screen()
- mymob.internals.icon = ui_style
- mymob.internals.icon_state = "internal0"
- mymob.internals.name = "internal"
- mymob.internals.screen_loc = ui_internal
-
- mymob.fire = new /obj/screen()
- mymob.fire.icon = ui_style
- mymob.fire.icon_state = "fire0"
- mymob.fire.name = "fire"
- mymob.fire.screen_loc = ui_fire
-
- mymob.bodytemp = new /obj/screen()
- mymob.bodytemp.icon = ui_style
- mymob.bodytemp.icon_state = "temp1"
- mymob.bodytemp.name = "body temperature"
- mymob.bodytemp.screen_loc = ui_temp
-
- mymob.healths = new /obj/screen()
- mymob.healths.icon = ui_style
- mymob.healths.icon_state = "health0"
- mymob.healths.name = "health"
- mymob.healths.screen_loc = ui_health
-
- mymob.pullin = new /obj/screen()
- mymob.pullin.icon = ui_style
- mymob.pullin.icon_state = "pull0"
- mymob.pullin.name = "pull"
- mymob.pullin.screen_loc = ui_pull_resist
-
- mymob.blind = new /obj/screen()
- mymob.blind.icon = 'icons/mob/screen1_full.dmi'
- mymob.blind.icon_state = "blackimageoverlay"
- mymob.blind.name = " "
- mymob.blind.screen_loc = "1,1"
- mymob.blind.layer = 0
-
- mymob.flash = new /obj/screen()
- mymob.flash.icon = ui_style
- mymob.flash.icon_state = "blank"
- mymob.flash.name = "flash"
- mymob.flash.screen_loc = "1,1 to 15,15"
- mymob.flash.layer = 17
-
- mymob.zone_sel = new /obj/screen/zone_sel()
- mymob.zone_sel.icon = ui_style
- mymob.zone_sel.overlays.Cut()
- mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
-
- //Handle the gun settings buttons
- mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
- if (mymob.client)
- if (mymob.client.gun_mode) // If in aim mode, correct the sprite
- mymob.gun_setting_icon.dir = 2
- for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
- if (G.target)
- mymob.item_use_icon = new /obj/screen/gun/item(null)
- if (mymob.client.target_can_click)
- mymob.item_use_icon.dir = 1
- src.adding += mymob.item_use_icon
- mymob.gun_move_icon = new /obj/screen/gun/move(null)
- if (mymob.client.target_can_move)
- mymob.gun_move_icon.dir = 1
- mymob.gun_run_icon = new /obj/screen/gun/run(null)
- if (mymob.client.target_can_run)
- mymob.gun_run_icon.dir = 1
- src.adding += mymob.gun_run_icon
- src.adding += mymob.gun_move_icon
-
- mymob.client.screen = null
-
- mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
- mymob.client.screen += src.adding + src.other
-
- return
-
diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm
index 29c0b4defb..552f5014e0 100644
--- a/code/modules/mob/living/carbon/monkey/monkey.dm
+++ b/code/modules/mob/living/carbon/monkey/monkey.dm
@@ -175,23 +175,6 @@
//mob/living/carbon/monkey/bullet_act(var/obj/item/projectile/Proj)taken care of in living
-/mob/living/carbon/monkey/hand_p(mob/M as mob)
- if ((M.a_intent == "hurt" && !( istype(wear_mask, /obj/item/clothing/mask/muzzle) )))
- if ((prob(75) && health > 0))
- for(var/mob/O in viewers(src, null))
- O.show_message(text("\red [M.name] has bit []!", src), 1)
- var/damage = rand(1, 5)
- if (HULK in mutations) damage += 10
- adjustBruteLoss(damage)
- updatehealth()
-
- for(var/datum/disease/D in M.viruses)
- if(istype(D, /datum/disease/jungle_fever))
- contract_disease(D,1,0)
- else
- for(var/mob/O in viewers(src, null))
- O.show_message(text("\red [M.name] has attempted to bite []!", src), 1)
- return
/mob/living/carbon/monkey/attack_paw(mob/M as mob)
..()
@@ -272,10 +255,10 @@
O.show_message(text("\red [] has attempted to punch [name]!", M), 1)
else
if (M.a_intent == "grab")
- if (M == src)
+ if (M == src || anchored)
return
- var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M, M, src )
+ var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src )
M.put_in_active_hand(G)
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index c978045198..134cd56c43 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -397,3 +397,240 @@
if(update_slimes)
for(var/mob/living/carbon/slime/M in view(1,src))
M.UpdateFeed(src)
+
+/mob/living/verb/resist()
+ set name = "Resist"
+ set category = "IC"
+
+ if(!isliving(usr) || usr.next_move > world.time)
+ return
+ usr.next_move = world.time + 20
+
+ var/mob/living/L = usr
+
+ //Resisting control by an alien mind.
+ if(istype(src.loc,/mob/living/simple_animal/borer))
+ var/mob/living/simple_animal/borer/B = src.loc
+ var/mob/living/captive_brain/H = src
+
+ H << "\red You begin doggedly resisting the parasite's control (this will take approximately sixty seconds)."
+ B.host << "\red You feel the captive mind of [src] begin to resist your control."
+
+ spawn(rand(350,450)+B.host.brainloss)
+
+ if(!B || !B.controlling)
+ return
+
+ B.host.adjustBrainLoss(rand(5,10))
+ H << "\red With an immense exertion of will, you regain control of your body!"
+ B.host << "\red You feel control of the host brain ripped from your grasp, and retract your probosci before the wild neural impulses can damage you."
+ B.controlling = 0
+
+ B.ckey = B.host.ckey
+ B.host.ckey = H.ckey
+
+ H.ckey = null
+ H.name = "host brain"
+ H.real_name = "host brain"
+
+ verbs -= /mob/living/carbon/proc/release_control
+ verbs -= /mob/living/carbon/proc/punish_host
+ verbs -= /mob/living/carbon/proc/spawn_larvae
+
+ return
+
+ //resisting grabs (as if it helps anyone...)
+ if ((!( L.stat ) && L.canmove && !( L.restrained() )))
+ var/resisting = 0
+ for(var/obj/O in L.requests)
+ L.requests.Remove(O)
+ del(O)
+ resisting++
+ for(var/obj/item/weapon/grab/G in usr.grabbed_by)
+ resisting++
+ if (G.state == 1)
+ del(G)
+ else
+ if (G.state == 2)
+ if (prob(25))
+ for(var/mob/O in viewers(L, null))
+ O.show_message(text("\red [] has broken free of []'s grip!", L, G.assailant), 1)
+ del(G)
+ else
+ if (G.state == 3)
+ if (prob(5))
+ for(var/mob/O in viewers(usr, null))
+ O.show_message(text("\red [] has broken free of []'s headlock!", L, G.assailant), 1)
+ del(G)
+ if(resisting)
+ for(var/mob/O in viewers(usr, null))
+ O.show_message(text("\red [] resists!", L), 1)
+
+
+ //unbuckling yourself
+ if(L.buckled && (L.last_special <= world.time) )
+ if(iscarbon(L))
+ var/mob/living/carbon/C = L
+ if( C.handcuffed )
+ C.next_move = world.time + 100
+ C.last_special = world.time + 100
+ C << "\red You attempt to unbuckle yourself. (This will take around 2 minutes and you need to stand still)"
+ for(var/mob/O in viewers(L))
+ O.show_message("\red [usr] attempts to unbuckle themself!", 1)
+ spawn(0)
+ if(do_after(usr, 1200))
+ if(!C.buckled)
+ return
+ for(var/mob/O in viewers(C))
+ O.show_message("\red [usr] manages to unbuckle themself!", 1)
+ C << "\blue You successfully unbuckle yourself."
+ C.buckled.manual_unbuckle(C)
+ else
+ L.buckled.manual_unbuckle(L)
+
+ //Breaking out of a locker?
+ else if( src.loc && (istype(src.loc, /obj/structure/closet)) )
+ var/breakout_time = 2 //2 minutes by default
+
+ var/obj/structure/closet/C = L.loc
+ if(C.opened)
+ return //Door's open... wait, why are you in it's contents then?
+ if(istype(L.loc, /obj/structure/closet/secure_closet))
+ var/obj/structure/closet/secure_closet/SC = L.loc
+ if(!SC.locked && !SC.welded)
+ return //It's a secure closet, but isn't locked. Easily escapable from, no need to 'resist'
+ else
+ if(!C.welded)
+ return //closed but not welded...
+ // else Meh, lets just keep it at 2 minutes for now
+ // breakout_time++ //Harder to get out of welded lockers than locked lockers
+
+ //okay, so the closet is either welded or locked... resist!!!
+ usr.next_move = world.time + 100
+ L.last_special = world.time + 100
+ L << "\red You lean on the back of \the [C] and start pushing the door open. (this will take about [breakout_time] minutes)"
+ for(var/mob/O in viewers(usr.loc))
+ O.show_message("\red The [L.loc] begins to shake violently!", 1)
+
+
+ spawn(0)
+ if(do_after(usr,(breakout_time*60*10))) //minutes * 60seconds * 10deciseconds
+ if(!C || !L || L.stat != CONSCIOUS || L.loc != C || C.opened) //closet/user destroyed OR user dead/unconcious OR user no longer in closet OR closet opened
+ return
+
+ //Perform the same set of checks as above for weld and lock status to determine if there is even still a point in 'resisting'...
+ if(istype(L.loc, /obj/structure/closet/secure_closet))
+ var/obj/structure/closet/secure_closet/SC = L.loc
+ if(!SC.locked && !SC.welded)
+ return
+ else
+ if(!C.welded)
+ return
+
+ //Well then break it!
+ if(istype(usr.loc, /obj/structure/closet/secure_closet))
+ var/obj/structure/closet/secure_closet/SC = L.loc
+ SC.desc = "It appears to be broken."
+ SC.icon_state = SC.icon_off
+ flick(SC.icon_broken, SC)
+ sleep(10)
+ flick(SC.icon_broken, SC)
+ sleep(10)
+ SC.broken = 1
+ SC.locked = 0
+ usr << "\red You successfully break out!"
+ for(var/mob/O in viewers(L.loc))
+ O.show_message("\red \the [usr] successfully broke out of \the [SC]!", 1)
+ if(istype(SC.loc, /obj/structure/bigDelivery)) //Do this to prevent contents from being opened into nullspace (read: bluespace)
+ var/obj/structure/bigDelivery/BD = SC.loc
+ BD.attack_hand(usr)
+ SC.open()
+ else
+ C.welded = 0
+ usr << "\red You successfully break out!"
+ for(var/mob/O in viewers(L.loc))
+ O.show_message("\red \the [usr] successfully broke out of \the [C]!", 1)
+ if(istype(C.loc, /obj/structure/bigDelivery)) //nullspace ect.. read the comment above
+ var/obj/structure/bigDelivery/BD = C.loc
+ BD.attack_hand(usr)
+ C.open()
+
+ //breaking out of handcuffs
+ else if(iscarbon(L))
+ var/mob/living/carbon/CM = L
+ if(CM.handcuffed && CM.canmove && (CM.last_special <= world.time))
+ CM.next_move = world.time + 100
+ CM.last_special = world.time + 100
+ if(isalienadult(CM) || (HULK in usr.mutations))//Don't want to do a lot of logic gating here.
+ usr << "\red You attempt to break your handcuffs. (This will take around 5 seconds and you need to stand still)"
+ for(var/mob/O in viewers(CM))
+ O.show_message(text("\red [] is trying to break the handcuffs!", CM), 1)
+ spawn(0)
+ if(do_after(CM, 50))
+ if(!CM.handcuffed || CM.buckled)
+ return
+ for(var/mob/O in viewers(CM))
+ O.show_message(text("\red [] manages to break the handcuffs!", CM), 1)
+ CM << "\red You successfully break your handcuffs."
+ CM.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
+ del(CM.handcuffed)
+ CM.handcuffed = null
+ CM.update_inv_handcuffed()
+ else
+ var/obj/item/weapon/handcuffs/HC = CM.handcuffed
+ var/breakouttime = 1200 //A default in case you are somehow handcuffed with something that isn't an obj/item/weapon/handcuffs type
+ var/displaytime = 2 //Minutes to display in the "this will take X minutes."
+ if(istype(HC)) //If you are handcuffed with actual handcuffs... Well what do I know, maybe someone will want to handcuff you with toilet paper in the future...
+ breakouttime = HC.breakouttime
+ displaytime = breakouttime / 600 //Minutes
+ CM << "\red You attempt to remove \the [HC]. (This will take around [displaytime] minutes and you need to stand still)"
+ for(var/mob/O in viewers(CM))
+ O.show_message( "\red [usr] attempts to remove \the [HC]!", 1)
+ spawn(0)
+ if(do_after(CM, breakouttime))
+ if(!CM.handcuffed || CM.buckled)
+ return // time leniency for lag which also might make this whole thing pointless but the server
+ for(var/mob/O in viewers(CM))// lags so hard that 40s isn't lenient enough - Quarxink
+ O.show_message("\red [CM] manages to remove the handcuffs!", 1)
+ CM << "\blue You successfully remove \the [CM.handcuffed]."
+ CM.handcuffed.loc = usr.loc
+ CM.handcuffed = null
+ CM.update_inv_handcuffed()
+ else if(CM.legcuffed && CM.canmove && (CM.last_special <= world.time))
+ CM.next_move = world.time + 100
+ CM.last_special = world.time + 100
+ if(isalienadult(CM) || (HULK in usr.mutations))//Don't want to do a lot of logic gating here.
+ usr << "\red You attempt to break your legcuffs. (This will take around 5 seconds and you need to stand still)"
+ for(var/mob/O in viewers(CM))
+ O.show_message(text("\red [] is trying to break the legcuffs!", CM), 1)
+ spawn(0)
+ if(do_after(CM, 50))
+ if(!CM.legcuffed || CM.buckled)
+ return
+ for(var/mob/O in viewers(CM))
+ O.show_message(text("\red [] manages to break the legcuffs!", CM), 1)
+ CM << "\red You successfully break your legcuffs."
+ CM.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
+ del(CM.legcuffed)
+ CM.legcuffed = null
+ CM.update_inv_legcuffed()
+ else
+ var/obj/item/weapon/legcuffs/HC = CM.legcuffed
+ var/breakouttime = 1200 //A default in case you are somehow legcuffed with something that isn't an obj/item/weapon/legcuffs type
+ var/displaytime = 2 //Minutes to display in the "this will take X minutes."
+ if(istype(HC)) //If you are legcuffed with actual legcuffs... Well what do I know, maybe someone will want to legcuff you with toilet paper in the future...
+ breakouttime = HC.breakouttime
+ displaytime = breakouttime / 600 //Minutes
+ CM << "\red You attempt to remove \the [HC]. (This will take around [displaytime] minutes and you need to stand still)"
+ for(var/mob/O in viewers(CM))
+ O.show_message( "\red [usr] attempts to remove \the [HC]!", 1)
+ spawn(0)
+ if(do_after(CM, breakouttime))
+ if(!CM.legcuffed || CM.buckled)
+ return // time leniency for lag which also might make this whole thing pointless but the server
+ for(var/mob/O in viewers(CM))// lags so hard that 40s isn't lenient enough - Quarxink
+ O.show_message("\red [CM] manages to remove the legcuffs!", 1)
+ CM << "\blue You successfully remove \the [CM.legcuffed]."
+ CM.legcuffed.loc = usr.loc
+ CM.legcuffed = null
+ CM.update_inv_legcuffed()
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index cb31c9ccd4..42c4b0745b 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -429,16 +429,6 @@ var/list/ai_list = list()
O.show_message(text("\red [] took a swipe at []!", M, src), 1)
return
-/mob/living/silicon/ai/attack_hand(mob/living/carbon/M as mob)
- if(ishuman(M))//Checks to see if they are ninja
- if(istype(M:gloves, /obj/item/clothing/gloves/space_ninja)&&M:gloves:candrain&&!M:gloves:draining)
- if(M:wear_suit:s_control)
- M:wear_suit:transfer_ai("AICORE", "NINJASUIT", src, M)
- else
- M << "\red ERROR: \black Remote access channel disabled."
- return
-
-
/mob/living/silicon/ai/attack_animal(mob/living/simple_animal/M as mob)
if(M.melee_damage_upper == 0)
M.emote("[M.friendly] [src]")
diff --git a/code/modules/mob/living/silicon/ai/freelook/eye.dm b/code/modules/mob/living/silicon/ai/freelook/eye.dm
index 776ef22d8e..c82fbb7c76 100644
--- a/code/modules/mob/living/silicon/ai/freelook/eye.dm
+++ b/code/modules/mob/living/silicon/ai/freelook/eye.dm
@@ -83,18 +83,6 @@
AI.cameraFollow = null
AI.eyeobj.setLoc(src)
-/mob/living/Click()
- if(isAI(usr))
- return
- ..()
-
-/mob/living/DblClick()
- if(isAI(usr) && usr != src)
- var/mob/living/silicon/ai/A = usr
- A.ai_actual_track(src)
- return
- ..()
-
// This will move the AIEye. It will also cause lights near the eye to light up, if toggled.
// This is handled in the proc below this one.
diff --git a/code/modules/mob/living/silicon/ai/hud.dm b/code/modules/mob/living/silicon/ai/hud.dm
deleted file mode 100644
index 79ca8f172b..0000000000
--- a/code/modules/mob/living/silicon/ai/hud.dm
+++ /dev/null
@@ -1,2 +0,0 @@
-/datum/hud/proc/ai_hud()
- return
\ No newline at end of file
diff --git a/code/modules/mob/living/silicon/robot/hud.dm b/code/modules/mob/living/silicon/robot/hud.dm
deleted file mode 100644
index 8b82011bc2..0000000000
--- a/code/modules/mob/living/silicon/robot/hud.dm
+++ /dev/null
@@ -1,171 +0,0 @@
-
-/datum/hud/proc/robot_hud()
-
- src.adding = list()
- src.other = list()
-
- var/obj/screen/using
-
-
-//Radio
- using = new /obj/screen()
- using.name = "radio"
- using.dir = SOUTHWEST
- using.icon = 'icons/mob/screen1_robot.dmi'
- using.icon_state = "radio"
- using.screen_loc = ui_movi
- using.layer = 20
- src.adding += using
-
-//Module select
-
- using = new /obj/screen()
- using.name = "module1"
- using.dir = SOUTHWEST
- using.icon = 'icons/mob/screen1_robot.dmi'
- using.icon_state = "inv1"
- using.screen_loc = ui_inv1
- using.layer = 20
- src.adding += using
- mymob:inv1 = using
-
- using = new /obj/screen()
- using.name = "module2"
- using.dir = SOUTHWEST
- using.icon = 'icons/mob/screen1_robot.dmi'
- using.icon_state = "inv2"
- using.screen_loc = ui_inv2
- using.layer = 20
- src.adding += using
- mymob:inv2 = using
-
- using = new /obj/screen()
- using.name = "module3"
- using.dir = SOUTHWEST
- using.icon = 'icons/mob/screen1_robot.dmi'
- using.icon_state = "inv3"
- using.screen_loc = ui_inv3
- using.layer = 20
- src.adding += using
- mymob:inv3 = using
-
-//End of module select
-
-//Intent
- using = new /obj/screen()
- using.name = "act_intent"
- using.dir = SOUTHWEST
- using.icon = 'icons/mob/screen1_robot.dmi'
- using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
- using.screen_loc = ui_acti
- using.layer = 20
- src.adding += using
- action_intent = using
-
-//Cell
- mymob:cells = new /obj/screen()
- mymob:cells.icon = 'icons/mob/screen1_robot.dmi'
- mymob:cells.icon_state = "charge-empty"
- mymob:cells.name = "cell"
- mymob:cells.screen_loc = ui_toxin
-
-//Health
- mymob.healths = new /obj/screen()
- mymob.healths.icon = 'icons/mob/screen1_robot.dmi'
- mymob.healths.icon_state = "health0"
- mymob.healths.name = "health"
- mymob.healths.screen_loc = ui_borg_health
-
-//Installed Module
- mymob.hands = new /obj/screen()
- mymob.hands.icon = 'icons/mob/screen1_robot.dmi'
- mymob.hands.icon_state = "nomod"
- mymob.hands.name = "module"
- mymob.hands.screen_loc = ui_borg_module
-
-//Module Panel
- using = new /obj/screen()
- using.name = "panel"
- using.icon = 'icons/mob/screen1_robot.dmi'
- using.icon_state = "panel"
- using.screen_loc = ui_borg_panel
- using.layer = 19
- src.adding += using
-
-//Store
- mymob.throw_icon = new /obj/screen()
- mymob.throw_icon.icon = 'icons/mob/screen1_robot.dmi'
- mymob.throw_icon.icon_state = "store"
- mymob.throw_icon.name = "store"
- mymob.throw_icon.screen_loc = ui_borg_store
-
-//Temp
- mymob.bodytemp = new /obj/screen()
- mymob.bodytemp.icon_state = "temp0"
- mymob.bodytemp.name = "body temperature"
- mymob.bodytemp.screen_loc = ui_temp
-
-
- mymob.oxygen = new /obj/screen()
- mymob.oxygen.icon = 'icons/mob/screen1_robot.dmi'
- mymob.oxygen.icon_state = "oxy0"
- mymob.oxygen.name = "oxygen"
- mymob.oxygen.screen_loc = ui_oxygen
-
- mymob.fire = new /obj/screen()
- mymob.fire.icon = 'icons/mob/screen1_robot.dmi'
- mymob.fire.icon_state = "fire0"
- mymob.fire.name = "fire"
- mymob.fire.screen_loc = ui_fire
-
- mymob.pullin = new /obj/screen()
- mymob.pullin.icon = 'icons/mob/screen1_robot.dmi'
- mymob.pullin.icon_state = "pull0"
- mymob.pullin.name = "pull"
- mymob.pullin.screen_loc = ui_borg_pull
-
- mymob.blind = new /obj/screen()
- mymob.blind.icon = 'icons/mob/screen1_full.dmi'
- mymob.blind.icon_state = "blackimageoverlay"
- mymob.blind.name = " "
- mymob.blind.screen_loc = "1,1"
- mymob.blind.layer = 0
-
- mymob.flash = new /obj/screen()
- mymob.flash.icon = 'icons/mob/screen1_robot.dmi'
- mymob.flash.icon_state = "blank"
- mymob.flash.name = "flash"
- mymob.flash.screen_loc = "1,1 to 15,15"
- mymob.flash.layer = 17
-
- mymob.zone_sel = new /obj/screen/zone_sel()
- mymob.zone_sel.icon = 'icons/mob/screen1_robot.dmi'
- mymob.zone_sel.overlays.Cut()
- mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
-
- //Handle the gun settings buttons
- mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
- if (mymob.client)
- if (mymob.client.gun_mode) // If in aim mode, correct the sprite
- mymob.gun_setting_icon.dir = 2
- for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
- if (G.target)
- mymob.item_use_icon = new /obj/screen/gun/item(null)
- if (mymob.client.target_can_click)
- mymob.item_use_icon.dir = 1
- src.adding += mymob.item_use_icon
- mymob.gun_move_icon = new /obj/screen/gun/move(null)
- if (mymob.client.target_can_move)
- mymob.gun_move_icon.dir = 1
- mymob.gun_run_icon = new /obj/screen/gun/run(null)
- if (mymob.client.target_can_run)
- mymob.gun_run_icon.dir = 1
- src.adding += mymob.gun_run_icon
- src.adding += mymob.gun_move_icon
-
- mymob.client.screen = null
-
- mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon) //, mymob.rest, mymob.sleep, mymob.mach )
- mymob.client.screen += src.adding + src.other
-
- return
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 71f83cf03a..611243f654 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -948,11 +948,6 @@
user << "You remove \the [broken_device]."
user.put_in_active_hand(broken_device)
- if(ishuman(user))
- if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
- call(/obj/item/clothing/gloves/space_ninja/proc/drain)("CYBORG",src,user:wear_suit)
- return
-
/mob/living/silicon/robot/proc/allowed(mob/M)
//check if it doesn't require any access at all
if(check_access(null))
diff --git a/code/modules/mob/living/simple_animal/friendly/corgi.dm b/code/modules/mob/living/simple_animal/friendly/corgi.dm
index 5df52388a8..54431d86f7 100644
--- a/code/modules/mob/living/simple_animal/friendly/corgi.dm
+++ b/code/modules/mob/living/simple_animal/friendly/corgi.dm
@@ -68,7 +68,7 @@
//Removing from inventory
if(href_list["remove_inv"])
- if(get_dist(src,usr) > 1 || !(ishuman(usr) || ismonkey(usr) || isrobot(usr) || isalienadult(usr)))
+ if(!Adjacent(usr) || !(ishuman(usr) || ismonkey(usr) || isrobot(usr) || isalienadult(usr)))
return
var/remove_from = href_list["remove_inv"]
switch(remove_from)
@@ -99,7 +99,7 @@
//Adding things to inventory
else if(href_list["add_inv"])
- if(get_dist(src,usr) > 1 || !(ishuman(usr) || ismonkey(usr) || isrobot(usr) || isalienadult(usr)))
+ if(!Adjacent(usr) || !(ishuman(usr) || ismonkey(usr) || isrobot(usr) || isalienadult(usr)))
return
var/add_to = href_list["add_inv"]
if(!usr.get_active_hand())
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 06afa1e82b..890fef4ef6 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -80,39 +80,6 @@
M.show_message( message, 1, blind_message, 2)
-//This is awful
-/mob/attackby(obj/item/weapon/W as obj, mob/user as mob)
-
- //Holding a balloon will shield you from an item that is_sharp() ... cause that makes sense
- if (user.intent != "harm")
- if (istype(src.l_hand,/obj/item/latexballon) && src.l_hand:air_contents && is_sharp(W))
- return src.l_hand.attackby(W)
- if (istype(src.r_hand,/obj/item/latexballon) && src.r_hand:air_contents && is_sharp(W))
- return src.r_hand.attackby(W)
-
- //If src is grabbing someone and facing the attacker, the src will use the grabbed person as a shield
- var/shielded = 0
- if (locate(/obj/item/weapon/grab, src))
- var/mob/safe = null
- if (istype(src.l_hand, /obj/item/weapon/grab))
- var/obj/item/weapon/grab/G = src.l_hand
- if ((G.state == 3 && get_dir(src, user) == src.dir))
- safe = G.affecting
- if (istype(src.r_hand, /obj/item/weapon/grab))
- var/obj/item/weapon/grab/G = src.r_hand
- if ((G.state == 3 && get_dir(src, user) == src.dir))
- safe = G.affecting
- if (safe)
- return safe.attackby(W, user)
-
- //If the mob is not wearing a shield or otherwise is not shielded
- if ((!( shielded ) || !( W.flags ) & NOSHIELD))
- spawn( 0 )
- if (W && istype(W, /obj/item)) //The istype is necessary for things like bodybags which are structures that do not have an attack() proc.
- W.attack(src, user)
- return
- return
-
/mob/proc/findname(msg)
for(var/mob/M in mob_list)
if (M.real_name == text("[]", msg))
@@ -134,7 +101,6 @@
//This proc is called whenever someone clicks an inventory ui slot.
/mob/proc/attack_ui(slot)
var/obj/item/W = get_active_hand()
-
if(istype(W))
equip_to_slot_if_possible(W, slot)
@@ -271,7 +237,7 @@ var/list/slot_equipment_priority = list( \
/mob/verb/mode()
set name = "Activate Held Object"
- set category = "IC"
+ set category = "Object"
set src = usr
if(hand)
@@ -284,6 +250,8 @@ var/list/slot_equipment_priority = list( \
if (W)
W.attack_self(src)
update_inv_r_hand()
+ if(next_move < world.time)
+ next_move = world.time + 2
return
/*
@@ -569,9 +537,8 @@ var/list/slot_equipment_priority = list( \
..()
if(M != usr) return
if(usr == src) return
- if(get_dist(usr,src) > 1) return
+ if(!Adjacent(usr)) return
if(istype(M,/mob/living/silicon/ai)) return
- if(LinkBlocked(usr.loc,loc)) return
show_inv(usr)
diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm
index f876e5a1ce..39e1b8fce2 100644
--- a/code/modules/mob/mob_defines.dm
+++ b/code/modules/mob/mob_defines.dm
@@ -55,7 +55,6 @@
var/disabilities = 0 //Carbon
var/atom/movable/pulling = null
var/next_move = null
- var/prev_move = null
var/monkeyizing = null //Carbon
var/other = 0.0
var/hand = null
@@ -116,7 +115,6 @@
var/a_intent = "help"//Living
var/m_int = null//Living
var/m_intent = "run"//Living
- var/lastDblClick = 0
var/lastKnownIP = null
var/obj/structure/stool/bed/buckled = null//Living
var/obj/item/l_hand = null//Living
diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm
index d716e537e6..13bf68005e 100644
--- a/code/modules/mob/mob_grab.dm
+++ b/code/modules/mob/mob_grab.dm
@@ -1,94 +1,79 @@
+#define UPGRADE_COOLDOWN 40
+#define UPGRADE_KILL_TIMER 100
+
/obj/item/weapon/grab
name = "grab"
- icon = 'icons/mob/screen1.dmi'
- icon_state = "grabbed"
- var/obj/screen/grab/hud1 = null
+ flags = NOBLUDGEON
+ var/obj/screen/grab/hud = null
var/mob/affecting = null
- var/atom/movable/structure = null // if the grab is not grabbing a mob
var/mob/assailant = null
- var/state = 1.0
+ var/state = GRAB_PASSIVE
- var/killing = 0.0 // 1 = about to kill, 2 = killing
- var/kill_loc = null
-
- var/allow_upgrade = 1.0
- var/last_suffocate = 1.0
+ var/allow_upgrade = 1
+ var/last_upgrade = 0
layer = 21
- abstract = 1.0
+ abstract = 1
item_state = "nothing"
w_class = 5.0
-/obj/item/weapon/grab/proc/throw()
+/obj/item/weapon/grab/New(mob/user, mob/victim)
+ ..()
+ loc = user
+ assailant = user
+ affecting = victim
- if(affecting)
- if(state >= 2)
- var/grabee = affecting
- spawn(1)
- del(src)
- return grabee
- else
- spawn(1)
- del(src)
- return null
-
- else if(structure)
- var/grabee = structure
- spawn(1)
- del(src)
- return grabee
-
- return null
-
-
-/obj/item/weapon/grab/proc/synch()
- if(affecting)
- if(affecting.anchored)//This will prevent from grabbing people that are anchored.
- del(src)
- if (assailant.r_hand == src)
- hud1.screen_loc = ui_rhand
- else
- hud1.screen_loc = ui_lhand
- return
-
-
-/obj/item/weapon/grab/process()
- if(!assailant || (!affecting && !structure))
+ if(affecting.anchored)
del(src)
return
- if(affecting && !structure)
- if ((!( isturf(assailant.loc) ) || (!( isturf(affecting.loc) ) || (assailant.loc != affecting.loc && get_dist(assailant, affecting) > 1))))
- //SN src = null
- del(src)
- return
- else if(!affecting && structure)
- if (!isturf(structure.loc) || !isturf(structure.loc) || (assailant.loc != structure.loc && get_dist(assailant, structure) > 1))
- del(src)
- return
+ hud = new /obj/screen/grab(src)
+ hud.icon_state = "reinforce"
+ hud.name = "reinforce grab"
+ hud.master = src
- if (assailant.client)
- assailant.client.screen -= hud1
- assailant.client.screen += hud1
- if (assailant.pulling == affecting || assailant.pulling == structure)
+
+//Used by throw code to hand over the mob, instead of throwing the grab. The grab is then deleted by the throw code.
+/obj/item/weapon/grab/proc/throw()
+ if(affecting)
+ if(affecting.buckled)
+ return null
+ if(state >= GRAB_AGGRESSIVE)
+ return affecting
+ return null
+
+
+//This makes sure that the grab screen object is displayed in the correct hand.
+/obj/item/weapon/grab/proc/synch()
+ if(affecting)
+ if(assailant.r_hand == src)
+ hud.screen_loc = ui_rhand
+ else
+ hud.screen_loc = ui_lhand
+
+
+/obj/item/weapon/grab/process()
+ confirm()
+
+ if(assailant.client)
+ assailant.client.screen -= hud
+ assailant.client.screen += hud
+
+ if(assailant.pulling == affecting)
assailant.stop_pulling()
- if (structure)
- structure.loc = assailant.loc
- structure.layer = assailant.layer + 1
-
- if (state <= 2)
+ if(state <= GRAB_AGGRESSIVE)
allow_upgrade = 1
- if ((assailant.l_hand && assailant.l_hand != src && istype(assailant.l_hand, /obj/item/weapon/grab)))
+ if((assailant.l_hand && assailant.l_hand != src && istype(assailant.l_hand, /obj/item/weapon/grab)))
var/obj/item/weapon/grab/G = assailant.l_hand
- if (G.affecting != affecting)
+ if(G.affecting != affecting)
allow_upgrade = 0
- if ((assailant.r_hand && assailant.r_hand != src && istype(assailant.r_hand, /obj/item/weapon/grab)))
+ if((assailant.r_hand && assailant.r_hand != src && istype(assailant.r_hand, /obj/item/weapon/grab)))
var/obj/item/weapon/grab/G = assailant.r_hand
- if (G.affecting != affecting)
+ if(G.affecting != affecting)
allow_upgrade = 0
- if (state == 2)
+ if(state == GRAB_AGGRESSIVE)
var/h = affecting.hand
affecting.hand = 0
affecting.drop_item()
@@ -96,185 +81,124 @@
affecting.drop_item()
affecting.hand = h
for(var/obj/item/weapon/grab/G in affecting.grabbed_by)
- if (G.state == 2)
+ if(G == src) continue
+ if(G.state == GRAB_AGGRESSIVE)
allow_upgrade = 0
- if (allow_upgrade)
- hud1.icon_state = "reinforce"
+ if(allow_upgrade)
+ hud.icon_state = "reinforce"
else
- hud1.icon_state = "!reinforce"
+ hud.icon_state = "!reinforce"
else
- if (!( affecting.buckled ))
+ if(!affecting.buckled)
affecting.loc = assailant.loc
- if ((killing == 2 && state == 3))
- if(assailant.loc != kill_loc)
- assailant.visible_message("\red [assailant] lost \his tightened grip on [affecting]'s neck!")
- killing = 0
- hud1.icon_state = "disarm/kill"
- return
- if(ishuman(affecting))
- var/mob/living/carbon/human/H = affecting
- var/datum/organ/external/head = H.get_organ("head")
- head.add_autopsy_data("Strangulation", 0)
+ if(state >= GRAB_NECK)
+ affecting.Stun(5) //It will hamper your voice, being choked and all.
+ if(isliving(affecting))
+ var/mob/living/L = affecting
+ L.adjustOxyLoss(1)
- affecting.Weaken(5) // Should keep you down unless you get help.
- affecting.Stun(5) // It will hamper your voice, being choked and all.
+ if(state >= GRAB_KILL)
+ affecting.Weaken(5) //Should keep you down unless you get help.
affecting.losebreath = min(affecting.losebreath + 2, 3)
- return
-/obj/item/weapon/grab/proc/s_click(obj/screen/S as obj)
- if (!affecting)
+/obj/item/weapon/grab/proc/s_click(obj/screen/S)
+ if(!affecting)
return
- if(killing)
+ if(state == GRAB_UPGRADING)
return
- if (assailant.next_move > world.time)
+ if(assailant.next_move > world.time)
return
- if ((!( assailant.canmove ) || assailant.lying))
- //SN src = null
+ if(world.time < (last_upgrade + UPGRADE_COOLDOWN))
+ return
+ if(!assailant.canmove || assailant.lying)
del(src)
return
- switch(S.id)
- if(1.0)
- if (state >= 3)
- if (!( killing ))
- assailant.visible_message("\red [assailant] has temporarily tightened \his grip on [affecting]!")
- //Foreach goto(97)
- assailant.next_move = world.time + 10
- //affecting.stunned = max(2, affecting.stunned)
- //affecting.paralysis = max(1, affecting.paralysis)
- affecting.losebreath = min(affecting.losebreath + 1, 3)
- last_suffocate = world.time
- flick("disarm/killf", S)
+
+ last_upgrade = world.time
+
+ if(state < GRAB_AGGRESSIVE)
+ if(!allow_upgrade)
+ return
+ assailant.visible_message("[assailant] has grabbed [affecting] aggressively (now hands)!")
+ state = GRAB_AGGRESSIVE
+ icon_state = "grabbed1"
+ else
+ if(state < GRAB_NECK)
+ if(isslime(affecting))
+ assailant << "You squeeze [affecting], but nothing interesting happens."
+ return
+
+ assailant.visible_message("[assailant] has reinforced \his grip on [affecting] (now neck)!")
+ state = GRAB_NECK
+ icon_state = "grabbed+1"
+ if(!affecting.buckled)
+ affecting.loc = assailant.loc
+ affecting.attack_log += "\[[time_stamp()]\] Has had their neck grabbed by [assailant.name] ([assailant.ckey])"
+ assailant.attack_log += "\[[time_stamp()]\] Grabbed the neck of [affecting.name] ([affecting.ckey])"
+ log_attack("[assailant.name] ([assailant.ckey]) grabbed the neck of [affecting.name] ([affecting.ckey])")
+ hud.icon_state = "disarm/kill"
+ hud.name = "disarm/kill"
else
- return
-
-
-/obj/item/weapon/grab/proc/s_dbclick(obj/screen/S as obj)
- //if ((assailant.next_move > world.time && !( last_suffocate < world.time + 2 )))
- // return
-
- if (!affecting)
- return
- if ((!( assailant.canmove ) || assailant.lying))
- del(src)
- return
- if(killing)
- return
-
- switch(S.id)
- if(1.0)
- if (state < 2)
- if (!( allow_upgrade ))
- return
- assailant.visible_message("\red [assailant] has grabbed [affecting] aggressively (now hands)!")
- state = 2
- icon_state = "grabbed1"
- /*if (prob(75))
- for(var/mob/O in viewers(assailant, null))
- O.show_message(text("\red [] has grabbed [] aggressively (now hands)!", assailant, affecting), 1)
- state = 2
- icon_state = "grabbed1"
- else
- for(var/mob/O in viewers(assailant, null))
- O.show_message(text("\red [] has failed to grab [] aggressively!", assailant, affecting), 1)
- del(src)
- return*/
- else
- if (state < 3)
- if(istype(affecting, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = affecting
- if(FAT in H.mutations)
- assailant << "\blue You can't strangle [affecting] through all that fat!"
- return
-
- /*Hrm might want to add this back in
- //we should be able to strangle the Captain if he is wearing a hat
- for(var/obj/item/clothing/C in list(H.head, H.wear_suit, H.wear_mask, H.w_uniform))
- if(C.body_parts_covered & HEAD)
- assailant << "\blue You have to take off [affecting]'s [C.name] first!"
- return
-
- if(istype(H.wear_suit, /obj/item/clothing/suit/space) || istype(H.wear_suit, /obj/item/clothing/suit/armor) || istype(H.wear_suit, /obj/item/clothing/suit/bio_suit) || istype(H.wear_suit, /obj/item/clothing/suit/swat_suit))
- assailant << "\blue You can't strangle [affecting] through their suit collar!"
- return
- */
-
- if(istype(affecting, /mob/living/carbon/slime))
- assailant << "\blue You squeeze [affecting], but nothing interesting happens."
+ if(state < GRAB_UPGRADING)
+ assailant.visible_message("[assailant] starts to tighten \his grip on [affecting]'s neck!")
+ hud.icon_state = "disarm/kill1"
+ state = GRAB_UPGRADING
+ if(do_after(assailant, UPGRADE_KILL_TIMER))
+ if(state == GRAB_KILL)
return
+ if(!affecting)
+ del(src)
+ return
+ if(!assailant.canmove || assailant.lying)
+ del(src)
+ return
+ state = GRAB_KILL
+ assailant.visible_message("[assailant] has tightened \his grip on [affecting]'s neck!")
+ affecting.attack_log += "\[[time_stamp()]\] Has been strangled (kill intent) by [assailant.name] ([assailant.ckey])"
+ assailant.attack_log += "\[[time_stamp()]\] Strangled (kill intent) [affecting.name] ([affecting.ckey])"
+ log_attack("[assailant.name] ([assailant.ckey]) Strangled (kill intent) [affecting.name] ([affecting.ckey])")
- assailant.visible_message("\red [assailant] has reinforced \his grip on [affecting] (now neck)!")
- state = 3
- icon_state = "grabbed+1"
- if (!( affecting.buckled ))
- affecting.loc = assailant.loc
- affecting.attack_log += text("\[[time_stamp()]\] Has had their neck grabbed by [assailant.name] ([assailant.ckey])")
- assailant.attack_log += text("\[[time_stamp()]\] Grabbed the neck of [affecting.name] ([affecting.ckey])")
- msg_admin_attack("[assailant.name] ([assailant.ckey]) grabbed the neck of [affecting.name] ([affecting.ckey]) (JMP)")
- hud1.icon_state = "disarm/kill"
- hud1.name = "disarm/kill"
+ assailant.next_move = world.time + 10
+ affecting.losebreath += 1
else
- if (state >= 3 && !killing)
- assailant.visible_message("\red [assailant] starts to tighten \his grip on [affecting]'s neck!")
- hud1.icon_state = "disarm/kill1"
- killing = 1
- if(do_after(assailant, 40))
- if(killing == 2)
- return
- if(!affecting)
- del(src)
- return
- if ((!( assailant.canmove ) || assailant.lying))
- del(src)
- return
- killing = 2
- kill_loc = assailant.loc
- assailant.visible_message("\red [assailant] has tightened \his grip on [affecting]'s neck!")
- affecting.attack_log += text("\[[time_stamp()]\] Has been strangled (kill intent) by [assailant.name] ([assailant.ckey])")
- assailant.attack_log += text("\[[time_stamp()]\] Strangled (kill intent) [affecting.name] ([affecting.ckey])")
- msg_admin_attack("[assailant.name] ([assailant.ckey]) Strangled (kill intent) [affecting.name] ([affecting.ckey]) (JMP)")
-
- assailant.next_move = world.time + 10
- affecting.losebreath += 1
- else
- assailant.visible_message("\red [assailant] was unable to tighten \his grip on [affecting]'s neck!")
- killing = 0
- hud1.icon_state = "disarm/kill"
- return
+ assailant.visible_message("[assailant] was unable to tighten \his grip on [affecting]'s neck!")
+ hud.icon_state = "disarm/kill"
+ state = GRAB_NECK
-/obj/item/weapon/grab/New(var/location, mob/user as mob, mob/affected as mob)
- ..()
- src.loc = location
- src.assailant = user
- src.affecting = affected
- // HUD
- hud1 = new /obj/screen/grab( src )
- hud1.icon_state = "reinforce"
- hud1.name = "Reinforce Grab"
- hud1.id = 1
- hud1.master = src
- return
+//This is used to make sure the victim hasn't managed to yackety sax away before using the grab.
+/obj/item/weapon/grab/proc/confirm()
+ if(!assailant || !affecting)
+ del(src)
+ return 0
+
+ if(affecting)
+ if(!isturf(assailant.loc) || ( !isturf(affecting.loc) || assailant.loc != affecting.loc && get_dist(assailant, affecting) > 1) )
+ del(src)
+ return 0
+
+ return 1
-/obj/item/weapon/grab/attack(mob/M as mob, mob/user as mob)
- if(!affecting) return
- if (M == affecting)
- if (state < 3)
- s_dbclick(hud1)
- else
- s_click(hud1)
+/obj/item/weapon/grab/attack(mob/M, mob/user)
+ if(!affecting)
return
- if(M == assailant && state >= 2)
- if( ( ishuman(user) && (FAT in user.mutations) && ismonkey(affecting) ) || ( isalien(user) && iscarbon(affecting) ) )
+
+ if(M == affecting)
+ s_click(hud)
+ return
+
+ if(M == assailant && state >= GRAB_AGGRESSIVE)
+ if( (ishuman(user) && (FAT in user.mutations) && ismonkey(affecting) ) || ( isalien(user) && iscarbon(affecting) ) )
var/mob/living/carbon/attacker = user
- user.visible_message("\red [user] is attempting to devour [affecting]!")
+ user.visible_message("[user] is attempting to devour [affecting]!")
if(istype(user, /mob/living/carbon/alien/humanoid/hunter))
if(!do_mob(user, affecting)||!do_after(user, 30)) return
else
if(!do_mob(user, affecting)||!do_after(user, 100)) return
- user.visible_message("\red [user] devours [affecting]!")
+ user.visible_message("[user] devours [affecting]!")
affecting.loc = user
attacker.stomach_contents.Add(affecting)
del(src)
@@ -282,10 +206,7 @@
/obj/item/weapon/grab/dropped()
del(src)
- return
-
/obj/item/weapon/grab/Del()
- del(hud1)
+ del(hud)
..()
- return
diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm
index 29b2bfeac3..314a4026ab 100644
--- a/code/modules/mob/mob_helpers.dm
+++ b/code/modules/mob/mob_helpers.dm
@@ -358,57 +358,6 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
return 0
-//Triggered when F12 is pressed (Unless someone changed something in the DMF)
-/mob/verb/button_pressed_F12()
- set name = "F12"
- set hidden = 1
-
- if(hud_used)
- if(ishuman(src))
- if(!src.client) return
-
- if(hud_used.hud_shown)
- hud_used.hud_shown = 0
- if(src.hud_used.adding)
- src.client.screen -= src.hud_used.adding
- if(src.hud_used.other)
- src.client.screen -= src.hud_used.other
- if(src.hud_used.hotkeybuttons)
- src.client.screen -= src.hud_used.hotkeybuttons
- if(src.hud_used.item_action_list)
- src.client.screen -= src.hud_used.item_action_list
-
- //Due to some poor coding some things need special treatment:
- //These ones are a part of 'adding', 'other' or 'hotkeybuttons' but we want them to stay
- src.client.screen += src.hud_used.l_hand_hud_object //we want the hands to be visible
- src.client.screen += src.hud_used.r_hand_hud_object //we want the hands to be visible
- src.client.screen += src.hud_used.action_intent //we want the intent swticher visible
- src.hud_used.action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
-
- //These ones are not a part of 'adding', 'other' or 'hotkeybuttons' but we want them gone.
- src.client.screen -= src.zone_sel //zone_sel is a mob variable for some reason.
-
- else
- hud_used.hud_shown = 1
- if(src.hud_used.adding)
- src.client.screen += src.hud_used.adding
- if(src.hud_used.other && src.hud_used.inventory_shown)
- src.client.screen += src.hud_used.other
- if(src.hud_used.hotkeybuttons && !src.hud_used.hotkey_ui_hidden)
- src.client.screen += src.hud_used.hotkeybuttons
-
-
- src.hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position
- src.client.screen += src.zone_sel //This one is a special snowflake
-
- hud_used.hidden_inventory_update()
- hud_used.persistant_inventory_update()
- update_action_buttons()
- else
- usr << "\red Inventory hiding is currently only supported for human mobs, sorry."
- else
- usr << "\red This mob type does not use a HUD."
-
//converts intent-strings into numbers and back
var/list/intents = list("help","disarm","grab","hurt")
/proc/intent_numeric(argument)
diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm
index 7a618ac654..81b0646380 100644
--- a/code/modules/mob/mob_movement.dm
+++ b/code/modules/mob/mob_movement.dm
@@ -176,7 +176,7 @@
/atom/movable/Move(NewLoc, direct)
- if (direct & direct - 1)
+ if (direct & (direct - 1))
if (direct & 1)
if (direct & 4)
if (step(src, NORTH))
@@ -276,9 +276,12 @@
if(mob.restrained())//Why being pulled while cuffed prevents you from moving
for(var/mob/M in range(mob, 1))
- if(M.pulling == mob && !M.restrained() && M.stat == 0 && M.canmove)
- src << "\blue You're restrained! You can't move!"
- return 0
+ if(M.pulling == mob)
+ if(!M.restrained() && M.stat == 0 && M.canmove && mob.Adjacent(M))
+ src << "\blue You're restrained! You can't move!"
+ return 0
+ else
+ M.stop_pulling()
if(mob.pinned.len)
src << "\blue You're pinned to a wall by [mob.pinned[1]]!"
diff --git a/code/modules/mob/new_player/hud.dm b/code/modules/mob/new_player/hud.dm
deleted file mode 100644
index 67af01d645..0000000000
--- a/code/modules/mob/new_player/hud.dm
+++ /dev/null
@@ -1,3 +0,0 @@
-
-/datum/hud/proc/unplayer_hud()
- return
\ No newline at end of file
diff --git a/code/modules/mob/screen.dm b/code/modules/mob/screen.dm
deleted file mode 100644
index 7e65b4048e..0000000000
--- a/code/modules/mob/screen.dm
+++ /dev/null
@@ -1,834 +0,0 @@
-/obj/screen
- name = ""
- icon = 'icons/mob/screen1.dmi'
- layer = 20.0
- unacidable = 1
- var/id = 0.0
- var/obj/master
- var/gun_click_time = -100 //I'm lazy.
-
-/obj/screen/text
- icon = null
- icon_state = null
- mouse_opacity = 0
- screen_loc = "CENTER-7,CENTER-7"
- maptext_height = 480
- maptext_width = 480
-
-/obj/screen/inventory
- var/slot_id
-
-/obj/screen/close
- name = "close"
- master = null
-
-/obj/screen/close/DblClick()
- if (src.master)
- src.master:close(usr)
- return
-
-/obj/screen/item_action
- var/obj/item/owner
-
-/obj/screen/item_action/DblClick()
- if(!usr || !owner)
- return
-
- if(usr.stat || usr.restrained() || usr.stunned || usr.lying)
- return
-
- if(!(owner in usr))
- return
-
- spawn()
- owner.ui_action_click()
- switch(owner.icon_action_button)
- if("action_hardhat", "action_welding")
- usr.update_inv_head()
- if("action_welding_g")
- usr.update_inv_glasses()
- if("action_jetpack")
- usr.update_inv_back()
-
-//This is the proc used to update all the action buttons. It just returns for all mob types except humans.
-/mob/proc/update_action_buttons()
- return
-
-/obj/screen/grab
- name = "grab"
- master = null
-
-/obj/screen/storage
- name = "storage"
- master = null
-
-/obj/screen/storage/attack_hand(mob/user)
- if(master)
- var/obj/item/I = user.get_active_hand()
- if(I)
- master.attackby(I, user)
-
-/obj/screen/zone_sel
- name = "Damage Zone"
- icon = 'icons/mob/screen1.dmi'
- icon_state = "zone_sel"
- var/selecting = "chest"
- screen_loc = ui_zonesel
-
-/obj/screen/gun
- name = "gun"
- icon = 'icons/mob/screen1.dmi'
- master = null
- dir = 2
-
- move
- name = "Allow Walking"
- icon_state = "no_walk0"
- screen_loc = ui_gun2
-
- run
- name = "Allow Running"
- icon_state = "no_run0"
- screen_loc = ui_gun3
-
- item
- name = "Allow Item Use"
- icon_state = "no_item0"
- screen_loc = ui_gun1
-
- mode
- name = "Toggle Gun Mode"
- icon_state = "gun0"
- screen_loc = ui_gun_select
- //dir = 1
-
-
-/obj/screen/zone_sel/MouseDown(location, control,params)
- // Changes because of 4.0
- var/list/PL = params2list(params)
- var/icon_x = text2num(PL["icon-x"])
- var/icon_y = text2num(PL["icon-y"])
-
- if (icon_y < 2)
- return
- else if (icon_y < 5)
- if ((icon_x > 9 && icon_x < 23))
- if (icon_x < 16)
- selecting = "r_foot"
- else
- selecting = "l_foot"
- else if (icon_y < 11)
- if ((icon_x > 11 && icon_x < 21))
- if (icon_x < 16)
- selecting = "r_leg"
- else
- selecting = "l_leg"
- else if (icon_y < 12)
- if ((icon_x > 11 && icon_x < 21))
- if (icon_x < 14)
- selecting = "r_leg"
- else if (icon_x < 19)
- selecting = "groin"
- else
- selecting = "l_leg"
- else
- return
- else if (icon_y < 13)
- if ((icon_x > 7 && icon_x < 25))
- if (icon_x < 12)
- selecting = "r_hand"
- else if (icon_x < 13)
- selecting = "r_leg"
- else if (icon_x < 20)
- selecting = "groin"
- else if (icon_x < 21)
- selecting = "l_leg"
- else
- selecting = "l_hand"
- else
- return
- else if (icon_y < 14)
- if ((icon_x > 7 && icon_x < 25))
- if (icon_x < 12)
- selecting = "r_hand"
- else if (icon_x < 21)
- selecting = "groin"
- else
- selecting = "l_hand"
- else
- return
- else if (icon_y < 16)
- if ((icon_x > 7 && icon_x < 25))
- if (icon_x < 13)
- selecting = "r_hand"
- else if (icon_x < 20)
- selecting = "chest"
- else
- selecting = "l_hand"
- else
- return
- else if (icon_y < 23)
- if ((icon_x > 7 && icon_x < 25))
- if (icon_x < 12)
- selecting = "r_arm"
- else if (icon_x < 21)
- selecting = "chest"
- else
- selecting = "l_arm"
- else
- return
- else if (icon_y < 24)
- if ((icon_x > 11 && icon_x < 21))
- selecting = "chest"
- else
- return
- else if (icon_y < 25)
- if ((icon_x > 11 && icon_x < 21))
- if (icon_x < 16)
- selecting = "head"
- else if (icon_x < 17)
- selecting = "mouth"
- else
- selecting = "head"
- else
- return
- else if (icon_y < 26)
- if ((icon_x > 11 && icon_x < 21))
- if (icon_x < 15)
- selecting = "head"
- else if (icon_x < 18)
- selecting = "mouth"
- else
- selecting = "head"
- else
- return
- else if (icon_y < 27)
- if ((icon_x > 11 && icon_x < 21))
- if (icon_x < 15)
- selecting = "head"
- else if (icon_x < 16)
- selecting = "eyes"
- else if (icon_x < 17)
- selecting = "mouth"
- else if (icon_x < 18)
- selecting = "eyes"
- else
- selecting = "head"
- else
- return
- else if (icon_y < 28)
- if ((icon_x > 11 && icon_x < 21))
- if (icon_x < 14)
- selecting = "head"
- else if (icon_x < 19)
- selecting = "eyes"
- else
- selecting = "head"
- else
- return
- else if (icon_y < 29)
- if ((icon_x > 11 && icon_x < 21))
- if (icon_x < 15)
- selecting = "head"
- else if (icon_x < 16)
- selecting = "eyes"
- else if (icon_x < 17)
- selecting = "head"
- else if (icon_x < 18)
- selecting = "eyes"
- else
- selecting = "head"
- else
- return
- else if (icon_y < 31)
- if ((icon_x > 11 && icon_x < 21))
- selecting = "head"
- else
- return
- else
- return
-
- overlays.Cut()
- overlays += image('icons/mob/zone_sel.dmi', "[selecting]")
-
- return
-
-/obj/screen/grab/Click()
- master:s_click(src)
- return
-
-/obj/screen/grab/DblClick()
- master:s_dbclick(src)
- return
-
-/obj/screen/grab/attack_hand()
- return
-
-/obj/screen/grab/attackby()
- return
-
-/*
-/obj/screen/MouseEntered(object,location,control,params)
- if(!ishuman(usr) && !istype(usr,/mob/living/carbon/alien/humanoid) && !islarva(usr) && !ismonkey(usr))
- return
- switch(name)
- if("act_intent")
- if(ishuman(usr) || istype(usr,/mob/living/carbon/alien/humanoid) || islarva(usr))
- usr.hud_used.action_intent.icon_state = "intent_[usr.a_intent]"
-
-/obj/screen/MouseExited(object,location,control,params)
- if(!ishuman(usr) && !istype(usr,/mob/living/carbon/alien/humanoid) && !islarva(usr) && !ismonkey(usr))
- return
- switch(name)
- if("act_intent")
- if(ishuman(usr) || istype(usr,/mob/living/carbon/alien/humanoid) || islarva(usr))
- var/intent = usr.a_intent
- if(intent == "hurt")
- intent = "harm" //hurt and harm have different sprite names for some reason.
- usr.hud_used.action_intent.icon_state = "[intent]"
-*/
-
-/obj/screen/Click(location, control, params)
- if(!usr) return
- switch(name)
- if("map")
- usr.clearmap()
-
- if("other")
- if (usr.hud_used.inventory_shown)
- usr.hud_used.inventory_shown = 0
- usr.client.screen -= usr.hud_used.other
- else
- usr.hud_used.inventory_shown = 1
- usr.client.screen += usr.hud_used.other
-
- usr.hud_used.hidden_inventory_update()
-
- if("equip")
- usr.quick_equip()
-
- if("resist")
- if(isliving(usr))
- var/mob/living/L = usr
- L.resist()
-
- if("maprefresh")
- var/obj/machinery/computer/security/seccomp = usr.machine
-
- if(seccomp!=null)
- seccomp.drawmap(usr)
- else
- usr.clearmap()
-
- if("mov_intent")
- if(iscarbon(usr))
- var/mob/living/carbon/C = usr
- if(C.legcuffed)
- C << "\red You are legcuffed! You cannot run until you get your cuffs removed!"
- C.m_intent = "walk" //Just incase
- C.hud_used.move_intent.icon_state = "walking"
- return
- switch(usr.m_intent)
- if("run")
- usr.m_intent = "walk"
- usr.hud_used.move_intent.icon_state = "walking"
- if("walk")
- usr.m_intent = "run"
- usr.hud_used.move_intent.icon_state = "running"
- if(istype(usr,/mob/living/carbon/alien/humanoid)) usr.update_icons()
- if("m_intent")
- if (!( usr.m_int ))
- switch(usr.m_intent)
- if("run")
- usr.m_int = "13,14"
- if("walk")
- usr.m_int = "14,14"
- if("face")
- usr.m_int = "15,14"
- else
- usr.m_int = null
- if("walk")
- usr.m_intent = "walk"
- usr.m_int = "14,14"
- if("face")
- usr.m_intent = "face"
- usr.m_int = "15,14"
- if("run")
- usr.m_intent = "run"
- usr.m_int = "13,14"
- if("Reset Machine")
- usr.unset_machine()
- if("internal")
- if (( !usr.stat && !usr.stunned && !usr.paralysis && !usr.restrained() ))
- if (usr.internal)
- usr.internal = null
- usr << "\blue No longer running on internals."
- if (usr.internals)
- usr.internals.icon_state = "internal0"
- else
- if(ishuman(usr))
- if (!( istype(usr.wear_mask, /obj/item/clothing/mask) ))
- usr << "\red You are not wearing a mask"
- return
- else
- if (ishuman(usr) && istype(usr:s_store, /obj/item/weapon/tank))
- usr << "\blue You are now running on internals from the [usr:s_store] on your [usr:wear_suit]."
- usr.internal = usr:s_store
- else if (ishuman(usr) && istype(usr:belt, /obj/item/weapon/tank))
- usr << "\blue You are now running on internals from the [usr:belt] on your belt."
- usr.internal = usr:belt
- else if (istype(usr:l_store, /obj/item/weapon/tank))
- usr << "\blue You are now running on internals from the [usr:l_store] in your left pocket."
- usr.internal = usr:l_store
- else if (istype(usr:r_store, /obj/item/weapon/tank))
- usr << "\blue You are now running on internals from the [usr:r_store] in your right pocket."
- usr.internal = usr:r_store
- else if (istype(usr.back, /obj/item/weapon/tank))
- usr << "\blue You are now running on internals from the [usr.back] on your back."
- usr.internal = usr.back
- else if (istype(usr.l_hand, /obj/item/weapon/tank))
- usr << "\blue You are now running on internals from the [usr.l_hand] on your left hand."
- usr.internal = usr.l_hand
- else if (istype(usr.r_hand, /obj/item/weapon/tank))
- usr << "\blue You are now running on internals from the [usr.r_hand] on your right hand."
- usr.internal = usr.r_hand
- if (usr.internal)
- //for(var/mob/M in viewers(usr, 1))
- // M.show_message(text("[] is now running on internals.", usr), 1)
- if (usr.internals)
- usr.internals.icon_state = "internal1"
- else
- usr << "\blue You don't have an oxygen tank."
- if("act_intent")
- if(issilicon(usr))
- if(usr.a_intent == "help")
- usr.a_intent = "hurt"
- usr.hud_used.action_intent.icon_state = "harm"
- else
- usr.a_intent = "help"
- usr.hud_used.action_intent.icon_state = "help"
- else
- usr.a_intent_change("right")
- if("help")
- usr.a_intent = "help"
- usr.hud_used.action_intent.icon_state = "intent_help"
- if("harm")
- usr.a_intent = "hurt"
- usr.hud_used.action_intent.icon_state = "intent_hurt"
- if("grab")
- usr.a_intent = "grab"
- usr.hud_used.action_intent.icon_state = "intent_grab"
- if("disarm")
- usr.a_intent = "disarm"
- usr.hud_used.action_intent.icon_state = "intent_disarm"
- if("pull")
- usr.stop_pulling()
- if("throw")
- if (!usr.stat && isturf(usr.loc) && !usr.restrained())
- usr:toggle_throw_mode()
- if("drop")
- usr.drop_item_v()
- if("swap")
- usr:swap_hand()
- if("hand")
- usr:swap_hand()
- if("r_hand")
- if(iscarbon(usr))
- var/mob/living/carbon/C = usr
- C.activate_hand("r")
- if("l_hand")
- if(iscarbon(usr))
- var/mob/living/carbon/C = usr
- C.activate_hand("l")
- if("module")
- if(issilicon(usr))
- if(usr:module)
- return
- usr:pick_module()
-
- if("radio")
- if(issilicon(usr))
- usr:radio_menu()
- if("panel")
- if(issilicon(usr))
- usr:installed_modules()
-
- if("store")
- if(issilicon(usr))
- usr:uneq_active()
-
- if("module1")
- if(usr:module_state_1)
- if(usr:module_active != usr:module_state_1)
- usr:inv1.icon_state = "inv1 +a"
- usr:inv2.icon_state = "inv2"
- usr:inv3.icon_state = "inv3"
- usr:module_active = usr:module_state_1
- else
- usr:inv1.icon_state = "inv1"
- usr:module_active = null
-
- if("module2")
- if(usr:module_state_2)
- if(usr:module_active != usr:module_state_2)
- usr:inv1.icon_state = "inv1"
- usr:inv2.icon_state = "inv2 +a"
- usr:inv3.icon_state = "inv3"
- usr:module_active = usr:module_state_2
- else
- usr:inv2.icon_state = "inv2"
- usr:module_active = null
-
- if("module3")
- if(usr:module_state_3)
- if(usr:module_active != usr:module_state_3)
- usr:inv1.icon_state = "inv1"
- usr:inv2.icon_state = "inv2"
- usr:inv3.icon_state = "inv3 +a"
- usr:module_active = usr:module_state_3
- else
- usr:inv3.icon_state = "inv3"
- usr:module_active = null
-
- if("Allow Walking")
- if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
- return
- if(!istype(usr.equipped(),/obj/item/weapon/gun))
- usr << "You need your gun in your active hand to do that!"
- return
- usr.client.AllowTargetMove()
- gun_click_time = world.time
-
- if("Disallow Walking")
- if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
- return
- if(!istype(usr.equipped(),/obj/item/weapon/gun))
- usr << "You need your gun in your active hand to do that!"
- return
- usr.client.AllowTargetMove()
- gun_click_time = world.time
-
- if("Allow Running")
- if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
- return
- if(!istype(usr.equipped(),/obj/item/weapon/gun))
- usr << "You need your gun in your active hand to do that!"
- return
- usr.client.AllowTargetRun()
- gun_click_time = world.time
-
- if("Disallow Running")
- if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
- return
- if(!istype(usr.equipped(),/obj/item/weapon/gun))
- usr << "You need your gun in your active hand to do that!"
- return
- usr.client.AllowTargetRun()
- gun_click_time = world.time
-
- if("Allow Item Use")
- if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
- return
- if(!istype(usr.equipped(),/obj/item/weapon/gun))
- usr << "You need your gun in your active hand to do that!"
- return
- usr.client.AllowTargetClick()
- gun_click_time = world.time
-
-
- if("Disallow Item Use")
- if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
- return
- if(!istype(usr.equipped(),/obj/item/weapon/gun))
- usr << "You need your gun in your active hand to do that!"
- return
- usr.client.AllowTargetClick()
- gun_click_time = world.time
-
- if("Toggle Gun Mode")
- usr.client.ToggleGunMode()
-
- else
- DblClick()
- return
-
-/obj/screen/inventory/attack_hand(mob/user as mob)
- user.attack_ui(slot_id)
- user.update_inv_l_hand(0)
- user.update_inv_r_hand()
- return
-
-/obj/screen/inventory/attack_paw(mob/user as mob)
- user.attack_ui(slot_id)
- user.update_inv_l_hand(0)
- user.update_inv_r_hand()
- return
-
-
-/mob/living/carbon/verb/mob_sleep()
- set name = "Sleep"
- set category = "IC"
-
- if(usr.sleeping)
- usr << "\red You are already sleeping"
- return
- else
- if(alert(src,"You sure you want to sleep for a while?","Sleep","Yes","No") == "Yes")
- usr.sleeping = 20 //Short nap
-
-/mob/living/verb/lay_down()
- set name = "Rest"
- set category = "IC"
-
- resting = !resting
- src << "\blue You are now [resting ? "resting" : "getting up"]"
-
-/mob/verb/quick_equip()
- set name = "quick-equip"
- set hidden = 1
- var/obj/item/I = usr.get_active_hand()
- if(!I)
- usr << "\blue You are not holding anything to equip."
- return
- if(ishuman(usr))
- var/mob/living/carbon/human/H = usr
- H.equip_to_appropriate_slot(I)
- H.update_inv_l_hand(0)
- H.update_inv_r_hand()
-
-/mob/living/verb/resist()
- set name = "Resist"
- set category = "IC"
-
- if(!isliving(usr) || usr.next_move > world.time)
- return
- usr.next_move = world.time + 20
-
- var/mob/living/L = usr
-
- //Resisting control by an alien mind.
- if(istype(src.loc,/mob/living/simple_animal/borer))
- var/mob/living/simple_animal/borer/B = src.loc
- var/mob/living/captive_brain/H = src
-
- H << "\red You begin doggedly resisting the parasite's control (this will take approximately sixty seconds)."
- B.host << "\red You feel the captive mind of [src] begin to resist your control."
-
- spawn(rand(350,450)+B.host.brainloss)
-
- if(!B || !B.controlling)
- return
-
- B.host.adjustBrainLoss(rand(5,10))
- H << "\red With an immense exertion of will, you regain control of your body!"
- B.host << "\red You feel control of the host brain ripped from your grasp, and retract your probosci before the wild neural impulses can damage you."
- B.controlling = 0
-
- B.ckey = B.host.ckey
- B.host.ckey = H.ckey
-
- H.ckey = null
- H.name = "host brain"
- H.real_name = "host brain"
-
- verbs -= /mob/living/carbon/proc/release_control
- verbs -= /mob/living/carbon/proc/punish_host
- verbs -= /mob/living/carbon/proc/spawn_larvae
-
- return
-
- //resisting grabs (as if it helps anyone...)
- if ((!( L.stat ) && L.canmove && !( L.restrained() )))
- var/resisting = 0
- for(var/obj/O in L.requests)
- L.requests.Remove(O)
- del(O)
- resisting++
- for(var/obj/item/weapon/grab/G in usr.grabbed_by)
- resisting++
- if (G.state == 1)
- del(G)
- else
- if (G.state == 2)
- if (prob(25))
- for(var/mob/O in viewers(L, null))
- O.show_message(text("\red [] has broken free of []'s grip!", L, G.assailant), 1)
- del(G)
- else
- if (G.state == 3)
- if (prob(5))
- for(var/mob/O in viewers(usr, null))
- O.show_message(text("\red [] has broken free of []'s headlock!", L, G.assailant), 1)
- del(G)
- if(resisting)
- for(var/mob/O in viewers(usr, null))
- O.show_message(text("\red [] resists!", L), 1)
-
-
- //unbuckling yourself
- if(L.buckled && (L.last_special <= world.time) )
- if(iscarbon(L))
- var/mob/living/carbon/C = L
- if( C.handcuffed )
- C.next_move = world.time + 100
- C.last_special = world.time + 100
- C << "\red You attempt to unbuckle yourself. (This will take around 2 minutes and you need to stand still)"
- for(var/mob/O in viewers(L))
- O.show_message("\red [usr] attempts to unbuckle themself!", 1)
- spawn(0)
- if(do_after(usr, 1200))
- if(!C.buckled)
- return
- for(var/mob/O in viewers(C))
- O.show_message("\red [usr] manages to unbuckle themself!", 1)
- C << "\blue You successfully unbuckle yourself."
- C.buckled.manual_unbuckle(C)
- else
- L.buckled.manual_unbuckle(L)
-
- //Breaking out of a locker?
- else if( src.loc && (istype(src.loc, /obj/structure/closet)) )
- var/breakout_time = 2 //2 minutes by default
-
- var/obj/structure/closet/C = L.loc
- if(C.opened)
- return //Door's open... wait, why are you in it's contents then?
- if(istype(L.loc, /obj/structure/closet/secure_closet))
- var/obj/structure/closet/secure_closet/SC = L.loc
- if(!SC.locked && !SC.welded)
- return //It's a secure closet, but isn't locked. Easily escapable from, no need to 'resist'
- else
- if(!C.welded)
- return //closed but not welded...
- // else Meh, lets just keep it at 2 minutes for now
- // breakout_time++ //Harder to get out of welded lockers than locked lockers
-
- //okay, so the closet is either welded or locked... resist!!!
- usr.next_move = world.time + 100
- L.last_special = world.time + 100
- L << "\red You lean on the back of \the [C] and start pushing the door open. (this will take about [breakout_time] minutes)"
- for(var/mob/O in viewers(usr.loc))
- O.show_message("\red The [L.loc] begins to shake violently!", 1)
-
-
- spawn(0)
- if(do_after(usr,(breakout_time*60*10))) //minutes * 60seconds * 10deciseconds
- if(!C || !L || L.stat != CONSCIOUS || L.loc != C || C.opened) //closet/user destroyed OR user dead/unconcious OR user no longer in closet OR closet opened
- return
-
- //Perform the same set of checks as above for weld and lock status to determine if there is even still a point in 'resisting'...
- if(istype(L.loc, /obj/structure/closet/secure_closet))
- var/obj/structure/closet/secure_closet/SC = L.loc
- if(!SC.locked && !SC.welded)
- return
- else
- if(!C.welded)
- return
-
- //Well then break it!
- if(istype(usr.loc, /obj/structure/closet/secure_closet))
- var/obj/structure/closet/secure_closet/SC = L.loc
- SC.desc = "It appears to be broken."
- SC.icon_state = SC.icon_off
- flick(SC.icon_broken, SC)
- sleep(10)
- flick(SC.icon_broken, SC)
- sleep(10)
- SC.broken = 1
- SC.locked = 0
- usr << "\red You successfully break out!"
- for(var/mob/O in viewers(L.loc))
- O.show_message("\red \the [usr] successfully broke out of \the [SC]!", 1)
- if(istype(SC.loc, /obj/structure/bigDelivery)) //Do this to prevent contents from being opened into nullspace (read: bluespace)
- var/obj/structure/bigDelivery/BD = SC.loc
- BD.attack_hand(usr)
- SC.open()
- else
- C.welded = 0
- usr << "\red You successfully break out!"
- for(var/mob/O in viewers(L.loc))
- O.show_message("\red \the [usr] successfully broke out of \the [C]!", 1)
- if(istype(C.loc, /obj/structure/bigDelivery)) //nullspace ect.. read the comment above
- var/obj/structure/bigDelivery/BD = C.loc
- BD.attack_hand(usr)
- C.open()
-
- //breaking out of handcuffs
- else if(iscarbon(L))
- var/mob/living/carbon/CM = L
- if(CM.handcuffed && CM.canmove && (CM.last_special <= world.time))
- CM.next_move = world.time + 100
- CM.last_special = world.time + 100
- if(isalienadult(CM) || (HULK in usr.mutations))//Don't want to do a lot of logic gating here.
- usr << "\red You attempt to break your handcuffs. (This will take around 5 seconds and you need to stand still)"
- for(var/mob/O in viewers(CM))
- O.show_message(text("\red [] is trying to break the handcuffs!", CM), 1)
- spawn(0)
- if(do_after(CM, 50))
- if(!CM.handcuffed || CM.buckled)
- return
- for(var/mob/O in viewers(CM))
- O.show_message(text("\red [] manages to break the handcuffs!", CM), 1)
- CM << "\red You successfully break your handcuffs."
- CM.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
- del(CM.handcuffed)
- CM.handcuffed = null
- CM.update_inv_handcuffed()
- else
- var/obj/item/weapon/handcuffs/HC = CM.handcuffed
- var/breakouttime = 1200 //A default in case you are somehow handcuffed with something that isn't an obj/item/weapon/handcuffs type
- var/displaytime = 2 //Minutes to display in the "this will take X minutes."
- if(istype(HC)) //If you are handcuffed with actual handcuffs... Well what do I know, maybe someone will want to handcuff you with toilet paper in the future...
- breakouttime = HC.breakouttime
- displaytime = breakouttime / 600 //Minutes
- CM << "\red You attempt to remove \the [HC]. (This will take around [displaytime] minutes and you need to stand still)"
- for(var/mob/O in viewers(CM))
- O.show_message( "\red [usr] attempts to remove \the [HC]!", 1)
- spawn(0)
- if(do_after(CM, breakouttime))
- if(!CM.handcuffed || CM.buckled)
- return // time leniency for lag which also might make this whole thing pointless but the server
- for(var/mob/O in viewers(CM))// lags so hard that 40s isn't lenient enough - Quarxink
- O.show_message("\red [CM] manages to remove the handcuffs!", 1)
- CM << "\blue You successfully remove \the [CM.handcuffed]."
- CM.handcuffed.loc = usr.loc
- CM.handcuffed = null
- CM.update_inv_handcuffed()
- else if(CM.legcuffed && CM.canmove && (CM.last_special <= world.time))
- CM.next_move = world.time + 100
- CM.last_special = world.time + 100
- if(isalienadult(CM) || (HULK in usr.mutations))//Don't want to do a lot of logic gating here.
- usr << "\red You attempt to break your legcuffs. (This will take around 5 seconds and you need to stand still)"
- for(var/mob/O in viewers(CM))
- O.show_message(text("\red [] is trying to break the legcuffs!", CM), 1)
- spawn(0)
- if(do_after(CM, 50))
- if(!CM.legcuffed || CM.buckled)
- return
- for(var/mob/O in viewers(CM))
- O.show_message(text("\red [] manages to break the legcuffs!", CM), 1)
- CM << "\red You successfully break your legcuffs."
- CM.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
- del(CM.legcuffed)
- CM.legcuffed = null
- CM.update_inv_legcuffed()
- else
- var/obj/item/weapon/legcuffs/HC = CM.legcuffed
- var/breakouttime = 1200 //A default in case you are somehow legcuffed with something that isn't an obj/item/weapon/legcuffs type
- var/displaytime = 2 //Minutes to display in the "this will take X minutes."
- if(istype(HC)) //If you are legcuffed with actual legcuffs... Well what do I know, maybe someone will want to legcuff you with toilet paper in the future...
- breakouttime = HC.breakouttime
- displaytime = breakouttime / 600 //Minutes
- CM << "\red You attempt to remove \the [HC]. (This will take around [displaytime] minutes and you need to stand still)"
- for(var/mob/O in viewers(CM))
- O.show_message( "\red [usr] attempts to remove \the [HC]!", 1)
- spawn(0)
- if(do_after(CM, breakouttime))
- if(!CM.legcuffed || CM.buckled)
- return // time leniency for lag which also might make this whole thing pointless but the server
- for(var/mob/O in viewers(CM))// lags so hard that 40s isn't lenient enough - Quarxink
- O.show_message("\red [CM] manages to remove the legcuffs!", 1)
- CM << "\blue You successfully remove \the [CM.legcuffed]."
- CM.legcuffed.loc = usr.loc
- CM.legcuffed = null
- CM.update_inv_legcuffed()
\ No newline at end of file
diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm
index 9c53d869bb..38b42a86b9 100644
--- a/code/modules/paperwork/filingcabinet.dm
+++ b/code/modules/paperwork/filingcabinet.dm
@@ -66,6 +66,22 @@
return
+/obj/structure/filingcabinet/attack_tk(mob/user)
+ if(anchored)
+ attack_self_tk(user)
+ else
+ ..()
+
+/obj/structure/filingcabinet/attack_self_tk(mob/user)
+ if(contents.len)
+ if(prob(40 + contents.len * 5))
+ var/obj/item/I = pick(contents)
+ I.loc = loc
+ if(prob(25))
+ step_rand(I)
+ user << "You pull \a [I] out of [src] at random."
+ return
+ user << "You find nothing in [src]."
/obj/structure/filingcabinet/Topic(href, href_list)
if(href_list["retrieve"])
@@ -88,7 +104,7 @@
var/virgin = 1
-/obj/structure/filingcabinet/security/attack_hand(mob/user as mob)
+/obj/structure/filingcabinet/security/proc/populate()
if(virgin)
for(var/datum/data/record/G in data_core.general)
var/datum/data/record/S
@@ -110,6 +126,13 @@
//before the records have been generated, so we do this inside the loop.
..()
+/obj/structure/filingcabinet/security/attack_hand()
+ populate()
+ ..()
+
+/obj/structure/filingcabinet/security/attack_tk()
+ populate()
+ ..()
/*
* Medical Record Cabinets
@@ -117,7 +140,7 @@
/obj/structure/filingcabinet/medical
var/virgin = 1
-/obj/structure/filingcabinet/medical/attack_hand(mob/user as mob)
+/obj/structure/filingcabinet/medical/proc/populate()
if(virgin)
for(var/datum/data/record/G in data_core.general)
var/datum/data/record/M
@@ -138,3 +161,11 @@
virgin = 0 //tabbing here is correct- it's possible for people to try and use it
//before the records have been generated, so we do this inside the loop.
..()
+
+/obj/structure/filingcabinet/medical/attack_hand()
+ populate()
+ ..()
+
+/obj/structure/filingcabinet/medical/attack_tk()
+ populate()
+ ..()
diff --git a/code/modules/paperwork/handlabeler.dm b/code/modules/paperwork/handlabeler.dm
index 6d1008ca8d..940a797add 100644
--- a/code/modules/paperwork/handlabeler.dm
+++ b/code/modules/paperwork/handlabeler.dm
@@ -7,7 +7,8 @@
var/labels_left = 30
var/mode = 0 //off or on.
-/obj/item/weapon/hand_labeler/afterattack(atom/A, mob/user as mob)
+/obj/item/weapon/hand_labeler/afterattack(atom/A, mob/user as mob, proximity)
+ if(!proximity) return
if(!mode) //if it's off, give up.
return
if(A == loc) // if placing the labeller into something (e.g. backpack)
diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm
index dae7ac1384..f050a42822 100644
--- a/code/modules/paperwork/photography.dm
+++ b/code/modules/paperwork/photography.dm
@@ -116,7 +116,7 @@
icon_state = "camera"
item_state = "electropack"
w_class = 2.0
- flags = FPRINT | CONDUCT | USEDELAY | TABLEPASS
+ flags = FPRINT | CONDUCT | TABLEPASS
slot_flags = SLOT_BELT
m_amt = 2000
var/pictures_max = 10
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index 38e1ad5872..7a68873fd1 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -468,10 +468,6 @@
if(stat & (BROKEN|MAINT))
return
- if(ishuman(user))
- if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
- call(/obj/item/clothing/gloves/space_ninja/proc/drain)("APC",src,user:wear_suit)
- return
// do APC interaction
user.set_machine(src)
src.interact(user)
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index 903115a418..bbcbdb9c9d 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -67,10 +67,7 @@
/obj/structure/cable/proc/get_powernet() //TODO: remove this as it is obsolete
return powernet
-/obj/structure/cable/attack_hand(mob/user)
- if(ishuman(user))
- if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
- call(/obj/item/clothing/gloves/space_ninja/proc/drain)("WIRE",src,user:wear_suit)
+/obj/structure/cable/attack_tk(mob/user)
return
/obj/structure/cable/attackby(obj/item/W, mob/user)
@@ -167,7 +164,7 @@
throw_range = 5
m_amt = 50
g_amt = 20
- flags = TABLEPASS | USEDELAY | FPRINT | CONDUCT
+ flags = TABLEPASS | FPRINT | CONDUCT
slot_flags = SLOT_BELT
item_state = "coil_red"
attack_verb = list("whipped", "lashed", "disciplined", "flogged")
diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm
index f5db6e12bf..486e71ded4 100644
--- a/code/modules/power/cell.dm
+++ b/code/modules/power/cell.dm
@@ -63,8 +63,11 @@
/obj/item/weapon/cell/attack_self(mob/user as mob)
src.add_fingerprint(user)
if(ishuman(user))
- if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
- call(/obj/item/clothing/gloves/space_ninja/proc/drain)("CELL",src,user:wear_suit)
+ var/mob/living/carbon/human/H = user
+ var/obj/item/clothing/gloves/space_ninja/SNG = H.gloves
+ if(!istype(SNG) || !SNG.candrain || !SNG.draining) return
+
+ SNG.drain("CELL",src,H.wear_suit)
return
/obj/item/weapon/cell/attackby(obj/item/W, mob/user)
diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm
index cd7c4bba89..0a3a4d3794 100644
--- a/code/modules/power/lighting.dm
+++ b/code/modules/power/lighting.dm
@@ -501,9 +501,13 @@
if(prot > 0 || (COLD_RESISTANCE in user.mutations))
user << "You remove the light [fitting]"
+ else if(TK in user.mutations)
+ user << "You telekinetically remove the light [fitting]."
else
user << "You try to remove the light [fitting], but it's too hot and you don't want to burn your hand."
return // if burned, don't remove the light
+ else
+ user << "You remove the light [fitting]."
// create a light tube/bulb item and put it in the user's hand
var/obj/item/weapon/light/L = new light_type()
@@ -523,6 +527,30 @@
status = LIGHT_EMPTY
update()
+
+/obj/machinery/light/attack_tk(mob/user)
+ if(status == LIGHT_EMPTY)
+ user << "There is no [fitting] in this light."
+ return
+
+ user << "You telekinetically remove the light [fitting]."
+ // create a light tube/bulb item and put it in the user's hand
+ var/obj/item/weapon/light/L = new light_type()
+ L.status = status
+ L.rigged = rigged
+ L.brightness = brightness
+
+ // light item inherits the switchcount, then zero it
+ L.switchcount = switchcount
+ switchcount = 0
+
+ L.update()
+ L.add_fingerprint(user)
+ L.loc = loc
+
+ status = LIGHT_EMPTY
+ update()
+
// break the light and make sparks if was on
/obj/machinery/light/proc/broken(var/skip_sound_and_sparks = 0)
@@ -706,7 +734,8 @@
// shatter light, unless it was an attempt to put it in a light socket
// now only shatter if the intent was harm
-/obj/item/weapon/light/afterattack(atom/target, mob/user)
+/obj/item/weapon/light/afterattack(atom/target, mob/user, proximity)
+ if(!proximity) return
if(istype(target, /obj/machinery/light))
return
if(user.a_intent != "hurt")
diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm
index cf5ca92ab2..ecc7acb817 100644
--- a/code/modules/power/smes.dm
+++ b/code/modules/power/smes.dm
@@ -168,11 +168,6 @@
/obj/machinery/power/smes/attack_hand(mob/user)
add_fingerprint(user)
if(stat & BROKEN) return
-
- if(ishuman(user))
- if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
- call(/obj/item/clothing/gloves/space_ninja/proc/drain)("SMES",src,user:wear_suit)
- return
interact(user)
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index de1e19ac26..7bcfecfa46 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -4,7 +4,7 @@
icon = 'icons/obj/gun.dmi'
icon_state = "detective"
item_state = "gun"
- flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
+ flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT
m_amt = 2000
w_class = 3.0
@@ -51,7 +51,7 @@
O.emp_act(severity)
/obj/item/weapon/gun/afterattack(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, flag, params)
- if(flag) return //we're placing gun on a table or in backpack
+ if(flag) return //It's adjacent, is the user, or is on the user's person
if(istype(target, /obj/machinery/recharger) && istype(src, /obj/item/weapon/gun/energy)) return//Shouldnt flag take care of this?
if(user && user.client && user.client.gun_mode && !(A in target))
PreFire(A,user,params) //They're using the new gun system, locate what they're aiming at.
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index ca2d1cd053..35934b4bf1 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -5,7 +5,7 @@
fire_sound = 'sound/weapons/Laser.ogg'
origin_tech = "combat=2;magnets=4"
w_class = 4.0
- flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
+ flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BACK
charge_cost = 100
projectile_type = "/obj/item/projectile/ion"
@@ -33,7 +33,7 @@ obj/item/weapon/gun/energy/staff
icon_state = "staffofchange"
item_state = "staffofchange"
fire_sound = 'sound/weapons/emitter.ogg'
- flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
+ flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BACK
w_class = 4.0
charge_cost = 200
diff --git a/code/modules/projectiles/guns/projectile/bow.dm b/code/modules/projectiles/guns/projectile/bow.dm
index 5a627ae6ef..f422abd04e 100644
--- a/code/modules/projectiles/guns/projectile/bow.dm
+++ b/code/modules/projectiles/guns/projectile/bow.dm
@@ -43,7 +43,7 @@
icon_state = "crossbow"
item_state = "crossbow-solid"
w_class = 5.0
- flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
+ flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT | SLOT_BACK
w_class = 3.0
diff --git a/code/modules/projectiles/guns/projectile/pneumatic.dm b/code/modules/projectiles/guns/projectile/pneumatic.dm
index fe6c2651bd..9924e3d93f 100644
--- a/code/modules/projectiles/guns/projectile/pneumatic.dm
+++ b/code/modules/projectiles/guns/projectile/pneumatic.dm
@@ -5,7 +5,7 @@
icon_state = "pneumatic"
item_state = "pneumatic"
w_class = 5.0
- flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
+ flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT
max_w_class = 3
max_combined_w_class = 20
diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm
index 5170421e17..853be2e06a 100644
--- a/code/modules/projectiles/guns/projectile/shotgun.dm
+++ b/code/modules/projectiles/guns/projectile/shotgun.dm
@@ -6,7 +6,7 @@
max_shells = 4
w_class = 4.0
force = 10
- flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
+ flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BACK
caliber = "shotgun"
origin_tech = "combat=4;materials=2"
@@ -66,7 +66,7 @@
max_shells = 2
w_class = 4.0
force = 10
- flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
+ flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BACK
caliber = "shotgun"
origin_tech = "combat=3;materials=1"
diff --git a/code/modules/reagents/reagent_containers/food/drinks.dm b/code/modules/reagents/reagent_containers/food/drinks.dm
index 02215e98c5..44de752b6b 100644
--- a/code/modules/reagents/reagent_containers/food/drinks.dm
+++ b/code/modules/reagents/reagent_containers/food/drinks.dm
@@ -65,7 +65,8 @@
return 0
- afterattack(obj/target, mob/user , flag)
+ afterattack(obj/target, mob/user, proximity)
+ if(!proximity) return
if(istype(target, /obj/structure/reagent_dispensers)) //A dispenser. Transfer FROM it TO us.
diff --git a/code/modules/reagents/reagent_containers/food/snacks.dm b/code/modules/reagents/reagent_containers/food/snacks.dm
index c6817a2830..8066b844af 100644
--- a/code/modules/reagents/reagent_containers/food/snacks.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks.dm
@@ -96,15 +96,9 @@
return 0
-/obj/item/weapon/reagent_containers/food/snacks/afterattack(obj/target, mob/user , flag)
+/obj/item/weapon/reagent_containers/food/snacks/afterattack(obj/target, mob/user, proximity)
return
-
-
-
-
-
-
/obj/item/weapon/reagent_containers/food/snacks/examine()
set src in view()
..()
@@ -1338,7 +1332,8 @@
..()
reagents.add_reagent("nutriment",10)
- afterattack(obj/O as obj, mob/user as mob)
+ afterattack(obj/O as obj, mob/user as mob, proximity)
+ if(!proximity) return
if(istype(O,/obj/structure/sink) && !wrapped)
user << "You place \the [name] under a stream of water..."
loc = get_turf(O)
diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm
index 15123bacf8..b2cc535ba3 100644
--- a/code/modules/reagents/reagent_containers/glass.dm
+++ b/code/modules/reagents/reagent_containers/glass.dm
@@ -64,7 +64,8 @@
flags |= OPENCONTAINER
update_icon()
- afterattack(obj/target, mob/user , flag)
+ afterattack(obj/target, mob/user, proximity)
+ if(!proximity) return
if (!is_open_container())
return
diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm
index 6c3c363a18..076e769d8b 100644
--- a/code/modules/reagents/reagent_containers/pill.dm
+++ b/code/modules/reagents/reagent_containers/pill.dm
@@ -57,7 +57,8 @@
return 0
- afterattack(obj/target, mob/user , flag)
+ afterattack(obj/target, mob/user, proximity)
+ if(!proximity) return
if(target.is_open_container() != 0 && target.reagents)
if(!target.reagents.total_volume)
diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm
index 8762eb8d52..7cbd460257 100644
--- a/code/modules/reagents/reagent_containers/spray.dm
+++ b/code/modules/reagents/reagent_containers/spray.dm
@@ -4,7 +4,7 @@
icon = 'icons/obj/janitor.dmi'
icon_state = "cleaner"
item_state = "cleaner"
- flags = TABLEPASS|OPENCONTAINER|FPRINT|USEDELAY
+ flags = TABLEPASS|OPENCONTAINER|FPRINT|NOBLUDGEON
slot_flags = SLOT_BELT
throwforce = 3
w_class = 2.0
@@ -243,7 +243,9 @@
reagents.add_reagent("plantbgone", 100)
-/obj/item/weapon/reagent_containers/spray/plantbgone/afterattack(atom/A as mob|obj, mob/user as mob)
+/obj/item/weapon/reagent_containers/spray/plantbgone/afterattack(atom/A as mob|obj, mob/user as mob, proximity)
+ if(!proximity) return
+
if (istype(A, /obj/machinery/hydroponics)) // We are targeting hydrotray
return
diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm
index d53dd4d589..9279fbfb0e 100644
--- a/code/modules/reagents/reagent_containers/syringes.dm
+++ b/code/modules/reagents/reagent_containers/syringes.dm
@@ -50,7 +50,8 @@
return
- afterattack(obj/target, mob/user , flag)
+ afterattack(obj/target, mob/user, proximity)
+ if(!proximity) return
if(!target.reagents) return
if(mode == SYRINGE_BROKEN)
diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm
index de028bd296..94bb46e354 100644
--- a/code/modules/recycling/disposal.dm
+++ b/code/modules/recycling/disposal.dm
@@ -456,7 +456,7 @@
CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if (istype(mover,/obj/item) && mover.throwing)
var/obj/item/I = mover
- if(istype(I, /obj/item/weapon/dummy) || istype(I, /obj/item/projectile))
+ if(istype(I, /obj/item/projectile))
return
if(prob(75))
I.loc = src
diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm
index 9c7bc06029..f3b3709d86 100755
--- a/code/modules/recycling/sortingmachinery.dm
+++ b/code/modules/recycling/sortingmachinery.dm
@@ -6,7 +6,7 @@
var/obj/wrapped = null
density = 1
var/sortTag = 0
- flags = FPRINT
+ flags = FPRINT | NOBLUDGEON
mouse_drag_pointer = MOUSE_ACTIVE_POINTER
attack_hand(mob/user as mob)
@@ -88,11 +88,11 @@
var/amount = 25.0
- afterattack(var/obj/target as obj, mob/user as mob)
+ afterattack(var/obj/target as obj, mob/user as mob, proximity)
+ if(!proximity) return
if(!istype(target)) //this really shouldn't be necessary (but it is). -Pete
return
- if(istype(target, /obj/structure/table) || istype(target, /obj/structure/rack) \
- || istype(target, /obj/item/smallDelivery) || istype(target,/obj/structure/bigDelivery) \
+ if(istype(target, /obj/item/smallDelivery) || istype(target,/obj/structure/bigDelivery) \
|| istype(target, /obj/item/weapon/gift) || istype(target, /obj/item/weapon/evidencebag))
return
if(target.anchored)
@@ -218,7 +218,7 @@
return
Bumped(var/atom/movable/AM) //Go straight into the chute
- if(istype(AM, /obj/item/projectile) || istype(AM, /obj/item/weapon/dummy)) return
+ if(istype(AM, /obj/item/projectile)) return
switch(dir)
if(NORTH)
if(AM.loc.y != src.loc.y+1) return
diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm
index 5597c81509..4cc18d6434 100644
--- a/code/modules/research/rdconsole.dm
+++ b/code/modules/research/rdconsole.dm
@@ -550,11 +550,6 @@ won't update every console in existence) but it's more of a hassle to do. Also,
if(stat & (BROKEN|NOPOWER))
return
- if(ishuman(user))
- if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
- call(/obj/item/clothing/gloves/space_ninja/proc/drain)("RESEARCH",src,user:wear_suit)
- return
-
user.set_machine(src)
var/dat = ""
files.RefreshResearch()
diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm
index e1f5740b69..ac9166602f 100644
--- a/code/modules/research/server.dm
+++ b/code/modules/research/server.dm
@@ -154,9 +154,6 @@
return
if (shocked)
shock(user,50)
- if(ishuman(user))
- if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
- call(/obj/item/clothing/gloves/space_ninja/proc/drain)("RESEARCH",src,user:wear_suit)
return
diff --git a/code/modules/virus2/items_devices.dm b/code/modules/virus2/items_devices.dm
index 5e067f92ad..98e0dab2a1 100644
--- a/code/modules/virus2/items_devices.dm
+++ b/code/modules/virus2/items_devices.dm
@@ -10,7 +10,7 @@
icon_state = "health"
w_class = 2.0
item_state = "electronic"
- flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
+ flags = FPRINT | TABLEPASS | CONDUCT
/obj/item/device/antibody_scanner/attack(mob/living/carbon/M as mob, mob/user as mob)
diff --git a/code/setup.dm b/code/setup.dm
index 06c4711b45..cc26315cbd 100644
--- a/code/setup.dm
+++ b/code/setup.dm
@@ -190,6 +190,7 @@ var/MAX_EXPLOSION_RANGE = 14
#define CONDUCT 64 // conducts electricity (metal etc.)
#define FPRINT 256 // takes a fingerprint
#define ON_BORDER 512 // item has priority to check when entering or leaving
+#define NOBLUDGEON 4 // when an item has this it produces no "X has been hit by Y with Z" message with the default handler
#define GLASSESCOVERSEYES 1024
#define MASKCOVERSEYES 1024 // get rid of some of the other retardation in these flags
@@ -455,6 +456,13 @@ var/list/global_mutations = list() // list of hidden mutation things
var/static/list/scarySounds = list('sound/weapons/thudswoosh.ogg','sound/weapons/Taser.ogg','sound/weapons/armbomb.ogg','sound/voice/hiss1.ogg','sound/voice/hiss2.ogg','sound/voice/hiss3.ogg','sound/voice/hiss4.ogg','sound/voice/hiss5.ogg','sound/voice/hiss6.ogg','sound/effects/Glassbr1.ogg','sound/effects/Glassbr2.ogg','sound/effects/Glassbr3.ogg','sound/items/Welder.ogg','sound/items/Welder2.ogg','sound/machines/airlock.ogg','sound/effects/clownstep1.ogg','sound/effects/clownstep2.ogg')
+//Grab levels
+#define GRAB_PASSIVE 1
+#define GRAB_AGGRESSIVE 2
+#define GRAB_NECK 3
+#define GRAB_UPGRADING 4
+#define GRAB_KILL 5
+
//Security levels
#define SEC_LEVEL_GREEN 0
#define SEC_LEVEL_BLUE 1