public override void NotifyOfEvent(AbstractEvent eventData) { int poiseToApply = 0; // need to cast to access "damageDealt" field if (eventData.type == EventType.ARGUMENT_ATTACKED_BLOCKED) { EventArgAttackedBlocked data = eventData as EventArgAttackedBlocked; poiseToApply = data.damageDealt; } else { EventArgAttackedUnblocked data = eventData as EventArgAttackedUnblocked; poiseToApply = data.damageDealt; } NegotiationManager.Instance.AddAction(new ApplyPoiseAction(charToApplyPoiseTo, charToApplyPoiseTo.GetCoreArgument(), poiseToApply)); foreach (AbstractArgument arg in charToApplyPoiseTo.GetTargetableArguments()) { NegotiationManager.Instance.AddAction(new ApplyPoiseAction(charToApplyPoiseTo, arg, poiseToApply)); } }
public override void NotifyOfEvent(AbstractEvent eventData) { switch (eventData.type) { case EventType.TURN_START: EventTurnStart data = (EventTurnStart)eventData; if (data.start == this.OWNER) { this.stacks = 1; } break; case EventType.ARGUMENT_ATTACKED_UNBLOCKED: EventArgAttackedUnblocked attacked = (EventArgAttackedUnblocked)eventData; if (attacked.argumentAttacked == this) { NegotiationManager.Instance.AddAction(new ApplyPoiseAction(this.OWNER, this, this.stacks)); NegotiationManager.Instance.AddAction(new AddStacksToArgumentAction(this, 1)); } break; } }