mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-25 08:34:23 +00:00
A lot of different calls for update_inv_[slot] now won't call for update_icons.dm(). Such as dropping, throwing, picking up objects, moving objects around your gear, using your active hand, firing guns, stripping, etc. All the different calls for UpdateDamageIcon() now they won't call for update_icons() The different sprites of humans/monkeys will now have their own layer, humans starting with MUTANTRACE_LAYER in layer -1 to R_HAND_LAYER in layer -20, so the sprites don't get messy overlapping eachother if update_icons() is not called. To help this change, all layers numbers were changed, R_HAND_LAYER used to be 1, now it's 20. (This can be changed back if it ends up being confusing or ugly to read) TL;RL I removed 90% of the calls for update_icons() modifying the different update procs of update_icons.dm of monkeys/humans. The goal is to reduce lag. JUST IN CASE, lying down will call for update_icons(), so players have an easy way to update their icons if something goes horribly wrong. Which won't. I hope. Fixes issue 842. Handcuffs sprites appearing on the player's UI if this one was handcuffed. Because I liked this we'll call it feature and add some awesome sprites made by Cheridan, you'll now have a new sprite on your UI telling you "you're handcuffed buddy!". (Also he named the sprites so don't blame me) git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5809 316c924e-a436-60f5-8080-3fe189b3f50e
155 lines
6.3 KiB
Plaintext
155 lines
6.3 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)
|
|
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/datum/limb/affecting = user.get_organ(organ)
|
|
if(affecting.take_damage(0,force))
|
|
user.UpdateDamageIcon(0)
|
|
else
|
|
user.take_organ_damage(0,force)
|
|
|
|
/obj/item/weapon/grown/nettle/afterattack(atom/A as mob|obj, mob/user as mob)
|
|
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/datum/limb/affecting = user.get_organ(organ)
|
|
if(affecting.take_damage(0,force))
|
|
user.UpdateDamageIcon(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!"
|
|
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Had the [src.name] used on them by [user.name] ([user.ckey])</font>")
|
|
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] on [M.name] ([M.ckey])</font>")
|
|
|
|
log_attack("<font color='red'> [user.name] ([user.ckey]) used the [src.name] on [M.name] ([M.ckey])</font>")
|
|
|
|
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)
|
|
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 |