Massive changes.

- Changes how it mitigates damage.
- It now only affects external attacks (punches, mobs, items, guns, etc.)
- Now is PRE armor mitigation! https://i.imgur.com/CXx82J5.png
- Adds variants. Allows mobs to use the new variants, but not the pack itself.
- Adds an extended description and fluff text.
- Adds ability to have both min&max for each variable.

I still need to make them have specialized recharging batteries (especially for the belt unit), but currently the normal recharging batteries are fine.
This commit is contained in:
C.L
2022-09-11 04:24:26 -04:00
parent e4bb0438d0
commit 937026bd90
7 changed files with 372 additions and 62 deletions
@@ -16,9 +16,9 @@
var/obj/item/weapon/gun/energy/gun/generator/active_weapon
var/obj/item/weapon/cell/device/bcell = null
var/generator_hit_cost = 100 // Power used when a special effect (such as a bullet being blocked) is performed!
var/generator_hit_cost = 100 // Power used when a special effect (such as a bullet being blocked) is performed! Could also be expanded to other things.
var/generator_active_cost = 10 // Power used when turned on.
var/has_weapon = 1
var/has_weapon = 1 // Backpack units generally have weapons.
var/shield_active = 0 // If the shield gen is active.
var/energy_modifier = 25 // 40 damage absorbed per 1000 charge. If the charge used is > the cell's remaining charge, the excess is dealt to the user!
var/modifier_type = /datum/modifier/shield_projection //What type of modifier will it add? Used for variant modifiers!
@@ -107,7 +107,7 @@
M.put_in_any_hand_if_possible(src)
/obj/item/device/personal_shield_generator/attackby(obj/item/weapon/W, mob/user, params) //This should never happen unless admin spawns in an empty one.
/obj/item/device/personal_shield_generator/attackby(obj/item/weapon/W, mob/user, params)
if(W == active_weapon)
reattach_gun(user)
else if(istype(W, /obj/item/weapon/cell))
@@ -260,38 +260,11 @@
update_icon()
/*
Base Unit Subtypes
*/
/obj/item/device/personal_shield_generator/belt
name = "personal shield generator"
desc = "A personal shield generator."
icon_state = "shield_back_active"
item_state = "shield_pack"
w_class = ITEMSIZE_LARGE //No putting these in backpacks!
slot_flags = SLOT_BELT
origin_tech = list(TECH_BIO = 5, TECH_POWER = 3)
has_weapon = 0 //No gun with the belt!
/obj/item/device/personal_shield_generator/belt/loaded
bcell = /obj/item/weapon/cell/device/weapon/recharge
/obj/item/device/personal_shield_generator/belt/update_icon()
if(shield_active)
icon_state = "shield_back_active"
else
icon_state = "shield_pack"
//The gun
/obj/item/weapon/gun/energy/gun/generator //The gun attached to the personal shield generator.
name = "energy gun"
desc = "Another bestseller of Lawson Arms, the LAEP80 Thor is a versatile energy based pistol, capable of switching between low and high \
capacity projectile settings. In other words: Stun or Kill."
description_fluff = "Lawson Arms is Hephaestus Industries main personal-energy-weapon branding, often sold alongside MarsTech projectile \
weapons to security and law enforcement agencies."
name = "generator gun"
desc = "A gun that is attached to the battery of the personal shield generator."
icon_state = "egunstun"
item_state = null //so the human update icon uses the icon_state instead.
fire_delay = 8
@@ -304,7 +277,7 @@
firemodes = list(
list(mode_name="stun", projectile_type=/obj/item/projectile/beam/stun/med, modifystate="egunstun", fire_sound='sound/weapons/Taser.ogg', charge_cost = 240),
list(mode_name="lethal", projectile_type=/obj/item/projectile/beam, modifystate="egunkill", fire_sound='sound/weapons/Laser.ogg', charge_cost = 480),
) //Zero charge_cost since it's handled per shot.
)
var/obj/item/device/personal_shield_generator/shield_generator //The generator we are linked to!
var/wielded = 0
@@ -344,17 +317,7 @@
return 1
/* //TODO: Emp act.
/obj/item/weapon/shockpaddles/emp_act(severity)
var/new_safety = rand(0, 1)
if(safety != new_safety)
safety = new_safety
if(safety)
make_announcement("beeps, \"Safety protocols enabled!\"", "notice")
playsound(src, 'sound/machines/defib_safetyon.ogg', 50, 0)
else
make_announcement("beeps, \"Safety protocols disabled!\"", "warning")
playsound(src, 'sound/machines/defib_safetyoff.ogg', 50, 0)
update_icon()
/obj/item/weapon/gun/energy/gun/generator/emp_act(severity)
..()
*/
@@ -373,4 +336,70 @@
return (shield_generator.bcell && shield_generator.bcell.check_charge(charge_amt))
/obj/item/weapon/gun/energy/gun/generator/checked_use(var/charge_amt)
return (shield_generator.bcell && shield_generator.bcell.checked_use(charge_amt))
return (shield_generator.bcell && shield_generator.bcell.checked_use(charge_amt))
//VARIANTS.
/obj/item/device/personal_shield_generator/belt
name = "personal shield generator"
desc = "A personal shield generator."
icon_state = "shield_back_active"
item_state = "shield_pack"
w_class = ITEMSIZE_LARGE //No putting these in backpacks!
slot_flags = SLOT_BELT
origin_tech = list(TECH_BIO = 5, TECH_POWER = 3)
has_weapon = 0 //No gun with the belt!
/obj/item/device/personal_shield_generator/belt/loaded
bcell = /obj/item/weapon/cell/device/weapon/recharge
/obj/item/device/personal_shield_generator/belt/update_icon()
if(shield_active)
icon_state = "shield_back_active"
else
icon_state = "shield_pack"
/obj/item/device/personal_shield_generator/belt/bruteburn //Example of a modified generator.
modifier_type = /datum/modifier/shield_projection/bruteburn
/obj/item/device/personal_shield_generator/belt/bruteburn/loaded //If mapped in, ONLY put loaded ones down.
bcell = /obj/item/weapon/cell/device/weapon/recharge
/obj/item/device/personal_shield_generator/belt/mining
name = "mining personal shield generator"
desc = "A personal shield generator designed for mining. It has a warning on the back: 'Do NOT expose the shield to stun-based weaponry.'"
modifier_type = /datum/modifier/shield_projection/mining
/obj/item/device/personal_shield_generator/belt/mining/loaded
bcell = /obj/item/weapon/cell/device/weapon/recharge
/obj/item/device/personal_shield_generator/belt/security
name = "security personal shield generator"
desc = "A personal shield generator designed for security."
modifier_type = /datum/modifier/shield_projection/security/weak
/obj/item/device/personal_shield_generator/belt/security/loaded
bcell = /obj/item/weapon/cell/device/weapon/recharge
/*
/obj/item/device/personal_shield_generator/belt/mining/attackby(obj/item/weapon/W, mob/user, params)
if(modifier_type == /datum/modifier/shield_projection/mining/strong))
to_chat(user, "<span class='warning'>This shield generator is already upgraded!</span>")
return
if(istype(W, /obj/item/borg/upgrade/modkit/shield_upgrade))
modifier_type = /datum/modifier/shield_projection/mining/strong
drop_from_inventory(W)
qdel(W)
else
..()
*/
/obj/item/device/personal_shield_generator/belt/adminbus
desc = "You should not see this. You REALLY should not see this. If you do, you have either been blessed or are about to be the target of some sick prank."
modifier_type = /datum/modifier/shield_projection/admin
generator_hit_cost = 0
generator_active_cost = 0
shield_active = 0
energy_modifier = 0
bcell = /obj/item/weapon/cell/device/weapon/recharge
+15 -1
View File
@@ -29,4 +29,18 @@
/obj/item/device/assembly/electronic_assembly
description_info = "This is the casing for the 'device' type of electronic assembly. It behaves like any other 'assembly' type device such as an igniter or signaler \
and can be attached to others in the same way. Use the 'toggle-open' verb (right click) or a crowbar to pop the electronic device open to add components and close when finished."
and can be attached to others in the same way. Use the 'toggle-open' verb (right click) or a crowbar to pop the electronic device open to add components and close when finished."
/obj/item/device/personal_shield_generator
description_info = "This is a personal shield generator. Depending on the type, it can either be worn on your backpack slot, your belt slot, or in a rigsuit \
storage slot. It runs on an internal battery, which is usually self-charging. Some versions come with a gun. To active the shield, click the button in the upper \
right of the screen, use the 'Toggle Shield' command under your objects tab, or click the device itself while it is on you. Some units come with an active weapon \
which can be taken out at any time by Alt-clicking the device. If the device requires a cell, a screwdriver can be used. The shield slowly drains charge while \
active and becomes weaker with each individual strike taken."
description_fluff = "A relatively new invention, made in a collaboration between Hephaestus Industries and a startup known as Kuznetsova Enterprise in the year \
2322. Numerous variants of the device have been made for specific tasks, ranging from riot control, mining, biohazard containment, and search and rescue, among \
others. Most of the devices share the flaw that electrical attacks can easily overload the device and cause a shield failure, encouraging combatants to swap to \
the use of stun-based electric weaponry when shield generators are in use. Most shield devices are self-charging, running off a micro-nuclear reactor built into \
the chassis itself, although some variants exist without this capability and can have normal cells inserted into them. Larger units boast the capability of \
storing a weapon, although without upgraded batteries the usage of said weapon is ill-advised."
+39
View File
@@ -64,11 +64,50 @@
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.
// ENERGY CODE. Variables to allow for energy based modifiers.
var/energy_based // Sees if the modifier is based on something electronic based.
var/energy_cost // How much the modifier uses per action/special effect blocked. For base values.
var/energy_modifier // How much energy is used when numbers are involed. For values, such as taking damage. Ex: (Damage*energy_modifier)
var/obj/item/weapon/cell/energy_source = null // The source of the above.
// RESISTANCES CODE. Variable to enable external damage resistance modifiers. This is not unlike armor.
// 0 = immune || < 0 = heals || 1 = full damage || >1 = increased damage.
// It should never be below zero as it is not intended to do such, but you are free to experiment!
// Ex: Max_brute_resistance = 0. Min_brute resistance = 1. When started, provides 100% resistance to brute. When cell is dying, goes down to 0% resistance.
// Max is the MAXIMUM % multiplier that will be taken at a low charge. Min is the MINIMUM % multiplier that will be taken at a full charge.
// Think of it like this: Minimum = what happens at minimum charge. Max = what happens at maximum charge.
// Why do I mention this so much? Because even /I/ got confused, and I wrote this thing!
var/min_damage_resistance
var/max_damage_resistance
var/effective_damage_resistance
var/min_brute_resistance
var/max_brute_resistance
var/effective_brute_resistance
var/min_fire_resistance
var/max_fire_resistance
var/effective_fire_resistance
var/min_tox_resistance
var/max_tox_resistance
var/effective_tox_resistance
var/min_oxy_resistance
var/max_oxy_resistance
var/effective_oxy_resistance
var/min_clone_resistance
var/max_clone_resistance
var/effective_clone_resistance
var/min_hal_resistance
var/max_hal_resistance
var/effective_hal_resistance
// Resistances end
/datum/modifier/New(var/new_holder, var/new_origin)
holder = new_holder
if(new_origin)
+148 -14
View File
@@ -46,27 +46,51 @@
on_created_text = "<span class='notice'>Your shield generator buzzes on.</span>"
on_expired_text = "<span class='warning'>Your shield generator buzzes off.</span>"
mob_overlay_state = "repel_missiles" //Looks alright, I guess. Placeholder.
mob_overlay_state = "repel_missiles" //Looks actually pretty good. Could use a better sprite, but that'll work!
stacks = MODIFIER_STACK_FORBID //No stacking shields. If you put one one your belt and backpack it won't work.
siemens_coefficient = 2 //Stun weapons drain 100% charge per damage. They're good at blocking lasers and bullets but not good at blocking stun beams!
incoming_brute_damage_percent = 0
incoming_fire_damage_percent = 0
incoming_hal_damage_percent = 0
siemens_coefficient = 2 //Stun weapons drain 100% charge per point of damage. They're good at blocking lasers and bullets but not good at blocking stun beams!
energy_based = 1
energy_cost = 99999 //This is changed to the shield_genertor's energy_cost.
energy_cost = 99999 //This is changed to the shield_generator's energy_cost.
energy_modifier = 50 //This is how much battery is used per damage unit absorbed. Higher damage means higher charge use per damage absorbed. Changed below!
//Not actually in use until effective resistances are set. Just here so it doesn't have to be placed down for all the variants. Less lines.
max_damage_resistance = 1
max_brute_resistance = 1
max_fire_resistance = 1
max_tox_resistance = 1
max_oxy_resistance = 1
max_clone_resistance = 1
max_hal_resistance = 1
min_damage_resistance = 1
min_brute_resistance = 1
min_fire_resistance = 1
min_tox_resistance = 1
min_oxy_resistance = 1
min_clone_resistance = 1
min_hal_resistance = 1
/* // These are not set, but left here as an example. All three (min,max,effective) must be set or BAD THINGS will happen.
min_brute_resistance = 1 // Min = WHAT HAPPENS AT MINIMUM CHARGE
max_brute_resistance = 0 // MAX = WHAT HAPPENS AT MAXIMUM CHARGE
effective_brute_resistance = 1 //Just tells the game that it has vars. Done to use less checks.
min_fire_resistance = 1
max_fire_resistance = 0
effective_fire_resistance = 1
disable_duration_percent = 1 //THIS CAN ALSO BE USED! Don't be too afraid to use this one, but use it sparingly!
*/
var/obj/item/device/personal_shield_generator/shield_generator //This is the shield generator you're wearing!
/datum/modifier/shield_projection/on_applied()
/datum/modifier/shield_projection/on_applied() //Don't need to modify this!
return
/datum/modifier/shield_projection/on_expire()
/datum/modifier/shield_projection/on_expire() //Don't need to modify this!
return
/datum/modifier/shield_projection/check_if_valid() //Let's check to make sure you got the stuff and set the vars.
if(ishuman(holder)) //Only humans can use this!
/datum/modifier/shield_projection/check_if_valid() //Let's check to make sure you got the stuff and set the vars. Don't need to modify this for any subtypes!
if(ishuman(holder)) //Only humans can use this! Other things later down the line might use the same stuff this does, but the shield generator is human only!
var/mob/living/carbon/human/H = holder
if(istype(H.get_equipped_item(slot_back), /obj/item/device/personal_shield_generator))
shield_generator = H.get_equipped_item(slot_back) //Sets the var on the modifier that the shield gen is their back shield gen.
@@ -93,7 +117,117 @@
expire(silent = TRUE) //If you're dead the generator stops protecting you but keeps running.
if(!shield_generator || !shield_generator.slot_check()) //No shield to begin with/shield is not on them any longer.
expire(silent = FALSE)
var/shield_efficiency = 1-(energy_source.charge/energy_source.maxcharge) //0 = complete resistance. 1 = no resistance.
incoming_brute_damage_percent = shield_efficiency //Less charge means less resistance!
incoming_fire_damage_percent = shield_efficiency
incoming_hal_damage_percent = shield_efficiency
var/shield_efficiency = (energy_source.charge/energy_source.maxcharge) //1 = complete resistance. 0 = no resistance. Must be adjusted for subtypes!
if(!isnull(effective_damage_resistance))
effective_damage_resistance = min_damage_resistance + (max_damage_resistance - min_damage_resistance) * shield_efficiency
if(!isnull(effective_brute_resistance))
effective_brute_resistance = min_brute_resistance + (max_brute_resistance - min_brute_resistance) * shield_efficiency
if(!isnull(effective_fire_resistance))
effective_fire_resistance = min_fire_resistance + (max_fire_resistance - min_fire_resistance) * shield_efficiency
if(!isnull(effective_tox_resistance))
effective_tox_resistance = min_tox_resistance + (max_tox_resistance - min_tox_resistance) * shield_efficiency
if(!isnull(effective_oxy_resistance))
effective_oxy_resistance = min_oxy_resistance + (max_oxy_resistance - min_oxy_resistance) * shield_efficiency
if(!isnull(effective_clone_resistance))
effective_clone_resistance = min_clone_resistance + (max_clone_resistance - min_clone_resistance) * shield_efficiency
if(!isnull(effective_hal_resistance))
effective_hal_resistance = min_hal_resistance + (max_hal_resistance - min_hal_resistance) * shield_efficiency
//Shield variants.
//Simple. Goes from 100% resistance to 0% resistance depending on charge.
/datum/modifier/shield_projection/bruteburn
max_brute_resistance = 0
effective_brute_resistance = 1
max_fire_resistance = 0
effective_fire_resistance = 1
/datum/modifier/shield_projection/bruteburn/weak
max_brute_resistance = 0.5
max_fire_resistance = 0.5
/datum/modifier/shield_projection/security // Security backpack.
max_brute_resistance = 0.5
effective_brute_resistance = 1
max_fire_resistance = 0.5
effective_fire_resistance = 1
max_hal_resistance = 0.5
effective_hal_resistance = 1
/datum/modifier/shield_projection/security/weak // Security belt.
max_brute_resistance = 0.75
max_fire_resistance = 0.75
max_hal_resistance = 0.75
/datum/modifier/shield_projection/security/strong // Dunno. Upgraded variant of security backpack?
max_brute_resistance = 0.25
max_fire_resistance = 0.25
max_hal_resistance = 0.25
siemens_coefficient = 1.5 //Not as weak as normal, but still weak.
/datum/modifier/shield_projection/mining //Base mining belt. 25% resistance.
max_brute_resistance = 0.75
effective_brute_resistance = 1
max_fire_resistance = 0.75
effective_fire_resistance = 1
max_hal_resistance = 1.5 // No mobs should be shooting you with halloss. If this happens, it means you're using it wrong!!!
min_hal_resistance = 1.5
effective_hal_resistance = 1
disable_duration_percent = 0.75 //Miners often come into contact with things that can stun them.
/datum/modifier/shield_projection/mining/strong // Mining belt, but upgraded. Even weaker to halloss! Tasers WILL destroy you. Don't try to be superman.
max_brute_resistance = 0.5
max_fire_resistance = 0.5
disable_duration_percent = 0.5
max_hal_resistance = 2
min_hal_resistance = 2
/datum/modifier/shield_projection/admin // Adminbus.
on_created_text = "<span class='notice'>Your shield generator activates and you feel the power of the tesla buzzing around you.</span>"
on_expired_text = "<span class='warning'>Your shield generator deactivates, leaving you feeling weak and vulnerable.</span>"
siemens_coefficient = 0
disable_duration_percent = 0
min_damage_resistance = 0
max_damage_resistance = 0
effective_damage_resistance = 0
min_brute_resistance = 0
max_brute_resistance = 0
effective_brute_resistance = 0
min_fire_resistance = 0
max_fire_resistance = 0
effective_fire_resistance = 0
min_tox_resistance = 0
max_tox_resistance = 0
effective_tox_resistance = 0
min_oxy_resistance = 0
max_oxy_resistance = 0
effective_oxy_resistance = 0
min_clone_resistance = 0
max_clone_resistance = 0
effective_clone_resistance = 0
min_hal_resistance = 0
max_hal_resistance = 0
effective_hal_resistance = 0
/datum/modifier/shield_projection/broken //For broken variants. Good if possible randomization is included for packs spawned on PoIs.
max_brute_resistance = 2
min_brute_resistance = 2
effective_brute_resistance = 1
max_fire_resistance = 2
min_fire_resistance = 2
effective_fire_resistance = 1
@@ -475,6 +475,53 @@ This function restores all organs.
if(!def_zone) def_zone = ran_zone(def_zone)
organ = get_organ(check_zone(def_zone))
for(var/datum/modifier/M in modifiers) //MODIFIER STUFF. It's best to do this RIGHT before armor is calculated, so it's done here! This is the 'forcefield' defence.
if(damagetype == BRUTE && (!isnull(M.effective_brute_resistance)))
if(M.energy_based)
M.energy_source.use(M.energy_modifier * damage)
damage = damage * M.effective_brute_resistance
continue
if((damagetype == BURN || damagetype == ELECTROCUTE)&& (!isnull(M.effective_fire_resistance)))
if(M.energy_based)
M.energy_source.use(M.energy_modifier * damage)
damage = damage * M.effective_fire_resistance
continue
if(damagetype == TOX && (!isnull(M.effective_tox_resistance)))
if(M.energy_based)
M.energy_source.use(M.energy_modifier * damage)
damage = damage * M.effective_tox_resistance
continue
if(damagetype == OXY && (!isnull(M.effective_oxy_resistance)))
if(M.energy_based)
M.energy_source.use(M.energy_modifier * damage)
damage = damage * M.effective_oxy_resistance
continue
if(damagetype == CLONE && (!isnull(M.effective_clone_resistance)))
if(M.energy_based)
M.energy_source.use(M.energy_modifier * damage)
damage = damage * M.effective_clone_resistance
continue
if(damagetype == HALLOSS && (!isnull(M.effective_hal_resistance)))
if(M.energy_based)
M.energy_source.use(M.energy_modifier * damage)
damage = damage * M.effective_hal_resistance
continue
if(damagetype == SEARING && (!isnull(M.effective_fire_resistance) || !isnull(M.effective_brute_resistance)))
if(M.energy_based)
M.energy_source.use(M.energy_modifier * damage)
var/damage_mitigation = 0//Used for dual calculations.
if(!isnull(M.effective_fire_resistance))
damage_mitigation += round((1/3)*damage * M.effective_fire_resistance)
if(!isnull(M.effective_brute_resistance))
damage_mitigation += round((2/3)*damage * M.effective_brute_resistance)
damage -= damage_mitigation
continue
if(damagetype == BIOACID && (isSynthetic() && (!isnull(M.effective_fire_resistance))) || (!isSynthetic() && M.effective_tox_resistance))
if(isSynthetic())
damage = damage * M.effective_fire_resistance
else
damage = damage * M.effective_tox_resistance
continue
//Handle other types of damage
if((damagetype != BRUTE) && (damagetype != BURN))
if(damagetype == HALLOSS)
@@ -504,7 +551,6 @@ This function restores all organs.
if(Debug2)
to_world_log("## DEBUG: [src] was hit for [damage].")
switch(damagetype)
if(BRUTE)
damageoverlaytemp = 20
@@ -38,7 +38,7 @@ emp_act
if(!prob(armor/2)) //Even if the armor doesn't stop the bullet from hurting you, it might stop it from embedding.
var/hit_embed_chance = P.embed_chance + (P.damage - armor) //More damage equals more chance to embed
//Modifiers can make bullets less likely to embed!
//Modifiers can make bullets less likely to embed! These are the normal modifiers and shouldn't be related to energy stuff, but they can be anyways!
for(var/datum/modifier/M in modifiers)
if(!isnull(M.incoming_damage_percent))
if(M.energy_based)
+48
View File
@@ -13,6 +13,53 @@
to_world_log("## DEBUG: apply_damage() was called on [src], with [damage] damage, and an armor value of [blocked].")
if(!damage || (blocked >= 100))
return 0
for(var/datum/modifier/M in modifiers) //MODIFIER STUFF. It's best to do this RIGHT before armor is calculated, so it's done here! This is the 'forcefield' defence.
if(damagetype == BRUTE && (!isnull(M.effective_brute_resistance)))
if(M.energy_based)
M.energy_source.use(M.energy_modifier * damage)
damage = damage * M.effective_brute_resistance
continue
if((damagetype == BURN || damagetype == ELECTROCUTE)&& (!isnull(M.effective_fire_resistance)))
if(M.energy_based)
M.energy_source.use(M.energy_modifier * damage)
damage = damage * M.effective_fire_resistance
continue
if(damagetype == TOX && (!isnull(M.effective_tox_resistance)))
if(M.energy_based)
M.energy_source.use(M.energy_modifier * damage)
damage = damage * M.effective_tox_resistance
continue
if(damagetype == OXY && (!isnull(M.effective_oxy_resistance)))
if(M.energy_based)
M.energy_source.use(M.energy_modifier * damage)
damage = damage * M.effective_oxy_resistance
continue
if(damagetype == CLONE && (!isnull(M.effective_clone_resistance)))
if(M.energy_based)
M.energy_source.use(M.energy_modifier * damage)
damage = damage * M.effective_clone_resistance
continue
if(damagetype == HALLOSS && (!isnull(M.effective_hal_resistance)))
if(M.energy_based)
M.energy_source.use(M.energy_modifier * damage)
damage = damage * M.effective_hal_resistance
continue
if(damagetype == SEARING && (!isnull(M.effective_fire_resistance) || !isnull(M.effective_brute_resistance)))
if(M.energy_based)
M.energy_source.use(M.energy_modifier * damage)
var/damage_mitigation = 0//Used for dual calculations.
if(!isnull(M.effective_fire_resistance))
damage_mitigation += round((1/3)*damage * M.effective_fire_resistance)
if(!isnull(M.effective_brute_resistance))
damage_mitigation += round((2/3)*damage * M.effective_brute_resistance)
damage -= damage_mitigation
continue
if(damagetype == BIOACID && (isSynthetic() && (!isnull(M.effective_fire_resistance))) || (!isSynthetic() && M.effective_tox_resistance))
if(isSynthetic())
damage = damage * M.effective_fire_resistance
else
damage = damage * M.effective_tox_resistance
continue
if(soaked)
if(soaked >= round(damage*0.8))
damage -= round(damage*0.8)
@@ -55,6 +102,7 @@
/mob/living/proc/apply_damages(var/brute = 0, var/burn = 0, var/tox = 0, var/oxy = 0, var/clone = 0, var/halloss = 0, var/def_zone = null, var/blocked = 0)
if(blocked >= 100)
return 0
// INSERT MODIFIER CODE HERE... But no, really, only two things in the game use it, quad and viruses. The former is admin-only and the latter wouldn't be affected logically, but would if shield code was inerted here. If you really want, you can copy&paste the above and modify it to adjust brute/burn/etc. I do not advise this however.
if(brute) apply_damage(brute, BRUTE, def_zone, blocked)
if(burn) apply_damage(burn, BURN, def_zone, blocked)
if(tox) apply_damage(tox, TOX, def_zone, blocked)