示例#1
0
 //Small Creatures
 private static void Hazer_BitByPlayer(On.Hazer.orig_BitByPlayer orig, Hazer self, Creature.Grasp grasp, bool eu)
 {
     orig.Invoke(self, grasp, eu);
     for (int i = 0; i < 2; i++)
     {
         self.room.AddObject(new BloodParticle(self.bodyChunks[0].pos, new Vector2(UnityEngine.Random.Range(-3f, 3f), UnityEngine.Random.Range(1f, 5f)), BloodMod.creatureColors["Hazer"], "Hazer", null, 1.3f));
     }
 }
    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();
            }
        }
    }