|
@@ -12,15 +12,19 @@ module AIRules {
|
|
export var resultHostile = new ContentMarker("I'll hit you until you drop dead.", true);
|
|
export var resultHostile = new ContentMarker("I'll hit you until you drop dead.", true);
|
|
|
|
|
|
export function printGrudgeResult (aggressor : Thing, victim : Person, ...markers : Array<ContentMarker>) {
|
|
export function printGrudgeResult (aggressor : Thing, victim : Person, ...markers : Array<ContentMarker>) {
|
|
- let group = new ContentGroup();
|
|
|
|
- let unit = new CombatPokeUnit();
|
|
|
|
- group.addUnit(unit);
|
|
|
|
- unit.setTarget(victim);
|
|
|
|
- unit.setAggressor(aggressor);
|
|
|
|
- unit.addMarker(...markers);
|
|
|
|
|
|
+ if (victim.isVisibleTo(WorldState.player)) {
|
|
|
|
+ let group = new ContentGroup();
|
|
|
|
+ let unit = new CombatPokeUnit();
|
|
|
|
+ group.addUnit(unit);
|
|
|
|
+ unit.setTarget(victim);
|
|
|
|
+ unit.setAggressor(aggressor);
|
|
|
|
+ unit.addMarker(...markers);
|
|
|
|
|
|
- victim.AI.warnedTimes++;
|
|
|
|
- Elements.CurrentTurnHandler.printAsContent(new Say(...CombatPokeDescription.getDescription(group)));
|
|
|
|
|
|
+ if (aggressor == WorldState.player) {
|
|
|
|
+ victim.AI.warnedTimes++;
|
|
|
|
+ }
|
|
|
|
+ Elements.CurrentTurnHandler.printAsContent(new Say(...CombatPokeDescription.getDescription(group)));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
export var Grudge = AI.rules.createAndAddRule({
|
|
export var Grudge = AI.rules.createAndAddRule({
|
|
@@ -54,10 +58,10 @@ module AIRules {
|
|
}
|
|
}
|
|
|
|
|
|
printGrudgeResult(action.actor, person, actionLevel, result);
|
|
printGrudgeResult(action.actor, person, actionLevel, result);
|
|
-
|
|
|
|
if (result == resultRetaliate) {
|
|
if (result == resultRetaliate) {
|
|
return new ActionAttack(person, action.actor);
|
|
return new ActionAttack(person, action.actor);
|
|
}
|
|
}
|
|
|
|
+ return new ActionWait(person); // we talked so we shouldn't move further
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|