Skip to content

Commit

Permalink
Removes Armortype Variable (vlggms#792)
Browse files Browse the repository at this point in the history
* God I hate Armortype

Clean Up

Why is this here??????

Integration Fix, damage defaults to checking against Brute if atypical.

Integration Test: Armor is defaults to not affecting if atypical damage.

Damage Processing

Damage Flag removal (Armor Type but for Projectiles)

* Removes flag and armortype

Removes damage_flag from the majority of procs where it was applicable, left alone for obj_break and such as to not conflict with variable names.

* White-space cleanup

* Cleans up Whitespace and redundant damtype

* White Space Clean Up
  • Loading branch information
LanceSmites328 authored and vampirebat74 committed May 10, 2024
1 parent 4d1c1fc commit d22ec5a
Show file tree
Hide file tree
Showing 229 changed files with 327 additions and 719 deletions.
2 changes: 1 addition & 1 deletion ModularTegustation/tegu_borg_code/medborg_holobed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
visible_message("<span class='warning'>[src] suddenly flickers and vanishes!</span>")
return ..()

/obj/structure/bed/holobed/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
/obj/structure/bed/holobed/play_attack_sound(damage_amount, damage_type = BRUTE)
playsound(src, 'sound/effects/empulse.ogg', 50, TRUE)

/obj/structure/bed/holobed/attackby(obj/item/W, mob/user, params)
Expand Down
3 changes: 0 additions & 3 deletions ModularTegustation/tegu_items/apostle_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@
name = "guardian scythe"
desc = "The divine light will grant you protection."
damtype = PALE_DAMAGE
armortype = PALE_DAMAGE
force = 25
throwforce = 6
spin_force = 75
Expand Down Expand Up @@ -217,7 +216,6 @@
/obj/projectile/magic/arcane_barrage/apostle
damage = 20
damage_type = WHITE_DAMAGE
flag = WHITE_DAMAGE

/obj/projectile/magic/arcane_barrage/apostle/on_hit(target)
if(ismob(target))
Expand All @@ -241,7 +239,6 @@
force = 30 // Weaker in melee, but kills everyone with its active ability.
throwforce = 35
damtype = BLACK_DAMAGE
armortype = BLACK_DAMAGE
throw_speed = 4
throw_range = 11
embedding = list("impact_pain_mult" = 2, "remove_pain_mult" = 4, "jostle_chance" = 2.5)
Expand Down
1 change: 0 additions & 1 deletion ModularTegustation/tegu_items/gadgets/powered.dm
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@
health = 150
maxHealth = 150
melee_damage_type = RED_DAMAGE
armortype = RED_DAMAGE
damage_coeff = list(RED_DAMAGE = 0.9, WHITE_DAMAGE = 0.9, BLACK_DAMAGE = 0.9, PALE_DAMAGE = 1.5)
melee_damage_lower = 12
melee_damage_upper = 14
Expand Down
1 change: 0 additions & 1 deletion ModularTegustation/tegu_items/workshop/_materials.dm
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@
creation.attack_speed *= attack_mult
if(type_override)
creation.damtype = type_override
creation.armortype = type_override
creation.type_overriden = TRUE
if(hitsound_override)
creation.hitsound = hitsound_override
Expand Down
3 changes: 1 addition & 2 deletions ModularTegustation/tegu_items/workshop/_templates.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
force = 0
attack_speed = 1
damtype = RED_DAMAGE
armortype = RED_DAMAGE

attack_verb_continuous = list("pokes", "jabs", "tears", "lacerates", "gores")
attack_verb_simple = list("poke", "jab", "tear", "lacerate", "gore")
hitsound = 'sound/weapons/ego/spear1.ogg'
Expand Down Expand Up @@ -46,7 +46,6 @@

if(!type_overriden)
damtype = mod.damagetype
armortype = mod.damagetype
if(!color)
// Material color overwrites
color = mod.weaponcolor
Expand Down
20 changes: 0 additions & 20 deletions ModularTegustation/tegu_items/workshop/templates/basic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ Katana - Use in hand to dash
force = 22
reach = 2 //Has 2 Square Reach.
attack_speed = 1.2
damtype = RED_DAMAGE
armortype = RED_DAMAGE
attack_verb_continuous = list("pokes", "jabs", "tears", "lacerates", "gores")
attack_verb_simple = list("poke", "jab", "tear", "lacerate", "gore")
hitsound = 'sound/weapons/ego/spear1.ogg'
Expand All @@ -27,8 +25,6 @@ Katana - Use in hand to dash
desc = "A blank sword workshop template."
icon_state = "swordtemplate"
force = 22
damtype = RED_DAMAGE
armortype = RED_DAMAGE
hitsound = 'sound/weapons/bladeslice.ogg'
attack_verb_continuous = list("attacks", "slashes", "stabs", "slices", "tears", "lacerates", "rips", "dices", "cuts")
attack_verb_simple = list("attack", "slash", "stab", "slice", "tear", "lacerate", "rip", "dice", "cut")
Expand All @@ -44,8 +40,6 @@ Katana - Use in hand to dash
icon_state = "knifetemplate"
force = 20
attack_speed = 0.7
damtype = RED_DAMAGE
armortype = RED_DAMAGE
hitsound = 'sound/weapons/bladeslice.ogg'
attack_verb_continuous = list("attacks", "slashes", "stabs", "slices", "tears", "lacerates", "rips", "dices", "cuts")
attack_verb_simple = list("attack", "slash", "stab", "slice", "tear", "lacerate", "rip", "dice", "cut")
Expand All @@ -61,8 +55,6 @@ Katana - Use in hand to dash
icon_state = "axetemplate"
force = 30
attack_speed = 1.5
damtype = RED_DAMAGE
armortype = RED_DAMAGE
hitsound = 'sound/abnormalities/woodsman/woodsman_attack.ogg'
attack_verb_continuous = list("attacks", "slashes", "cleaves", "slices", "cuts")
attack_verb_simple = list("attack", "slash", "cleave", "slice", "cut")
Expand All @@ -79,8 +71,6 @@ Katana - Use in hand to dash
force = 26
attack_speed = 1.8
aoe_range = 1
damtype = RED_DAMAGE
armortype = RED_DAMAGE
hitsound = 'sound/abnormalities/woodsman/woodsman_attack.ogg'
attack_verb_continuous = list("bashes", "beats")
attack_verb_simple = list("bash", "beat")
Expand All @@ -98,8 +88,6 @@ Katana - Use in hand to dash
reach = 2 //Has 2 Square Reach.
attack_speed = 1.7 //not really for melee and is therefore really slow.
throwforce = 50
damtype = RED_DAMAGE
armortype = RED_DAMAGE
attack_verb_continuous = list("pokes", "jabs", "tears", "lacerates", "gores")
attack_verb_simple = list("poke", "jab", "tear", "lacerate", "gore")
hitsound = 'sound/weapons/ego/spear1.ogg'
Expand All @@ -116,8 +104,6 @@ Katana - Use in hand to dash
force = 16
attack_speed = 0.8 //melee is shit lol
throwforce = 38
damtype = RED_DAMAGE
armortype = RED_DAMAGE
attack_verb_continuous = list("bonks", "bashes")
attack_verb_simple = list("bonk", "bash")

Expand All @@ -140,8 +126,6 @@ Katana - Use in hand to dash
icon_state = "greatswordtemplate"
force = 38
attack_speed = 2
damtype = RED_DAMAGE
armortype = RED_DAMAGE
hitsound = 'sound/abnormalities/woodsman/woodsman_attack.ogg'
attack_verb_continuous = list("attacks", "slashes", "cleaves", "slices", "cuts")
attack_verb_simple = list("attack", "slash", "cleave", "slice", "cut")
Expand All @@ -156,8 +140,6 @@ Katana - Use in hand to dash
icon_state = "clawtemplate"
force = 12
attack_speed = 0.4
damtype = RED_DAMAGE
armortype = RED_DAMAGE
attack_verb_continuous = list("rends", "tears", "lacerates", "rips", "cuts")
attack_verb_simple = list("rend", "tear", "lacerate", "rip", "cut")

Expand All @@ -172,8 +154,6 @@ Katana - Use in hand to dash
icon_state = "clubtemplate"
force = 20
attack_speed = 1.6
damtype = RED_DAMAGE
armortype = RED_DAMAGE
attack_verb_continuous = list("pounds", "crushes", "smashes", "whacks", "smacks")
attack_verb_simple = list("pound", "crush", "smash", "whack", "smack")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
desc = "A glowing weapon made using Wcorp charge technology."
icon_state = "chargetemplate"
force = 18
damtype = RED_DAMAGE
armortype = RED_DAMAGE
hitsound = 'sound/weapons/bladeslice.ogg'
attack_verb_continuous = list("attacks", "slashes", "stabs", "slices", "tears", "lacerates", "rips", "dices", "cuts")
attack_verb_simple = list("attack", "slash", "stab", "slice", "tear", "lacerate", "rip", "dice", "cut")
Expand Down
2 changes: 0 additions & 2 deletions ModularTegustation/tegu_items/workshop/templates/dice.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
icon_state = "dicetemplate"
force = 40
throwforce = 20
damtype = RED_DAMAGE
armortype = RED_DAMAGE
finishedicon = list("finisheddice")
finishedname = list("dice")
finisheddesc = "A finished dice, ready for use."
Expand Down
4 changes: 1 addition & 3 deletions ModularTegustation/tegu_items/workshop/templates/gauntlet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
special = "This weapon deals it's damage after a short windup."
icon_state = "gauntlettemplate"
force = 40
damtype = RED_DAMAGE
armortype = RED_DAMAGE
finishedicon = list("finishedgauntlet")
finishedname = list("fist", "gauntlet", "glove")
finisheddesc = "A finished gauntlet, ready for use."
Expand All @@ -32,7 +30,7 @@
if(ishuman(target))
punch_damage = 50

target.apply_damage(punch_damage, damtype, null, target.run_armor_check(null, armortype), spread_damage = TRUE) //MASSIVE fuckoff punch
target.apply_damage(punch_damage, damtype, null, target.run_armor_check(null, damtype), spread_damage = TRUE) //MASSIVE fuckoff punch

playsound(src, 'sound/weapons/resonator_blast.ogg', 50, TRUE)
var/atom/throw_target = get_edge_target_turf(target, user.dir)
Expand Down
2 changes: 0 additions & 2 deletions ModularTegustation/tegu_items/workshop/templates/katana.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
icon_state = "katanatemplate"
force = 22
attack_speed = 1.3
damtype = RED_DAMAGE
armortype = RED_DAMAGE
hitsound = 'sound/weapons/bladeslice.ogg'
attack_verb_continuous = list("attacks", "slashes", "stabs", "slices", "tears", "lacerates", "rips", "dices", "cuts")
attack_verb_simple = list("attack", "slash", "stab", "slice", "tear", "lacerate", "rip", "dice", "cut")
Expand Down
2 changes: 0 additions & 2 deletions ModularTegustation/tegu_items/workshop/templates/scythe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
icon_state = "scythetemplate"
force = 20
attack_speed = 0.9
damtype = RED_DAMAGE
armortype = RED_DAMAGE
attack_verb_continuous = list("slashes", "slices", "rips", "cuts")
attack_verb_simple = list("slash", "slice", "rip", "cut")
hitsound = 'sound/weapons/ego/da_capo1.ogg'
Expand Down
2 changes: 0 additions & 2 deletions ModularTegustation/tegu_mobs/lc13_outskirtdwellers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,6 @@ Mobs that mostly focus on dealing RED damage, they are all a bit more frail than
move_to_delay = 4
stat_attack = HARD_CRIT
melee_damage_type = RED_DAMAGE
armortype = RED_DAMAGE
butcher_results = list(/obj/item/food/meat/slab = 1)
guaranteed_butcher_results = list(/obj/item/food/meat/slab = 1)
damage_coeff = list(BRUTE = 1, RED_DAMAGE = 1.6, WHITE_DAMAGE = 0.8, BLACK_DAMAGE = 1, PALE_DAMAGE = 2)
Expand Down Expand Up @@ -683,7 +682,6 @@ Mobs that mostly focus on dealing RED damage, they are all a bit more frail than
melee_damage_lower = 25
melee_damage_upper = 30
melee_damage_type = RED_DAMAGE
armortype = RED_DAMAGE
attack_sound = 'sound/creatures/lc13/lovetown/slam.ogg'
attack_verb_continuous = "grapples"
attack_verb_simple = "grapple"
Expand Down
1 change: 0 additions & 1 deletion ModularTegustation/tegu_mobs/necromancer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,6 @@
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
force = 66
damtype = PALE_DAMAGE
armortype = PALE_DAMAGE
attack_verb_continuous = list("cuts", "slices", "dices")
attack_verb_simple = list("cut", "slice", "dice")
w_class = WEIGHT_CLASS_BULKY
Expand Down
1 change: 0 additions & 1 deletion ModularTegustation/tegu_mobs/necromancer_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
ranged = 1
ranged_cooldown_time = 40
melee_damage_type = BLACK_DAMAGE
armortype = BLACK_DAMAGE
melee_damage_lower = 24
melee_damage_upper = 28
retreat_distance = 2
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@

// /obj signals

///from base of [/obj/proc/take_damage]: (damage_amount, damage_type, damage_flag, sound_effect, attack_dir, aurmor_penetration)
///from base of [/obj/proc/take_damage]: (damage_amount, damage_type, sound_effect, attack_dir, aurmor_penetration)
#define COMSIG_OBJ_TAKE_DAMAGE "obj_take_damage"
/// Return bitflags for the above signal which prevents the object taking any damage.
#define COMPONENT_NO_TAKE_DAMAGE (1<<0)
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"<span class='danger'>You hit [src] with [I]!</span>", null, COMBAT_MESSAGE_RANGE)
//only witnesses close by and the victim see a hit message.
log_combat(user, src, "attacked", I)
take_damage(I.force, I.damtype, I.armortype, 1)
take_damage(I.force, I.damtype, I.damtype, 1)

