Skip to content

Commit

Permalink
Removes useless armor type (#11029)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsar-Salat authored Aug 8, 2024
1 parent 4d1ffcf commit 28f8510
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 31 deletions.
2 changes: 0 additions & 2 deletions code/__DEFINES/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
#define LASER "laser"
/// Involves a melee attack or a thrown object.
#define MELEE "melee"
/// Involves magic.
#define MAGIC "magic"
/// Bleed prevention
#define BLEED "bleed"

Expand Down
25 changes: 11 additions & 14 deletions code/datums/armor.dm
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#define ARMORID "armor-[melee]-[bullet]-[laser]-[energy]-[bomb]-[bio]-[rad]-[fire]-[acid]-[magic]-[stamina]-[consume]-[bleed]"
#define ARMORID "armor-[melee]-[bullet]-[laser]-[energy]-[bomb]-[bio]-[rad]-[fire]-[acid]-[stamina]-[consume]-[bleed]"

/proc/getArmor(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0, magic = 0, stamina = 0, consume = 0, bleed = 0)
/proc/getArmor(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0, stamina = 0, consume = 0, bleed = 0)
. = locate(ARMORID)
if (!.)
. = new /datum/armor(melee, bullet, laser, energy, bomb, bio, rad, fire, acid, magic, stamina, consume, bleed)
. = new /datum/armor(melee, bullet, laser, energy, bomb, bio, rad, fire, acid, stamina, consume, bleed)

/datum/armor
datum_flags = DF_USE_TAG
Expand All @@ -16,12 +16,11 @@
var/rad
var/fire
var/acid
var/magic
var/stamina
var/consume
var/bleed

/datum/armor/New(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0, magic = 0, stamina = 0, consume = 0, bleed = 0)
/datum/armor/New(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0, stamina = 0, consume = 0, bleed = 0)
src.melee = melee
src.bullet = bullet
src.laser = laser
Expand All @@ -31,19 +30,18 @@
src.rad = rad
src.fire = fire
src.acid = acid
src.magic = magic
src.stamina = stamina
src.consume = consume
src.bleed = bleed
tag = ARMORID

/datum/armor/proc/modifyRating(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0, magic = 0, stamina = 0, consume = 0, bleed = 0)
return getArmor(src.melee+melee, src.bullet+bullet, src.laser+laser, src.energy+energy, src.bomb+bomb, src.bio+bio, src.rad+rad, src.fire+fire, src.acid+acid, src.magic+magic, src.stamina+stamina, src.consume+consume, src.bleed+bleed)
/datum/armor/proc/modifyRating(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0, stamina = 0, consume = 0, bleed = 0)
return getArmor(src.melee+melee, src.bullet+bullet, src.laser+laser, src.energy+energy, src.bomb+bomb, src.bio+bio, src.rad+rad, src.fire+fire, src.acid+acid, src.stamina+stamina, src.consume+consume, src.bleed+bleed)

/datum/armor/proc/modifyAllRatings(modifier = 0)
return getArmor(melee+modifier, bullet+modifier, laser+modifier, energy+modifier, bomb+modifier, bio+modifier, rad+modifier, fire+modifier, acid+modifier, magic+modifier, stamina+modifier, consume+modifier, bleed+modifier)
return getArmor(melee+modifier, bullet+modifier, laser+modifier, energy+modifier, bomb+modifier, bio+modifier, rad+modifier, fire+modifier, acid+modifier, stamina+modifier, consume+modifier, bleed+modifier)

/datum/armor/proc/setRating(melee, bullet, laser, energy, bomb, bio, rad, fire, acid, magic, consume, bleed)
/datum/armor/proc/setRating(melee, bullet, laser, energy, bomb, bio, rad, fire, acid, consume, bleed)
return getArmor((isnull(melee) ? src.melee : melee),\
(isnull(bullet) ? src.bullet : bullet),\
(isnull(laser) ? src.laser : laser),\
Expand All @@ -53,7 +51,6 @@
(isnull(rad) ? src.rad : rad),\
(isnull(fire) ? src.fire : fire),\
(isnull(acid) ? src.acid : acid),\
(isnull(magic) ? src.magic : magic),\
(isnull(stamina) ? src.stamina : stamina),\
(isnull(consume) ? src.consume : consume),\
(isnull(bleed) ? src.bleed : bleed))
Expand All @@ -62,13 +59,13 @@
return vars[rating]

/datum/armor/proc/getList()
return list(MELEE = melee, BULLET = bullet, LASER = laser, ENERGY = energy, BOMB = bomb, BIO = bio, RAD = rad, FIRE = fire, ACID = acid, MAGIC = magic, STAMINA = stamina, CONSUME = consume, BLEED = bleed)
return list(MELEE = melee, BULLET = bullet, LASER = laser, ENERGY = energy, BOMB = bomb, BIO = bio, RAD = rad, FIRE = fire, ACID = acid, STAMINA = stamina, CONSUME = consume, BLEED = bleed)

/datum/armor/proc/attachArmor(datum/armor/AA)
return getArmor(melee+AA.melee, bullet+AA.bullet, laser+AA.laser, energy+AA.energy, bomb+AA.bomb, bio+AA.bio, rad+AA.rad, fire+AA.fire, acid+AA.acid, magic+AA.magic, stamina+AA.stamina, consume+AA.consume, bleed+AA.bleed)
return getArmor(melee+AA.melee, bullet+AA.bullet, laser+AA.laser, energy+AA.energy, bomb+AA.bomb, bio+AA.bio, rad+AA.rad, fire+AA.fire, acid+AA.acid, stamina+AA.stamina, consume+AA.consume, bleed+AA.bleed)

/datum/armor/proc/detachArmor(datum/armor/AA)
return getArmor(melee-AA.melee, bullet-AA.bullet, laser-AA.laser, energy-AA.energy, bomb-AA.bomb, bio-AA.bio, rad-AA.rad, fire-AA.fire, acid-AA.acid, magic-AA.magic, stamina-AA.stamina, consume+AA.consume, bleed+AA.bleed)
return getArmor(melee-AA.melee, bullet-AA.bullet, laser-AA.laser, energy-AA.energy, bomb-AA.bomb, bio-AA.bio, rad-AA.rad, fire-AA.fire, acid-AA.acid, stamina-AA.stamina, consume+AA.consume, bleed+AA.bleed)

/datum/armor/vv_edit_var(var_name, var_value)
if (var_name == NAMEOF(src, tag))
Expand Down
4 changes: 1 addition & 3 deletions code/modules/clothing/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
compare_to = thing
break
var/list/readout = list("<span class='notice'><u><b>PROTECTION CLASSES</u></b>")
if(armor.bio || armor.bomb || armor.bullet || armor.energy || armor.laser || armor.magic || armor.melee || armor.rad || armor.stamina || armor.bleed)
if(armor.bio || armor.bomb || armor.bullet || armor.energy || armor.laser || armor.melee || armor.rad || armor.stamina || armor.bleed)
readout += "<br /><b>ARMOR (I-X)</b>"
if(armor.bio || compare_to?.armor?.bio)
readout += "<br />TOXIN [armor_to_protection_class(armor.bio, compare_to?.armor?.bio)]"
Expand All @@ -230,8 +230,6 @@
readout += "<br />ENERGY [armor_to_protection_class(armor.energy, compare_to?.armor?.energy)]"
if(armor.laser || compare_to?.armor?.laser)
readout += "<br />LASER [armor_to_protection_class(armor.laser, compare_to?.armor?.laser)]"
if(armor.magic || compare_to?.armor?.magic)
readout += "<br />MAGIC [armor_to_protection_class(armor.magic, compare_to?.armor?.magic)]"
if(armor.melee || compare_to?.armor?.melee)
readout += "<br />MELEE [armor_to_protection_class(armor.melee, compare_to?.armor?.melee)]"
if(armor.rad || compare_to?.armor?.rad)
Expand Down
26 changes: 21 additions & 5 deletions code/modules/projectiles/guns/magic/staff.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,27 @@
max_charges = 10
recharge_rate = 2
no_den_usage = 1
var/allowed_projectile_types = list(/obj/projectile/magic/change, /obj/projectile/magic/animate, /obj/projectile/magic/resurrection,
/obj/projectile/magic/death, /obj/projectile/magic/teleport, /obj/projectile/magic/door, /obj/projectile/magic/fireball,
/obj/projectile/magic/spellblade, /obj/projectile/magic/arcane_barrage, /obj/projectile/magic/locker, /obj/projectile/magic/flying,
/obj/projectile/magic/bounty, /obj/projectile/magic/antimagic, /obj/projectile/magic/fetch, /obj/projectile/magic/sapping,
/obj/projectile/magic/necropotence, /obj/projectile/magic, /obj/projectile/temp/chill, /obj/projectile/magic/wipe)
var/allowed_projectile_types = list(
/obj/projectile/magic/change,
/obj/projectile/magic/animate,
/obj/projectile/magic/resurrection,
/obj/projectile/magic/death,
/obj/projectile/magic/teleport,
/obj/projectile/magic/door,
/obj/projectile/magic/fireball,
/obj/projectile/magic/spellblade,
/obj/projectile/magic/arcane_barrage,
/obj/projectile/magic/locker,
/obj/projectile/magic/flying,
/obj/projectile/magic/bounty,
/obj/projectile/magic/antimagic,
/obj/projectile/magic/fetch,
/obj/projectile/magic/sapping,
/obj/projectile/magic/necropotence,
/obj/projectile/magic,
/obj/projectile/temp/chill,
/obj/projectile/magic/wipe
)

/obj/item/gun/magic/staff/chaos/process_fire(atom/target, mob/living/user, message = TRUE, params = null, zone_override = "", bonus_spread = 0)
chambered.projectile_type = pick(allowed_projectile_types)
Expand Down
8 changes: 1 addition & 7 deletions code/modules/projectiles/projectile/magic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
damage_type = OXY
nodamage = TRUE
armour_penetration = 100
armor_flag = MAGIC
armor_flag = NONE
martial_arts_no_deflect = TRUE

/obj/projectile/magic/death
Expand Down Expand Up @@ -351,7 +351,6 @@
icon_state = "lavastaff"
damage = 15
damage_type = BURN
armor_flag = MAGIC
dismemberment = 50
nodamage = FALSE
martial_arts_no_deflect = FALSE
Expand All @@ -371,8 +370,6 @@
damage = 20
damage_type = BURN
nodamage = FALSE
armour_penetration = 0
armor_flag = MAGIC
hitsound = 'sound/weapons/barragespellhit.ogg'
martial_arts_no_deflect = FALSE

Expand All @@ -390,7 +387,6 @@
name = "locker bolt"
icon_state = "locker"
nodamage = TRUE
armor_flag = MAGIC
martial_arts_no_deflect = FALSE
var/weld = TRUE
var/created = FALSE //prevents creation of more then one locker if it has multiple hits
Expand Down Expand Up @@ -637,7 +633,6 @@
damage_type = BURN
nodamage = FALSE
speed = 0.3
armor_flag = MAGIC

var/tesla_power = 20000
var/tesla_range = 15
Expand Down Expand Up @@ -732,4 +727,3 @@
nodamage = FALSE
armour_penetration = 100
temperature = -200 // Cools you down greatly per hit
armor_flag = MAGIC

0 comments on commit 28f8510

Please sign in to comment.