Skip to content

Commit

Permalink
removed useless attack damage conversion variables
Browse files Browse the repository at this point in the history
  • Loading branch information
BurgerLua authored and BurgerLua committed Oct 13, 2019
1 parent 7ae6571 commit fb8442c
Show file tree
Hide file tree
Showing 58 changed files with 27 additions and 460 deletions.
2 changes: 1 addition & 1 deletion code/__defines/damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define BURN "burn"
#define TOX "toxin"
#define OXY "oxy"
#define FATIGUE "fatigue"

#define HEALTH "health"
#define MANA "mana"
Expand All @@ -22,4 +23,3 @@
#define HOLY "holy"
#define DARK "dark"

#define FATIGUE "fatigue"
6 changes: 3 additions & 3 deletions code/_core/atom/_atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
var/health_current = 0
var/health_regeneration = 0

var/list/damage = list(BRUTE = 0, BURN = 0, TOX = 0, OXY = 0)
var/list/damage_soft = list(BRUTE = 0, BURN = 0, TOX = 0, OXY = 0)
var/list/damage = list(BRUTE = 0, BURN = 0, TOX = 0, OXY = 0, FATIGUE = 0)
var/list/damage_soft = list(BRUTE = 0, BURN = 0, TOX = 0, OXY = 0, FATIGUE = 0)

var/damage_multiplier = 1 //How much damage, multiplied, does this atom recieve?

Expand All @@ -24,7 +24,7 @@

var/damage_type = "default" //The id of the damage type of the weapon, if any.

var/list/resistance = list(BRUTE = 0, BURN = 0, TOX = 0, OXY = 0) //How much to subtract damage
var/list/resistance = list(BRUTE = 0, BURN = 0, TOX = 0, OXY = 0, FATIGUE = 0) //How much to subtract damage

var/attack_range = 1 //If it's a melee weapon, it needs a range. TODO: MOVE TO ITEM

Expand Down
24 changes: 21 additions & 3 deletions code/_core/atom/health.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
damage[OXY] = value
return value

/atom/proc/set_fatigue_loss(var/value)
damage[FATIGUE] = value
return value

//Adding/Subtracting
/atom/proc/adjust_brute_loss(var/value)
value -= (value > 0 ? resistance[BRUTE] : 0)
Expand All @@ -43,16 +47,26 @@
damage[OXY] += value
return value

/atom/proc/get_total_loss()
/atom/proc/adjust_fatigue_loss(var/value)
value -= (value > 0 ? resistance[FATIGUE] : 0)
value -= min(0,damage[FATIGUE] + value)
damage[FATIGUE] += value
return value

/atom/proc/get_total_loss(var/include_fatigue = TRUE)
var/returning_value = 0
for(var/damage_type in damage)
if(!include_fatigue && damage_type == FATIGUE)
continue
returning_value += damage[damage_type]

return returning_value

/atom/proc/get_total_loss_soft()
/atom/proc/get_total_loss_soft(var/include_fatigue = TRUE)
var/returning_value = 0
for(var/damage_type in damage_soft)
if(!include_fatigue && damage_type == FATIGUE)
continue
returning_value += damage_soft[damage_type]

return returning_value
Expand All @@ -70,6 +84,9 @@
/atom/proc/get_oxy_loss()
return damage[OXY]

/atom/proc/get_fatigue_loss()
return damage[FATIGUE]

/atom/proc/get_loss(var/damage_type)
return damage[damage_type]

Expand All @@ -89,7 +106,8 @@
return adjust_tox_loss(amount)
if(OXY)
return adjust_oxy_loss(amount)

if(FATIGUE)
return adjust_fatigue_loss(amount)

/atom/proc/do_impact_effect(var/atom/attacker,var/atom/weapon,var/damagetype/DT,var/damage_dealt)
return TRUE
2 changes: 1 addition & 1 deletion code/_core/datum/damagetype/_damagetype.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
RAD = TOX,
HOLY = BURN,
DARK = BURN,
FATIGUE = OXY
FATIGUE = FATIGUE
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
Expand Down
5 changes: 0 additions & 5 deletions code/_core/datum/damagetype/default.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
BLUNT = DAMAGE_C,
)