/mob/living/attacked_by(obj/item/I, mob/living/user)
send_item_attack_message(I, user)
Expand All @@ -147,7 +147,7 @@
return TRUE //successful attack

/mob/living/simple_animal/attacked_by(obj/item/I, mob/living/user)
if(!attack_threshold_check(I.force, I.damtype, I.armortype, FALSE))
if(!attack_threshold_check(I.force, I.damtype, FALSE))
playsound(loc, 'sound/weapons/tap.ogg', I.get_clamped_volume(), TRUE, -1)
else
return ..()
Expand Down
2 changes: 1 addition & 1 deletion code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
var/a_incidence_s = abs(incidence_s)
if(a_incidence_s > 90 && a_incidence_s < 270)
return FALSE
if((P.flag in list(BULLET, BOMB)) && P.ricochet_incidence_leeway)
if((P.damage_type in list(BULLET, BOMB)) && P.ricochet_incidence_leeway)
if((a_incidence_s < 90 && a_incidence_s < 90 - P.ricochet_incidence_leeway) || (a_incidence_s > 270 && a_incidence_s -270 > P.ricochet_incidence_leeway))
return FALSE
var/new_angle_s = SIMPLIFY_DEGREES(face_angle + incidence_s)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/camera/camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@
return ..()


/obj/machinery/camera/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
/obj/machinery/camera/run_obj_armor(damage_amount, damage_type, attack_dir)
if(machine_stat & BROKEN)
return damage_amount
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/_computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
deconstruct(TRUE, user)
return TRUE

