private void player_DeliveryItemDropped(ActorEventArgs <IItem> e) { if (e.Actor.Name.Equals(this.TargetActorName)) { this.CompleteTask(); } }
private void player_ItemDropped(ActorEventArgs <IItem> e) { if (e.Actor.Name.Equals(this.TargetActorName)) { this.Count--; if (this.Count < this.Quantity && this.IsComplete) { this.IsComplete = false; } } }
private void player_ItemReceived(ActorEventArgs <IItem> e) { if (e.Actor.Name.Equals(this.TargetActorName)) { this.Count++; if (this.Count >= this.Quantity && !this.IsComplete) { this.CompleteTask(); } } }
private void player_KilledActor(ActorEventArgs <IActor> e) { if (e.Actor.Name.Equals(this.TargetActorName)) { //if (this.Type == TaskType.KillWithItem && e.Actor.Name != this.UseActorName) //{ // return; //} this.Count++; if (this.Count >= this.Quantity && !this.IsComplete) { this.CompleteTask(); } } }
private void player_PlaceEntered(ActorEventArgs <IPlayer> e) { switch (this.TargetActorType) { case ObjectType.Actor: case ObjectType.Mobile: case ObjectType.Player: // If the actor exists in the current place then they have been discovered. var actor = e.Actor.Place.GetAllChildren().Where(c => c.Name.Equals(this.TargetActorName) && (c.ObjectType == ObjectType.Actor || c.ObjectType == ObjectType.Mobile || c.ObjectType == ObjectType.Player)).FirstOrDefault(); if (actor != null && !this.IsComplete) { this.CompleteTask(); } break; case ObjectType.Place: if (e.Actor.Place.Name.Equals(this.TargetActorName) && !this.IsComplete) { this.CompleteTask(); } break; } }