Esempio n. 1
0
        /// <summary>
        /// Initialize function creates all the required components for the bird.
        /// </summary>
        /// <param name="sprites">The sprite sheet to use for the bird</param>
        /// <param name="species"></param>
        public void Initialize(string sprites, string species)
        {
            // When true, causes the bird to face the direction its moving in
            Physics.Orientation = Physics.OrientMode.RotateY;


            CreateSprite(ContentPaths.Entities.Animals.fowl[Species], Manager);

            // Used to sense hostile creatures
            Physics.AddChild(new EnemySensor(Manager, "EnemySensor", Matrix.Identity, new Vector3(20, 5, 20), Vector3.Zero));

            // Controls the behavior of the creature
            Physics.AddChild(new PacingCreatureAI(Manager, "AI", Sensors));

            // The bird can peck at its enemies (0.1 damage)
            Attacks = new List <Attack>
            {
                new Attack("Peck", 0.01f, 2.0f, 0.5f, SoundSource.Create(ContentPaths.Audio.Oscar.sfx_oc_chicken_attack), ContentPaths.Effects.pierce)
                {
                    Mode         = Attack.AttackMode.Melee,
                    TriggerFrame = 2,
                    TriggerMode  = Attack.AttackTrigger.Animation
                }
            };


            // The bird can hold one item at a time in its inventory
            Physics.AddChild(new Inventory(Manager, "Inventory", Physics.BoundingBox.Extents(), Physics.LocalBoundingBoxOffset));

            Physics.AddChild(Shadow.Create(0.5f, Manager));
            // The bird will emit a shower of blood when it dies
            Physics.AddChild(new ParticleTrigger("blood_particle", Manager, "Death Gibs", Matrix.Identity, Vector3.One, Vector3.Zero)
            {
                TriggerOnDeath = true,
                TriggerAmount  = 1
            });

            Physics.AddChild(new ParticleTrigger("feather", Manager, "Death Gibs", Matrix.Identity, Vector3.One, Vector3.Zero)
            {
                TriggerOnDeath = true,
                TriggerAmount  = 10
            });

            // The bird is flammable, and can die when exposed to fire.
            Physics.AddChild(new Flammable(Manager, "Flames"));

            // Tag the physics component with some information
            // that can be used later
            Physics.Tags.Add(species);
            Physics.Tags.Add("Animal");
            Physics.Tags.Add("DomesticAnimal");
            Stats.FullName     = TextGenerator.GenerateRandom("$firstname") + " the " + species;
            Stats.CurrentClass = new EmployeeClass()
            {
                Name   = species,
                Levels = new List <EmployeeClass.Level>()
                {
                    new EmployeeClass.Level()
                    {
                        Index = 0, Name = species
                    }
                }
            };


            NoiseMaker.Noises["Hurt"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_oc_chicken_hurt_1, ContentPaths.Audio.Oscar.sfx_oc_chicken_hurt_2
            };
            NoiseMaker.Noises["Chirp"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_oc_chicken_neutral_1, ContentPaths.Audio.Oscar.sfx_oc_chicken_neutral_2
            };
            NoiseMaker.Noises["Lay Egg"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_oc_chicken_lay_egg
            };
            Species = species;

            var deathParticleTrigger = Parent.EnumerateAll().OfType <ParticleTrigger>().FirstOrDefault();

            if (deathParticleTrigger != null)
            {
                deathParticleTrigger.SoundToPlay = NoiseMaker.Noises["Hurt"][0];
            }
        }
Esempio n. 2
0
        public override void CreateCosmeticChildren(ComponentManager manager)
        {
            CreateDwarfSprite(Stats.CurrentClass, manager);
            Physics.AddChild(Shadow.Create(0.75f, manager));
            Physics.AddChild(new VoxelRevealer(manager, Physics, 5)).SetFlag(Flag.ShouldSerialize, false);
            Physics.AddChild(new MinimapIcon(Manager, new NamedImageFrame(ContentPaths.GUI.map_icons, 16, 0, 0))).SetFlag(Flag.ShouldSerialize, false);

            NoiseMaker = new NoiseMaker();
            NoiseMaker.Noises["Hurt"] = new List <string>
            {
                ContentPaths.Audio.Oscar.sfx_ic_dwarf_hurt_1,
                ContentPaths.Audio.Oscar.sfx_ic_dwarf_hurt_2,
            };

            NoiseMaker.Noises["Ok"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_ic_dwarf_ok_1,
                ContentPaths.Audio.Oscar.sfx_ic_dwarf_ok_2,
                ContentPaths.Audio.Oscar.sfx_ic_dwarf_ok_3
            };

            NoiseMaker.Noises["Die"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_ic_dwarf_death
            };

            NoiseMaker.Noises["Pleased"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_ic_dwarf_pleased
            };

            NoiseMaker.Noises["Tantrum"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_ic_dwarf_tantrum_1,
                ContentPaths.Audio.Oscar.sfx_ic_dwarf_tantrum_2,
                ContentPaths.Audio.Oscar.sfx_ic_dwarf_tantrum_3,
            };
            NoiseMaker.Noises["Jump"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_ic_dwarf_jump
            };

            NoiseMaker.Noises["Climb"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_ic_dwarf_climb_1,
                ContentPaths.Audio.Oscar.sfx_ic_dwarf_climb_2,
                ContentPaths.Audio.Oscar.sfx_ic_dwarf_climb_3
            };

            Physics.AddChild(new ParticleTrigger("blood_particle", Manager, "Death Gibs", Matrix.Identity, Vector3.One, Vector3.Zero)
            {
                TriggerOnDeath  = true,
                TriggerAmount   = 1,
                BoxTriggerTimes = 10,
                SoundToPlay     = ContentPaths.Entities.Dwarf.Audio.dwarfhurt1,
            }).SetFlag(Flag.ShouldSerialize, false);

            if (Equipment.HasValue(out var equipment) && GetRoot().GetComponent <DwarfSprites.LayeredCharacterSprite>().HasValue(out var sprite))
            {
                equipment.AddLayersToSprite(sprite);
            }

            base.CreateCosmeticChildren(manager);
        }
Esempio n. 3
0
 public override void CreateCosmeticChildren(ComponentManager manager)
 {
     CreateSprite(Stats.CurrentClass, manager);
     Physics.AddChild(Shadow.Create(0.75f, manager));
     base.CreateCosmeticChildren(manager);
 }
Esempio n. 4
0
 public override void CreateCosmeticChildren(ComponentManager manager)
 {
     CreateSprite(ContentPaths.Entities.Animals.fowl[Species], manager);
     Physics.AddChild(Shadow.Create(0.5f, manager));
     base.CreateCosmeticChildren(manager);
 }
Esempio n. 5
0
 public override void CreateCosmeticChildren(ComponentManager manager)
 {
     CreateSprite(SpriteAsset, manager, 0.35f);
     Physics.AddChild(Shadow.Create(0.3f, manager));
     base.CreateCosmeticChildren(manager);
 }
