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 virtual void PrepareChase(CreatureEntity enemy, AttackRisk risk, bool canMove) { EnemyChaseGoal chaseGoal = (EnemyChaseGoal)FindGoalByKind(GoalKind.gk_EnemyChase); if (chaseGoal == null || !chaseGoal.Enemy.Equals(enemy)) { chaseGoal = ((EnemyChaseGoal)CreateGoal(GoalKind.gk_EnemyChase)); chaseGoal.Enemy = enemy; chaseGoal.Risk = risk; chaseGoal.CanMove = canMove; } }