mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-02-23 15:38:29 +01:00
Bugfix: Only decrease HP by 1 (and not 3) when full health and having sustenance+food poison
* Apply negative effects first (for example, food poison), so that the positive effect (for example, sustenance) can have some effect.
This commit is contained in:
@@ -277,13 +277,20 @@ public final class ActorStatsController {
|
||||
}
|
||||
|
||||
private void applyStatsEffects(Actor actor, boolean isFullRound) {
|
||||
// Apply negative effects before positive effects
|
||||
for (ActorCondition c : actor.conditions) {
|
||||
StatsModifierTraits effect = isFullRound ? c.conditionType.statsEffect_everyFullRound : c.conditionType.statsEffect_everyRound;
|
||||
boolean hasEffect = applyStatsModifierEffect(actor, effect, c.magnitude);
|
||||
if (hasEffect) actorConditionListeners.onActorConditionRoundEffectApplied(actor, c);
|
||||
if (!c.conditionType.isPositive) applyStatsEffects(actor, isFullRound, c);
|
||||
}
|
||||
for (ActorCondition c : actor.conditions) {
|
||||
if (c.conditionType.isPositive) applyStatsEffects(actor, isFullRound, c);
|
||||
}
|
||||
controllers.effectController.startEnqueuedEffect(actor.position);
|
||||
}
|
||||
private void applyStatsEffects(Actor actor, boolean isFullRound, ActorCondition c) {
|
||||
StatsModifierTraits effect = isFullRound ? c.conditionType.statsEffect_everyFullRound : c.conditionType.statsEffect_everyRound;
|
||||
boolean hasEffect = applyStatsModifierEffect(actor, effect, c.magnitude);
|
||||
if (hasEffect) actorConditionListeners.onActorConditionRoundEffectApplied(actor, c);
|
||||
}
|
||||
|
||||
private void decreaseDurationAndRemoveConditions(Actor actor) {
|
||||
boolean removedAnyConditions = false;
|
||||
@@ -351,7 +358,7 @@ public final class ActorStatsController {
|
||||
}
|
||||
if (effect.currentHPBoost != null) {
|
||||
int effectValue = Constants.rollValue(effect.currentHPBoost) * magnitude;
|
||||
boolean changed = changeActorHealth(actor, effectValue, false, false);
|
||||
boolean changed = changeActorHealth(actor, effectValue, true, false);
|
||||
if (changed) {
|
||||
int visualEffectID = effect.visualEffectID;
|
||||
if (!effect.hasVisualEffect()) {
|
||||
|
||||
@@ -65,15 +65,15 @@ public final class GameRoundController implements TimedMessageTask.Callback {
|
||||
roundTimer.stop();
|
||||
world.model.uiSelections.isMainActivityVisible = false;
|
||||
}
|
||||
|
||||
public void onNewFullRound() {
|
||||
|
||||
public void onNewFullRound() {
|
||||
controllers.mapController.resetMapsNotRecentlyVisited();
|
||||
controllers.actorStatsController.applyConditionsToMonsters(world.model.currentMap, true);
|
||||
controllers.actorStatsController.applyConditionsToPlayer(world.model.player, true);
|
||||
gameRoundListeners.onNewFullRound();
|
||||
}
|
||||
|
||||
public void onNewRound() {
|
||||
private void onNewRound() {
|
||||
onNewMonsterRound();
|
||||
onNewPlayerRound();
|
||||
gameRoundListeners.onNewRound();
|
||||
|
||||
Reference in New Issue
Block a user