diff options
Diffstat (limited to 'server/lib/core/methods/round_methods.dart')
| -rw-r--r-- | server/lib/core/methods/round_methods.dart | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/server/lib/core/methods/round_methods.dart b/server/lib/core/methods/round_methods.dart index 4ad146d..5102fb2 100644 --- a/server/lib/core/methods/round_methods.dart +++ b/server/lib/core/methods/round_methods.dart @@ -96,8 +96,8 @@ class RoundMethods { int init = 0; for (int i = 0; i < newList.length; i++) { - ListItemData currentItem = newList[i]; - int currentItemInitiative = GameMethods.getInitiative(currentItem); + final ListItemData currentItem = newList[i]; + final int currentItemInitiative = GameMethods.getInitiative(currentItem); if (currentItemInitiative > initiative && currentItemInitiative > init) { if (i > currentTurnItemIndex) { newList.insert(i, item); @@ -265,18 +265,18 @@ class RoundMethods { }) { final gs = gameState ?? getIt<GameState>(); final gd = gameData ?? getIt<GameData>(); - List<SpecialRule>? rules = + final List<SpecialRule>? rules = gd.modelData[gs.currentCampaign]?.scenarios[gs.scenario]?.specialRules; if (rules != null) { for (SpecialRule rule in rules) { if (rule.type == "Objective" || rule.type == "Escort") { - Character? character = + final Character? character = gs.currentList.firstWhereOrNull( (element) => element.id == rule.name, ) as Character?; if (character != null) { - int? newHealth = StatCalculator.calculateFormula( + final int? newHealth = StatCalculator.calculateFormula( rule.health.toString(), ); if (newHealth != character.characterState.maxHealth && @@ -286,14 +286,14 @@ class RoundMethods { } } } else if (rule.type == "LevelAdjust") { - Monster? monster = + final Monster? monster = gs.currentList.firstWhereOrNull( (element) => element.id == rule.name, ) as Monster?; if (monster != null) { if (gs.level == monster.level) { - int newLevel = (monster.level + rule.level).clamp( + final int newLevel = (monster.level + rule.level).clamp( _kMinLevel, _kMaxLevel, ); @@ -361,7 +361,7 @@ class RoundMethods { final conditions = figure._conditions; //handle chill separately - int nrOfChills = figure.conditions + final int nrOfChills = figure.conditions .where((a) => a == Condition.chill) .length; if (nrOfChills > 0) { @@ -380,7 +380,7 @@ class RoundMethods { .length; for (int i = conditions.length - 1; i >= 0; i--) { - Condition item = conditions[i]; + final Condition item = conditions[i]; if (GameMethods.canExpire(item)) { if (item != Condition.chill) { if (!figure.conditionsAddedThisTurn.contains(item)) { @@ -463,7 +463,7 @@ class RoundMethods { //get next active item and set to current for (; newIndex < gs.currentList.length; newIndex++) { - ListItemData data = gs.currentList[newIndex]; + final ListItemData data = gs.currentList[newIndex]; if (data is Monster) { if (data.isActive && !GameMethods.isInactiveForRule(data.type.name)) { if (data.turnState == TurnsState.done) { |
