<string name="skill_longdescription_eater">Gives +%1$d health points (HP) on every kill per skill level.</string>
<string name="skill_longdescription_fortitude">On every subsequent level-up, maximum health points (HP) will be raised by %1$d per skill level. This is not applied retroactively, only subsequent level-ups will be affected.</string>
<string name="skill_longdescription_evasion">For every skill level, reduces both the chance of failed flee attempts by %1$d %% and the chance that an adjacent monster will attack by %2$d %%.</string>
- <string name="skill_longdescription_regeneration">Gain +%1$d health points (HP) on every round per skill level.</string>
+ <string name="skill_longdescription_regeneration">Gain +%1$d health points (HP) on every round per skill level when no monsters are directly adjacent.</string>
<string name="skill_longdescription_lower_exploss">For every skill level, reduces the amount of lost experience caused by death by %1$d %% (percentage of existing exp loss value, not percentage points). %2$d levels will remove all experience loss caused by death.</string>
<string name="skill_longdescription_magicfinder">Increases the chance of finding non-ordinary items by %1$d %% for every skill level.</string>
<string name="skill_longdescription_resistance_mental">Lowers the chance of being afflicted with mental conditions by %1$d %% for every skill level, up to a maximum of %2$d %%. This includes conditions caused by monster attacks such as Dazed or Weapon Feebleness.</string>
}
}
- public void applySkillEffectsForNewRound(Player player) {
- boolean changed = player.health.add(player.getSkillLevel(SkillCollection.SKILL_REGENERATION) * SkillCollection.PER_SKILLPOINT_INCREASE_REGENERATION, false);
- if (changed) {
- view.mainActivity.updateStatus();
+ public void applySkillEffectsForNewRound(Player player, PredefinedMap currentMap) {
+ int level = player.getSkillLevel(SkillCollection.SKILL_REGENERATION);
+ if (level > 0) {
+ boolean hasAdjacentMonster = MovementController.hasAdjacentAggressiveMonster(currentMap, player.position);
+ if (!hasAdjacentMonster) {
+ boolean changed = player.health.add(level * SkillCollection.PER_SKILLPOINT_INCREASE_REGENERATION, false);
+ if (changed) view.mainActivity.updateStatus();
+ }
}
}
}
}
public boolean canExitCombat() { return getAdjacentMonster() == null; }
- private Monster getAdjacentMonster() {
- for (MonsterSpawnArea a : model.currentMap.spawnAreas) {
- for (Monster m : a.monsters) {
- if (!m.isAgressive()) continue;
- if (m.rectPosition.isAdjacentTo(model.player.position)) {
- return m;
- }
- }
- }
- return null;
+ private Monster getAdjacentMonster() {
+ return MovementController.getAdjacentAggressiveMonster(model.currentMap, model.player.position);
}
public void executeMoveAttack(int dx, int dy) {
this.view = context;
this.world = context;
this.model = world.model;
- //this.id = ModelContainer.rnd.nextInt();
this.roundTimer = new TimedMessageTask(this, Constants.TICK_DELAY, true);
}
private int ticksUntilNextRound = Constants.TICKS_PER_ROUND;
private int ticksUntilNextFullRound = Constants.TICKS_PER_FULLROUND;
public boolean onTick(TimedMessageTask task) {
- //L.log(id + " : Controller::tick()");
- if (!model.uiSelections.isMainActivityVisible) return false;
+ if (!model.uiSelections.isMainActivityVisible) return false;
if (model.uiSelections.isInCombat) return false;
onNewTick();
}
public void onNewPlayerRound() {
view.actorStatsController.applyConditionsToPlayer(model.player, false);
- view.actorStatsController.applySkillEffectsForNewRound(model.player);
+ view.actorStatsController.applySkillEffectsForNewRound(model.player, model.currentMap);
}
public void onNewMonsterRound() {
view.actorStatsController.applyConditionsToMonsters(model.currentMap, false);
}
}
}
+
+ public static boolean hasAdjacentAggressiveMonster(PredefinedMap map, Coord position) {
+ return getAdjacentAggressiveMonster(map, position) != null;
+ }
+ public static Monster getAdjacentAggressiveMonster(PredefinedMap map, Coord position) {
+ for (MonsterSpawnArea a : map.spawnAreas) {
+ for (Monster m : a.monsters) {
+ if (!m.isAgressive()) continue;
+ if (m.rectPosition.isAdjacentTo(position)) return m;
+ }
+ }
+ return null;
+ }
}