Exemple #1
0
    internal override void AddSpecificOrganism(BasicOrganismScript newOrganism)
    {
        PlantScript newPlant = (PlantScript)newOrganism;

        plants.Add(newPlant);
        newPlant.specificOrganismIndex = plants.Count - 1;
    }
Exemple #2
0
 public void SetupBasicOrgan(BasicSpeciesOrganScript basicSpeciesOrganScript, BasicOrganismScript basicOrganismScript)
 {
     this.basicSpeciesOrganScript = basicSpeciesOrganScript;
     this.basicOrganismScript     = basicOrganismScript;
     SetupOrgan(basicSpeciesOrganScript);
     SetUpSpecificOrgan();
 }
Exemple #3
0
    internal override void AddSpecificOrganism(BasicOrganismScript newOrganism)
    {
        AnimalScript newAnimal = (AnimalScript)newOrganism;

        animals.Add(newAnimal);
        newAnimal.specificOrganismIndex = animals.Count - 1;
    }
Exemple #4
0
    public override void MakeOrganism(BasicOrganismScript newOrganism)
    {
        SeedOrgan seeds = newOrganism.gameObject.AddComponent <SeedOrgan>();

        seeds.speciesSeeds = this;
        seeds.SetupBasicOrgan(this, newOrganism);
    }
    public override void MakeOrganism(BasicOrganismScript newOrganism)
    {
        EarsScript earsScript = speciesScript.InstantiateNewOrgan(ears, newOrganism).GetComponent <EarsScript>();

        earsScript.hearRange = hearRange;
        earsScript.SetupBasicOrgan(this, newOrganism);
    }
Exemple #6
0
    public override void MakeOrganism(BasicOrganismScript newOrganism)
    {
        BladeOrgan bladeOrgan = newOrganism.gameObject.AddComponent <BladeOrgan>();

        bladeOrgan.SetupBasicOrgan(this, newOrganism);
        bladeOrgan.speciesBlade = this;
        MakeEddibleOrganism(bladeOrgan, newOrganism);
    }
    public override void MakeOrganism(BasicOrganismScript newOrganism)
    {
        RootOrgan rootOrgan = newOrganism.gameObject.AddComponent <RootOrgan>();

        rootOrgan.SetupBasicOrgan(this, newOrganism);
        rootOrgan.speciesRoots = this;
        rootOrgan.rootGrowth.x = rootGrowthMax.x;
    }
Exemple #8
0
    public override void MakeOrganism(BasicOrganismScript newOrganism)
    {
        StemOrgan stemOrgan = newOrganism.gameObject.AddComponent <StemOrgan>();

        stemOrgan.SetupBasicOrgan(this, newOrganism);
        stemOrgan.speciesStem = this;
        MakeEddibleOrganism(stemOrgan, newOrganism);
    }
    public override void MakeOrganism(BasicOrganismScript newOrganism)
    {
        GameObject newNose   = speciesScript.InstantiateNewOrgan(nose, newOrganism);
        NoseScript noseScipt = newNose.GetComponent <NoseScript>();

        noseScipt.speciesNose = this;
        noseScipt.SetupBasicOrgan(this, newOrganism);
    }
    public override void MakeOrganism(BasicOrganismScript newOrganism)
    {
        GameObject         newReproductiveSystem    = speciesScript.InstantiateNewOrgan(reproductiveSystemPrefab, newOrganism);
        ReproductiveSystem reproductiveSystemScript = newReproductiveSystem.GetComponent <ReproductiveSystem>();

        reproductiveSystemScript.animalSpeciesReproductive = this;
        reproductiveSystemScript.SetupBasicOrgan(this, newOrganism);
    }
    public override void MakeOrganism(BasicOrganismScript newOrganism)
    {
        GameObject newEyes    = speciesScript.InstantiateNewOrgan(eyes, newOrganism);
        EyesScript eyesScript = newEyes.GetComponent <EyesScript>();

        eyesScript.speciesEyes = this;
        eyesScript.SetupBasicOrgan(this, newOrganism);
    }
    public override void MakeOrganism(BasicOrganismScript newOrganism)
    {
        MouthScript mouthScript = speciesScript.InstantiateNewOrgan(mouth, newOrganism).GetComponent <MouthScript>();

        mouthScript.biteSize = biteSize;
        mouthScript.eatTime  = eatTime;
        mouthScript.eatRange = eatRange;
        mouthScript.SetupBasicOrgan(this, newOrganism);
    }
 public override void MakeOrganism(BasicOrganismScript newOrganism)
 {
     return;
     //VegetativePropagationOrgan propagation = newOrganism.AddComponent<VegetativePropagationOrgan>();
     //propagation.SetupBasicOrgan(this);
     //propagation.plantSpeciesVegetativePropagation = this;
     //propagation.growthMax = growthMax;
     //propagation.newPlantGrowthCost = newPlantGrowthCost;
     //propagation.newPlantGrowChance = newPlantGrowChance;
 }
Exemple #14
0
    public virtual void SetupOrganismMotor(EarthScript earth, BasicOrganismScript organismScript)
    {
        this.earth          = earth;
        this.organismScript = organismScript;
        transform.parent.SetParent(earth.GetOrganismsTransform());
        Vector3 previousSize = transform.parent.localScale;

        transform.parent.localScale    = new Vector3(1, 1, 1);
        transform.parent.localPosition = new Vector3(0, .5f, 0);
        transform.localScale           = new Vector3(transform.localScale.x * previousSize.x, transform.localScale.y * previousSize.y, transform.localScale.z * previousSize.z);
    }
Exemple #15
0
 public void FollowOrganism(BasicOrganismScript organism)
 {
     GoToPoint(organism.position);
 }
