Skip to content

Commit

Permalink
Delimb rework (#6)
Browse files Browse the repository at this point in the history
* initial carbon defense tweak

* more probabilities to die

* dripstation edit

* fracture chance up

* edit

* recomment bomb effects

* just break, i duno whyyy

---------

Co-authored-by: Blundir <[email protected]>
  • Loading branch information
MrCastmer and Blundir authored Feb 5, 2024
1 parent 763ed4b commit 7afc471
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
3 changes: 3 additions & 0 deletions code/__DEFINES/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -285,3 +285,6 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(
#define WEATHER_RAD "rad"
#define WEATHER_SNOW "snow"
#define WEATHER_ALL "all"

#define BULLET_DISMEMBER_THRESHOLD 60 //dripstation edit. Blocks dismemberment in code\modules\mob\living\carbon\carbon_defense.dm if
#define LASER_DISMEMBER_THRESHOLD 50 //dripstation edit, same as above
8 changes: 8 additions & 0 deletions code/modules/mob/living/carbon/carbon_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@

/mob/living/carbon/check_projectile_dismemberment(obj/projectile/P, def_zone)
var/obj/item/bodypart/affecting = get_bodypart(def_zone)
if(P.damtype == BRUTE) // dripstation edit start
var/brute_armor = getarmor(affecting, BULLET) // so here we hardblocking projectile-based dismemberment if the armor protection is 60 and more. On station it`s only bulletproof helmet, that protects head from violent falling
if(brute_armor >= BULLET_DISMEMBER_THRESHOLD)
return ..()
if(P.damtype == BURN)
var/burn_armor = getarmor(affecting, LASER)
if(burn_armor >= LASER_DISMEMBER_THRESHOLD)
return ..() // dripstation edit end
if(affecting && affecting.dismemberable && affecting.get_damage() >= (affecting.max_damage - P.dismemberment))
affecting.dismember(P.damtype)

Expand Down
47 changes: 46 additions & 1 deletion code/modules/mob/living/carbon/human/human_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,52 @@
adjustEarDamage(15,60)
Knockdown(max(120 - (bomb_armor * 2),0)) //60 bomb armor prevents knockdown entirely

take_overall_damage(brute_loss,burn_loss)
if (EXPLODE_NONE) //dripstation edit
Knockdown(max(60 - bomb_armor,0)) //short knock, 60 bomb armor prevents knockdown entirely, dripstation edit

take_overall_damage(brute_loss,burn_loss)
//dripstation edit start, tg-like bomb defence, more violent
var/max_limb_loss = 0
var/probability = 0
var/violent = FALSE
switch(severity)
if(EXPLODE_NONE)
max_limb_loss = 1
probability = 20
if(EXPLODE_LIGHT)
max_limb_loss = 2
probability = 30
if(EXPLODE_HEAVY)
max_limb_loss = 3
probability = 40
if(EXPLODE_DEVASTATE)
max_limb_loss = 4
probability = 50
violent = TRUE
if(HAS_TRAIT(src, TRAIT_EASYDISMEMBER))
max_limb_loss += 1
probability += 20
for(var/X in bodyparts)
var/obj/item/bodypart/BP = X
if(probability <= 0)
break
if(prob(probability) && BP.body_zone != BODY_ZONE_HEAD)
if(BP.body_zone == BODY_ZONE_CHEST && !violent)
continue
var/bomb_part_armor = getarmor(BP, BOMB)
var/fracture_probability = 70 - probability + round(bomb_part_armor/1.5, 10) //EXPLODE_LIGHT = 40+(armor/1.5)% chance, EXPLODE_HEAVY = 30+(armor/1.5)%
if(severity == EXPLODE_NONE || fracture_probability >= 100 || prob(fracture_probability))
BP.brute_dam += 6*(2 - round(bomb_part_armor/60, 0.05)) //2-12 damage total depending on bomb armor
var/datum/wound/blunt/critical/fracture = new
fracture.apply_wound(BP)
else
BP.brute_dam = BP.max_damage
BP.dismember()
probability -= 10
max_limb_loss--
if(!max_limb_loss)
break //dripstation edit end
/*
//attempt to dismember bodyparts
if(severity <= 2 || HAS_TRAIT(src, TRAIT_EASYDISMEMBER)) //light explosions only can dismember those with easy dismember
var/max_limb_loss = round(4/severity) //so you don't lose more than 2 limbs on severity 2
Expand All @@ -493,6 +537,7 @@
max_limb_loss--
if(!max_limb_loss)
break
*/


/mob/living/carbon/human/blob_act(obj/structure/blob/B)
Expand Down

0 comments on commit 7afc471

Please sign in to comment.