Skip to content

Commit

Permalink
afdasdf
Browse files Browse the repository at this point in the history
  • Loading branch information
Anorak2024 committed Oct 23, 2024
1 parent 5ab9897 commit 6bc1074
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 10 deletions.
22 changes: 19 additions & 3 deletions code/datums/weather/weather_types/ash_storm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,32 @@
return .
if(ishuman(mob_to_check))
var/mob/living/carbon/human/human_mob = mob_to_check
if(human_mob.get_thermal_protection() >= FIRE_IMMUNITY_MAX_TEMP_PROTECT)
if(human_mob.get_main_thermal_protection() >= FIRE_IMMUNITY_MAX_TEMP_PROTECT)
return FALSE
else if(istype(mob_to_check, /mob/living/simple_animal/borer))
var/mob/living/simple_animal/borer/borer = mob_to_check
if(borer.host?.get_thermal_protection() >= FIRE_IMMUNITY_MAX_TEMP_PROTECT)
if(borer.host?.get_main_thermal_protection() >= FIRE_IMMUNITY_MAX_TEMP_PROTECT)
return FALSE


/datum/weather/ash_storm/weather_act(mob/living/target)
target.adjustFireLoss(4)
if(!ishuman(target))
target.adjustFireLoss(4)
return

target.apply_damage((1 - target.getarmor(BODY_ZONE_HEAD, FIRE) / 100) * THERMAL_PROTECTION_HEAD * 4, BURN, BODY_ZONE_HEAD)
target.apply_damage((1 - target.getarmor(BODY_ZONE_CHEST, FIRE) / 100) * THERMAL_PROTECTION_UPPER_TORSO * 4, BURN, BODY_ZONE_CHEST)
target.apply_damage((1 - target.getarmor(BODY_ZONE_PRECISE_GROIN, FIRE) / 100) * THERMAL_PROTECTION_LOWER_TORSO * 4, BURN, BODY_ZONE_PRECISE_GROIN)

target.apply_damage((1 - target.getarmor(BODY_ZONE_L_ARM, FIRE) / 100) * THERMAL_PROTECTION_ARM_LEFT * 4, BURN, BODY_ZONE_L_ARM)
target.apply_damage((1 - target.getarmor(BODY_ZONE_PRECISE_L_HAND, FIRE) / 100) * THERMAL_PROTECTION_HAND_LEFT * 4, BURN, BODY_ZONE_PRECISE_L_HAND)
target.apply_damage((1 - target.getarmor(BODY_ZONE_R_ARM, FIRE) / 100) * THERMAL_PROTECTION_ARM_RIGHT * 4, BURN, BODY_ZONE_R_ARM)
target.apply_damage((1 - target.getarmor(BODY_ZONE_PRECISE_R_HAND, FIRE) / 100) * THERMAL_PROTECTION_HAND_RIGHT * 4, BURN, BODY_ZONE_PRECISE_R_HAND)

target.apply_damage((1 - target.getarmor(BODY_ZONE_L_LEG, FIRE) / 100) * THERMAL_PROTECTION_LEG_LEFT * 4, BURN, BODY_ZONE_L_LEG)
target.apply_damage((1 - target.getarmor(BODY_ZONE_PRECISE_L_FOOT, FIRE) / 100) * THERMAL_PROTECTION_FOOT_LEFT * 4, BURN, BODY_ZONE_PRECISE_L_FOOT)
target.apply_damage((1 - target.getarmor(BODY_ZONE_R_LEG, FIRE) / 100) * THERMAL_PROTECTION_LEG_RIGHT * 4, BURN, BODY_ZONE_R_LEG)
target.apply_damage((1 - target.getarmor(BODY_ZONE_PRECISE_R_FOOT, FIRE) / 100) * THERMAL_PROTECTION_FOOT_RIGHT * 4, BURN, BODY_ZONE_PRECISE_R_FOOT)


//Emberfalls are the result of an ash storm passing by close to the playable area of lavaland. They have a 10% chance to trigger in place of an ash storm.
Expand Down
35 changes: 28 additions & 7 deletions code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
return

