Inheritance: AssignmentAI, IJobObserver
Beispiel #1
0
        public void InitializeWorld(World world)
        {
            var envBuilder = new EnvironmentObjectBuilder(new IntSize3(64, 64, 4), VisibilityMode.AllVisible);

            TileData td;

            int surfaceLevel = 2;

            td = new TileData()
            {
                TerrainID = TerrainID.NaturalWall, TerrainMaterialID = MaterialID.Granite, InteriorID = InteriorID.Empty
            };
            FillVolume(envBuilder, new IntBox(envBuilder.Bounds.Plane, 0), td);
            FillVolume(envBuilder, new IntBox(envBuilder.Bounds.Plane, 1), td);

            td = new TileData()
            {
                TerrainID = TerrainID.NaturalFloor, TerrainMaterialID = MaterialID.Granite, InteriorID = InteriorID.Empty
            };
            FillVolume(envBuilder, new IntBox(envBuilder.Bounds.Plane, 2), td);

            td = new TileData()
            {
                TerrainID = TerrainID.Empty, InteriorID = InteriorID.Empty
            };
            FillVolume(envBuilder, new IntBox(envBuilder.Bounds.Plane, 3), td);

            td = new TileData()
            {
                TerrainID = TerrainID.NaturalWall, TerrainMaterialID = MaterialID.Granite, InteriorID = InteriorID.Empty
            };
            DrawRect(envBuilder, new IntRectZ(envBuilder.Bounds.Plane, 2), td);

            var env = envBuilder.Create(world);

            env.HomeLocation = new IntPoint3(envBuilder.Width / 2, 4, surfaceLevel);


            /* Add Monsters */

            CreateSheep(env, surfaceLevel);

            {
                var builder = new LivingObjectBuilder(LivingID.Wolf);
                var wolf    = builder.Create(env.World);
                var ai      = new Dwarrowdelf.AI.CarnivoreAI(wolf);
                wolf.SetAI(ai);

                wolf.MoveTo(env, GetRandomSurfaceLocation(env, surfaceLevel));
            }

            {
                var builder = new LivingObjectBuilder(LivingID.Dragon);
                var dragon  = builder.Create(env.World);
                var ai      = new Dwarrowdelf.AI.MonsterAI(dragon);
                dragon.SetAI(ai);

                dragon.MoveTo(env, GetRandomSurfaceLocation(env, surfaceLevel));
            }
        }
Beispiel #2
0
        public void InitializeWorld(World world)
        {
            var envBuilder = new EnvironmentObjectBuilder(new IntSize3(64, 64, 4), VisibilityMode.AllVisible);

            TileData td;

            int surfaceLevel = 2;

            td = new TileData() { TerrainID = TerrainID.NaturalWall, TerrainMaterialID = MaterialID.Granite, InteriorID = InteriorID.Empty };
            FillVolume(envBuilder, new IntBox(envBuilder.Bounds.Plane, 0), td);
            FillVolume(envBuilder, new IntBox(envBuilder.Bounds.Plane, 1), td);

            td = new TileData() { TerrainID = TerrainID.NaturalFloor, TerrainMaterialID = MaterialID.Granite, InteriorID = InteriorID.Empty };
            FillVolume(envBuilder, new IntBox(envBuilder.Bounds.Plane, 2), td);

            td = new TileData() { TerrainID = TerrainID.Empty, InteriorID = InteriorID.Empty };
            FillVolume(envBuilder, new IntBox(envBuilder.Bounds.Plane, 3), td);

            td = new TileData() { TerrainID = TerrainID.NaturalWall, TerrainMaterialID = MaterialID.Granite, InteriorID = InteriorID.Empty };
            DrawRect(envBuilder, new IntRectZ(envBuilder.Bounds.Plane, 2), td);

            var env = envBuilder.Create(world);
            env.HomeLocation = new IntPoint3(envBuilder.Width / 2, 4, surfaceLevel);

            /* Add Monsters */

            CreateSheep(env, surfaceLevel);

            {
                var builder = new LivingObjectBuilder(LivingID.Wolf);
                var wolf = builder.Create(env.World);
                var ai = new Dwarrowdelf.AI.CarnivoreAI(wolf);
                wolf.SetAI(ai);

                wolf.MoveTo(env, GetRandomSurfaceLocation(env, surfaceLevel));
            }

            {
                var builder = new LivingObjectBuilder(LivingID.Dragon);
                var dragon = builder.Create(env.World);
                var ai = new Dwarrowdelf.AI.MonsterAI(dragon);
                dragon.SetAI(ai);

                dragon.MoveTo(env, GetRandomSurfaceLocation(env, surfaceLevel));
            }
        }