Esempio n. 6
0
        /// <summary>
        /// Initialize function creates all the required components for the bird.
        /// </summary>
        /// <param name="sprites">The sprite sheet to use for the bird</param>
        public void Initialize(string sprites)
        {
            // When true, causes the bird to face the direction its moving in
            Physics.Orientation = Physics.OrientMode.RotateY;

            SpriteAsset = sprites;

            CreateSprite(SpriteAsset, Manager, 0.35f);

            // Used to sense hostile creatures
            Physics.AddChild(new EnemySensor(Manager, "EnemySensor", Matrix.Identity, new Vector3(20, 5, 20), Vector3.Zero));

            // Controls the behavior of the creature
            Physics.AddChild(new PacingCreatureAI(Manager, "Rabbit AI", Sensors));

            // The bird can peck at its enemies (0.1 damage)
            Attacks = new List <Attack> {
                new Attack("Bite", 0.01f, 2.0f, 1.0f, SoundSource.Create(ContentPaths.Audio.Oscar.sfx_oc_frog_attack), ContentPaths.Effects.bite)
            };


            // The bird can hold one item at a time in its inventory
            Physics.AddChild(new Inventory(Manager, "Inventory", Physics.BoundingBox.Extents(), Physics.LocalBoundingBoxOffset));

            Physics.AddChild(Shadow.Create(0.25f, Manager));

            // The bird will emit a shower of blood when it dies
            Physics.AddChild(new ParticleTrigger("blood_particle", Manager, "Death Gibs", Matrix.Identity, Vector3.One, Vector3.Zero)
            {
                TriggerOnDeath = true,
                TriggerAmount  = 1,
                SoundToPlay    = ContentPaths.Audio.Oscar.sfx_oc_frog_hurt_1
            });

            // The bird is flammable, and can die when exposed to fire.
            Physics.AddChild(new Flammable(Manager, "Flames"));

            // Tag the physics component with some information
            // that can be used later
            Physics.Tags.Add("Frog");
            Physics.Tags.Add("Animal");
            Physics.Tags.Add("DomesticAnimal");
            Stats.FullName     = TextGenerator.GenerateRandom("$firstname") + " the frog";
            Stats.CurrentClass = new EmployeeClass()
            {
                Name   = "Frog",
                Levels = new List <EmployeeClass.Level>()
                {
                    new EmployeeClass.Level()
                    {
                        Index = 0, Name = "Frog"
                    }
                }
            };


            NoiseMaker.Noises["Idle"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_oc_frog_neutral_1, ContentPaths.Audio.Oscar.sfx_oc_frog_neutral_2
            };
            NoiseMaker.Noises["Chrip"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_oc_frog_neutral_1, ContentPaths.Audio.Oscar.sfx_oc_frog_neutral_2
            };
            NoiseMaker.Noises["Hurt"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_oc_frog_hurt_1, ContentPaths.Audio.Oscar.sfx_oc_frog_hurt_2
            };
            Species      = "Frog";
            CanReproduce = true;
            BabyType     = "Frog";
        }
