Files
Paradise/code/game/objects/grille.dm
panurgomatic 15a5ecdd06 - Moved passability flags from atom/var/flags to atom/var/pass_flags.
Currently there are three - PASSTABLE, PASSGLASS and PASSGRILLE. PASSTABLE - same as TABLEPASS, PASSGRILLE - can this atom pass through grilles and PASSGLASS - can this atom pass through windows, glass doors, etc. Most can_pass() procs were updated.
Added checkpass atom proc to check if this atom has certain pass_flag set.
- Added proc/sanitize_simple() and proc/strip_html_simple(). sanitize_simple does not html_encode the string and strip_html_simple does not sanitize it. Additionally, sanitize_simple and sanitize can take associative list of key-val chars as second argument, where key is char to searh for and val is replacement.
- Added datum/gas_mixture/proc/return_volume() and datum/gas_mixture/proc/return_temperature().
- Added proc/tg_text2list() and proc/tg_list2text(). tg_list2text is slower then dd_list2text, but processes associative lists differently (it adds not the keys, but associated values). tg_text2list is somewhat faster then dd_text2list.
- Added proc/listclearnulls(), proc/difflist(), proc/intersectlist() and proc/uniquemergelist(). Check the code comments for more info.
- Mechs can hold 3 equipment pieces. Gygax can hold 4.
- Tweaked global_iterator CRASH report.
- Fixed mech pilot ejection if mecha was destroyed.
- Fixed mech fabricator process() waiting for sync() to finish.
- Fixed mech fabricator Topic() waiting for process_queue() to finish.
- Some bugixes related to global map and random sectors.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1722 316c924e-a436-60f5-8080-3fe189b3f50e
2011-06-24 23:30:27 +00:00

154 lines
4.1 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/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