public static void Breed(Creature c1, Creature c2) { Movement.GetTo(c1, c2.X, c2.Y, true); Movement.GetTo(c2, c1.X, c1.Y, true); if (c1.CanBreed > 0 && ((Math.Abs(c1.X - c2.X) == 1 && c1.Y == c2.Y) || (c1.X == c2.X && Math.Abs(c1.Y - c2.Y) == 1))) { c1.breed(c2); } }
private static void BreedInPassing(Creature c) { try { if (c.CanBreed > 0 && c.CurrentHealth >= 105) { int mateid = BaseAI.getCreatureAtLocation(c.X + 1, c.Y); if (-1 != mateid && BaseAI.creatures[mateid].Owner == BaseAI.playerID() && BaseAI.creatures[mateid].CurrentHealth >= 105) { c.breed(BaseAI.creatures[mateid]); } else { mateid = BaseAI.getCreatureAtLocation(c.X - 1, c.Y); if (-1 != mateid && BaseAI.creatures[mateid].Owner == BaseAI.playerID() && BaseAI.creatures[mateid].CurrentHealth >= 105) { c.breed(BaseAI.creatures[mateid]); } else { mateid = BaseAI.getCreatureAtLocation(c.X, c.Y + 1); if (-1 != mateid && BaseAI.creatures[mateid].Owner == BaseAI.playerID() && BaseAI.creatures[mateid].CurrentHealth >= 105) { c.breed(BaseAI.creatures[mateid]); } else { mateid = BaseAI.getCreatureAtLocation(c.X, c.Y - 1); if (-1 != mateid && BaseAI.creatures[mateid].Owner == BaseAI.playerID() && BaseAI.creatures[mateid].CurrentHealth >= 105) { c.breed(BaseAI.creatures[mateid]); } } } } } } catch { Console.WriteLine("error in breedInPassingFn"); } }