Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warding Pheromones rework #877

Merged
merged 11 commits into from
Dec 28, 2024
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/species/_species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
damage = victim.modify_by_armor(damage, blocked, penetration, def_zone)

if(victim.protection_aura)
damage = round(damage * ((20 - victim.protection_aura) / 20))
damage = round(damage * (1 - victim.protection_aura*0.05)) //10% for SLs, 15% for commanders
RUTGMC4429 marked this conversation as resolved.
Show resolved Hide resolved

if(!damage)
return FALSE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/pain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
painloss += O.damage * 1.5

if(M.protection_aura)
painloss -= 20 + M.protection_aura * 20 //-40 pain for SLs, -80 for Commanders
painloss -= 20*(1 + M.protection_aura) //-60 pain for SLs, -80 for Commanders
RUTGMC4429 marked this conversation as resolved.
Show resolved Hide resolved

painloss += reagent_pain_modifier

Expand Down
6 changes: 6 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/damage_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
return ..()

/mob/living/carbon/xenomorph/modify_by_armor(damage_amount, armor_type, penetration, def_zone, attack_dir)
//Warding pheromones used to change soft armor, but now change the damage directly in apply_damage
RUTGMC4429 marked this conversation as resolved.
Show resolved Hide resolved
var/hard_armor_remaining = get_hard_armor(armor_type, def_zone)

var/effective_penetration = max(0, penetration - hard_armor_remaining)
Expand Down Expand Up @@ -66,6 +67,11 @@
else
damage = modify_by_armor(damage, blocked, penetration, def_zone)

// WARDING PHEROMONES EFFECT
if(warding_aura)
var/effect_per_aura_level = 0.03 // %damage decrease per level. Max base level is 6, but can be increases from upgrades
RUTGMC4429 marked this conversation as resolved.
Show resolved Hide resolved
damage = damage * (1 - warding_aura*effect_per_aura_level)
RUTGMC4429 marked this conversation as resolved.
Show resolved Hide resolved

if(!damage) //no damage
return FALSE

Expand Down
4 changes: 0 additions & 4 deletions code/modules/mob/living/carbon/xenomorph/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,7 @@
set_frenzy_aura(received_auras[AURA_XENO_FRENZY] || 0)

if(warding_aura != (received_auras[AURA_XENO_WARDING] || 0))
if(warding_aura) //If either the new or old warding is 0, we can skip adjusting armor for it.
soft_armor = soft_armor.modifyAllRatings(-warding_aura * 2.5)
warding_aura = received_auras[AURA_XENO_WARDING] || 0
if(warding_aura)
soft_armor = soft_armor.modifyAllRatings(warding_aura * 2.5)

recovery_aura = received_auras[AURA_XENO_RECOVERY] || 0

Expand Down
Loading