Add probability bool and weather data util

This commit is contained in:
Vortrex
2022-10-29 10:08:50 -05:00
parent 2e75230d38
commit 0e32d8bed8

View File

@@ -1121,7 +1121,7 @@ let profanityFilterWords = [
"anus", "anus",
"apeshit", "apeshit",
"arsehole", "arsehole",
"ass", //"ass",
"asshole", "asshole",
"assmunch", "assmunch",
"autoerotic", "autoerotic",
@@ -3231,3 +3231,19 @@ function isServerGoingToChangeMapsSoon(hour, minute) {
} }
// =========================================================================== // ===========================================================================
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];
}
// ===========================================================================