good
This commit is contained in:
@@ -324,12 +324,12 @@ as performing this in action() will cause the upgrade to end up in the borg inst
|
||||
/obj/item/borg/upgrade/lavaproof/action(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if(.)
|
||||
R.weather_immunities += "lava"
|
||||
ADD_TRAIT(src, TRAIT_LAVA_IMMUNE, type)
|
||||
|
||||
/obj/item/borg/upgrade/lavaproof/deactivate(mob/living/silicon/robot/R, user = usr)
|
||||
. = ..()
|
||||
if (.)
|
||||
R.weather_immunities -= "lava"
|
||||
REMOVE_TRAIT(src, TRAIT_LAVA_IMMUNE, type)
|
||||
|
||||
/obj/item/borg/upgrade/selfrepair
|
||||
name = "self-repair module"
|
||||
|
||||
@@ -17,6 +17,16 @@
|
||||
barefootstep = FOOTSTEP_LAVA
|
||||
clawfootstep = FOOTSTEP_LAVA
|
||||
heavyfootstep = FOOTSTEP_LAVA
|
||||
/// How much fire damage we deal to living mobs stepping on us
|
||||
var/lava_damage = 20
|
||||
/// How many firestacks we add to living mobs stepping on us
|
||||
var/lava_firestacks = 20
|
||||
/// How much temperature we expose objects with
|
||||
var/temperature_damage = 10000
|
||||
/// mobs with this trait won't burn.
|
||||
var/immunity_trait = TRAIT_LAVA_IMMUNE
|
||||
/// objects with these flags won't burn.
|
||||
var/immunity_resistance_flags = LAVA_PROOF
|
||||
|
||||
/turf/open/lava/ex_act(severity, target, origin)
|
||||
contents_explosion(severity, target, origin)
|
||||
@@ -107,62 +117,98 @@
|
||||
LAZYREMOVE(found_safeties, S)
|
||||
return LAZYLEN(found_safeties)
|
||||
|
||||
///Generic return value of the can_burn_stuff() proc. Does nothing.
|
||||
#define LAVA_BE_IGNORING 0
|
||||
/// Another. Won't burn the target but will make the turf start processing.
|
||||
#define LAVA_BE_PROCESSING 1
|
||||
/// Burns the target and makes the turf process (depending on the return value of do_burn()).
|
||||
#define LAVA_BE_BURNING 2
|
||||
|
||||
/turf/open/lava/proc/burn_stuff(AM)
|
||||
. = 0
|
||||
///Proc that sets on fire something or everything on the turf that's not immune to lava. Returns TRUE to make the turf start processing.
|
||||
/turf/open/lava/proc/burn_stuff(atom/movable/to_burn, delta_time = 1)
|
||||
|
||||
if(is_safe())
|
||||
return FALSE
|
||||
|
||||
var/thing_to_check = src
|
||||
if (AM)
|
||||
thing_to_check = list(AM)
|
||||
for(var/thing in thing_to_check)
|
||||
if(isobj(thing))
|
||||
var/obj/O = thing
|
||||
if((O.resistance_flags & (LAVA_PROOF|INDESTRUCTIBLE)) || O.throwing)
|
||||
if (to_burn)
|
||||
thing_to_check = list(to_burn)
|
||||
for(var/atom/movable/burn_target as anything in thing_to_check)
|
||||
switch(can_burn_stuff(burn_target))
|
||||
if(LAVA_BE_IGNORING)
|
||||
continue
|
||||
. = 1
|
||||
if((O.resistance_flags & (ON_FIRE)))
|
||||
continue
|
||||
if(!(O.resistance_flags & FLAMMABLE))
|
||||
O.resistance_flags |= FLAMMABLE //Even fireproof things burn up in lava
|
||||
if(O.resistance_flags & FIRE_PROOF)
|
||||
O.resistance_flags &= ~FIRE_PROOF
|
||||
if(O.armor.fire > 50) //obj with 100% fire armor still get slowly burned away.
|
||||
O.armor = O.armor.setRating(fire = 50)
|
||||
O.fire_act(10000, 1000)
|
||||
|
||||
else if (isliving(thing))
|
||||
. = 1
|
||||
var/mob/living/L = thing
|
||||
if(L.movement_type & FLYING)
|
||||
continue //YOU'RE FLYING OVER IT
|
||||
if("lava" in L.weather_immunities)
|
||||
continue
|
||||
var/buckle_check = L.buckling
|
||||
if(!buckle_check)
|
||||
buckle_check = L.buckled
|
||||
if(isobj(buckle_check))
|
||||
var/obj/O = buckle_check
|
||||
if(O.resistance_flags & LAVA_PROOF)
|
||||
if(LAVA_BE_BURNING)
|
||||
if(!do_burn(burn_target, delta_time))
|
||||
continue
|
||||
else if(isliving(buckle_check))
|
||||
var/mob/living/live = buckle_check
|
||||
if("lava" in live.weather_immunities)
|
||||
continue
|
||||
if(iscarbon(L))
|
||||
var/mob/living/carbon/C = L
|
||||
var/obj/item/clothing/S = C.get_item_by_slot(ITEM_SLOT_OCLOTHING)
|
||||
var/obj/item/clothing/H = C.get_item_by_slot(ITEM_SLOT_HEAD)
|
||||
. = TRUE
|
||||
|
||||
if(S && H && S.clothing_flags & LAVAPROTECT && H.clothing_flags & LAVAPROTECT)
|
||||
return
|
||||
/turf/open/lava/proc/can_burn_stuff(atom/movable/burn_target)
|
||||
if(burn_target.movement_type & (FLYING|FLOATING)) //you're flying over it.
|
||||
return isliving(burn_target) ? LAVA_BE_PROCESSING : LAVA_BE_IGNORING
|
||||
|
||||
L.adjustFireLoss(20)
|
||||
if(L) //mobs turning into object corpses could get deleted here.
|
||||
L.adjust_fire_stacks(20)
|
||||
L.IgniteMob()
|
||||
if(isobj(burn_target))
|
||||
if(burn_target.throwing) // to avoid gulag prisoners easily escaping, throwing only works for objects.
|
||||
return LAVA_BE_IGNORING
|
||||
var/obj/burn_obj = burn_target
|
||||
if((burn_obj.resistance_flags & immunity_resistance_flags))
|
||||
return LAVA_BE_PROCESSING
|
||||
return LAVA_BE_BURNING
|
||||
|
||||
if (!isliving(burn_target))
|
||||
return LAVA_BE_IGNORING
|
||||
|
||||
if(HAS_TRAIT(burn_target, immunity_trait))
|
||||
return LAVA_BE_PROCESSING
|
||||
var/mob/living/burn_living = burn_target
|
||||
var/atom/movable/burn_buckled = burn_living.buckled
|
||||
if(burn_buckled)
|
||||
if(burn_buckled.movement_type & (FLYING|FLOATING))
|
||||
return LAVA_BE_PROCESSING
|
||||
if(isobj(burn_buckled))
|
||||
var/obj/burn_buckled_obj = burn_buckled
|
||||
if(burn_buckled_obj.resistance_flags & immunity_resistance_flags)
|
||||
return LAVA_BE_PROCESSING
|
||||
else if(HAS_TRAIT(burn_buckled, immunity_trait))
|
||||
return LAVA_BE_PROCESSING
|
||||
|
||||
if(iscarbon(burn_living))
|
||||
var/mob/living/carbon/burn_carbon = burn_living
|
||||
var/obj/item/clothing/burn_suit = burn_carbon.get_item_by_slot(ITEM_SLOT_OCLOTHING)
|
||||
var/obj/item/clothing/burn_helmet = burn_carbon.get_item_by_slot(ITEM_SLOT_HEAD)
|
||||
if(burn_suit?.clothing_flags & LAVAPROTECT && burn_helmet?.clothing_flags & LAVAPROTECT)
|
||||
return LAVA_BE_PROCESSING
|
||||
|
||||
return LAVA_BE_BURNING
|
||||
|
||||
#undef LAVA_BE_IGNORING
|
||||
#undef LAVA_BE_PROCESSING
|
||||
#undef LAVA_BE_BURNING
|
||||
|
||||
/turf/open/lava/proc/do_burn(atom/movable/burn_target, delta_time = 1)
|
||||
. = TRUE
|
||||
if(isobj(burn_target))
|
||||
var/obj/burn_obj = burn_target
|
||||
if(burn_obj.resistance_flags & ON_FIRE) // already on fire; skip it.
|
||||
return
|
||||
if(!(burn_obj.resistance_flags & FLAMMABLE))
|
||||
burn_obj.resistance_flags |= FLAMMABLE //Even fireproof things burn up in lava
|
||||
if(burn_obj.resistance_flags & FIRE_PROOF)
|
||||
burn_obj.resistance_flags &= ~FIRE_PROOF
|
||||
if(burn_obj.armor.fire > 50) //obj with 100% fire armor still get slowly burned away.
|
||||
burn_obj.armor = burn_obj.armor.setRating(fire = 50)
|
||||
burn_obj.fire_act(temperature_damage, 1000 * delta_time)
|
||||
if(istype(burn_obj, /obj/structure/closet))
|
||||
var/obj/structure/closet/burn_closet = burn_obj
|
||||
for(var/burn_content in burn_closet.contents)
|
||||
burn_stuff(burn_content)
|
||||
|
||||
var/mob/living/burn_living = burn_target
|
||||
burn_living.update_fire()
|
||||
|
||||
burn_living.adjustFireLoss(lava_damage * delta_time)
|
||||
if(!QDELETED(burn_living)) //mobs turning into object corpses could get deleted here.
|
||||
burn_living.adjust_fire_stacks(lava_firestacks * delta_time)
|
||||
burn_living.IgniteMob()
|
||||
|
||||
/turf/open/lava/smooth
|
||||
name = "lava"
|
||||
|
||||
Reference in New Issue
Block a user