/// <summary> /// dont use directly, only if necessary to rewrite new genes for the harcoded genes in the contract /// </summary> public static byte[] MineBotGenes(Random rnd, PracticeLevel level) { Hue hue; sbyte shade; GetDummyVisuals(level, out hue, out shade); var headVariation = (byte)(level) - 1; byte targetStat = (byte)(Formulas.BaseStatSplit + ((byte)level) * 5); var isOdd = ((int)level) % 2 == 1; //var movesList = allowedMoves != null ? allowedMoves.ToArray() : null; return(MineGenes(rnd, x => { if ((x.Rarity != Rarity.Bot) || (x.GetBodyPart(BodyPart.Head).Variation != headVariation) || (x.SkinHue != hue || x.SkinShade != shade) || (Math.Abs(x.BaseStamina - targetStat) > 1 || Math.Abs(x.BaseAttack - targetStat) > 10 || Math.Abs(x.BaseDefense - targetStat) > 10) || (x.BaseAttack < x.BaseStamina != isOdd)) { return false; } return true; }, (genes) => { genes[Constants.GENE_RARITY] = (byte)((genes[Constants.GENE_RARITY] / 6) * 6); genes[Constants.GENE_STAMINA] = (byte)(targetStat - 5 + rnd.Next() % 10); genes[Constants.GENE_ATK] = (byte)(targetStat - 5 + rnd.Next() % 10); genes[Constants.GENE_DEF] = (byte)(targetStat - 5 + rnd.Next() % 10); genes[Constants.GENE_COUNTRY] = (byte)Country.Mexico; /*if (movesList != null) * { * var index = genes[GENE_MOVE] % movesList.Length; * var targetMove = movesList[index]; * genes[GENE_MOVE] = (byte)((int)targetMove - (1 + (int)WrestlingMove.Custom)); * }*/ } )); }
public static void GetDummyVisuals(PracticeLevel level, out Hue hue, out sbyte shade) { switch (level) { case PracticeLevel.Wood: { hue = Hue.Brown; shade = 0; break; } case PracticeLevel.Iron: { hue = Hue.Gray; shade = -1; break; } case PracticeLevel.Steel: { hue = Hue.Blue; shade = 0; break; } case PracticeLevel.Silver: { hue = Hue.Gray; shade = 1; break; } case PracticeLevel.Gold: { hue = Hue.Brown; shade = 2; break; } case PracticeLevel.Ruby: { hue = Hue.Pink; shade = 0; break; } case PracticeLevel.Emerald: { hue = Hue.Green; shade = 2; break; } case PracticeLevel.Diamond: { hue = Hue.Cyan; shade = 1; break; } default: { hue = Hue.Purple; shade = 0; break; } } }