예제 #1
0
    public int Deliver(int x, int y, Mob myClass, bool colony, byte number)
    {
        x = CheakPosX(x);
        y = CheakPosY(y);

        if (Map[x, y] == null)
        {
            int energy = myClass.GetDamage(45);
            Dna dna    = new Dna();
            dna.DnaProgramm    = (byte[])myClass.DnaCopy.DnaProgramm.Clone();
            dna.DnaProgramm[0] = number;
            if (Random.Range(0, 100) < 12)
            {
                dna.Mutate();
            }
            CreateMob(dna, x, y, energy, colony);
            return(2);
        }
        else
        {
            return(3);
        }
    }