Skip to content

Commit

Permalink
Merge pull request #5907 from Trilbyspaceclone/ablative_armor_tweaks
Browse files Browse the repository at this point in the history
ablative mobs + blocking buff
  • Loading branch information
Trilbyspaceclone authored Dec 28, 2024
2 parents e1b6807 + 2e2b390 commit b8444a8
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 17 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/items_clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
#define HEAVY_OBSCURATION 5

//RIG ablation
#define ABLATION_SKIN 2
#define ABLATION_CERAMIC 3
#define ABLATION_SOFT 5
#define ABLATION_STANDARD 10
Expand Down
36 changes: 30 additions & 6 deletions code/modules/mob/living/carbon/human/human_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,46 @@ uniquic_armor_act
return (armorval/max(total, 1))

/mob/living/carbon/human/getarmorablative(var/def_zone, var/type)

var/total = 0
var/obj/item/rig/R = get_equipped_item(slot_back)
if(istype(R))
if(R.ablative_armor && (type in list(ARMOR_MELEE, ARMOR_BULLET, ARMOR_ENERGY, ARMOR_BOMB)))
return R.ablative_armor
return FALSE
total += R.ablative_armor

total += mob_ablative_armor
//Blocking gives of affectively free armor based on TGH + item in hand
if(blocking)
var/item_punishment = 0

if(get_active_hand())//are we blocking with an item?
var/obj/item/I = get_active_hand()
if(istype(I))
if(I.force)
var/math_var = clamp(0, (I.force * 0.05) + (I.w_class * 0.5), 10)
total += math_var
item_punishment = clamp(0, math_var, 8)

if(stats.getStat(STAT_TGH) > 0)
total += clamp(0, round(stats.getStat(STAT_TGH)/(12 + item_punishment)), 10)

return total

//Returns true if the ablative armor successfully took damage
/mob/living/carbon/human/damageablative(var/def_zone, var/damage_taken)

var/damaged_armor = FALSE
//Rig ablative armor goes first
var/obj/item/rig/R = get_equipped_item(slot_back)
if(istype(R))
if(R.ablative_armor)
R.ablative_armor = max(R.ablative_armor - damage_taken / R.ablation, 0)
return TRUE
return FALSE
damage_taken = max(damage_taken / R.ablation, 0)
damaged_armor = TRUE

if(mob_ablative_armor && damage_taken > 0)
mob_ablative_armor = max(mob_ablative_armor - damage_taken / ablative_retaining, 0)
damaged_armor = TRUE

return damaged_armor

//this proc returns the Siemens coefficient of electrical resistivity for a particular external organ.
/mob/living/carbon/human/proc/get_siemens_coefficient_organ(obj/item/organ/external/def_zone)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
melee_damage_lower = 40
melee_damage_upper = 50
move_to_delay = 5
armor = list(melee = 15, bullet = 9, energy = 15, bomb = 40, bio = 100, rad = 100) //We want to be gunned down, not lasered
armor = list(melee = 7, bullet = 3, energy = 7, bomb = 40, bio = 100, rad = 100) //We want to be gunned down, not lasered
drop_amount = 3
size_factor = 1.25 // 25% bigger

mob_ablative_armor = 10
ablative_retaining = ABLATION_STANDARD

/mob/living/carbon/superior_animal/ameridian_golem/behemoth/attack_hand(mob/living/carbon/M as mob)
if(M.a_intent == I_GRAB || M.a_intent == I_DISARM)
visible_message(SPAN_WARNING("[src] punch [M] when \he stupidly try to grab it!"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
mob_classification = CLASSIFICATION_SYNTHETIC
status_flags = CANPUSH // Cannot be stun, weakened or paralyzed

armor = list(melee = 7, bullet = 0, energy = 8, bomb = 30, bio = 100, rad = 100) //We want to be gunned down, not lasered
armor = list(melee = 3, bullet = 0, energy = 4, bomb = 30, bio = 100, rad = 100) //We want to be gunned down, not lasered

do_gibs = FALSE

Expand Down Expand Up @@ -55,6 +55,11 @@
/datum/stat_modifier/mob/living/carbon/superior_animal/aggressive = 10
)

//Golems in general to make shotguns more affective for them use ablative armor
mob_ablative_armor = 8
ablative_retaining = ABLATION_SOFT


/mob/living/carbon/superior_animal/ameridian_golem/add_initial_transforms()
. = ..()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
health = 30 * AMGOLEM_HEALTH_MOD
maxHealth = 30 * AMGOLEM_HEALTH_MOD
move_to_delay = 3 // Very fast
armor = list(melee = 4, bullet = -2, energy = 6, bomb = 15, bio = 100, rad = 100) //We want to be gunned down, not lasered
armor = list(melee = 1, bullet = -2, energy = 2, bomb = 15, bio = 100, rad = 100) //We want to be gunned down, not lasered
drop_amount = 1
size_factor = 0.75 // 25% Smaller

mob_ablative_armor = 4
ablative_retaining = ABLATION_CERAMIC
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
desc = "A weird creature made of ameridian. It is quadruped and seems to shoot ameridian shards."
health = 50 * AMGOLEM_HEALTH_MOD
maxHealth = 50 * AMGOLEM_HEALTH_MOD
armor = list(melee = 2, bullet = 8, energy = 13, bomb = 30, bio = 100, rad = 100) //We want to be rushed in melee, not shot.
armor = list(melee = 2, bullet = 4, energy = 6, bomb = 30, bio = 100, rad = 100) //We want to be rushed in melee, not shot.
ranged = TRUE
rapid = TRUE
projectiletype = /obj/item/projectile/ameridian_shard/golem
Expand All @@ -27,3 +27,5 @@
/datum/stat_modifier/mob/living/carbon/superior_animal/quickdraw = 5,
/datum/stat_modifier/mob/living/carbon/superior_animal/slowdraw = 10
)

