Skip to content

Commit

Permalink
Xeno penetration (#22)
Browse files Browse the repository at this point in the history
* penetration

* bruh

* aaaaaaaaa

* rutgmc
  • Loading branch information
homexp13 authored Jul 19, 2024
1 parent 804edf6 commit 075d336
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
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)
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)
adjust_sunder(proj.sundering) // RUTGMC EDIT

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

0 comments on commit 075d336

Please sign in to comment.