[MIRROR] Defines damage flags. (Hopefully without 50+ commits) (#491)

* Defines damage flags. (#53158)

* Defines damage flags. (Hopefully without 50+ commits)

Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
This commit is contained in:
SkyratBot
2020-08-24 22:52:31 +02:00
committed by GitHub
co-authored by TemporalOroboros
parent a6c3cbb8e3
commit 3bd294f26f
278 changed files with 731 additions and 700 deletions
+1 -1
View File
@@ -37,7 +37,7 @@
icon_state = "xmashat"
desc = "A crappy paper hat that you are REQUIRED to wear."
flags_inv = 0
armor = list("melee" = 0, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0)
armor = list(MELEE = 0, BULLET = 0, LASER = 0,ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 0, ACID = 0)
dog_fashion = /datum/dog_fashion/head/festive
/obj/effect/spawner/xmastree
+3 -3
View File
@@ -126,7 +126,7 @@
return 1
/datum/spacevine_mutation/fire_proof/on_hit(obj/structure/spacevine/holder, mob/hitter, obj/item/I, expected_damage)
if(I && I.damtype == "fire")
if(I && I.damtype == BURN)
. = 0
else
. = expected_damage
@@ -162,7 +162,7 @@
var/mob/living/carbon/C = M //If the mob is carbon then it now also exists as a "C", and not just an M.
if(istype(C)) //If the mob (M) is a carbon subtype (C) we move on to pick a more complex damage proc, with damage zones, wounds and armor mitigation.
var/obj/item/bodypart/limb = pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD, BODY_ZONE_CHEST) //Picks a random bodypart. Does not runtime even if it's missing.
var/armor = C.run_armor_check(limb, "melee", null, null) //armor = the armor value of that randomly chosen bodypart. Nulls to not print a message, because it would still print on pierce.
var/armor = C.run_armor_check(limb, MELEE, null, null) //armor = the armor value of that randomly chosen bodypart. Nulls to not print a message, because it would still print on pierce.
var/datum/spacevine_mutation/thorns/T = locate() in S.mutations //Searches for the thorns mutation in the "mutations"-list inside obj/structure/spacevine, and defines T if it finds it.
if(T && (prob(40))) //If we found the thorns mutation there is now a chance to get stung instead of lashed or smashed.
C.apply_damage(50, BRUTE, def_zone = limb, wound_bonus = rand(-20,10), sharpness = SHARP_POINTY) //This one gets a bit lower damage because it ignores armor.
@@ -382,7 +382,7 @@
for(var/datum/spacevine_mutation/SM in mutations)
damage_dealt = SM.on_hit(src, user, I, damage_dealt) //on_hit now takes override damage as arg and returns new value for other mutations to permutate further
take_damage(damage_dealt, I.damtype, "melee", 1)
take_damage(damage_dealt, I.damtype, MELEE, 1)
/obj/structure/spacevine/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)