set WeightedOdds for Vibration trigger
This commit is contained in:
parent
910e9d1473
commit
78b66c5023
|
@ -107,7 +107,16 @@ namespace DalamudShock
|
||||||
var intensity = random.Next(0, Configuration.MaxValue);
|
var intensity = random.Next(0, Configuration.MaxValue);
|
||||||
var duration = random.Next(1000, Configuration.MaxDuration);
|
var duration = random.Next(1000, Configuration.MaxDuration);
|
||||||
|
|
||||||
var type = isVibrationAllowed && random.Next(2) == 0 ? "shock" : "vibrate";
|
// Calculate the type based on weighted odds
|
||||||
|
var type = "shock";
|
||||||
|
if (isVibrationAllowed)
|
||||||
|
{
|
||||||
|
var chance = random.Next(1, 11);
|
||||||
|
if (chance > 8)
|
||||||
|
{
|
||||||
|
type = "vibrate";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var requestData = new[]
|
var requestData = new[]
|
||||||
{
|
{
|
||||||
|
@ -121,6 +130,7 @@ namespace DalamudShock
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var jsonContent = JsonConvert.SerializeObject(requestData);
|
var jsonContent = JsonConvert.SerializeObject(requestData);
|
||||||
var content = new StringContent(jsonContent, Encoding.UTF8, "application/json");
|
var content = new StringContent(jsonContent, Encoding.UTF8, "application/json");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue