Files
Paradise/code/game/objects/grille.dm
vageyenaman@gmail.com ebcdc09c10 There's a few things in this revision made by me, and some made by other people that
requested I commit into the SVN. Please PM the collective coders if you find any bugs in 

their work.


AI:

     The AI now has a verb that lets it change its appearance. It doesn't do much, but but 

it's some neat aesthetics that compliment the little display panes scattered around the 

station that the AI can modify. This was a combined effort between Firecage, Petethegoat, 

and Superxpdude.



Miscellaneous Changes (by Petethegreat):

     - Cup Ramen sprite changed to a nicer one by Cheridan
     - Plasma sheet sprite changed to a thicker one by Aru




Metroids:

     They work. There might be some lingering bugs I simply cannot catch by testing alone, 

but they WORK. They act as an entire new player-controllable race, are found in 

xeniobiology, and I refuse to say anything else on the matter that would spoil anything. If 

you feel so entitled to, you can view the source code to spoil everything like a little 

cheater! I haven't completed everything I would like to, and as a result Metroids are 

pretty useless. They're still very fun though!

     Xenobiology, as a result of Metroids, got a bit of expansion. Scientists have access 

to Xenobiology now, for now. If anyone wants Xenobiology to become a standalone job or 

whatever, here's the place to post feedback.


Bugfixes:
     
     - Perriot's Throat virus no longer makes you mute, instead, does what it was intended 

to HONKHONKHONKHONK!!!!
     - Some bugfixes with Turrets.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1774 316c924e-a436-60f5-8080-3fe189b3f50e
2011-07-05 19:34:42 +00:00

168 lines
4.5 KiB
Plaintext

/obj/grille/ex_act(severity)
switch(severity)
if(1.0)
del(src)
return
if(2.0)
if (prob(50))
//SN src = null
del(src)
return
if(3.0)
if (prob(25))
src.health -= 11
healthcheck()
else
return
/obj/grille/blob_act()
del(src)
/obj/grille/meteorhit(var/obj/M)
if (M.icon_state == "flaming")
src.health -= 2
healthcheck()
return
/obj/grille/attack_hand(var/obj/M)
if ((usr.mutations & HULK))
usr << text("\blue You kick the grille.")
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [] kicks the grille.", usr)
src.health -= 5
healthcheck()
return
else if(!shock(usr, 70))
usr << text("\blue You kick the grille.")
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [] kicks the grille.", usr)
playsound(src.loc, 'grillehit.ogg', 80, 1)
src.health -= 3
healthcheck()
/obj/grille/attack_paw(var/obj/M)
if ((usr.mutations & HULK))
usr << text("\blue You kick the grille.")
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [] kicks the grille.", usr)
src.health -= 5
healthcheck()
return
else if(!shock(usr, 70))
usr << text("\blue You kick the grille.")
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [] kicks the grille.", usr)
playsound(src.loc, 'grillehit.ogg', 80, 1)
src.health -= 3
/obj/grille/attack_alien(var/obj/M)
if (istype(usr, /mob/living/carbon/alien/larva))//Safety check for larva, in case they get attack_alien in the future. /N
return
if (!shock(usr, 70))
usr << text("\green You mangle the grille.")
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [] mangles the grille.", usr)
playsound(src.loc, 'grillehit.ogg', 80, 1)
src.health -= 3
healthcheck()
return
/obj/grille/attack_metroid(var/obj/M)
if(!istype(usr, /mob/living/carbon/metroid/adult))
return
usr<< text("\green You smash against the grille.")
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [] smashes against the grille.", usr)
playsound(src.loc, 'grillehit.ogg', 80, 1)
src.health -= rand(2,3)
healthcheck()
return
return
/obj/grille/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0)) return 1
if(istype(mover) && mover.checkpass(PASSGRILLE))
return 1
else
if (istype(mover, /obj/item/projectile))
return prob(30)
else
return !src.density
/obj/grille/attackby(obj/item/weapon/W, mob/user)
if (istype(W, /obj/item/weapon/wirecutters))
if(!(destroyed))
if(!shock(user, 100))
playsound(src.loc, 'Wirecutter.ogg', 100, 1)
src.health = 0
else
playsound(src.loc, 'Wirecutter.ogg', 100, 1)
src.health = -100
else if ((istype(W, /obj/item/weapon/screwdriver) && (istype(src.loc, /turf/simulated) || src.anchored)))
if(!shock(user, 90))
playsound(src.loc, 'Screwdriver.ogg', 100, 1)
src.anchored = !( src.anchored )
user << (src.anchored ? "You have fastened the grille to the floor." : "You have unfastened the grill.")
for(var/mob/O in oviewers())
O << text("\red [user] [src.anchored ? "fastens" : "unfastens"] the grille.")
return
else if(istype(W, /obj/item/weapon/shard)) // can't get a shock by attacking with glass shard
src.health -= W.force * 0.1
else // anything else, chance of a shock
if(!shock(user, 70))
playsound(src.loc, 'grillehit.ogg', 80, 1)
switch(W.damtype)
if("fire")
src.health -= W.force
if("brute")
src.health -= W.force * 0.1
src.healthcheck()
..()
return
/obj/grille/proc/healthcheck()
if (src.health <= 0)
if (!( src.destroyed ))
src.icon_state = "brokengrille"
src.density = 0
src.destroyed = 1
new /obj/item/stack/rods( src.loc )
else
if (src.health <= -10.0)
new /obj/item/stack/rods( src.loc )
//SN src = null
del(src)
return
return
// shock user with probability prb (if all connections & power are working)
// returns 1 if shocked, 0 otherwise
/obj/grille/proc/shock(mob/user, prb)
if(!anchored || destroyed) // anchored/destroyed grilles are never connected
return 0
if(!prob(prb))
return 0
var/turf/T = get_turf(src)
if (electrocute_mob(user, T.get_cable_node(), src))
var/datum/effects/system/spark_spread/s = new /datum/effects/system/spark_spread
s.set_up(5, 1, src)
s.start()
return 1
else
return 0