Esempio n. 7
0
        /// <summary>
        /// Initialize function creates all the required components for the bird.
        /// </summary>
        /// <param name="sprites">The sprite sheet to use for the bird</param>
        public void Initialize(string sprites)
        {
            SpriteAsset = sprites;
            HasBones    = false;
            // When true, causes the bird to face the direction its moving in
            Physics.Orientation = Physics.OrientMode.RotateY;

            CreateSprite(sprites, Manager);
            // Used to grab other components
            Hands = Physics.AddChild(new Grabber("hands", Manager, Matrix.Identity, new Vector3(0.2f, 0.2f, 0.2f), Vector3.Zero)) as Grabber;

            // Used to sense hostile creatures
            Sensors = Physics.AddChild(new EnemySensor(Manager, "EnemySensor", Matrix.Identity, new Vector3(20, 5, 20), Vector3.Zero)) as EnemySensor;

            // Controls the behavior of the creature
            AI = Physics.AddChild(new PacingCreatureAI(Manager, "Spider AI", Sensors, PlanService)) as CreatureAI;

            // The bird can peck at its enemies (0.1 damage)
            Attacks = new List <Attack> {
                new Attack("Sting", 0.01f, 1.0f, 3.0f, SoundSource.Create(ContentPaths.Audio.Oscar.sfx_oc_giant_spider_attack_1, ContentPaths.Audio.Oscar.sfx_oc_giant_spider_attack_2), ContentPaths.Effects.bite),
                new Attack("Web", 0.0f, 1.0f, 5.0f, SoundSource.Create(ContentPaths.Audio.Oscar.sfx_oc_giant_spider_attack_1, ContentPaths.Audio.Oscar.sfx_oc_giant_spider_attack_2), ContentPaths.Effects.claws)
                {
                    Mode = Attack.AttackMode.Ranged, LaunchSpeed = 10, ProjectileType = "Web"
                }
            };


            // The bird can hold one item at a time in its inventory
            Inventory = Physics.AddChild(new Inventory(Manager, "Inventory", Physics.BoundingBox.Extents(), Physics.BoundingBoxPos)) as Inventory;

            Physics.AddChild(Shadow.Create(0.25f, Manager));

            // The bird will emit a shower of blood when it dies
            Physics.AddChild(new ParticleTrigger("blood_particle", Manager, "Death Gibs", Matrix.Identity, Vector3.One, Vector3.Zero)
            {
                TriggerOnDeath = true,
                TriggerAmount  = 1
            });

            // The bird is flammable, and can die when exposed to fire.
            Physics.AddChild(new Flammable(Manager, "Flames"));

            // Tag the physics component with some information
            // that can be used later
            Physics.Tags.Add("Spider");
            Physics.Tags.Add("Animal");

            Stats.FullName     = TextGenerator.GenerateRandom("$firstname") + " the Spider";
            Stats.CurrentClass = new EmployeeClass()
            {
                Name   = "Spider",
                Levels = new List <EmployeeClass.Level>()
                {
                    new EmployeeClass.Level()
                    {
                        Index = 0, Name = "Spider"
                    }
                }
            };

            NoiseMaker.Noises["Hurt"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_oc_giant_spider_hurt_1
            };
            NoiseMaker.Noises["Chirp"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_oc_giant_spider_neutral_1,
                ContentPaths.Audio.Oscar.sfx_oc_giant_spider_neutral_2
            };
            AI.Movement.CanClimbWalls = true;
            AI.Movement.CanSwim       = false;
            Species      = "Spider";
            CanReproduce = true;
            BabyType     = "Spider";
        }
Esempio n. 8
0
        /// <summary>
        /// Initialize function creates all the required components for the bird.
        /// </summary>
        /// <param name="sprites">The sprite sheet to use for the bird</param>
        public void Initialize(string sprites)
        {
            HasBones = false;
            // When true, causes the bird to face the direction its moving in
            Physics.Orientation = Physics.OrientMode.RotateY;

            SpriteAsset = sprites;
            CreateSprite(sprites, Manager);

            Physics.AddChild(Shadow.Create(0.25f, Manager));

            // Used to sense hostile creatures
            Physics.AddChild(new EnemySensor(Manager, "EnemySensor", Matrix.Identity, new Vector3(20, 5, 20), Vector3.Zero));

            // Controls the behavior of the creature
            Physics.AddChild(new PacingCreatureAI(Manager, "Scorpion AI", Sensors, PlanService));

            // The bird can peck at its enemies (0.1 damage)
            Attacks = new List <Attack> {
                new Attack("Sting", 4.0f, 2.0f, 1.5f, SoundSource.Create(ContentPaths.Audio.Oscar.sfx_oc_scorpion_attack_1, ContentPaths.Audio.Oscar.sfx_oc_scorpion_attack_2), ContentPaths.Effects.pierce)
                {
                    TriggerFrame = 2, TriggerMode = Attack.AttackTrigger.Animation
                }
            };


            // The bird can hold one item at a time in its inventory
            Physics.AddChild(new Inventory(Manager, "Inventory", Physics.BoundingBox.Extents(), Physics.LocalBoundingBoxOffset));

            // The bird will emit a shower of blood when it dies
            Physics.AddChild(new ParticleTrigger("blood_particle", Manager, "Death Gibs", Matrix.Identity, Vector3.One, Vector3.Zero)
            {
                TriggerOnDeath = true,
                TriggerAmount  = 1
            });

            // The bird is flammable, and can die when exposed to fire.
            Physics.AddChild(new Flammable(Manager, "Flames"));

            // Tag the physics component with some information
            // that can be used later
            Physics.Tags.Add("Scorpion");
            Physics.Tags.Add("Animal");

            Stats.FullName     = TextGenerator.GenerateRandom("$firstname") + " the Scorpion";
            Stats.CurrentClass = new EmployeeClass()
            {
                Name   = "Scorpion",
                Levels = new List <EmployeeClass.Level>()
                {
                    new EmployeeClass.Level()
                    {
                        Index = 0, Name = "Scorpion"
                    }
                }
            };

            NoiseMaker.Noises["Hurt"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_oc_scorpion_hurt_1
            };
            NoiseMaker.Noises["Chirp"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_oc_scorpion_neutral_1, ContentPaths.Audio.Oscar.sfx_oc_scorpion_neutral_2
            };
            AI.Movement.CanClimbWalls = true;
            AI.Movement.CanSwim       = false;
            AI.Movement.SetSpeed(MoveType.Jump, 1.5f);
            AI.Movement.SetSpeed(MoveType.Climb, 1.5f);
            AI.Movement.SetCost(MoveType.Climb, 0.1f);
            Species      = "Scorpion";
            CanReproduce = true;
            BabyType     = "Scorpion";
        }
