public FireballProjectile(ComponentManager manager, Vector3 position, Vector3 initialVelocity, Body target) :
            base(manager, position, initialVelocity, new Health.DamageAmount() { Amount = 15.0f, DamageType = Health.DamageType.Fire }, 0.25f, ContentPaths.Particles.fireball, "flame", ContentPaths.Audio.Oscar.sfx_ic_demon_fire_hit_1, target)
        {
            Sprite.LightsWithVoxels  = false;
            Sprite2.LightsWithVoxels = false;

            HitAnimation = AnimationLibrary.CreateSimpleAnimation(ContentPaths.Effects.pierce);
        }
Beispiel #2
0
        public Projectile(ComponentManager manager, Vector3 position, Vector3 initialVelocity, Health.DamageAmount damage, float size, string asset, string hitParticles, string hitNoise, Body target, bool animated = false, bool singleSprite = false) :
            base(manager, "Projectile", Matrix.CreateTranslation(position), new Vector3(size, size, size), Vector3.One, 1.0f, 1.0f, 1.0f, 1.0f, new Vector3(0, -10, 0), OrientMode.Fixed, false)
        {
            this.AllowPhysicsSleep = false;
            Target       = target;
            HitAnimation = null;
            IsSleeping   = false;
            Velocity     = initialVelocity;
            Orientation  = OrientMode.LookAt;
            CollideMode  = Physics.CollisionMode.None;
            var spriteSheet = new SpriteSheet(asset);

            if (animated)
            {
                spriteSheet.FrameWidth  = Math.Min(spriteSheet.FrameWidth, spriteSheet.FrameHeight);
                spriteSheet.FrameHeight = spriteSheet.FrameWidth;
            }

            Sprite = AddChild(new AnimatedSprite(Manager, "Sprite", Matrix.CreateRotationY((float)Math.PI * 0.5f),
                                                 false)
            {
                OrientationType = AnimatedSprite.OrientMode.Fixed
            }) as AnimatedSprite;

            Sprite.AddAnimation(AnimationLibrary.CreateSimpleAnimation(asset));

            if (singleSprite)
            {
                this.Sprite.OrientationType = AnimatedSprite.OrientMode.Spherical;
            }

            if (!singleSprite)
            {
                Sprite2 = Sprite.AddChild(new AnimatedSprite(Manager, "Sprite2",
                                                             Matrix.CreateRotationX((float)Math.PI * 0.5f),
                                                             false)
                {
                    OrientationType = AnimatedSprite.OrientMode.Fixed
                }) as AnimatedSprite;

                Sprite2.AddAnimation(AnimationLibrary.CreateSimpleAnimation(asset));
            }
            Damage       = damage;
            HitParticles = AddChild(new ParticleTrigger(hitParticles, manager, "Hit Particles",
                                                        Matrix.Identity, new Vector3(size * 0.5f, size * 0.5f, size * 0.5f), Vector3.Zero)
            {
                TriggerOnDeath  = true,
                SoundToPlay     = hitNoise,
                BoxTriggerTimes = 2
            }) as ParticleTrigger;
            DamageRadius = (float)Math.Pow(size * 4, 2);
        }
Beispiel #3
0
 public Attack(string name, float damage, float time, float range, SoundSource noise, string animation)
 {
     Name           = name;
     DamageAmount   = damage;
     RechargeTimer  = new Timer(time + MathFunctions.Rand(-0.2f, 0.2f), false);
     Range          = range;
     HitNoise       = noise;
     Mode           = AttackMode.Melee;
     Knockback      = 0.0f;
     HitAnimation   = null;
     HitColor       = Color.White;
     HitParticles   = "";
     ProjectileType = "";
     AnimationAsset = animation;
     HitAnimation   = AnimationLibrary.CreateSimpleAnimation(AnimationAsset);
 }
 public override void CreateCosmeticChildren(ComponentManager Manager)
 {
     base.CreateCosmeticChildren(Manager);
     HitAnimation = AnimationLibrary.CreateSimpleAnimation(ContentPaths.Effects.pierce);
 }
 public ArrowProjectile(ComponentManager manager, Vector3 position, Vector3 initialVelocity, Body target) :
     base(manager, position, initialVelocity, new Health.DamageAmount() { Amount = 10.0f, DamageType = Health.DamageType.Slashing }, 0.25f, ContentPaths.Entities.Elf.Sprites.arrow, "puff", ContentPaths.Audio.Oscar.sfx_ic_elf_arrow_hit, target)
 {
     HitAnimation = AnimationLibrary.CreateSimpleAnimation(ContentPaths.Effects.pierce);
 }
 public MudProjectile(ComponentManager manager, Vector3 position, Vector3 initialVelocity, Body target) :
     base(manager, position, initialVelocity, new Health.DamageAmount() { Amount = 30.0f, DamageType = Health.DamageType.Normal }, 0.25f, ContentPaths.Entities.mudball, "dirt_particle", ContentPaths.Audio.gravel, target, true, true)
 {
     HitAnimation = AnimationLibrary.CreateSimpleAnimation(ContentPaths.Effects.flash);
 }
 public SnowballProjectile(ComponentManager manager, Vector3 position, Vector3 initialVelocity, Body target) :
     base(manager, position, initialVelocity, new Health.DamageAmount() { Amount = 30.0f, DamageType = Health.DamageType.Normal }, 0.25f, ContentPaths.Entities.snowball, "snow_particle", ContentPaths.Audio.Oscar.sfx_env_voxel_snow_destroy, target, true, true)
 {
     HitAnimation = AnimationLibrary.CreateSimpleAnimation(ContentPaths.Effects.flash);
 }
Beispiel #8
0
 private void OnDeserialized(StreamingContext context)
 {
     HitAnimation = AnimationLibrary.CreateSimpleAnimation(AnimationAsset);
 }
 public BulletProjectile(ComponentManager manager, Vector3 position, Vector3 initialVelocity, Body target) :
     base(manager, position, initialVelocity, new Health.DamageAmount() { Amount = 30.0f, DamageType = Health.DamageType.Normal }, 0.25f, ContentPaths.Particles.stone_particle, null, ContentPaths.Audio.Oscar.sfx_ic_dwarf_musket_bullet_explode_1, target)
 {
     HitAnimation = AnimationLibrary.CreateSimpleAnimation(ContentPaths.Effects.explode);
 }
Beispiel #10
0
 public override void CreateCosmeticChildren(ComponentManager Manager)
 {
     base.CreateCosmeticChildren(Manager);
     HitAnimation = AnimationLibrary.CreateSimpleAnimation(ContentPaths.Entities.Animals.Spider.webstick);
 }
Beispiel #11
0
 public WebProjectile(ComponentManager manager, Vector3 position, Vector3 initialVelocity, Body target) :
     base(manager, position, initialVelocity, new Health.DamageAmount() { Amount = 10.0f, DamageType = Health.DamageType.Acid }, 0.25f, ContentPaths.Entities.Animals.Spider.webshot, "puff", ContentPaths.Audio.whoosh, target)
 {
     HitAnimation = AnimationLibrary.CreateSimpleAnimation(ContentPaths.Entities.Animals.Spider.webstick);
 }