//The damage conversion table of the weapon. Useful for when you want blade attacks to deal holy damage or something.
attack_damage_conversion = list(
BLUNT = BRUTE
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
attack_damage_penetration = list(
BLUNT = 0
Expand Down
5 changes: 0 additions & 5 deletions code/_core/datum/damagetype/melee/club/gun_butt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
BLUNT = DAMAGE_C
)

//The damage conversion table of the weapon. Useful for when you want blade attacks to deal holy damage or something.
attack_damage_conversion = list(
BLUNT = BRUTE
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
attack_damage_penetration = list(
BLUNT = ARMOR_E
Expand Down
5 changes: 0 additions & 5 deletions code/_core/datum/damagetype/melee/club/null_rod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
HOLY = DAMAGE_B
)

attack_damage_conversion = list(
BLUNT = BRUTE,
HOLY = BURN
)

attack_damage_penetration = list(
BLUNT = ARMOR_D,
HOLY = ARMOR_A
Expand Down
5 changes: 0 additions & 5 deletions code/_core/datum/damagetype/melee/club/null_staff.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
HOLY = DAMAGE_B
)

attack_damage_conversion = list(
BLUNT = BRUTE,
HOLY = BURN
)

attack_damage_penetration = list(
BLUNT = ARMOR_D,
HOLY = ARMOR_A
Expand Down
7 changes: 0 additions & 7 deletions code/_core/datum/damagetype/melee/club/pickaxe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@
PIERCE = DAMAGE_C
)

//The damage conversion table of the weapon. Useful for when you want blade attacks to deal holy damage or something.
attack_damage_conversion = list(
BLADE = BRUTE,
BLUNT = BRUTE,
PIERCE = BRUTE
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
attack_damage_penetration = list(
BLADE = ARMOR_F,
Expand Down
13 changes: 0 additions & 13 deletions code/_core/datum/damagetype/melee/club/shield.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
FATIGUE = DAMAGE_B
)

//The damage conversion table of the weapon. Useful for when you want blade attacks to deal holy damage or something.
attack_damage_conversion = list(
BLUNT = BRUTE,
FATIGUE = OXY
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
attack_damage_penetration = list(
BLUNT = ARMOR_F,
Expand Down Expand Up @@ -58,13 +52,6 @@
FATIGUE = DAMAGE_B
)

//The damage conversion table of the weapon. Useful for when you want blade attacks to deal holy damage or something.
attack_damage_conversion = list(
BLUNT = BRUTE,
LASER = BURN,
FATIGUE = OXY
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
attack_damage_penetration = list(
BLUNT = ARMOR_F,
Expand Down
10 changes: 0 additions & 10 deletions code/_core/datum/damagetype/melee/club/stunbaton.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
BLUNT = DAMAGE_C
)

//The damage conversion table of the weapon. Useful for when you want blade attacks to deal holy damage or something.
attack_damage_conversion = list(
BLUNT = BRUTE
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
attack_damage_penetration = list(
BLUNT = ARMOR_D
Expand Down Expand Up @@ -48,11 +43,6 @@
FATIGUE = DAMAGE_A
)

//The damage conversion table of the weapon. Useful for when you want blade attacks to deal holy damage or something.
attack_damage_conversion = list(
FATIGUE = OXY
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
attack_damage_penetration = list(
FATIGUE = ARMOR_A
Expand Down
5 changes: 0 additions & 5 deletions code/_core/datum/damagetype/melee/club/toolbox.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
BLUNT = DAMAGE_C
)

//The damage conversion table of the weapon. Useful for when you want blade attacks to deal holy damage or something.
attack_damage_conversion = list(
BLUNT = BRUTE
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
attack_damage_penetration = list(
BLUNT = ARMOR_C
Expand Down
5 changes: 0 additions & 5 deletions code/_core/datum/damagetype/melee/dagger/null_dagger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
HOLY = DAMAGE_B
)

attack_damage_conversion = list(
BLADE = BRUTE,
HOLY = BURN
)

attack_damage_penetration = list(
PIERCE = ARMOR_D,
HOLY = ARMOR_S
Expand Down
10 changes: 0 additions & 10 deletions code/_core/datum/damagetype/melee/flashlight.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
BLUNT = DAMAGE_E
)

//The damage conversion table of the weapon. Useful for when you want blade attacks to deal holy damage or something.
attack_damage_conversion = list(
BLUNT = BRUTE
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
attack_damage_penetration = list(
BLUNT = ARMOR_F
Expand Down Expand Up @@ -49,11 +44,6 @@
HOLY = DAMAGE_B
)

//The damage conversion table of the weapon. Useful for when you want blade attacks to deal holy damage or something.
attack_damage_conversion = list(
HOLY = BURN
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
attack_damage_penetration = list(
HOLY = ARMOR_F
Expand Down
10 changes: 0 additions & 10 deletions code/_core/datum/damagetype/melee/spear.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
BLADE = DAMAGE_C
)

attack_damage_conversion = list(
PIERCE = BRUTE,
BLADE = BRUTE
)

attack_damage_penetration = list(
PIERCE = ARMOR_A
)
Expand Down Expand Up @@ -47,11 +42,6 @@
BLADE = DAMAGE_B
)

attack_damage_conversion = list(
PIERCE = BRUTE,
BLADE = BRUTE
)

attack_damage_penetration = list(
PIERCE = ARMOR_S
)
Expand Down
12 changes: 0 additions & 12 deletions code/_core/datum/damagetype/melee/sword/chainsaw.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
PIERCE = DAMAGE_D,
)

//The damage conversion table of the weapon. Useful for when you want blade attacks to deal holy damage or something.
attack_damage_conversion = list(
BLADE = BRUTE,
PIERCE = BRUTE,
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
attack_damage_penetration = list(
BLADE = ARMOR_D,
Expand Down Expand Up @@ -55,12 +49,6 @@
PIERCE = DAMAGE_D,
)

//The damage conversion table of the weapon. Useful for when you want blade attacks to deal holy damage or something.
attack_damage_conversion = list(
BLADE = BRUTE,
PIERCE = BRUTE,
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
attack_damage_penetration = list(
BLADE = ARMOR_C,
Expand Down
6 changes: 0 additions & 6 deletions code/_core/datum/damagetype/melee/sword/claymore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
PIERCE = DAMAGE_D,
)

//The damage conversion table of the weapon. Useful for when you want blade attacks to deal holy damage or something.
attack_damage_conversion = list(
BLADE = BRUTE,
PIERCE = BRUTE,
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
attack_damage_penetration = list(
BLADE = ARMOR_C,
Expand Down
10 changes: 0 additions & 10 deletions code/_core/datum/damagetype/melee/sword/energy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
FATIGUE = DAMAGE_D
)

//The damage conversion table of the weapon. Useful for when you want blade attacks to deal holy damage or something.
attack_damage_conversion = list(
BLUNT = BRUTE
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
attack_damage_penetration = list(
BLUNT = ARMOR_D,
Expand Down Expand Up @@ -50,11 +45,6 @@
LASER = DAMAGE_A
)

//The damage conversion table of the weapon. Useful for when you want blade attacks to deal holy damage or something.
attack_damage_conversion = list(
LASER = BRUTE
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
attack_damage_penetration = list(
LASER = ARMOR_A
Expand Down
5 changes: 0 additions & 5 deletions code/_core/datum/damagetype/melee/sword/sabre.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
BLADE = DAMAGE_C
)

//The damage conversion table of the weapon. Useful for when you want blade attacks to deal holy damage or something.
attack_damage_conversion = list(
BLADE = BRUTE
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
attack_damage_penetration = list(
BLADE = ARMOR_D
Expand Down
11 changes: 0 additions & 11 deletions code/_core/datum/damagetype/melee/torch.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
BLUNT = DAMAGE_D,
)

//The damage conversion table of the weapon. Useful for when you want blade attacks to deal holy damage or something.
attack_damage_conversion = list(
BLUNT = BRUTE
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
attack_damage_penetration = list(
BLUNT = ARMOR_F
Expand Down Expand Up @@ -49,12 +44,6 @@
HEAT = DAMAGE_C
)

//The damage conversion table of the weapon. Useful for when you want blade attacks to deal holy damage or something.
attack_damage_conversion = list(
BLUNT = BRUTE,
HEAT = BURN
)

//How much armor to penetrate. It basically removes the percentage of the armor using these values.
attack_damage_penetration = list(
BLUNT = ARMOR_F,
Expand Down
Loading

0 comments on commit fb8442c

Please sign in to comment.