mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
-Grilles can now be destroyed by fires.
-Added a define for the minimum amount of damage a mob takes from plasma. -Increased it to 20, from 10. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4931 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -14,202 +14,208 @@
|
|||||||
var/destroyed = 0
|
var/destroyed = 0
|
||||||
explosion_resistance = 5
|
explosion_resistance = 5
|
||||||
|
|
||||||
ex_act(severity)
|
/obj/structure/grille/ex_act(severity)
|
||||||
switch(severity)
|
switch(severity)
|
||||||
if(1.0)
|
if(1.0)
|
||||||
|
del(src)
|
||||||
|
return
|
||||||
|
if(2.0)
|
||||||
|
if(prob(50))
|
||||||
del(src)
|
del(src)
|
||||||
return
|
return
|
||||||
if(2.0)
|
if(3.0)
|
||||||
if(prob(50))
|
if(prob(25))
|
||||||
del(src)
|
src.health -= 11
|
||||||
return
|
healthcheck()
|
||||||
if(3.0)
|
return
|
||||||
if(prob(25))
|
|
||||||
src.health -= 11
|
/obj/structure/grille/blob_act()
|
||||||
healthcheck()
|
del(src)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
/obj/structure/grille/Bumped(atom/user)
|
||||||
|
if(ismob(user)) shock(user, 70)
|
||||||
|
|
||||||
|
|
||||||
blob_act()
|
/obj/structure/grille/meteorhit(var/obj/M)
|
||||||
del(src)
|
if (M.icon_state == "flaming")
|
||||||
return
|
src.health -= 2
|
||||||
|
healthcheck()
|
||||||
Bumped(atom/user)
|
return
|
||||||
if(ismob(user)) shock(user, 70)
|
|
||||||
|
|
||||||
|
|
||||||
meteorhit(var/obj/M)
|
/obj/structure/grille/attack_hand(var/mob/user)
|
||||||
if (M.icon_state == "flaming")
|
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||||
src.health -= 2
|
user.visible_message("[user.name] kicks the [src.name].", \
|
||||||
healthcheck()
|
"You kick the [src.name].", \
|
||||||
return
|
"You hear a noise")
|
||||||
|
if((HULK in usr.mutations) || (SUPRSTR in usr.augmentations))
|
||||||
|
src.health -= 5
|
||||||
|
else if(!shock(user, 70))
|
||||||
|
src.health -= 3
|
||||||
|
healthcheck()
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
attack_hand(var/mob/user)
|
/obj/structure/grille/attack_paw(var/mob/user)
|
||||||
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
attack_hand(user)
|
||||||
user.visible_message("[user.name] kicks the [src.name].", \
|
|
||||||
"You kick the [src.name].", \
|
|
||||||
"You hear a noise")
|
/obj/structure/grille/attack_alien(var/mob/user)
|
||||||
if((HULK in usr.mutations) || (SUPRSTR in usr.augmentations))
|
if (istype(usr, /mob/living/carbon/alien/larva)) return
|
||||||
src.health -= 5
|
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||||
else if(!shock(user, 70))
|
user.visible_message("[user.name] mangles the [src.name].", \
|
||||||
src.health -= 3
|
"You mangle the [src.name].", \
|
||||||
|
"You hear a noise")
|
||||||
|
if(!shock(usr, 70))
|
||||||
|
src.health -= 5
|
||||||
healthcheck()
|
healthcheck()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
/obj/structure/grille/attack_metroid(var/mob/user)
|
||||||
|
if(!istype(usr, /mob/living/carbon/metroid/adult)) return
|
||||||
|
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||||
|
user.visible_message("[user.name] smashes against the [src.name].", \
|
||||||
|
"You smash against the [src.name].", \
|
||||||
|
"You hear a noise")
|
||||||
|
src.health -= rand(2,3)
|
||||||
|
healthcheck()
|
||||||
|
return
|
||||||
|
|
||||||
attack_paw(var/mob/user)
|
/obj/structure/grille/attack_animal(var/mob/living/simple_animal/M as mob)
|
||||||
attack_hand(user)
|
if(M.melee_damage_upper == 0) return
|
||||||
|
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||||
|
M.visible_message("[M.name] smashes against the [src.name].", \
|
||||||
|
"You smash against the [src.name].", \
|
||||||
|
"You hear a noise")
|
||||||
|
src.health -= M.melee_damage_upper
|
||||||
|
healthcheck()
|
||||||
|
return
|
||||||
|
|
||||||
|
/obj/structure/grille/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||||
attack_alien(var/mob/user)
|
if(air_group || (height==0)) return 1
|
||||||
if (istype(usr, /mob/living/carbon/alien/larva)) return
|
if(istype(mover) && mover.checkpass(PASSGRILLE))
|
||||||
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
return 1
|
||||||
user.visible_message("[user.name] mangles the [src.name].", \
|
else
|
||||||
"You mangle the [src.name].", \
|
if (istype(mover, /obj/item/projectile))
|
||||||
"You hear a noise")
|
return prob(30)
|
||||||
if(!shock(usr, 70))
|
|
||||||
src.health -= 5
|
|
||||||
healthcheck()
|
|
||||||
return
|
|
||||||
|
|
||||||
attack_metroid(var/mob/user)
|
|
||||||
if(!istype(usr, /mob/living/carbon/metroid/adult)) return
|
|
||||||
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
|
||||||
user.visible_message("[user.name] smashes against the [src.name].", \
|
|
||||||
"You smash against the [src.name].", \
|
|
||||||
"You hear a noise")
|
|
||||||
src.health -= rand(2,3)
|
|
||||||
healthcheck()
|
|
||||||
return
|
|
||||||
|
|
||||||
attack_animal(var/mob/living/simple_animal/M as mob)
|
|
||||||
if(M.melee_damage_upper == 0) return
|
|
||||||
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
|
||||||
M.visible_message("[M.name] smashes against the [src.name].", \
|
|
||||||
"You smash against the [src.name].", \
|
|
||||||
"You hear a noise")
|
|
||||||
src.health -= M.melee_damage_upper
|
|
||||||
healthcheck()
|
|
||||||
return
|
|
||||||
|
|
||||||
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
|
else
|
||||||
if (istype(mover, /obj/item/projectile))
|
return !src.density
|
||||||
return prob(30)
|
|
||||||
|
|
||||||
|
/obj/structure/grille/attackby(obj/item/weapon/W, mob/user)
|
||||||
|
if(iswirecutter(W))
|
||||||
|
if(!shock(user, 100))
|
||||||
|
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
|
||||||
|
src.health = 0
|
||||||
|
if(!destroyed)
|
||||||
|
src.health = -100
|
||||||
|
else if ((isscrewdriver(W)) && (istype(src.loc, /turf/simulated) || src.anchored))
|
||||||
|
if(!shock(user, 90))
|
||||||
|
playsound(src.loc, 'sound/items/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/stack/sheet/rglass) || istype(W,/obj/item/stack/sheet/glass) )
|
||||||
|
var/dir_to_set = 1
|
||||||
|
if(src.loc == usr.loc)
|
||||||
|
dir_to_set = usr.dir
|
||||||
|
else
|
||||||
|
if( ( src.x == usr.x ) || (src.y == usr.y) ) //Only supposed to work for cardinal directions.
|
||||||
|
if( src.x == usr.x )
|
||||||
|
if( src.y > usr.y )
|
||||||
|
dir_to_set = 2
|
||||||
|
else
|
||||||
|
dir_to_set = 1
|
||||||
|
else if( src.y == usr.y )
|
||||||
|
if( src.x > usr.x )
|
||||||
|
dir_to_set = 8
|
||||||
|
else
|
||||||
|
dir_to_set = 4
|
||||||
else
|
else
|
||||||
return !src.density
|
usr << "\red You can't reach there.."
|
||||||
|
return //Only works for cardinal direcitons, diagonals aren't supposed to work like this.
|
||||||
|
for(var/obj/structure/window/WINDOW in src.loc)
|
||||||
attackby(obj/item/weapon/W, mob/user)
|
if(WINDOW.dir == dir_to_set)
|
||||||
if(iswirecutter(W))
|
usr << "\red There is already a window facing this way there."
|
||||||
if(!shock(user, 100))
|
|
||||||
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
|
|
||||||
src.health = 0
|
|
||||||
if(!destroyed)
|
|
||||||
src.health = -100
|
|
||||||
else if ((isscrewdriver(W)) && (istype(src.loc, /turf/simulated) || src.anchored))
|
|
||||||
if(!shock(user, 90))
|
|
||||||
playsound(src.loc, 'sound/items/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
|
return
|
||||||
else if( istype(W,/obj/item/stack/sheet/rglass) || istype(W,/obj/item/stack/sheet/glass) )
|
usr << "\blue You start placing the window"
|
||||||
var/dir_to_set = 1
|
if(do_after(user,20))
|
||||||
if(src.loc == usr.loc)
|
if(!src) return //Grille destroyed while waiting
|
||||||
dir_to_set = usr.dir
|
|
||||||
else
|
|
||||||
if( ( src.x == usr.x ) || (src.y == usr.y) ) //Only supposed to work for cardinal directions.
|
|
||||||
if( src.x == usr.x )
|
|
||||||
if( src.y > usr.y )
|
|
||||||
dir_to_set = 2
|
|
||||||
else
|
|
||||||
dir_to_set = 1
|
|
||||||
else if( src.y == usr.y )
|
|
||||||
if( src.x > usr.x )
|
|
||||||
dir_to_set = 8
|
|
||||||
else
|
|
||||||
dir_to_set = 4
|
|
||||||
else
|
|
||||||
usr << "\red You can't reach there.."
|
|
||||||
return //Only works for cardinal direcitons, diagonals aren't supposed to work like this.
|
|
||||||
for(var/obj/structure/window/WINDOW in src.loc)
|
for(var/obj/structure/window/WINDOW in src.loc)
|
||||||
if(WINDOW.dir == dir_to_set)
|
if(WINDOW.dir == dir_to_set)//checking this for a 2nd time to check if a window was made while we were waiting.
|
||||||
usr << "\red There is already a window facing this way there."
|
usr << "\red There is already a window facing this way there."
|
||||||
return
|
return
|
||||||
usr << "\blue You start placing the window"
|
var/obj/structure/window/WD
|
||||||
if(do_after(user,20))
|
if(istype(W,/obj/item/stack/sheet/rglass))
|
||||||
if(!src) return //Grille destroyed while waiting
|
WD = new/obj/structure/window(src.loc,1) //reinforced window
|
||||||
for(var/obj/structure/window/WINDOW in src.loc)
|
|
||||||
if(WINDOW.dir == dir_to_set)//checking this for a 2nd time to check if a window was made while we were waiting.
|
|
||||||
usr << "\red There is already a window facing this way there."
|
|
||||||
return
|
|
||||||
var/obj/structure/window/WD
|
|
||||||
if(istype(W,/obj/item/stack/sheet/rglass))
|
|
||||||
WD = new/obj/structure/window(src.loc,1) //reinforced window
|
|
||||||
else
|
|
||||||
WD = new/obj/structure/window(src.loc,0) //normal window
|
|
||||||
WD.dir = dir_to_set
|
|
||||||
WD.ini_dir = dir_to_set
|
|
||||||
WD.anchored = 0
|
|
||||||
WD.state = 0
|
|
||||||
var/obj/item/stack/ST = W
|
|
||||||
ST.use(1)
|
|
||||||
usr << "\blue You place the [WD] on the [src]"
|
|
||||||
return
|
|
||||||
else if(istype(W, /obj/item/weapon/shard))
|
|
||||||
src.health -= W.force * 0.1
|
|
||||||
else if(!shock(user, 70))
|
|
||||||
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
|
||||||
switch(W.damtype)
|
|
||||||
if("fire")
|
|
||||||
src.health -= W.force
|
|
||||||
if("brute")
|
|
||||||
src.health -= W.force * 0.1
|
|
||||||
src.healthcheck()
|
|
||||||
..()
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
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
|
else
|
||||||
if (src.health <= -10.0)
|
WD = new/obj/structure/window(src.loc,0) //normal window
|
||||||
new /obj/item/stack/rods( src.loc )
|
WD.dir = dir_to_set
|
||||||
//SN src = null
|
WD.ini_dir = dir_to_set
|
||||||
del(src)
|
WD.anchored = 0
|
||||||
return
|
WD.state = 0
|
||||||
|
var/obj/item/stack/ST = W
|
||||||
|
ST.use(1)
|
||||||
|
usr << "\blue You place the [WD] on the [src]"
|
||||||
return
|
return
|
||||||
|
else if(istype(W, /obj/item/weapon/shard))
|
||||||
|
src.health -= W.force * 0.1
|
||||||
|
else if(!shock(user, 70))
|
||||||
|
playsound(src.loc, 'sound/effects/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/structure/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)
|
// shock user with probability prb (if all connections & power are working)
|
||||||
// returns 1 if shocked, 0 otherwise
|
// returns 1 if shocked, 0 otherwise
|
||||||
|
|
||||||
proc/shock(mob/user, prb)
|
/obj/structure/grille/proc/shock(mob/user, prb)
|
||||||
if(!anchored || destroyed) // anchored/destroyed grilles are never connected
|
if(!anchored || destroyed) // anchored/destroyed grilles are never connected
|
||||||
return 0
|
|
||||||
if(!prob(prb))
|
|
||||||
return 0
|
|
||||||
if(!in_range(src, usr))//To prevent TK and mech users from getting shocked
|
|
||||||
return 0
|
|
||||||
var/turf/T = get_turf(src)
|
|
||||||
var/obj/structure/cable/C = T.get_cable_node()
|
|
||||||
if(C)
|
|
||||||
if (electrocute_mob(user, C, src))
|
|
||||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
|
||||||
s.set_up(5, 1, src)
|
|
||||||
s.start()
|
|
||||||
return 1
|
|
||||||
else
|
|
||||||
return 0
|
|
||||||
return 0
|
return 0
|
||||||
|
if(!prob(prb))
|
||||||
|
return 0
|
||||||
|
if(!in_range(src, usr))//To prevent TK and mech users from getting shocked
|
||||||
|
return 0
|
||||||
|
var/turf/T = get_turf(src)
|
||||||
|
var/obj/structure/cable/C = T.get_cable_node()
|
||||||
|
if(C)
|
||||||
|
if (electrocute_mob(user, C, src))
|
||||||
|
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||||
|
s.set_up(5, 1, src)
|
||||||
|
s.start()
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
return 0
|
||||||
|
|
||||||
|
/obj/structure/grille/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||||
|
if(!destroyed)
|
||||||
|
if(exposed_temperature > T0C + 1500)
|
||||||
|
src.health -= 1
|
||||||
|
healthcheck()
|
||||||
|
..()
|
||||||
@@ -414,7 +414,7 @@
|
|||||||
|
|
||||||
if(Toxins_pp > safe_toxins_max) // Too much toxins
|
if(Toxins_pp > safe_toxins_max) // Too much toxins
|
||||||
var/ratio = breath.toxins/safe_toxins_max
|
var/ratio = breath.toxins/safe_toxins_max
|
||||||
adjustToxLoss(min(ratio, 10)) //Limit amount of damage toxin exposure can do per second
|
adjustToxLoss(min(ratio, MIN_PLASMA_DAMAGE)) //Limit amount of damage toxin exposure can do per second
|
||||||
toxins_alert = max(toxins_alert, 1)
|
toxins_alert = max(toxins_alert, 1)
|
||||||
else
|
else
|
||||||
toxins_alert = 0
|
toxins_alert = 0
|
||||||
|
|||||||
@@ -288,7 +288,7 @@
|
|||||||
|
|
||||||
if(Toxins_pp > safe_toxins_max) // Too much toxins
|
if(Toxins_pp > safe_toxins_max) // Too much toxins
|
||||||
var/ratio = breath.toxins/safe_toxins_max
|
var/ratio = breath.toxins/safe_toxins_max
|
||||||
adjustToxLoss(min(ratio, 10)) //Limit amount of damage toxin exposure can do per second
|
adjustToxLoss(min(ratio, MIN_PLASMA_DAMAGE)) //Limit amount of damage toxin exposure can do per second
|
||||||
toxins_alert = max(toxins_alert, 1)
|
toxins_alert = max(toxins_alert, 1)
|
||||||
else
|
else
|
||||||
toxins_alert = 0
|
toxins_alert = 0
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#define MOLES_N2STANDARD MOLES_CELLSTANDARD*N2STANDARD // N2 standard value (79%)
|
#define MOLES_N2STANDARD MOLES_CELLSTANDARD*N2STANDARD // N2 standard value (79%)
|
||||||
|
|
||||||
#define MOLES_PLASMA_VISIBLE 0.7 //Moles in a standard cell after which plasma is visible
|
#define MOLES_PLASMA_VISIBLE 0.7 //Moles in a standard cell after which plasma is visible
|
||||||
|
#define MIN_PLASMA_DAMAGE 20
|
||||||
|
|
||||||
#define BREATH_VOLUME 0.5 //liters in a normal breath
|
#define BREATH_VOLUME 0.5 //liters in a normal breath
|
||||||
#define BREATH_PERCENTAGE BREATH_VOLUME/CELL_VOLUME
|
#define BREATH_PERCENTAGE BREATH_VOLUME/CELL_VOLUME
|
||||||
@@ -38,7 +39,7 @@
|
|||||||
|
|
||||||
#define SPACE_HELMET_MIN_COLD_PROTECITON_TEMPERATURE 2.0 //what min_cold_protection_temperature is set to for space-helmet quality headwear. MUST NOT BE 0.
|
#define SPACE_HELMET_MIN_COLD_PROTECITON_TEMPERATURE 2.0 //what min_cold_protection_temperature is set to for space-helmet quality headwear. MUST NOT BE 0.
|
||||||
#define SPACE_SUIT_MIN_COLD_PROTECITON_TEMPERATURE 2.0 //what min_cold_protection_temperature is set to for space-suit quality jumpsuits or suits. MUST NOT BE 0.
|
#define SPACE_SUIT_MIN_COLD_PROTECITON_TEMPERATURE 2.0 //what min_cold_protection_temperature is set to for space-suit quality jumpsuits or suits. MUST NOT BE 0.
|
||||||
#define FIRESUIT_MAX_HEAT_PROTECITON_TEMPERATURE 15000 //what max_heat_protection_temperature is set to for firesuit quality headwear. MUST NOT BE 0.
|
#define FIRESUIT_MAX_HEAT_PROTECITON_TEMPERATURE 30000 //what max_heat_protection_temperature is set to for firesuit quality headwear. MUST NOT BE 0.
|
||||||
#define FIRE_HELMET_MAX_HEAT_PROTECITON_TEMPERATURE 15000 //for fire helmet quality items (red and white hardhats)
|
#define FIRE_HELMET_MAX_HEAT_PROTECITON_TEMPERATURE 15000 //for fire helmet quality items (red and white hardhats)
|
||||||
#define HELMET_MIN_COLD_PROTECITON_TEMPERATURE 160 //For normal helmets
|
#define HELMET_MIN_COLD_PROTECITON_TEMPERATURE 160 //For normal helmets
|
||||||
#define HELMET_MAX_HEAT_PROTECITON_TEMPERATURE 600 //For normal helmets
|
#define HELMET_MAX_HEAT_PROTECITON_TEMPERATURE 600 //For normal helmets
|
||||||
@@ -127,7 +128,7 @@ var/MAX_EXPLOSION_RANGE = 14
|
|||||||
|
|
||||||
#define HUMAN_STRIP_DELAY 40 //takes 40ds = 4s to strip someone.
|
#define HUMAN_STRIP_DELAY 40 //takes 40ds = 4s to strip someone.
|
||||||
|
|
||||||
#define ALIEN_SELECT_AFK_BUFFER 2 // How many minutes that a person can be AFK before not being allowed to be an alien.
|
#define ALIEN_SELECT_AFK_BUFFER 1 // How many minutes that a person can be AFK before not being allowed to be an alien.
|
||||||
|
|
||||||
#define NORMPIPERATE 30 //pipe-insulation rate divisor
|
#define NORMPIPERATE 30 //pipe-insulation rate divisor
|
||||||
#define HEATPIPERATE 8 //heat-exch pipe insulation
|
#define HEATPIPERATE 8 //heat-exch pipe insulation
|
||||||
|
|||||||
Reference in New Issue
Block a user