mob_ablative_armor = 8
22 changes: 16 additions & 6 deletions code/modules/mob/living/carbon/superior_animal/termite/termite.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ GLOBAL_LIST_INIT(termites_special, list(/mob/living/carbon/superior_animal/termi

cant_gib = TRUE

//Rather then good armor will have some ablative to take a bullet or two but
mob_ablative_armor = 12
ablative_retaining = ABLATION_SOFT

/mob/living/carbon/superior_animal/termite/New(loc, obj/machinery/mining/drill/drill, datum/termite_controller/parent)
..()
if(parent)
Expand Down Expand Up @@ -162,7 +166,8 @@ GLOBAL_LIST_INIT(termites_special, list(/mob/living/carbon/superior_animal/termi
melee_damage_upper = TERMITE_DMG_MED

//Armor related variables
armor = list(melee = 5, bullet = -1, energy = 3, bomb = 50, bio = 100, rad = 0)
armor = list(melee = 1, bullet = -1, energy = 0, bomb = 50, bio = 100, rad = 0)
mob_ablative_armor = 5

//Loot related variables
ore = /obj/item/stack/ore/iron
Expand All @@ -188,7 +193,8 @@ GLOBAL_LIST_INIT(termites_special, list(/mob/living/carbon/superior_animal/termi
melee_damage_upper = TERMITE_DMG_HIGH

//Armor related variables
armor = list(melee = 8, bullet = 1, energy = 2, bomb = 50, bio = 100, rad = 0)
armor = list(melee = 1, bullet = 1, energy = 0, bomb = 50, bio = 100, rad = 0)
mob_ablative_armor = 8

//Loot related variables
ore = /obj/item/stack/ore/silver
Expand Down Expand Up @@ -217,7 +223,8 @@ GLOBAL_LIST_INIT(termites_special, list(/mob/living/carbon/superior_animal/termi
melee_damage_upper = TERMITE_DMG_LOW

//Armor related variables
armor = list(melee = 6, bullet = -1, energy = 2, bomb = 50, bio = 100, rad = 0)
armor = list(melee = 1, bullet = -1, energy = 0, bomb = 50, bio = 100, rad = 0)
mob_ablative_armor = 8

//Loot related variables
ore = /obj/item/stack/ore/uranium
Expand All @@ -243,7 +250,8 @@ GLOBAL_LIST_INIT(termites_special, list(/mob/living/carbon/superior_animal/termi
melee_damage_upper = TERMITE_DMG_MED

//Armor related variables
armor = list(melee = 5, bullet = -1, energy = 6, bomb = 50, bio = 100, rad = 0)
armor = list(melee = 1, bullet = -1, energy = 3, bomb = 50, bio = 100, rad = 0)
mob_ablative_armor = 5

//Loot related variables
ore = /obj/item/stack/ore/plasma
Expand Down Expand Up @@ -271,7 +279,8 @@ GLOBAL_LIST_INIT(termites_special, list(/mob/living/carbon/superior_animal/termi
melee_damage_upper = TERMITE_DMG_HIGH

//Armor related variables
armor = list(melee = 6, bullet = 0, energy = 5, bomb = 50, bio = 100, rad = 0)
armor = list(melee = 2, bullet = 0, energy = 1, bomb = 50, bio = 100, rad = 0)
mob_ablative_armor = 8

//Loot related variables
ore = /obj/item/stack/ore/diamond
Expand Down Expand Up @@ -304,7 +313,8 @@ GLOBAL_LIST_INIT(termites_special, list(/mob/living/carbon/superior_animal/termi
ranged = TRUE

//Armor related variables
armor = list(melee = 12, bullet = 0, energy = 5, bomb = 50, bio = 100, rad = 0)
armor = list(melee = 3, bullet = 0, energy = 1, bomb = 50, bio = 100, rad = 0)
mob_ablative_armor = 12

//Loot related variables
ore = /obj/item/stack/ore/osmium
6 changes: 5 additions & 1 deletion code/modules/mob/living/living_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,13 @@
return FALSE

/mob/living/proc/getarmorablative(var/def_zone, var/type)
return FALSE
return mob_ablative_armor

/mob/living/proc/damageablative(var/def_zone, var/damage)
if(mob_ablative_armor)
mob_ablative_armor = round(mob_ablative_armor - damage / ablative_retaining)
if(mob_ablative_armor < 0)
mob_ablative_armor = 0
return FALSE

/mob/living/proc/hit_impact(damage, dir)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/mob/living/living_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,6 @@

/// Icon used for speechbubbles
var/bubble_icon = "default"

var/mob_ablative_armor = 0
var/ablative_retaining = ABLATION_SKIN

0 comments on commit b8444a8

Please sign in to comment.