Skip to content

Commit

Permalink
sanity adjusts block chances
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCastmer committed Feb 24, 2024
1 parent 0be1bd4 commit c669763
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion code/modules/mob/living/carbon/human/human_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,12 @@

/mob/living/carbon/human/proc/check_block()
if(mind)
if(mind.martial_art && prob(mind.martial_art.block_chance) && mind.martial_art.can_use(src) && in_throw_mode && !incapacitated(FALSE, TRUE))
var/sane_mod = 0 //dripstation edit
var/datum/component/mood/mood = GetComponent(/datum/component/mood) //dripstation edit
if(mood) //dripstation edit
sane_mod = min(30, 30 - 0.32 * mood.sanity) //dripstation edit
sane_mod = max(10, sane_mod) //dripstation edit
if(mind.martial_art && prob(mind.martial_art.block_chance - sane_mod) && mind.martial_art.can_use(src) && in_throw_mode && !incapacitated(FALSE, TRUE)) //dripstation edit
return mind.martial_art //need to use this where blocks are handled to handle counters since check_block doesn't reference the attacker
return FALSE

Expand Down
2 changes: 1 addition & 1 deletion modular_dripstation/code/datums/martial/sleeping_carp.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
block_chance = 100 //Carp evades freak shit like shoves and hands, 50% dodges other unarmed attacks
block_chance = 90 //Carp evades freak shit like shoves and hands, 50% dodges other unarmed attacks

///Carp conter: carp evades freak shit like shoves and hands, 50% dodges other unarmed attacks
/datum/martial_art/the_sleeping_carp/handle_counter(mob/living/carbon/human/user, mob/living/carbon/human/attacker)
Expand Down

0 comments on commit c669763

Please sign in to comment.