This commit is contained in:
2025-12-04 18:59:25 +09:00
parent 0dccab9eec
commit d3fd9680c2
11 changed files with 206 additions and 43 deletions
+12 -3
View File
@@ -277,15 +277,24 @@ class BattleProvider with ChangeNotifier {
switch (risk) {
case RiskLevel.safe:
success = random.nextDouble() < 1.0; // 100%
// Safe: 100% base chance + luck
double chance = 1.0 + (player.totalLuck / 100.0);
if (chance > 1.0) chance = 1.0;
success = random.nextDouble() < chance;
efficiency = 0.5; // 50%
break;
case RiskLevel.normal:
success = random.nextDouble() < 0.8; // 80%
// Normal: 80% base chance + luck
double chance = 0.8 + (player.totalLuck / 100.0);
if (chance > 1.0) chance = 1.0;
success = random.nextDouble() < chance;
efficiency = 1.0; // 100%
break;
case RiskLevel.risky:
success = random.nextDouble() < 0.4; // 40%
// Risky: 40% base chance + luck
double chance = 0.4 + (player.totalLuck / 100.0);
if (chance > 1.0) chance = 1.0;
success = random.nextDouble() < chance;
efficiency = 2.0; // 200%
break;
}