From 0e32d8bed8fd5256dd0f3fa8e6fa6aba39ec674c Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 29 Oct 2022 10:08:50 -0500 Subject: [PATCH] Add probability bool and weather data util --- scripts/shared/utilities.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/scripts/shared/utilities.js b/scripts/shared/utilities.js index 72713157..6239a4a9 100644 --- a/scripts/shared/utilities.js +++ b/scripts/shared/utilities.js @@ -1121,7 +1121,7 @@ let profanityFilterWords = [ "anus", "apeshit", "arsehole", - "ass", + //"ass", "asshole", "assmunch", "autoerotic", @@ -3230,4 +3230,20 @@ function isServerGoingToChangeMapsSoon(hour, minute) { return false; } +// =========================================================================== + +function getRandomBoolWithProbability(percentChance) { + return (Math.random() < percentChance / 100); +} + +// =========================================================================== + +function getWeatherData(weatherIndex, gameId = getGame()) { + if (typeof getGameConfig().weather[gameId][weatherIndex] == "undefined") { + return false; + } + + return getGameConfig().weather[gameId][weatherIndex]; +} + // =========================================================================== \ No newline at end of file