Esempio n. 9
0
        public override void CreateCosmeticChildren(ComponentManager Manager)
        {
            CreateSprite(ContentPaths.Entities.Animals.Snake.snake_animation, Manager, 0.35f);

            #region Create Tail Pieces

            Tail = new List <TailSegment>();
            var tailAnimations = Library.LoadCompositeAnimationSet(ContentPaths.Entities.Animals.Snake.tail_animation, "Snake");

            for (int i = 0; i < 10; ++i)
            {
                var tailPiece = new CharacterSprite(Manager, "Sprite", Matrix.CreateTranslation(0, 0.25f, 0));
                tailPiece.SetAnimations(tailAnimations);

                tailPiece.SetFlag(Flag.ShouldSerialize, false);
                tailPiece.Name = "Snake Tail";

                Tail.Add(
                    new TailSegment()
                {
                    Sprite = Manager.RootComponent.AddChild(tailPiece) as GameComponent,
                    Target = Physics.LocalTransform.Translation
                });


                tailPiece.AddChild(new Shadow(Manager));

                var inventory = tailPiece.AddChild(new Inventory(Manager, "Inventory", Physics.BoundingBox.Extents(), Physics.LocalBoundingBoxOffset)) as Inventory;
                inventory.SetFlag(Flag.ShouldSerialize, false);

                inventory.AddResource(new Resource("Meat")
                {
                    DisplayName = Stats.CurrentClass.Name + " Meat"
                });
                inventory.AddResource(new Resource("Bone")
                {
                    DisplayName = Stats.CurrentClass.Name + " Bone"
                });
            }

            #endregion

            Physics.AddChild(Shadow.Create(0.75f, Manager));

            Physics.AddChild(new MinimapIcon(Manager, new NamedImageFrame(ContentPaths.GUI.map_icons, 16, 2, 4))).SetFlag(Flag.ShouldSerialize, false);

            NoiseMaker = new NoiseMaker();
            NoiseMaker.Noises["Hurt"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_oc_giant_snake_hurt_1
            };
            NoiseMaker.Noises["Chirp"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_oc_giant_snake_neutral_1,
                ContentPaths.Audio.Oscar.sfx_oc_giant_snake_neutral_2
            };

            Physics.AddChild(new ParticleTrigger("blood_particle", Manager, "Death Gibs", Matrix.Identity, Vector3.One, Vector3.Zero)
            {
                TriggerOnDeath  = true,
                TriggerAmount   = 1,
                BoxTriggerTimes = 10,
                SoundToPlay     = ContentPaths.Audio.Oscar.sfx_oc_giant_snake_hurt_1,
            }).SetFlag(Flag.ShouldSerialize, false);

            base.CreateCosmeticChildren(Manager);
        }
