Pretty much all new click code

This commit is contained in:
ZomgPonies
2013-10-12 14:44:36 -04:00
parent 1d9537bbdc
commit 5daf979b72
158 changed files with 9471 additions and 11578 deletions
+17 -162
View File
@@ -132,8 +132,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)
@@ -167,8 +166,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
@@ -206,156 +204,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()]\]<font color='orange'> Attacked by [user.name] ([user.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(src.damtype)])</font>"
user.attack_log += "\[[time_stamp()]\]<font color='red'> Attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(src.damtype)])</font>"
msg_admin_attack("[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(src.damtype)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)") //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 <B>[M] has been [pick(src.attack_verb)] with [src][showname] </B>", 1)
else
O.show_message("\red <B>[M] has been attacked with [src][showname] </B>", 1)
if(!showname && user)
if(user.client)
user << "\red <B>You attack [M] with [src]. </B>"
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
@@ -470,11 +318,21 @@
if( !(slot_flags & SLOT_HEAD) )
return 0
return 1
if(slot_ears)
if(H.ears)
if(slot_l_ear)
if(H.l_ear)
return 0
if( !(slot_flags & SLOT_EARS) )
return 0
if( (slot_flags & SLOT_TWOEARS) && H.r_ear )
return 0
return 1
if(slot_r_ear)
if(H.r_ear)
return 0
if( !(slot_flags & SLOT_EARS) )
return 0
if( (slot_flags & SLOT_TWOEARS) && H.l_ear )
return 0
return 1
if(slot_w_uniform)
if(H.w_uniform)
@@ -590,6 +448,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 +469,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
+2 -1
View File
@@ -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)
+2 -1
View File
@@ -1020,7 +1020,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)
@@ -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]."
@@ -23,7 +23,7 @@
/obj/item/device/radio/headset/receive_range(freq, level)
if(ishuman(src.loc))
var/mob/living/carbon/human/H = src.loc
if(H.ears == src)
if(H.l_ear == src || H.r_ear == src)
return ..(freq, level)
return -1
-128
View File
@@ -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
*/
+4 -3
View File
@@ -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
+2 -1
View File
@@ -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))
+2 -1
View File
@@ -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
+2 -1
View File
@@ -199,7 +199,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
@@ -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
@@ -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))
@@ -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
@@ -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)
@@ -38,7 +38,7 @@
if(iscarbon(M))
eye_safety = M.eyecheck()
if(ishuman(M))
if(istype(M:ears, /obj/item/clothing/ears/earmuffs))
if(istype(M:l_ear, /obj/item/clothing/ears/earmuffs) || istype(M:r_ear, /obj/item/clothing/ears/earmuffs))
ear_safety += 2
if(HULK in M.mutations)
ear_safety += 1
@@ -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
@@ -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
+2 -1
View File
@@ -34,7 +34,8 @@ obj/item/weapon/mop/proc/clean(turf/simulated/A as turf)
..()
/obj/item/weapon/mop/afterattack(atom/A, mob/user as mob)
/obj/item/weapon/mop/afterattack(atom/A, mob/user, proximity)
if(!proximity) return
if(reagents.total_volume < 1 || mopcount >= 5)
user << "<span class='notice'>Your mop is dry!</span>"
return
+4 -2
View File
@@ -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]"
@@ -42,7 +42,7 @@
user << "\red The Bluespace interfaces of the two devices conflict and malfunction."
del(W)
return
/* //BoH+BoH=Singularity, commented out.
//BoH+BoH=Singularity, commented out.
if(istype(W, /obj/item/weapon/storage/backpack/holding) && !W.crit_fail)
investigate_log("has become a singularity. Caused by [user.key]","singulo")
user << "\red The Bluespace interfaces of the two devices catastrophically malfunction!"
@@ -53,7 +53,7 @@
log_game("[key_name(user)] detonated a bag of holding")
del(src)
return
*/
..()
proc/failcheck(mob/user as mob)
@@ -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"))
@@ -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,19 +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)
+2 -1
View File
@@ -244,7 +244,8 @@
location.hotspot_expose(700, 5)
/obj/item/weapon/weldingtool/afterattack(atom/O as obj|mob, 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"
+2 -1
View File
@@ -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
+22 -1
View File
@@ -165,4 +165,25 @@ LINEN BINS
hidden = null
add_fingerprint(user)
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 << "<span class='notice'>You telekinetically remove [B] from [src].</span>"
update_icon()
if(hidden)
hidden.loc = loc
hidden = null
@@ -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 << "<span class='notice'>It won't budge!</span>"
/obj/structure/closet/verb/verb_toggleopen()
set src in oview(1)
set category = "Object"
@@ -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"
@@ -37,6 +37,15 @@
opened = !opened
update_icon()
/obj/structure/extinguisher_cabinet/attack_tk(mob/user)
if(has_extinguisher)
has_extinguisher.loc = loc
user << "<span class='notice'>You telekinetically remove [has_extinguisher] from [src].</span>"
has_extinguisher = null
opened = 1
else
opened = !opened
update_icon()
/obj/structure/extinguisher_cabinet/attack_paw(mob/user)
attack_hand(user)
+4 -14
View File
@@ -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)
@@ -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
+188 -20
View File
@@ -20,6 +20,14 @@
layer = 2.8
throwpass = 1 //You can throw objects over this, despite it's density.")
var/parts = /obj/item/weapon/table_parts
var/flipped = 0
var/health = 100
/obj/structure/table/proc/update_adjacent()
for(var/direction in list(1,2,4,8,5,6,9,10))
if(locate(/obj/structure/table,get_step(src,direction)))
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction))
T.update_icon()
/obj/structure/table/New()
..()
@@ -27,16 +35,10 @@
if(T != src)
del(T)
update_icon()
for(var/direction in list(1,2,4,8,5,6,9,10))
if(locate(/obj/structure/table,get_step(src,direction)))
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction))
T.update_icon()
update_adjacent()
/obj/structure/table/Del()
for(var/direction in list(1,2,4,8,5,6,9,10))
if(locate(/obj/structure/table,get_step(src,direction)))
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction))
T.update_icon()
update_adjacent()
..()
/obj/structure/table/proc/destroy()
@@ -46,6 +48,28 @@
/obj/structure/table/update_icon()
if(flipped)
var/type = 0
var/tabledirs = 0
for(var/direction in list(turn(dir,90), turn(dir,-90)) )
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction))
if (T && T.flipped)
type++
tabledirs |= direction
var/base = "table"
if (istype(src, /obj/structure/table/woodentable))
base = "wood"
if (istype(src, /obj/structure/table/reinforced))
base = "rtable"
icon_state = "[base]flip[type]"
if (type==1)
if (tabledirs & turn(dir,90))
icon_state = icon_state+"-"
if (tabledirs & turn(dir,-90))
icon_state = icon_state+"+"
return 1
spawn(2) //So it properly updates when deleting
var/dir_sum = 0
for(var/direction in list(1,2,4,8,5,6,9,10))
@@ -77,7 +101,8 @@
skip_sum = 1
continue
if(!skip_sum) //means there is a window between the two tiles in this direction
if(locate(/obj/structure/table,get_step(src,direction)))
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction))
if(T && !T.flipped)
if(direction <5)
dir_sum += direction
else
@@ -235,11 +260,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,18 +283,60 @@
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
if(istype(mover,/obj/item/projectile))
return (check_cover(mover,target))
if(istype(mover) && mover.checkpass(PASSTABLE))
return 1
else
return 0
if (flipped)
if (get_dir(loc, target) == dir)
return !density
else
return 1
return 0
//checks if projectile 'P' from turf 'from' can hit whatever is behind the table. Returns 1 if it can, 0 if bullet stops.
/obj/structure/table/proc/check_cover(obj/item/projectile/P, turf/from)
var/turf/cover = flipped ? get_turf(src) : get_step(loc, get_dir(from, loc))
if (get_dist(P.starting, loc) <= 1) //Tables won't help you if people are THIS close
return 1
if (get_turf(P.original) == cover)
var/chance = 20
if (ismob(P.original))
var/mob/M = P.original
if (M.lying)
chance += 20 //Lying down lets you catch less bullets
if(flipped)
if(get_dir(loc, from) == dir) //Flipped tables catch mroe bullets
chance += 20
else
return 1 //But only from one side
if(prob(chance))
health -= P.damage/2
if (health > 0)
visible_message("<span class='warning'>[P] hits \the [src]!</span>")
return 0
else
visible_message("<span class='warning'>[src] breaks down!</span>")
destroy()
return 1
return 1
/obj/structure/table/CheckExit(atom/movable/O as mob|obj, target as turf)
if(istype(O) && O.checkpass(PASSTABLE))
return 1
if (flipped)
if (get_dir(loc, target) == dir)
return !density
else
return 1
return 1
/obj/structure/table/MouseDrop_T(obj/O as obj, mob/user as mob)
if ((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O))
return
if(isrobot(user))
@@ -285,7 +347,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))
@@ -329,6 +391,103 @@
user.drop_item(src)
return
/obj/structure/table/proc/straight_table_check(var/direction)
var/turf/left = get_step(src,turn(direction,90))
var/turf/right = get_step(src,turn(direction,-90))
var/turf/next = get_step(src,direction)
if(locate(/obj/structure/table,left) || locate(/obj/structure/table,right))
return 0
var/obj/structure/table/T = locate(/obj/structure/table, next)
if (istype(T,/obj/structure/table/reinforced/))
var/obj/structure/table/reinforced/R = T
if (R.status == 2)
return 0
if (!T)
return 1
else
return T.straight_table_check(direction)
/obj/structure/table/verb/do_flip()
set name = "Flip table"
set desc = "Flips a non-reinforced table"
set category = "Object"
set src in oview(1)
if (issilicon(usr))
usr << "<span class='notice'>You need hands for this.</span>"
return
if(!flip(get_cardinal_dir(usr,src)))
usr << "<span class='notice'>It won't budge.</span>"
else
usr.visible_message("<span class='warning'>[usr] flips \the [src]!</span>")
return
/obj/structure/table/proc/do_put()
set name = "Put table back"
set desc = "Puts flipped table back"
set category = "Object"
set src in oview(1)
if (!unflip())
usr << "<span class='notice'>It won't budge.</span>"
return
/obj/structure/table/proc/flip(var/direction)
if (flipped)
return 0
if( !straight_table_check(turn(direction,90)) || !straight_table_check(turn(direction,-90)) )
return 0
verbs -=/obj/structure/table/verb/do_flip
verbs +=/obj/structure/table/proc/do_put
var/list/targets = list(get_step(src,dir),get_step(src,turn(dir, 45)),get_step(src,turn(dir, -45)))
for (var/atom/movable/A in get_turf(src))
if (!A.anchored)
spawn(0)
A.throw_at(pick(targets),1,1)
dir = direction
if(dir != NORTH)
layer = 5
flipped = 1
flags |= ON_BORDER
for(var/D in list(turn(direction, 90), turn(direction, -90)))
if(locate(/obj/structure/table,get_step(src,D)))
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,D))
T.flip(direction)
update_icon()
update_adjacent()
return 1
/obj/structure/table/proc/unflip()
if (!flipped)
return 0
var/can_flip = 1
for (var/mob/A in oview(src,0))//src.loc)
if (istype(A))
can_flip = 0
if (!can_flip)
return 0
verbs -=/obj/structure/table/proc/do_put
verbs +=/obj/structure/table/verb/do_flip
layer = initial(layer)
flipped = 0
flags &= ~ON_BORDER
for(var/D in list(turn(dir, 90), turn(dir, -90)))
if(locate(/obj/structure/table,get_step(src,D)))
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,D))
T.unflip()
update_icon()
update_adjacent()
return 1
/*
* Wooden tables
@@ -338,7 +497,7 @@
desc = "Do not apply fire to this. Rumour says it burns easily."
icon_state = "wood_table"
parts = /obj/item/weapon/table_parts/wood
health = 50
/*
* Reinforced tables
*/
@@ -346,9 +505,15 @@
name = "reinforced table"
desc = "A version of the four legged table. It is stronger."
icon_state = "reinf_table"
health = 200
var/status = 2
parts = /obj/item/weapon/table_parts/reinforced
/obj/structure/table/reinforced/flip(var/direction)
if (status == 2)
return 0
else
return ..()
/obj/structure/table/reinforced/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/weldingtool))
@@ -478,3 +643,6 @@
new /obj/item/weapon/rack_parts(loc)
density = 0
del(src)
/obj/structure/rack/attack_tk() // no telehulk sorry
return
@@ -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)
+11 -5
View File
@@ -263,8 +263,11 @@
if(H.glasses && washglasses)
if(H.glasses.clean_blood())
H.update_inv_glasses(0)
if(H.ears && washears)
if(H.ears.clean_blood())
if(H.l_ear && washears)
if(H.l_ear.clean_blood())
H.update_inv_ears(0)
if(H.r_ear && washears)
if(H.r_ear.clean_blood())
H.update_inv_ears(0)
if(H.belt)
if(H.belt.clean_blood())
@@ -323,23 +326,26 @@
anchored = 1
var/busy = 0 //Something's being washed at the moment
/obj/structure/sink/attack_hand(mob/M as mob)
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))
+3
View File
@@ -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("<span class='notice'>Something knocks on [src].</span>")
playsound(loc, 'sound/effects/Glasshit.ogg', 50, 1)
/obj/structure/window/attack_hand(mob/user as mob)
if(HULK in user.mutations)