Skip to content

Commit

Permalink
Replaces random() with prob() in lavaland elite code (tgstation#72816)
Browse files Browse the repository at this point in the history
## About The Pull Request

Replaces random() proc with prob() in herald and goliath broodmother
code

## Why It's Good For The Game

Using prob() proc tooks less space and also it is more readable

## Changelog
:cl:
code: Replaced some random() procs in lavaland elite code with prob()
procs
/:cl:
  • Loading branch information
SuperSlayer committed Jan 23, 2023
1 parent 7893193 commit 5f8a648
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -247,7 +247,7 @@
return "mark detonation to have a <b>[bonus_value]%</b> chance to summon a patch of goliath tentacles at the target's location"

/obj/item/crusher_trophy/broodmother_tongue/on_mark_detonation(mob/living/target, mob/living/user)
if(rand(1, 100) <= bonus_value && target.stat != DEAD)
if(prob(bonus_value) && target.stat != DEAD)
new /obj/effect/temp_visual/goliath_tentacle/broodmother/patch(get_turf(target), user)

/obj/item/crusher_trophy/broodmother_tongue/attack_self(mob/user)
Expand Down
Expand Up @@ -270,7 +270,7 @@

/obj/item/clothing/neck/cloak/herald_cloak/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
. = ..()
if(rand(1,100) > hit_reaction_chance)
if(prob(hit_reaction_chance))
return
owner.visible_message(span_danger("[owner]'s [src] emits a loud noise as [owner] is struck!"))
var/static/list/directional_shot_angles = list(0, 45, 90, 135, 180, 225, 270, 315)
Expand Down

0 comments on commit 5f8a648

Please sign in to comment.