mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-14 02:43:16 +00:00
All the logging i have found in the code was changed to use the proc(maybe i missed something) Killed all runtimes found so far Proc now handles all the checks, no need to add checks in the body of object
155 lines
6.2 KiB
Plaintext
155 lines
6.2 KiB
Plaintext
/* Hydroponic Item Procs and Stuff
|
|
* Contains:
|
|
* Sunflowers Novaflowers Nettle Deathnettle Corncob
|
|
*/
|
|
|
|
//Sun/Novaflower
|
|
/obj/item/weapon/grown/sunflower/attack(mob/M as mob, mob/user as mob)
|
|
M << "<font color='green'><b> [user] smacks you with a sunflower!</font><font color='yellow'><b>FLOWER POWER<b></font>"
|
|
user << "<font color='green'> Your sunflower's </font><font color='yellow'><b>FLOWER POWER</b></font><font color='green'> strikes [M]</font>"
|
|
|
|
/obj/item/weapon/grown/novaflower/attack(mob/living/carbon/M as mob, mob/user as mob)
|
|
if(!..()) return
|
|
if(istype(M, /mob/living))
|
|
M << "\red You are heated by the warmth of the of the [name]!"
|
|
M.bodytemperature += potency/2 * TEMPERATURE_DAMAGE_COEFFICIENT
|
|
|
|
/obj/item/weapon/grown/novaflower/afterattack(atom/A as mob|obj, mob/user as mob,proximity)
|
|
if(!proximity) return
|
|
if(endurance > 0)
|
|
endurance -= rand(1,(endurance/3)+1)
|
|
else
|
|
usr << "All the petals have fallen off the [name] from violent whacking."
|
|
del(src)
|
|
|
|
/obj/item/weapon/grown/novaflower/pickup(mob/living/carbon/human/user as mob)
|
|
if(!user.gloves)
|
|
user << "\red The [name] burns your bare hand!"
|
|
user.adjustFireLoss(rand(1,5))
|
|
|
|
//Nettle
|
|
/obj/item/weapon/grown/nettle/pickup(mob/living/carbon/human/user as mob)
|
|
if(!user.gloves)
|
|
user << "\red The nettle burns your bare hand!"
|
|
if(istype(user, /mob/living/carbon/human))
|
|
var/organ = ((user.hand ? "l_":"r_") + "arm")
|
|
var/obj/item/organ/limb/affecting = user.get_organ(organ)
|
|
if(affecting.take_damage(0,force))
|
|
user.update_damage_overlays(0)
|
|
else
|
|
user.take_organ_damage(0,force)
|
|
|
|
/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)
|
|
else
|
|
usr << "All the leaves have fallen off the nettle from violent whacking."
|
|
del(src)
|
|
|
|
/obj/item/weapon/grown/nettle/changePotency(newValue) //-QualityVan
|
|
potency = newValue
|
|
force = round((5+potency/5), 1)
|
|
|
|
//Deathnettle
|
|
/obj/item/weapon/grown/deathnettle/pickup(mob/living/carbon/human/user as mob)
|
|
if(!user.gloves)
|
|
if(istype(user, /mob/living/carbon/human))
|
|
var/organ = ((user.hand ? "l_":"r_") + "arm")
|
|
var/obj/item/organ/limb/affecting = user.get_organ(organ)
|
|
if(affecting.take_damage(0,force))
|
|
user.update_damage_overlays(0)
|
|
else
|
|
user.take_organ_damage(0,force)
|
|
if(prob(50))
|
|
user.Paralyse(5)
|
|
user << "\red You are stunned by the Deathnettle when you try picking it up!"
|
|
|
|
/obj/item/weapon/grown/deathnettle/attack(mob/living/carbon/M as mob, mob/user as mob)
|
|
if(!..()) return
|
|
if(istype(M, /mob/living))
|
|
M << "\red You are stunned by the powerful acid of the Deathnettle!"
|
|
add_logs(user, M, "attacked", object="[src.name]")
|
|
|
|
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
|
|
|
|
M.eye_blurry += force/7
|
|
if(prob(20))
|
|
M.Paralyse(force/6)
|
|
M.Weaken(force/15)
|
|
M.drop_item()
|
|
|
|
/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
|
|
|
|
else
|
|
usr << "All the leaves have fallen off the deathnettle from violent whacking."
|
|
del(src)
|
|
|
|
/obj/item/weapon/grown/deathnettle/changePotency(newValue) //-QualityVan
|
|
potency = newValue
|
|
force = round((5+potency/2.5), 1)
|
|
|
|
|
|
//Corncob
|
|
/obj/item/weapon/corncob/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
|
..()
|
|
if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/kitchen/utensil/knife))
|
|
user << "<span class='notice'>You use [W] to fashion a pipe out of the corn cob!</span>"
|
|
new /obj/item/clothing/mask/cigarette/pipe/cobpipe (user.loc)
|
|
del(src)
|
|
return
|
|
|
|
//Bluespace Tomatoes
|
|
/obj/item/weapon/reagent_containers/food/snacks/grown/bluespacetomato/throw_impact(atom/hit_atom)
|
|
..()
|
|
var/mob/M = usr
|
|
var/outer_teleport_radius = potency/10 //Plant potency determines radius of teleport.
|
|
var/inner_teleport_radius = potency/15
|
|
var/list/turfs = new/list()
|
|
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
|
if(inner_teleport_radius < 1) //Wasn't potent enough, it just splats.
|
|
new/obj/effect/decal/cleanable/oil(src.loc)
|
|
src.visible_message("<span class='notice'>The [src.name] has been squashed.</span>","<span class='moderate'>You hear a smack.</span>")
|
|
del(src)
|
|
return
|
|
for(var/turf/T in orange(M,outer_teleport_radius))
|
|
if(T in orange(M,inner_teleport_radius)) continue
|
|
if(istype(T,/turf/space)) continue
|
|
if(T.density) continue
|
|
if(T.x>world.maxx-outer_teleport_radius || T.x<outer_teleport_radius) continue
|
|
if(T.y>world.maxy-outer_teleport_radius || T.y<outer_teleport_radius) continue
|
|
turfs += T
|
|
if(!turfs.len)
|
|
var/list/turfs_to_pick_from = list()
|
|
for(var/turf/T in orange(M,outer_teleport_radius))
|
|
if(!(T in orange(M,inner_teleport_radius)))
|
|
turfs_to_pick_from += T
|
|
turfs += pick(/turf in turfs_to_pick_from)
|
|
var/turf/picked = pick(turfs)
|
|
if(!isturf(picked)) return
|
|
switch(rand(1,2))//Decides randomly to teleport the thrower or the throwee.
|
|
if(1) // Teleports the person who threw the tomato.
|
|
s.set_up(3, 1, M)
|
|
s.start()
|
|
new/obj/effect/decal/cleanable/molten_item(M.loc) //Leaves a pile of goo behind for dramatic effect.
|
|
M.loc = picked //
|
|
sleep(1)
|
|
s.set_up(3, 1, M)
|
|
s.start() //Two set of sparks, one before the teleport and one after.
|
|
if(2) //Teleports mob the tomato hit instead.
|
|
for(var/mob/A in get_turf(hit_atom))//For the mobs in the tile that was hit...
|
|
s.set_up(3, 1, A)
|
|
s.start()
|
|
new/obj/effect/decal/cleanable/molten_item(A.loc) //Leave a pile of goo behind for dramatic effect...
|
|
A.loc = picked//And teleport them to the chosen location.
|
|
sleep(1)
|
|
s.set_up(3, 1, A)
|
|
s.start()
|
|
new/obj/effect/decal/cleanable/oil(src.loc)
|
|
src.visible_message("<span class='notice'>The [src.name] has been squashed, causing a distortion in space-time.</span>","<span class='moderate'>You hear a splat and a crackle.</span>")
|
|
del(src)
|
|
return |