Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Había dos que tenían que sobrevivir (por estar mejor adaptados) y murieron; ESTO SE REPITE. No esta funcionando la formula de adaptación. Parece que mueren de forma random.
- private List<int> ProcessDeaths(MoveChobysMessage message, List<Choby> allChobys){
- List<int> deadChobys = new List<int>();
- IEnumerable<IGrouping<EnvironmentType, Choby>> chobyGroups = allChobys.GroupBy(c => c.currentEnvironment);
- foreach (IGrouping<EnvironmentType, Choby> chobyGroup in chobyGroups) {
- Debug.Log("Chobi count in " + chobyGroup.Key + " is " + chobyGroup.Count());
- if(chobyGroup.Count() <= EvolutioConstants.MAX_ZONE_CHOBYS) continue;
- Debug.Log("Too many chobis in " + chobyGroup.Key);
- List<Choby> orderedChobys = chobyGroup.OrderBy(c => c.adaptabilityScore[c.currentEnvironment]).ToList();
- for (int i = EvolutioConstants.MAX_ZONE_CHOBYS; i < orderedChobys.Count; i++) {
- Debug.Log("Dead chobi (" + orderedChobys[i].id + ")");
- deadChobys.Add(orderedChobys[i].id);
- }
- }
- PlayerAction action = ActionFactory.CreateKillChobysAction(message.messageOrigin, deadChobys);
- ActionMessage actionMessage = new ActionMessage {action = Newtonsoft.Json.JsonConvert.SerializeObject(action)};
- NetworkServer.SendToAll(ActionMessage.MessageTypeId, actionMessage);
- return deadChobys;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement