Adds Modifier Armor (#7416)

This commit is contained in:
Neerti
2020-08-07 00:24:10 -04:00
committed by VirgoBot
parent dd7754514c
commit bc1db6310e
6 changed files with 267 additions and 19 deletions

View File

@@ -55,6 +55,14 @@
var/emp_modifier // Added to the EMP strength, which is an inverse scale from 1 to 4, with 1 being the strongest EMP. 5 is a nullification.
var/explosion_modifier // Added to the bomb strength, which is an inverse scale from 1 to 3, with 1 being gibstrength. 4 is a nullification.
// Note that these are combined with the mob's real armor values additatively. You can also omit specific armor types.
var/list/armor_percent = null // List of armor values to add to the holder when doing armor calculations. This is for percentage based armor. E.g. 50 = half damage.
var/list/armor_flat = null // Same as above but only for flat armor calculations. E.g. 5 = 5 less damage (this comes after percentage).
// Unlike armor, this is multiplicative. Two 50% protection modifiers will be combined into 75% protection (assuming no base protection on the mob).
var/heat_protection = null // Modifies how 'heat' protection is calculated, like wearing a firesuit. 1 = full protection.
var/cold_protection = null // Ditto, but for cold, like wearing a winter coat.
var/siemens_coefficient = null // Similar to above two vars but 0 = full protection, to be consistant with siemens numbers everywhere else.
var/vision_flags // Vision flags to add to the mob. SEE_MOB, SEE_OBJ, etc.
/datum/modifier/New(var/new_holder, var/new_origin)
@@ -186,10 +194,14 @@
// Checks if the mob has a modifier type.
/mob/living/proc/has_modifier_of_type(var/modifier_type)
return get_modifier_of_type(modifier_type) ? TRUE : FALSE
// Gets the first instance of a specific modifier type or subtype.
/mob/living/proc/get_modifier_of_type(var/modifier_type)
for(var/datum/modifier/M in modifiers)
if(istype(M, modifier_type))
return TRUE
return FALSE
return M
return null
// This displays the actual 'numbers' that a modifier is doing. Should only be shown in OOC contexts.
// When adding new effects, be sure to update this as well.

View File

@@ -397,4 +397,33 @@ the artifact triggers the rage.
/datum/modifier/outline_test/tick()
animate(filter_instance, size = 3, time = 0.25 SECONDS)
animate(size = 1, 0.25 SECONDS)
animate(size = 1, 0.25 SECONDS)
// Acts as a psuedo-godmode, yet probably is more reliable than the actual var for it nowdays.
// Can't protect from instantly killing things like singulos.
/datum/modifier/invulnerable
name = "invulnerable"
desc = "You are almost immune to harm, for a little while at least."
stacks = MODIFIER_STACK_EXTEND
disable_duration_percent = 0
incoming_damage_percent = 0
// bleeding_rate_percent = 0
pain_immunity = TRUE
armor_percent = list("melee" = 2000, "bullet" = 2000, "laser" = 2000, "bomb" = 2000, "energy" = 2000, "bio" = 2000, "rad" = 2000)
heat_protection = 1.0
cold_protection = 1.0
siemens_coefficient = 0.0
// Reduces resistance to "elements".
// Note that most things that do give resistance gives 100% protection,
// and due to multiplicitive stacking, this modifier won't do anything to change that.
/datum/modifier/elemental_vulnerability
name = "elemental vulnerability"
desc = "You're more vulnerable to extreme temperatures and electricity."
stacks = MODIFIER_STACK_EXTEND
heat_protection = -0.5
cold_protection = -0.5
siemens_coefficient = 1.5