Esempio n. 10
0
        public Bird(string sprites, Vector3 position, ComponentManager manager, string name) :
            base
            (
                manager,
                new CreatureStats
        {
            Dexterity    = 6,
            Constitution = 1,
            Strength     = 1,
            Wisdom       = 1,
            Charisma     = 1,
            Intelligence = 1,
            Size         = 0.25f,
            CanSleep     = false,
            LaysEggs     = true,
            IsMigratory  = true
        },
                "Herbivore",
                manager.World.PlanService,
                manager.World.Factions.Factions["Herbivore"],
                name
            )
        {
            Physics = new Physics
                      (
                manager,
                "A Bird",
                Matrix.CreateTranslation(position),
                new Vector3(0.25f, 0.25f, 0.25f),
                new Vector3(0.0f, 0.0f, 0.0f),
                1.0f, 1.0f, 0.999f, 0.999f,
                new Vector3(0, -10, 0)
                      );

            Physics.Orientation = Physics.OrientMode.RotateY;

            Physics.AddChild(this);


            SpriteAsset      = sprites;
            BaseMeatResource = "Bird Meat";
            CreateSprite(ContentPaths.Entities.Animals.Birds.GetBirdAnimations(SpriteAsset), Manager);

            // Used to sense hostile creatures
            Physics.AddChild(new EnemySensor(Manager, "EnemySensor", Matrix.Identity, new Vector3(20, 5, 20), Vector3.Zero));

            // Controls the behavior of the creature
            Physics.AddChild(new BirdAI(Manager, "Bird AI", Sensors, PlanService));

            // The bird can peck at its enemies (0.1 damage)
            Attacks = new List <Attack> {
                new Attack("Peck", 0.1f, 2.0f, 1.0f, SoundSource.Create(ContentPaths.Audio.Oscar.sfx_oc_bird_attack), ContentPaths.Effects.pierce)
                {
                    Mode = Attack.AttackMode.Dogfight
                }
            };


            // The bird can hold one item at a time in its inventory
            Physics.AddChild(new Inventory(Manager, "Inventory", Physics.BoundingBox.Extents(), Physics.LocalBoundingBoxOffset));

            Physics.AddChild(Shadow.Create(0.25f, Manager));

            // The bird will emit a shower of blood when it dies
            Physics.AddChild(new ParticleTrigger("blood_particle", Manager, "Death Gibs", Matrix.Identity, Vector3.One, Vector3.Zero)
            {
                TriggerOnDeath = true,
                TriggerAmount  = 1,
                SoundToPlay    = ContentPaths.Audio.Oscar.sfx_oc_bird_hurt
            });

            // The bird is flammable, and can die when exposed to fire.
            Physics.AddChild(new Flammable(Manager, "Flames"));

            // Tag the physics component with some information
            // that can be used later
            Physics.Tags.Add("Bird");
            Physics.Tags.Add("Animal");
            Physics.Tags.Add("DomesticAnimal");
            NoiseMaker.Noises.Add("chirp", new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_oc_bird_neutral_1, ContentPaths.Audio.Oscar.sfx_oc_bird_neutral_2
            });
            NoiseMaker.Noises["Hurt"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_oc_bird_hurt
            };
            NoiseMaker.Noises["Lay Egg"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_oc_bird_lay_egg
            };
            Stats.FullName     = TextGenerator.GenerateRandom("$firstname") + " the bird";
            Stats.CurrentClass = new EmployeeClass()
            {
                Name   = "Bird",
                Levels = new List <EmployeeClass.Level>()
                {
                    new EmployeeClass.Level()
                    {
                        Index = 0, Name = "Bird"
                    }
                }
            };

            AI.Movement.CanFly   = true;
            AI.Movement.CanWalk  = false;
            AI.Movement.CanClimb = false;
            Species = "Bird";
        }