/obj/machinery/computer/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
/obj/machinery/computer/play_attack_sound(damage_amount, damage_type = BRUTE)
switch(damage_type)
if(BRUTE)
if(machine_stat & BROKEN)
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1328,8 +1328,8 @@
log_combat(user, src, message)
add_hiddenprint(user)

/obj/machinery/door/airlock/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
if((damage_amount >= obj_integrity) && (damage_flag == BOMB))
/obj/machinery/door/airlock/take_damage(damage_amount, damage_type = BRUTE, sound_effect = 1, attack_dir)
if((damage_amount >= obj_integrity) && (damage_type == BOMB))
flags_1 |= NODECONSTRUCT_1 //If an explosive took us out, don't drop the assembly
. = ..()
if(obj_integrity < (0.75 * max_integrity))
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/doors/door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,13 @@
return TRUE
return ..()

/obj/machinery/door/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
/obj/machinery/door/take_damage(damage_amount, damage_type = BRUTE, sound_effect = 1, attack_dir)
. = ..()
if(. && obj_integrity > 0)
if(damage_amount >= 10 && prob(30))
spark_system.start()

/obj/machinery/door/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
/obj/machinery/door/play_attack_sound(damage_amount, damage_type = BRUTE)
switch(damage_type)
if(BRUTE)
if(glass)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/windowdoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
operating = FALSE
return 1

