Ejemplo n.º 1
0
    public void Clone(Critter originalCritter, Hex habitat)
    {
        name = "Bob " + num; num++;
        GameObject newCreature = originalCritter.gameObject;
        EvolutionList originList = originalCritter.GetComponent<EvolutionList>();

        GameObject creature = Instantiate(newCreature, newCreature.transform.position, Quaternion.identity) as GameObject;
        critter = creature.GetComponent<Critter>();

        creature.name = name;
        critter.SetName (name);
        critter.SetNumber(critterCount);
        critter.CloneStats(originalCritter);

        baseFoodValue = (size * size) * 10;
        critter.SetBaseFoodValue(baseFoodValue);
        critter.SetTokenSprite(SelectSprite());
        critter.SetTokenColor(originalCritter.GetTokenColor());
        critter.GenerateDiet();
        critter.GenerateLocomotion();
        critter.SetIsPlayer(false);

        critter.ResetAllXP();

        critter.adultPopulations.Clear();
        critter.cubPopulations.Clear();
        critter.babyPopulations.Clear();
        critter.ClearTokenList();
        critter.habitats.Clear();

        CreateCritterLists(critterCount);
        AddToLocalCritterList(critter, habitat);

        critter.adultPopulations.Add(.5f * startPop);
        critter.babyPopulations.Add(.2f * startPop);
        critter.cubPopulations.Add(.1f * startPop);

        critter.GenerateTokens();

        creature.GetComponent<EvolutionList>().ClearChildren();
        originList.AddNewChild(critter, TurnTimer.currentTurn);

        critter.SetSplinterEvoStart();
        critter.InitializePopsList();

        critterCount++;
    }
Ejemplo n.º 2
0
    //Equips Major evo to critter's dataSlot; then pushes all new requirements
    public void Equip(Critter critter, SlotData dataSlot)
    {
        dataSlot.EquipSlot(this);
        LockConflicts(critter);
        ModifyStats(critter);

        if(critter.GetIsPlayer()){
            CheckCurrentBuyState(critter);

            foreach (Adaptation item in Prerequisites1)
            {
                item.CheckCurrentBuyState(critter);
            }
            foreach (Adaptation item in Prerequisites2)
            {
                item.CheckCurrentBuyState(critter);
            }
            foreach (Adaptation item in Unlocks)
            {
                item.CheckCurrentBuyState(critter);
            }
        }

        critter.GenerateDiet();
        critter.GenerateLocomotion();
    }