public DaddyTentacle(DaddyLongLegs daddy, BodyChunk chunk, float length, int tentacleNumber, Vector2 tentacleDir)
     : base(daddy, chunk, length)
 {
     //触手索引 和 方向
     this.tentacleNumber = tentacleNumber;
     this.tentacleDir    = tentacleDir;
     //触手属性
     this.tProps = new Tentacle.TentacleProps(false, true, false, 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 3.2f, 10f, 0.25f, 5f, 15, 60, 12, 20);
     //触手Chunk
     this.tChunks = new Tentacle.TentacleChunk[(int)(length / 40.0)];
     for (int index = 0; index < this.tChunks.Length; ++index)
     {
         this.tChunks[index] = new Tentacle.TentacleChunk(this, index, (index + 1) / (float)this.tChunks.Length, 3f);
     }
 }
Beispiel #2
0
    public Game(ProcessManager manager) : base(manager, ProcessManager.ProcessID.Game)
    {
        this.nextIssuedId = UnityEngine.Random.Range(1000, 10000);

        //加载Demo配置文件
        this.LoadDemoConfigs();

        //初始化相机
        this.Camera = new RoomCamera(this);

        //初始化Demo房间
        this.Room = new Room(this);

        //相机聚焦房间
        this.Camera.MoveCamera(Room, 0);

        //根据Demo场景生成对应的生物
        if (Configs.Level == 1)
        {
            TentaclePlant plantDown = new TentaclePlant(new WorldEntity(new WorldCoordinate(26, 26), this.GetNewID()));
            plantDown.PlaceInRoom(Room);
            plantDown.ResetPlant(new Vector2(510, 110), Vector2.up);

            TentaclePlant plantRight = new TentaclePlant(new WorldEntity(new WorldCoordinate(26, 26), this.GetNewID()));
            plantRight.PlaceInRoom(Room);
            plantRight.ResetPlant(new Vector2(850, 350), Vector2.left);

            TentaclePlant plantLeft = new TentaclePlant(new WorldEntity(new WorldCoordinate(26, 26), this.GetNewID()));
            plantLeft.PlaceInRoom(Room);
            plantLeft.ResetPlant(new Vector2(110, 490), Vector2.right);
        }
        else
        {
            DaddyLongLegs daddy = new DaddyLongLegs(new WorldEntity(new WorldCoordinate(26, 26), this.GetNewID()));
            daddy.PlaceInRoom(Room);
            daddy.ResetCreature(new IntVector2(36, 5), Vector2.up);
        }
    }
 /// <summary>
 /// Checks if the region has colored BLLs/DLLs configured
 /// </summary>
 private static void DaddyLongLegs_ctor(On.DaddyLongLegs.orig_ctor orig, DaddyLongLegs self, AbstractCreature abstractCreature, World world)
 {
     orig(self, abstractCreature, world);
     if (world != null && !world.singleRoomWorld)
     {
         //CustomWorldMod.Log($"Region Name [{self.region.name}]");
         foreach (KeyValuePair <string, string> keyValues in CustomWorldMod.activatedPacks)
         {
             //CustomWorldMod.Log($"Checking in [{CustomWorldMod.availableRegions[keyValues.Key].regionName}]");
             if (CustomWorldMod.installedPacks[keyValues.Key].regionConfig.TryGetValue(world.region.name, out CustomWorldStructs.RegionConfiguration config))
             {
                 if (!config.bllVanilla)
                 {
                     //CustomWorldMod.Log($"Spawning custom DDL/BLL in [{world.region.name}] from [{CustomWorldMod.availableRegions[keyValues.Key].regionName}]");
                     self.colorClass  = true;
                     self.effectColor = config.bllColor ?? new UnityEngine.Color(0, 0, 1);
                     self.eyeColor    = self.effectColor;
                 }
                 break;
             }
         }
     }
 }
    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();
            }
        }
    }