Skip to content

Commit

Permalink
Reduces the chance for grenades to go off in your hands (#3441)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

This change reduces the probability of a grenade blowing up in one's
hands from 15% down to 5%.

Please let me know if this probability is too low. I just chose an
oddball low number to use.

The check was also modified so that the dice roll is only made if a
projectile hits a hand holding a grenade.

## Why It's Good For The Game

It always felt a little too high of a chance to me. The probability roll
happens for _each_ projectile that one gets hit with, and with how often
and how rapidly one can be hit in a firefight here, the chance of it
blowing up in ones hands goes from being somewhat unlikely to being more
likely to happen than not.


![image](https://github.com/user-attachments/assets/4a88545b-768d-480d-b8a1-38df915e1ea2)
This calculator gives the probability of the event occurring as being
68% likely, if one were shot 7 times. This is around how many shots it
takes to bring someone down, on average, from my anecdotal experience.

This currently has the effect of making grenades useful in only a few
very specific scenarios.

If the probability of this were to go down, it would encourage the use
of grenades more, which I feel can enhance fights.

## Changelog

:cl:
balance: rebalanced the probability of a grenade going off in one's
hands
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
zimon9 authored Oct 15, 2024
1 parent 84d4671 commit de9fb7a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion code/game/objects/items/grenades/grenade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,18 @@

/obj/item/grenade/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
var/obj/projectile/P = hitby
if(damage && attack_type == PROJECTILE_ATTACK && P.damage_type != STAMINA && prob(15))
var/list/valid_hands = list(FALSE, FALSE)

//checks if the projectile hits an arm holding a grenade
if (istype(owner.held_items[1], (/obj/item/grenade)))
if (P.def_zone == "l_arm")
valid_hands[1] = TRUE

if (istype(owner.held_items[2], (/obj/item/grenade)))
if (P.def_zone == "r_arm")
valid_hands[2] = TRUE

if(damage && attack_type == PROJECTILE_ATTACK && P.damage_type != STAMINA && (valid_hands[1] || valid_hands[2]) && prob(5)) //5% chance to go off
owner.visible_message("<span class='danger'>[attack_text] hits [owner]'s [src], setting it off! What a shot!</span>")
var/turf/T = get_turf(src)
log_game("A projectile ([hitby]) detonated a grenade held by [key_name(owner)] at [COORD(T)]")
Expand Down

0 comments on commit de9fb7a

Please sign in to comment.