var/loc_temp = get_temperature(environment)
// to_chat(world, "Loc temp: [loc_temp] - Body temp: [bodytemperature] - Fireloss: [getFireLoss()] - Thermal protection: [get_thermal_protection()] - Fire protection: [thermal_protection + add_fire_protection(loc_temp)] - Heat capacity: [environment_heat_capacity] - Location: [loc] - src: [src]")
// to_chat(world, "Loc temp: [loc_temp] - Body temp: [bodytemperature] - Fireloss: [getFireLoss()] - Thermal protection: [get_main_thermal_protection()] - Fire protection: [thermal_protection + add_fire_protection(loc_temp)] - Heat capacity: [environment_heat_capacity] - Location: [loc] - src: [src]")

//Body temperature is adjusted in two steps. Firstly your body tries to stabilize itself a bit.
if(stat != DEAD)
Expand Down Expand Up @@ -415,20 +415,22 @@
. = ..()
if(!. || HAS_TRAIT(src, TRAIT_RESIST_HEAT))
return
var/thermal_protection = get_thermal_protection()
var/thermal_protection_main = get_main_thermal_protection()
var/thermal_protection_secondary = get_secondary_thermal_protection()

if(thermal_protection >= FIRE_IMMUNITY_MAX_TEMP_PROTECT)
if(thermal_protection_main >= FIRE_IMMUNITY_MAX_TEMP_PROTECT)
return
if(thermal_protection >= FIRE_SUIT_MAX_TEMP_PROTECT)
adjust_bodytemperature(11)

if(thermal_protection_main >= FIRE_SUIT_MAX_TEMP_PROTECT)
adjust_bodytemperature(11 * (1 - thermal_protection_secondary))
else
adjust_bodytemperature(BODYTEMP_HEATING_MAX + (fire_stacks * 12))
adjust_bodytemperature((BODYTEMP_HEATING_MAX + (fire_stacks * 12)) * (1 - thermal_protection_secondary))
var/datum/antagonist/vampire/vamp = mind?.has_antag_datum(/datum/antagonist/vampire)
if(vamp && !vamp.get_ability(/datum/vampire_passive/full) && stat != DEAD)
vamp.bloodusable = max(vamp.bloodusable - 5, 0)


/mob/living/carbon/human/proc/get_thermal_protection()
/mob/living/carbon/human/proc/get_main_thermal_protection()
if(HAS_TRAIT(src, TRAIT_RESIST_HEAT))
return FIRE_IMMUNITY_MAX_TEMP_PROTECT

Expand All @@ -442,6 +444,25 @@
thermal_protection = round(thermal_protection)
return thermal_protection

/mob/living/carbon/human/proc/get_secondary_thermal_protection()
var/result = 0

result += getarmor(BODY_ZONE_HEAD, FIRE) / 100 * THERMAL_PROTECTION_HEAD
result += getarmor(BODY_ZONE_CHEST, FIRE) / 100 * THERMAL_PROTECTION_UPPER_TORSO
result += getarmor(BODY_ZONE_PRECISE_GROIN, FIRE) / 100 * THERMAL_PROTECTION_LOWER_TORSO

result += getarmor(BODY_ZONE_L_ARM, FIRE) / 100 * THERMAL_PROTECTION_ARM_LEFT
result += getarmor(BODY_ZONE_PRECISE_L_HAND, FIRE) / 100 * THERMAL_PROTECTION_HAND_LEFT
result += getarmor(BODY_ZONE_R_ARM, FIRE) / 100 * THERMAL_PROTECTION_ARM_RIGHT
result += getarmor(BODY_ZONE_PRECISE_R_HAND, FIRE) / 100 * THERMAL_PROTECTION_HAND_RIGHT

result += getarmor(BODY_ZONE_L_LEG, FIRE) / 100 * THERMAL_PROTECTION_LEG_LEFT
result += getarmor(BODY_ZONE_PRECISE_L_FOOT, FIRE) / 100 * THERMAL_PROTECTION_FOOT_LEFT
result += getarmor(BODY_ZONE_R_LEG, FIRE) / 100 * THERMAL_PROTECTION_LEG_RIGHT
result += getarmor(BODY_ZONE_PRECISE_R_FOOT, FIRE) / 100 * THERMAL_PROTECTION_FOOT_RIGHT

return result

//END FIRE CODE

/mob/living/carbon/human/proc/body_thermal_regulation(loc_temp)
Expand Down

0 comments on commit 6bc1074

Please sign in to comment.