mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-02 05:32:16 +00:00
- Welding tool code how has proper comments! Maybe not "proper" but at least I don't lie and say a proc is/does something that it doesn't actually do. - Welders now start full of fuel instead of some random amount between 10-20 - Someone decided it would be a good idea to set the welding tool's 'on/off' var in a ton of attackby() procs. These objects and turfs shouldnt even touch this variable. This is why people have been noticing their welding being on without the sprite or damagetype and amount reflecting that. - - I've removed a bunch of these instances but there are so many objects and turfs spread out through the code, there's no way to know if I've got them all (This is the majority of the files) - - I've created a new proc in welding tools that checks to see if they are turned on or not. "isOn()" - - Since I'm not sure if I've gotten every instance of this force-var-on, I've set the welding tool to update it's icon every process(). I hate adding checks like this to processes but it's necessary for now. - Added a setWelding() proc. If you HAVE to turn the welding tool on or off, use this, don't just change the var. In fact, dont even touch the 'welding' var anymore - Fixes issue 435 While changing the hundreds(literally) of cases of welding tool uses I've - Changed some :'s (object:varorproc) I've come across into .'s (object.varorproc) - Added checks to make sure the welding tool is actually on before using it (some attackby()'s didnt have this. Heck, some checked how much fuel you had, but didn't actually USE the fuel) - Added sanity checks after some do_after()s that were missing them Added traitor uplink items back to erro's stat tracker - Added 'random' with the tag "RN" - Added thermal meson glasses with the tag "TM" - Reorganized uplinks.dm a little by moving the 'random' item generation to its own proc - NOTE: I have absolutely no way to test this on my own, but it should work! I've tested a bunch of construction/deconstructions with the welding tool, but again I've probably missed a few things. If there are any problems, please let me know and I'll fix them asap. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3741 316c924e-a436-60f5-8080-3fe189b3f50e
349 lines
9.9 KiB
Plaintext
349 lines
9.9 KiB
Plaintext
/*
|
|
CONTAINS:
|
|
TABLE AND RACK OBJECT INTERATIONS
|
|
*/
|
|
|
|
|
|
//TABLE
|
|
/obj/structure/table/ex_act(severity)
|
|
switch(severity)
|
|
if(1.0)
|
|
del(src)
|
|
return
|
|
if(2.0)
|
|
if (prob(50))
|
|
del(src)
|
|
return
|
|
if(3.0)
|
|
if (prob(25))
|
|
src.density = 0
|
|
else
|
|
return
|
|
|
|
|
|
/obj/structure/table/blob_act()
|
|
if(prob(75))
|
|
if(istype(src, /obj/structure/table/woodentable))
|
|
new /obj/item/weapon/table_parts/wood( src.loc )
|
|
del(src)
|
|
return
|
|
new /obj/item/weapon/table_parts( src.loc )
|
|
del(src)
|
|
return
|
|
|
|
|
|
/obj/structure/table/hand_p(mob/user as mob)
|
|
return src.attack_paw(user)
|
|
return
|
|
|
|
|
|
/obj/structure/table/attack_paw(mob/user as mob)
|
|
if ((HULK in usr.mutations))
|
|
usr << "\blue You destroy the table."
|
|
for(var/mob/O in oviewers())
|
|
if ((O.client && !( O.blinded )))
|
|
O << "\red [user] smashes the table apart!"
|
|
if(istype(src, /obj/structure/table/reinforced))
|
|
new /obj/item/weapon/table_parts/reinforced( src.loc )
|
|
else if(istype(src, /obj/structure/table/woodentable))
|
|
new/obj/item/weapon/table_parts/wood( src.loc )
|
|
else
|
|
new /obj/item/weapon/table_parts( src.loc )
|
|
src.density = 0
|
|
del(src)
|
|
if (!( locate(/obj/structure/table, user.loc) ))
|
|
step(user, get_dir(user, src))
|
|
if (user.loc == src.loc)
|
|
user.layer = TURF_LAYER
|
|
for(var/mob/O in oviewers())
|
|
if ((O.client && !( O.blinded )))
|
|
O << "[user] hides under the table!"
|
|
//Foreach goto(69)
|
|
return
|
|
|
|
|
|
/obj/structure/table/attack_alien(mob/user as mob) //Removed code for larva since it doesn't work. Previous code is now a larva ability. /N
|
|
usr << "\green You destroy the table."
|
|
for(var/mob/O in oviewers())
|
|
if ((O.client && !( O.blinded )))
|
|
O << "\red [user] slices the table apart!"
|
|
if(istype(src, /obj/structure/table/reinforced))
|
|
new /obj/item/weapon/table_parts/reinforced( src.loc )
|
|
else if(istype(src, /obj/structure/table/woodentable))
|
|
new/obj/item/weapon/table_parts/wood( src.loc )
|
|
else
|
|
new /obj/item/weapon/table_parts( src.loc )
|
|
src.density = 0
|
|
del(src)
|
|
return
|
|
|
|
|
|
/obj/structure/table/attack_animal(mob/living/simple_animal/user as mob) //Removed code for larva since it doesn't work. Previous code is now a larva ability. /N
|
|
if(user.wall_smash)
|
|
usr << "\red You destroy the table."
|
|
for(var/mob/O in oviewers())
|
|
if ((O.client && !( O.blinded )))
|
|
O << "\red [user] smashes the table apart!"
|
|
if(istype(src, /obj/structure/table/reinforced))
|
|
new /obj/item/weapon/table_parts/reinforced( src.loc )
|
|
else if(istype(src, /obj/structure/table/woodentable))
|
|
new/obj/item/weapon/table_parts/wood( src.loc )
|
|
else
|
|
new /obj/item/weapon/table_parts( src.loc )
|
|
src.density = 0
|
|
del(src)
|
|
return
|
|
|
|
|
|
|
|
|
|
/obj/structure/table/attack_hand(mob/user as mob)
|
|
if ((HULK in usr.mutations) || (SUPRSTR in usr.augmentations))
|
|
usr << "\blue You destroy the table."
|
|
for(var/mob/O in oviewers())
|
|
if ((O.client && !( O.blinded )))
|
|
O << "\red [user] smashes the table apart!"
|
|
if(istype(src, /obj/structure/table/reinforced))
|
|
new /obj/item/weapon/table_parts/reinforced( src.loc )
|
|
else if(istype(src, /obj/structure/table/woodentable))
|
|
new/obj/item/weapon/table_parts/wood( src.loc )
|
|
else
|
|
new /obj/item/weapon/table_parts( src.loc )
|
|
src.density = 0
|
|
del(src)
|
|
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) && mover.checkpass(PASSTABLE))
|
|
return 1
|
|
else
|
|
return 0
|
|
|
|
|
|
/obj/structure/table/MouseDrop_T(obj/O as obj, mob/user as mob)
|
|
|
|
if ((!( istype(O, /obj/item/weapon) ) || user.equipped() != O))
|
|
return
|
|
if(isrobot(user))
|
|
return
|
|
user.drop_item()
|
|
if (O.loc != src.loc)
|
|
step(O, get_dir(O, src))
|
|
return
|
|
|
|
|
|
/obj/structure/table/attackby(obj/item/weapon/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(G.state<2)
|
|
user << "\red You need a better grip to do that!"
|
|
return
|
|
G.affecting.loc = src.loc
|
|
G.affecting.Weaken(5)
|
|
for(var/mob/O in viewers(world.view, src))
|
|
if (O.client)
|
|
O << "\red [G.assailant] puts [G.affecting] on the table."
|
|
del(W)
|
|
return
|
|
|
|
if (istype(W, /obj/item/weapon/wrench))
|
|
user << "\blue Now disassembling table"
|
|
playsound(src.loc, 'Ratchet.ogg', 50, 1)
|
|
if(do_after(user,50))
|
|
new /obj/item/weapon/table_parts( src.loc )
|
|
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
|
|
if(isrobot(user))
|
|
return
|
|
|
|
if(istype(W, /obj/item/weapon/melee/energy/blade))
|
|
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
|
spark_system.set_up(5, 0, src.loc)
|
|
spark_system.start()
|
|
playsound(src.loc, 'blade1.ogg', 50, 1)
|
|
playsound(src.loc, "sparks", 50, 1)
|
|
for(var/mob/O in viewers(user, 4))
|
|
O.show_message("\blue The table was sliced apart by [user]!", 1, "\red You hear metal coming apart.", 2)
|
|
new /obj/item/weapon/table_parts( src.loc )
|
|
del(src)
|
|
return
|
|
|
|
user.drop_item(src)
|
|
//if(W && W.loc) W.loc = src.loc // Unnecessary - see: mob/proc/drop_item(atom) - Doohl
|
|
return
|
|
|
|
|
|
//WOODEN TABLES
|
|
/obj/structure/table/woodentable/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
|
|
|
if (istype(W, /obj/item/weapon/grab))
|
|
var/obj/item/weapon/grab/G = W
|
|
if(G.state<2)
|
|
user << "\red You need a better grip to do that!"
|
|
return
|
|
G.affecting.loc = src.loc
|
|
G.affecting.Weaken(5)
|
|
for(var/mob/O in viewers(world.view, src))
|
|
if (O.client)
|
|
O << "\red [G.assailant] puts [G.affecting] on the wooden table."
|
|
del(W)
|
|
return
|
|
if (istype(W, /obj/item/weapon/wrench))
|
|
user << "\blue Now disassembling the wooden table"
|
|
playsound(src.loc, 'Ratchet.ogg', 50, 1)
|
|
sleep(50)
|
|
new /obj/item/weapon/table_parts/wood( src.loc )
|
|
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
|
|
del(src)
|
|
return
|
|
if(isrobot(user))
|
|
return
|
|
if(istype(W, /obj/item/weapon/melee/energy/blade))
|
|
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
|
spark_system.set_up(5, 0, src.loc)
|
|
spark_system.start()
|
|
playsound(src.loc, 'blade1.ogg', 50, 1)
|
|
playsound(src.loc, "sparks", 50, 1)
|
|
for(var/mob/O in viewers(user, 4))
|
|
O.show_message("\blue The wooden table was sliced apart by [user]!", 1, "\red You hear wood coming apart.", 2)
|
|
new /obj/item/weapon/table_parts/wood( src.loc )
|
|
del(src)
|
|
return
|
|
|
|
user.drop_item(src)
|
|
//if(W && W.loc) W.loc = src.loc
|
|
return
|
|
|
|
|
|
//REINFORCED TABLES
|
|
/obj/structure/table/reinforced/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
|
|
|
if (istype(W, /obj/item/weapon/grab))
|
|
var/obj/item/weapon/grab/G = W
|
|
if(G.state<2)
|
|
user << "\red You need a better grip to do that!"
|
|
return
|
|
G.affecting.loc = src.loc
|
|
G.affecting.Weaken(5)
|
|
for(var/mob/O in viewers(world.view, src))
|
|
if (O.client)
|
|
O << "\red [G.assailant] puts [G.affecting] on the reinforced table."
|
|
del(W)
|
|
return
|
|
|
|
if (istype(W, /obj/item/weapon/weldingtool))
|
|
var/obj/item/weapon/weldingtool/WT = W
|
|
if(WT.remove_fuel(0, user))
|
|
if(src.status == 2)
|
|
user << "\blue Now weakening the reinforced table"
|
|
playsound(src.loc, 'Welder.ogg', 50, 1)
|
|
if (do_after(user, 50))
|
|
if(!src || !WT.isOn()) return
|
|
user << "\blue Table weakened"
|
|
src.status = 1
|
|
else
|
|
user << "\blue Now strengthening the reinforced table"
|
|
playsound(src.loc, 'Welder.ogg', 50, 1)
|
|
if (do_after(user, 50))
|
|
if(!src || !WT.isOn()) return
|
|
user << "\blue Table strengthened"
|
|
src.status = 2
|
|
return
|
|
if(isrobot(user))
|
|
return
|
|
user.drop_item(src)
|
|
//if(W && W.loc) W.loc = src.loc
|
|
return
|
|
|
|
if (istype(W, /obj/item/weapon/wrench))
|
|
if(src.status == 1)
|
|
user << "\blue Now disassembling the reinforced table"
|
|
playsound(src.loc, 'Ratchet.ogg', 50, 1)
|
|
if (do_after(user, 50))
|
|
new /obj/item/weapon/table_parts/reinforced( src.loc )
|
|
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
|
|
del(src)
|
|
return
|
|
if(isrobot(user))
|
|
return
|
|
|
|
if(istype(W, /obj/item/weapon/melee/energy/blade))
|
|
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
|
spark_system.set_up(5, 0, src.loc)
|
|
spark_system.start()
|
|
playsound(src.loc, 'blade1.ogg', 50, 1)
|
|
playsound(src.loc, "sparks", 50, 1)
|
|
for(var/mob/O in viewers(user, 4))
|
|
O.show_message("\blue The reinforced table was sliced apart by [user]!", 1, "\red You hear metal coming apart.", 2)
|
|
new /obj/item/weapon/table_parts/reinforced( src.loc )
|
|
del(src)
|
|
return
|
|
|
|
user.drop_item(src)
|
|
//if(W && W.loc) W.loc = src.loc
|
|
return
|
|
|
|
//RACKS
|
|
|
|
/obj/structure/rack/ex_act(severity)
|
|
switch(severity)
|
|
if(1.0)
|
|
del(src)
|
|
if(2.0)
|
|
del(src)
|
|
if(prob(50))
|
|
new /obj/item/weapon/rack_parts(src.loc)
|
|
if(3.0)
|
|
if(prob(25))
|
|
del(src)
|
|
new /obj/item/weapon/rack_parts(src.loc)
|
|
|
|
/obj/structure/rack/blob_act()
|
|
if(prob(75))
|
|
del(src)
|
|
return
|
|
else if(prob(50))
|
|
new /obj/item/weapon/rack_parts(src.loc)
|
|
del(src)
|
|
return
|
|
|
|
/obj/structure/rack/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
|
if(air_group || (height==0)) return 1
|
|
if(src.density == 0) //Because broken racks -Agouri |TODO: SPRITE!|
|
|
return 1
|
|
if(istype(mover) && mover.checkpass(PASSTABLE))
|
|
return 1
|
|
else
|
|
return 0
|
|
|
|
/obj/structure/rack/MouseDrop_T(obj/O as obj, mob/user as mob)
|
|
if ((!( istype(O, /obj/item/weapon) ) || user.equipped() != O))
|
|
return
|
|
if(isrobot(user))
|
|
return
|
|
user.drop_item()
|
|
if (O.loc != src.loc)
|
|
step(O, get_dir(O, src))
|
|
return
|
|
|
|
/obj/structure/rack/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
|
if (istype(W, /obj/item/weapon/wrench))
|
|
new /obj/item/weapon/rack_parts( src.loc )
|
|
playsound(src.loc, 'Ratchet.ogg', 50, 1)
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
if(isrobot(user))
|
|
return
|
|
user.drop_item()
|
|
if(W && W.loc) W.loc = src.loc
|
|
return
|
|
|
|
/obj/structure/rack/meteorhit(obj/O as obj)
|
|
del(src) |