Exemple #16
0
 public void RunFromOrganism(BasicOrganismScript organism)
 {
     GetAnimalMotor().LookAwayFromPoint(organism.position);
     SetMoving(true);
 }
Exemple #17
0
    public override void UpdateOrganismsBehavior()
    {
        for (int i = 0; i < activeAnimals.Count; i++)
        {
            AnimalScript.AnimalActions animalAction = GetAnimalJobController().animalActions[i];
            AnimalScript animal = animals[activeAnimals[i]];
            switch (animalAction.actionType)
            {
            case AnimalScript.AnimalActions.ActionType.Idle:
                animal.Idle();
                User.Instance.PrintState("SittingStill", speciesDisplayName, 1);
                break;

            case AnimalScript.AnimalActions.ActionType.RunFromPredator:
                BasicOrganismScript targetPredatorOrganism = earth.GetZoneController().GetOrganismFromDataLocation(animalAction.dataLocation);
                if (targetPredatorOrganism.spawned)
                {
                    animal.RunFromOrganism(targetPredatorOrganism);
                    User.Instance.PrintState("PredatorFound", speciesDisplayName, 2);
                    break;
                }
                animal.Explore();
                User.Instance.PrintState("Exploring", speciesDisplayName, 1);
                break;

            case AnimalScript.AnimalActions.ActionType.EatFood:
                if (animalAction.dataLocation.dataType == ZoneController.DataLocation.DataType.Animal)
                {
                    AnimalScript targetAnimal = earth.GetZoneController().GetAnimalFromDataLocation(animalAction.dataLocation);
                    if (targetAnimal.spawned && animal.Eat(targetAnimal))
                    {
                        animal.LookAtPoint(earth.GetZoneController().GetOrganismFromDataLocation(animalAction.dataLocation).position);
                        User.Instance.PrintState("Eating", speciesDisplayName, 2);
                        break;
                    }
                }
                if (animalAction.dataLocation.dataType == ZoneController.DataLocation.DataType.Plant)
                {
                    PlantScript targetPlant = earth.GetZoneController().GetPlantFromDataLocation(animalAction.dataLocation);
                    if (targetPlant.spawned && animal.Eat(targetPlant))
                    {
                        animal.LookAtPoint(earth.GetZoneController().GetOrganismFromDataLocation(animalAction.dataLocation).position);
                        User.Instance.PrintState("Eating", speciesDisplayName, 2);
                        break;
                    }
                }
                animal.Explore();
                User.Instance.PrintState("Exploring", speciesDisplayName, 1);
                break;

            case AnimalScript.AnimalActions.ActionType.GoToFood:
                BasicOrganismScript targetGoToOrganism = earth.GetZoneController().GetOrganismFromDataLocation(animalAction.dataLocation);
                if (targetGoToOrganism.spawned)
                {
                    animal.GoToPoint(targetGoToOrganism.position);
                    User.Instance.PrintState("GoingToFood", speciesDisplayName, 1);
                }
                else
                {
                    animal.Explore();
                    User.Instance.PrintState("Exploring", speciesDisplayName, 1);
                }
                break;

            case AnimalScript.AnimalActions.ActionType.AttemptReproduction:
                if (animal.mate.spawned && animal.GetReproductive().AttemptReproduction())
                {
                    animal.LookAtPoint(animal.mate.position);
                    User.Instance.PrintState("AttemptReproduction", speciesDisplayName, 2);
                }
                else
                {
                    animal.Idle();
                    User.Instance.PrintState("SittingStill", speciesDisplayName, 1);
                }
                break;

            case AnimalScript.AnimalActions.ActionType.AttemptToMate:
                AnimalScript targetMate = earth.GetZoneController().GetAnimalFromDataLocation(animalAction.dataLocation);
                if (targetMate.spawned && animal.AttemptToMate(targetMate))
                {
                    animal.LookAtPoint(targetMate.position);
                    User.Instance.PrintState("FoundMate", speciesDisplayName, 2);
                }
                else
                {
                    animal.Explore();
                    User.Instance.PrintState("Exploring", speciesDisplayName, 1);
                }
                break;

            case AnimalScript.AnimalActions.ActionType.Explore:
                animal.Explore();
                User.Instance.PrintState("Exploring", speciesDisplayName, 1);
                break;
            }
        }
    }
Exemple #18
0
 public GameObject InstantiateNewOrgan(GameObject _organ, BasicOrganismScript _organism)
 {
     return(Instantiate(_organ, _organism.transform));
 }
Exemple #19
0
 internal void RandomiseOrganismChildPosition(BasicOrganismScript organism, BasicOrganismScript parent, float range = 2)
 {
     SpawnRandomizer.SpawnFromParent(organism.GetOrganismMotor(), parent.GetOrganismMotor().GetRotationTransform().position, parent.GetOrganismMotor().GetRotationTransform().eulerAngles, range);
 }
Exemple #20
0
 internal void RandomiseOrganismPosition(BasicOrganismScript organism)
 {
     SpawnRandomizer.SpawnRandom(organism.GetOrganismMotor());
 }
Exemple #21
0
 internal abstract void AddSpecificOrganism(BasicOrganismScript newOrganism);
Exemple #22
0
 public void AddOrganism(BasicOrganismScript newOrganism)
 {
     organisms.Add(newOrganism);
     newOrganism.organismIndex = organisms.Count - 1;
     AddSpecificOrganism(newOrganism);
 }
Exemple #23
0
 internal void MakeEddibleOrganism(EddiblePlantOrganScript eddiblePlantOrgan, BasicOrganismScript organismScript)
 {
     organismScript.GetComponent <PlantScript>().eddibleOrgans.Add(eddiblePlantOrgan);
 }
 public abstract void MakeOrganism(BasicOrganismScript newOrganism);