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",
"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];
}
// ===========================================================================