Skip to content

Commit

Permalink
Temporary Starting Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
LanceSmites328 committed Jul 19, 2023
1 parent ff26da5 commit a2b7850
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 24 deletions.
35 changes: 12 additions & 23 deletions code/datums/status_effects/buffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -513,34 +513,23 @@

//LC13 AI entity Buffs
//Buff Maroon Ordeal Soldiers, Feel free to cannibalize and rework to work for other creatures.
/datum/status_effect/all_armor_buff //due to multiplication the effect works more on entities that are weak to the damage value.
id = "all armor armor"
status_type = STATUS_EFFECT_UNIQUE
duration = 120 //6 seconds
alert_type = null
/datum/dc_change/maroon_buff
duration = 120
potency = 0.8
var/visual

/datum/status_effect/all_armor_buff/on_apply()
/datum/dc_change/maroon_buff/New(mob/living/simple_animal/S, apply_visual = FALSE, damtype = RED_DAMAGE)
if(apply_visual)
visual = mutable_appearance('ModularTegustation/Teguicons/tegu_effects.dmi', "manager_shield")
owner.add_overlay(visual)
damage_type = damtype
. = ..()
visual = mutable_appearance('ModularTegustation/Teguicons/tegu_effects.dmi', "manager_shield")
if(isanimal(owner))
var/mob/living/simple_animal/M = owner
M.add_overlay(visual)
M.damage_coeff[RED_DAMAGE] *= 0.8 //20% damage decrease
M.damage_coeff[WHITE_DAMAGE] *= 0.8
M.damage_coeff[BLACK_DAMAGE] *= 0.8
M.damage_coeff[PALE_DAMAGE] *= 0.8

/datum/status_effect/all_armor_buff/on_remove()
. = ..()
if(isanimal(owner))
var/mob/living/simple_animal/M = owner
M.damage_coeff[RED_DAMAGE] /= 0.8
M.damage_coeff[WHITE_DAMAGE] /= 0.8
M.damage_coeff[BLACK_DAMAGE] /= 0.8
M.damage_coeff[PALE_DAMAGE] /= 0.8
owner.cut_overlay(visual)

/datum/status_effect/all_armor_buff/Remove()
if(visual)
owner.cut_overlay(visual)
. = ..()

/datum/status_effect/minor_damage_buff
id = "minor damage buff"
Expand Down
48 changes: 48 additions & 0 deletions code/modules/mob/living/simple_animal/damage_coeff_helper.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// This is a modifier to Simple Animal's damage coeff.
// It's built to standarize the damage changes to abnos and other simple animals without causing them to desync during phase changes.

/datum/dc_change
name = "Damage Coeff Change"
desc = "This is a modification to a simple_animal's damage_coeff."
/// TRUE if it adds the potency value to damage_coeff, FALSE if it multiplies.
var/additive = FALSE
/// The amount the damage type is added or multiplied by.
var/potency = 0
/// Effected Damage Type
var/damage_type = RED_DAMAGE
/// Duration when the debuff is removed, in deciseconds by default.
var/duration = 0 SECONDS
var/mob/living/simple_animal/owner

/datum/dc_change/New(mob/living/simple_animal/S)
if(!istype(S))
qdel(S)
return
owner = S
owner.damage_mods += src
owner.Update_Coeff()
addtimer(CALLBACK(src, .proc/Remove), duration)

/datum/dc_change/proc/Remove()
owner.damage_mods -= src
owner.Update_Coeff()
qdel(src)

/// Updates the Simple Animal's damage coeff's.
/mob/living/simple_animal/proc/UpdateCoeff()
for(var/datum/dc_change/D in damage_mods)
if(D.additive)
continue
damage_coeff[D.damage_type] = unmodified_coeff[D.damage_type] * D.potency
for(var/datum/dc_change/D in damage_mods)
if(!D.additive)
continue
damage_coeff[D.damage_type] = unmodified_coeff[D.damage_type] + D.potency

/// Give it a dc_change modifier path and it will check aganist that. If it exists in the list, it will be returned.
/mob/living/simple_animal/proc/HasDamageMod(mod)
. = FALSE
if(damage_mods)
for(var/datum/dc_change/modifier in damage_mods)
if(istype(modifer, mod))
return mod
2 changes: 2 additions & 0 deletions code/modules/mob/living/simple_animal/dc_changes.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
if(prob(20))
say(pick("Lads we got a hostile!", "Shit, wake up troops hell just found us!", "I warn you, we dont die easy.", "Keep your cool and we can all get out of this alive!"))
for(var/mob/living/simple_animal/hostile/ordeal/G in oview(9, src))
if(istype(G, /mob/living/simple_animal/hostile/ordeal/steel_dawn) && G.stat != DEAD && !has_status_effect(/datum/status_effect/all_armor_buff || /datum/status_effect/minor_damage_buff))
if(istype(G, /mob/living/simple_animal/hostile/ordeal/steel_dawn) && G.stat != DEAD && (!HasDamageMod(/datum/dc_change/maroon_buff) || !has_status_effect(/datum/status_effect/minor_damage_buff)))
G.GiveTarget(target)
G.TemporarySpeedChange(-1, 1 SECONDS)
last_command = 1
Expand Down
6 changes: 6 additions & 0 deletions code/modules/mob/living/simple_animal/simple_animal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
var/armortype = RED_DAMAGE
/// 1 for full damage , 0 for none , -1 for 1:1 heal from that source.
var/list/damage_coeff = list(BRUTE = 1, RED_DAMAGE = 1, WHITE_DAMAGE = 1, BLACK_DAMAGE = 1, PALE_DAMAGE = 1)
/// A copy of the original damage_coeff, what the base resistances of a simple animal should be before modifiers.
var/list/unmodified_coeff = list()
/// The datum modifiers to
var/list/damage_mods = list()
///Attacking verb in present continuous tense.
var/attack_verb_continuous = "attacks"
///Attacking verb in present simple tense.
Expand Down Expand Up @@ -209,6 +213,8 @@
if(!unsuitable_heat_damage)
unsuitable_heat_damage = unsuitable_atmos_damage

unmodified_coeff = damage_coeff

/mob/living/simple_animal/Life()
. = ..()
if(staminaloss > 0)
Expand Down
1 change: 1 addition & 0 deletions lobotomy-corp13.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2630,6 +2630,7 @@
#include "code\modules\mob\living\simple_animal\constructs.dm"
#include "code\modules\mob\living\simple_animal\corpse.dm"
#include "code\modules\mob\living\simple_animal\damage_procs.dm"
#include "code\modules\mob\living\simple_animal\dc_changes.dm"
#include "code\modules\mob\living\simple_animal\eldritch_demons.dm"
#include "code\modules\mob\living\simple_animal\parrot.dm"
#include "code\modules\mob\living\simple_animal\shade.dm"
Expand Down

0 comments on commit a2b7850

Please sign in to comment.