Exemplo n.º 1
0
        public void OriginalRealize()
        {
            try {
                if (this.realizedCreature != null)
                {
                    return;
                }
            } catch (Exception e) {
                Debug.LogError("Failed On Realize Object Check");
            }

            try {
                switch (this.creatureTemplate.TopAncestor().type)
                {
                case CreatureTemplate.Type.Slugcat:
                    this.realizedCreature = new Player(this, this.world);
                    break;

                case CreatureTemplate.Type.LizardTemplate:
                    this.realizedCreature = new Lizard(this, this.world);
                    break;

                case CreatureTemplate.Type.Fly:
                    this.realizedCreature = new Fly(this, this.world);
                    break;

                case CreatureTemplate.Type.Leech:
                    this.realizedCreature = new Leech(this, this.world);
                    break;

                case CreatureTemplate.Type.Snail:
                    this.realizedCreature = new Snail(this, this.world);
                    break;

                case CreatureTemplate.Type.Vulture:
                    this.realizedCreature = new Vulture(this, this.world);
                    break;

                case CreatureTemplate.Type.GarbageWorm:
                    GarbageWormAI.MoveAbstractCreatureToGarbage(this, base.Room);
                    this.realizedCreature = new GarbageWorm(this, this.world);
                    break;

                case CreatureTemplate.Type.LanternMouse:
                    this.realizedCreature = new LanternMouse(this, this.world);
                    break;

                case CreatureTemplate.Type.CicadaA:
                    this.realizedCreature = new Cicada(this, this.world, this.creatureTemplate.type == CreatureTemplate.Type.CicadaA);
                    break;

                case CreatureTemplate.Type.Spider:
                    this.realizedCreature = new Spider(this, this.world);
                    break;

                case CreatureTemplate.Type.JetFish:
                    this.realizedCreature = new JetFish(this, this.world);
                    break;

                case CreatureTemplate.Type.BigEel:
                    this.realizedCreature = new BigEel(this, this.world);
                    break;

                case CreatureTemplate.Type.Deer:
                    this.realizedCreature = new Deer(this, this.world);
                    break;

                case CreatureTemplate.Type.TubeWorm:
                    this.realizedCreature = new TubeWorm(this, this.world);
                    break;

                case CreatureTemplate.Type.DaddyLongLegs:
                    this.realizedCreature = new DaddyLongLegs(this, this.world);
                    break;

                case CreatureTemplate.Type.TentaclePlant:
                    if (this.creatureTemplate.type == CreatureTemplate.Type.TentaclePlant)
                    {
                        this.realizedCreature = new TentaclePlant(this, this.world);
                    }
                    else
                    {
                        this.realizedCreature = new PoleMimic(this, this.world);
                    }
                    break;

                case CreatureTemplate.Type.MirosBird:
                    this.realizedCreature = new MirosBird(this, this.world);
                    break;

                case CreatureTemplate.Type.TempleGuard:
                    this.realizedCreature = new TempleGuard(this, this.world);
                    break;

                case CreatureTemplate.Type.Centipede:
                case CreatureTemplate.Type.RedCentipede:
                case CreatureTemplate.Type.Centiwing:
                case CreatureTemplate.Type.SmallCentipede:
                    this.realizedCreature = new Centipede(this, this.world);
                    break;

                case CreatureTemplate.Type.Scavenger:
                    this.realizedCreature = new Scavenger(this, this.world);
                    break;

                case CreatureTemplate.Type.Overseer:
                    this.realizedCreature = new Overseer(this, this.world);
                    break;

                case CreatureTemplate.Type.VultureGrub:
                    if (this.creatureTemplate.type == CreatureTemplate.Type.VultureGrub)
                    {
                        this.realizedCreature = new VultureGrub(this, this.world);
                    }
                    else if (this.creatureTemplate.type == CreatureTemplate.Type.Hazer)
                    {
                        this.realizedCreature = new Hazer(this, this.world);
                    }
                    break;

                case CreatureTemplate.Type.EggBug:
                    this.realizedCreature = new EggBug(this, this.world);
                    break;

                case CreatureTemplate.Type.BigSpider:
                case CreatureTemplate.Type.SpitterSpider:
                    this.realizedCreature = new BigSpider(this, this.world);
                    break;

                case CreatureTemplate.Type.BigNeedleWorm:
                    if (this.creatureTemplate.type == CreatureTemplate.Type.SmallNeedleWorm)
                    {
                        this.realizedCreature = new SmallNeedleWorm(this, this.world);
                    }
                    else
                    {
                        this.realizedCreature = new BigNeedleWorm(this, this.world);
                    }
                    break;

                case CreatureTemplate.Type.DropBug:
                    this.realizedCreature = new DropBug(this, this.world);
                    break;
                }
            } catch (Exception e) {
                Debug.LogError(e);
                Debug.LogError(string.Format("Failed on realized object creation, world is {0}, type is {1}, and this is {2}", world, type, this));
            }

            try {
                this.InitiateAI();
                for (int i = 0; i < this.stuckObjects.Count; i++)
                {
                    if (this.stuckObjects[i].A.realizedObject == null)
                    {
                        this.stuckObjects[i].A.Realize();
                    }
                    if (this.stuckObjects[i].B.realizedObject == null)
                    {
                        this.stuckObjects[i].B.Realize();
                    }
                }
            } catch (Exception e) {
                Debug.LogError("Failed on Stuck Realization");
            }
        }
    public override void Realize()
    {
        if (realizedCreature != null)
        {
            return;
        }
        switch (creatureTemplate.TopAncestor().type)
        {
        case CreatureTemplate.Type.Slugcat:
            realizedCreature = new Player(this, world);
            break;

        case CreatureTemplate.Type.LizardTemplate:
            realizedCreature = new Lizard(this, world);
            break;

        case CreatureTemplate.Type.Fly:
            realizedCreature = new Fly(this, world);
            break;

        case CreatureTemplate.Type.Leech:
            realizedCreature = new Leech(this, world);
            break;

        case CreatureTemplate.Type.Snail:
            realizedCreature = new Snail(this, world);
            break;

        case CreatureTemplate.Type.Vulture:
            realizedCreature = new Vulture(this, world);
            break;

        case CreatureTemplate.Type.GarbageWorm:
            GarbageWormAI.MoveAbstractCreatureToGarbage(this, Room);
            realizedCreature = new GarbageWorm(this, world);
            break;

        case CreatureTemplate.Type.LanternMouse:
            realizedCreature = new LanternMouse(this, world);
            break;

        case CreatureTemplate.Type.CicadaA:
            realizedCreature = new Cicada(this, world, creatureTemplate.type == CreatureTemplate.Type.CicadaA);
            break;

        case CreatureTemplate.Type.Spider:
            realizedCreature = new Spider(this, world);
            break;

        case CreatureTemplate.Type.JetFish:
            realizedCreature = new JetFish(this, world);
            break;

        case (CreatureTemplate.Type)patch_CreatureTemplate.Type.SeaDrake:
            realizedCreature = new SeaDrake(this, world);
            break;

        case CreatureTemplate.Type.BigEel:
            realizedCreature = new BigEel(this, world);
            break;

        case CreatureTemplate.Type.Deer:
            realizedCreature = new Deer(this, world);
            break;

        case (CreatureTemplate.Type)patch_CreatureTemplate.Type.WalkerBeast:
            realizedCreature = new WalkerBeast(this, world);
            break;

        case CreatureTemplate.Type.TubeWorm:
            realizedCreature = new TubeWorm(this, world);
            break;

        case CreatureTemplate.Type.DaddyLongLegs:
            realizedCreature = new DaddyLongLegs(this, world);
            break;

        case CreatureTemplate.Type.TentaclePlant:
            if (creatureTemplate.type == CreatureTemplate.Type.TentaclePlant)
            {
                realizedCreature = new TentaclePlant(this, world);
            }
            else
            {
                realizedCreature = new PoleMimic(this, world);
            }
            break;

        case CreatureTemplate.Type.MirosBird:
            realizedCreature = new MirosBird(this, world);
            break;

        case CreatureTemplate.Type.TempleGuard:
            realizedCreature = new TempleGuard(this, world);
            break;

        case CreatureTemplate.Type.Centipede:
        case CreatureTemplate.Type.RedCentipede:
        case CreatureTemplate.Type.Centiwing:
        case CreatureTemplate.Type.SmallCentipede:
            realizedCreature = new Centipede(this, world);
            break;

        case CreatureTemplate.Type.Scavenger:
            realizedCreature = new Scavenger(this, world);
            break;

        case CreatureTemplate.Type.Overseer:
            realizedCreature = new Overseer(this, world);
            break;

        case CreatureTemplate.Type.VultureGrub:
            if (creatureTemplate.type == CreatureTemplate.Type.VultureGrub)
            {
                realizedCreature = new VultureGrub(this, world);
            }
            else if (creatureTemplate.type == CreatureTemplate.Type.Hazer)
            {
                realizedCreature = new Hazer(this, world);
            }
            break;

        case CreatureTemplate.Type.EggBug:
            realizedCreature = new EggBug(this, world);
            break;

        case CreatureTemplate.Type.BigSpider:
        case CreatureTemplate.Type.SpitterSpider:
            realizedCreature = new BigSpider(this, world);
            break;

        case CreatureTemplate.Type.BigNeedleWorm:
            if (creatureTemplate.type == CreatureTemplate.Type.SmallNeedleWorm)
            {
                realizedCreature = new SmallNeedleWorm(this, world);
            }
            else
            {
                realizedCreature = new BigNeedleWorm(this, world);
            }
            break;

        case CreatureTemplate.Type.DropBug:
            realizedCreature = new DropBug(this, world);
            break;
        }
        InitiateAI();
        for (int i = 0; i < stuckObjects.Count; i++)
        {
            if (stuckObjects[i].A.realizedObject == null)
            {
                stuckObjects[i].A.Realize();
            }
            if (stuckObjects[i].B.realizedObject == null)
            {
                stuckObjects[i].B.Realize();
            }
        }
    }