protected override GoalEntity CreateGoalEx(int goalKind) { GoalEntity result = null; switch (goalKind) { case GoalKind.gk_Travel: result = new TravelGoal(this); break; case GoalKind.gk_PointGuard: result = new PointGuardGoal(this); break; case GoalKind.gk_ItemAcquire: result = new ItemAcquireGoal(this); break; case GoalKind.gk_EnemyChase: result = new EnemyChaseGoal(this); break; case GoalKind.gk_EnemyEvade: result = new EnemyEvadeGoal(this); break; case GoalKind.gk_AreaGuard: result = new AreaGuardGoal(this); break; case GoalKind.gk_ShopReturn: result = new ShopReturnGoal(this); break; case GoalKind.gk_PlayerFind: result = new PlayerFindGoal(this); break; case GoalKind.gk_Escort: result = new EscortGoal(this); break; case GoalKind.gk_Flock: result = new FlockGoal(this); break; case GoalKind.gk_DebtTake: result = new DebtTakeGoal(this); break; case GoalKind.gk_WareReturn: result = new WareReturnGoal(this); break; case GoalKind.gk_Stalk: result = new StalkGoal(this); break; } return(result); }
protected override void PrepareEmitter(Emitter emitter) { if (emitter.EmitterKind == EmitterKind.ek_GuardAlarm) { TravelGoal goal = (TravelGoal)CreateGoal(GoalKind.gk_Travel); goal.Position = emitter.Position; goal.EmitterID = emitter.UID_Renamed; goal.Duration = (int)Math.Round(MathHelper.Distance(emitter.Position, fSelf.Location) * 1.5f); } }
private void PrepareTravel() { try { NWCreature self = (NWCreature)fSelf; if (FindGoalByKind(GoalKind.gk_Travel) == null) { ExtPoint res = self.GetNearestPlace(self.Survey, true); if (!res.IsEmpty) { TravelGoal goal = (TravelGoal)CreateGoal(GoalKind.gk_Travel); goal.Position = res; goal.Duration = 25; } } } catch (Exception ex) { Logger.Write("BeastBrain.prepareTravel(): " + ex.Message); } }