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); }
public void SetEscortGoal(CreatureEntity leader, bool isParty) { EscortGoal goal = (EscortGoal)CreateGoal(GoalKind.gk_Escort); goal.Leader = leader; goal.NotParty = !isParty; }
private void PrepareEscort() { NWCreature self = (NWCreature)fSelf; EscortGoal goal = (EscortGoal)FindGoalByKind(GoalKind.gk_Escort); if (goal != null) { if (goal.NotParty) { goal.Position = self.GetNearestPlace(goal.Leader.Location, 3, true); } else { LeaderBrain leaderBrain = (LeaderBrain)goal.Leader.Brain; goal.Position = leaderBrain.GetMemberPosition(self); } } }