Esempio n. 11
0
        /// <summary>
        /// Initialize function creates all the required components for the bat.
        /// </summary>
        public void Initialize()
        {
            // When true, causes the bird to face the direction its moving in
            Physics.Orientation = Physics.OrientMode.RotateY;

            CreateSprite(ContentPaths.Entities.Animals.Bat.bat_animations, Manager);

            // Used to grab other components
            Hands = Physics.AddChild(new Grabber("hands", Manager, Matrix.Identity, new Vector3(0.1f, 0.1f, 0.1f), Vector3.Zero)) as Grabber;

            // Used to sense hostile creatures
            Sensors = Physics.AddChild(new EnemySensor(Manager, "EnemySensor", Matrix.Identity, new Vector3(20, 5, 20), Vector3.Zero)) as EnemySensor;

            // Controls the behavior of the creature
            AI = Physics.AddChild(new BatAI(Manager, "Bat AI", Sensors, PlanService)) as BatAI;
            AI.Movement.CanFly   = true;
            AI.Movement.CanSwim  = false;
            AI.Movement.CanClimb = false;
            AI.Movement.CanWalk  = false;

            // The bird can peck at its enemies (0.1 damage)
            Attacks = new List <Attack> {
                new Attack("Bite", 0.01f, 2.0f, 1.0f, ContentPaths.Audio.Oscar.sfx_oc_bat_attack_1, ContentPaths.Effects.bite)
                {
                    TriggerMode = Attack.AttackTrigger.Animation, TriggerFrame = 1, Mode = Attack.AttackMode.Dogfight, DiseaseToSpread = "Rabies"
                }
            };


            // The bird can hold one item at a time in its inventory
            Inventory = Physics.AddChild(new Inventory(Manager, "Inventory", Physics.BoundingBox.Extents(), Physics.LocalBoundingBoxOffset)) as Inventory;

            Physics.AddChild(Shadow.Create(0.25f, Manager));

            // The bird will emit a shower of blood when it dies
            Physics.AddChild(new ParticleTrigger("blood_particle", Manager, "Death Gibs", Matrix.Identity, Vector3.One, Vector3.Zero)
            {
                TriggerOnDeath = true,
                TriggerAmount  = 1
            });

            // The bird is flammable, and can die when exposed to fire.
            Physics.AddChild(new Flammable(Manager, "Flames"));

            // Tag the physics component with some information
            // that can be used later
            Physics.Tags.Add("Bat");
            Physics.Tags.Add("Animal");

            Stats.FullName     = TextGenerator.GenerateRandom("$firstname") + " the bat";
            Stats.CurrentClass = new EmployeeClass()
            {
                Name   = "Bat",
                Levels = new List <EmployeeClass.Level>()
                {
                    new EmployeeClass.Level()
                    {
                        Index = 0, Name = "Bat"
                    }
                },
            };


            NoiseMaker.Noises["Hurt"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_oc_bat_hurt_1
            };
            NoiseMaker.Noises["Chirp"] = new List <string>()
            {
                ContentPaths.Audio.Oscar.sfx_oc_bat_neutral_1, ContentPaths.Audio.Oscar.sfx_oc_bat_neutral_2
            };
            Species      = "Bat";
            CanReproduce = true;
            BabyType     = "Bat";
        }
Esempio n. 12
0
 public override void CreateCosmeticChildren(ComponentManager manager)
 {
     CreateSprite(ContentPaths.Entities.Animals.Bat.bat_animations, manager);
     Physics.AddChild(Shadow.Create(0.25f, manager));
     base.CreateCosmeticChildren(manager);
 }
Esempio n. 13
0
 public override void CreateCosmeticChildren(ComponentManager manager)
 {
     Physics.AddChild(Shadow.Create(0.75f, manager));
     base.CreateCosmeticChildren(manager);
 }