/obj/machinery/door/window/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
/obj/machinery/door/window/play_attack_sound(damage_amount, damage_type = BRUTE)
switch(damage_type)
if(BRUTE)
playsound(src, 'sound/effects/glasshit.ogg', 90, TRUE)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/firealarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
return TRUE
return FALSE

/obj/machinery/firealarm/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
/obj/machinery/firealarm/take_damage(damage_amount, damage_type = BRUTE, sound_effect = 1, attack_dir)
. = ..()
if(.) //damage received
if(obj_integrity > 0 && !(machine_stat & BROKEN) && buildstage != 0)
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/newscaster.dm
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ GLOBAL_LIST_EMPTY(allCasters)
else
. += "crack3"

/obj/machinery/newscaster/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
/obj/machinery/newscaster/take_damage(damage_amount, damage_type = BRUTE, sound_effect = 1, attack_dir)
. = ..()
update_icon()

Expand Down Expand Up @@ -754,7 +754,7 @@ GLOBAL_LIST_EMPTY(allCasters)
else
return ..()

/obj/machinery/newscaster/play_attack_sound(damage, damage_type = BRUTE, damage_flag = 0)
/obj/machinery/newscaster/play_attack_sound(damage, damage_type = BRUTE)
switch(damage_type)
if(BRUTE)
if(machine_stat & BROKEN)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/porta_turret/portable_turret.dm
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ DEFINE_BITFIELD(turret_flags, list(

addtimer(CALLBACK(src, .proc/toggle_on, TRUE), rand(60,600))

/obj/machinery/porta_turret/take_damage(damage, damage_type = BRUTE, damage_flag = 0, sound_effect = 1)
/obj/machinery/porta_turret/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
. = ..()
if(. && obj_integrity > 0) //damage received
if(prob(30))
Expand Down
Loading

0 comments on commit d22ec5a

Please sign in to comment.