Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xeno penetration #22

Merged
merged 4 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/modules/codex/entries/ammunition_codex.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
if(ammo.penetration)
entry.mechanics_text += "Armor penetration: [ammo.penetration]<br>"

if(ammo.additional_xeno_penetration)
entry.mechanics_text += "Xenomorph additional armor penetration: [ammo.penetration]<br>"

if(ammo.armor_type)
entry.mechanics_text += "Armor type: [ammo.armor_type]<br>"

Expand Down
3 changes: 3 additions & 0 deletions code/modules/codex/entries/magazine_codex.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
if(default_ammo.penetration)
traits += "Armor penetration: [default_ammo.penetration]<br>"

if(default_ammo.additional_xeno_penetration)
traits += "Xenomorph additional armor penetration: [default_ammo.additional_xeno_penetration]<br>"

if(default_ammo.sundering)
traits += "Sundering amount: [default_ammo.sundering]<br>"

Expand Down
2 changes: 2 additions & 0 deletions code/modules/projectiles/ammo_datums.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh
var/damage_type = BRUTE
///How much armor it ignores before calculations take place
var/penetration = 0
///How much extra penetration applies to xeno
var/additional_xeno_penetration = 0
///The % chance it will imbed in a human
var/shrapnel_chance = 0
///How fast the projectile moves
Expand Down
13 changes: 5 additions & 8 deletions code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
var/damage = 0
///ammo sundering value
var/sundering = 0
///How much extra penetration applies to xeno
var/additional_xeno_penetration = 0
var/accuracy = 90 //Base projectile accuracy. Can maybe be later taken from the mob if desired.

///how many damage points the projectile loses per tiles travelled
Expand Down Expand Up @@ -154,6 +156,7 @@
icon_state = ammo.icon_state
damage = ammo.damage + bonus_damage //Mainly for emitters.
penetration = ammo.penetration
additional_xeno_penetration = ammo.additional_xeno_penetration
sundering = ammo.sundering
scatter = ammo.scatter
airburst_multiplier = ammo.airburst_multiplier
Expand Down Expand Up @@ -902,12 +905,7 @@ So if we are on the 32th absolute pixel coordinate we are on tile 1, but if we a
damage *= STAGGER_DAMAGE_MULTIPLIER //Since we hate RNG, stagger reduces damage by a % instead of reducing accuracy; consider it a 'glancing' hit due to being disoriented.
var/original_damage = damage

//// RUTGMC EDIT
var/sunder_to_penetration = 0
if(isxeno(src))
sunder_to_penetration = log(proj.sundering + 1) * 10

damage = modify_by_armor(damage, proj.armor_type, proj.sundering >= 20 ? proj.penetration : (proj.penetration + sunder_to_penetration), proj.def_zone)// RUTGMC EDIT
damage = modify_by_armor(damage, proj.armor_type, isxeno(src) ? proj.penetration + proj.additional_xeno_penetration : proj.penetration, proj.def_zone)// RUTGMC EDIT
homexp13 marked this conversation as resolved.
Show resolved Hide resolved
if(damage == original_damage)
feedback_flags |= BULLET_FEEDBACK_PEN
else if(!damage)
Expand All @@ -919,8 +917,7 @@ So if we are on the 32th absolute pixel coordinate we are on tile 1, but if we a
if(IgniteMob())
feedback_flags |= (BULLET_FEEDBACK_FIRE)


if((proj.ammo.flags_ammo_behavior & AMMO_SUNDERING) && proj.sundering >= 20) // RUTGMC EDIT
if(proj.ammo.flags_ammo_behavior & AMMO_SUNDERING) // RUTGMC EDIT
homexp13 marked this conversation as resolved.
Show resolved Hide resolved
adjust_sunder(proj.sundering) // RUTGMC EDIT

if(stat != DEAD && ismob(proj.firer))
Expand Down
Loading