Beispiel #1
0
        public Inferno(Vector2 targetIndex, World world, AreaOfEffect affectedArea)
        {
            _magicCircleImage = ContentHelper.Content.Load <Texture2D>(@"Magic\MagicCircle3x3");
            _firstUpdate      = new TimeSpan();
            _lifespan         = new TimeSpan(0, 0, 3);
            _world            = world;
            _targetIndex      = targetIndex;

            affectedWorldIndices = affectedArea.GetAffectedWorldIndices(targetIndex);

            tileFire = new DodongosQuest.ParticleSystem.TileFireParticleSystem(GameReference.Game, 5);
            GameReference.Game.Components.Add(tileFire);
            tileFire._world = world;
            tileFire.particleSystemFinished += new DodongosQuest.ParticleSystem.ParticleSystem.ParticleSystemFinishedEventHandler(tileFire_particleSystemFinished);
            foreach (KeyValuePair <Vector2, double> affectedWorldIndex in affectedWorldIndices)
            {
                tileFire.AddParticles(affectedWorldIndex.Key, new Vector2(0, 0));
            }
        }
Beispiel #2
0
        public bool CastSpell(ICreature caster, Vector2 targetWorldIndex, AreaOfEffect affectedArea, World world)
        {
            affectedWorldIndicies = affectedArea.GetAffectedWorldIndices(targetWorldIndex);
            damage = RandomNumberProvider.GetRandomNumber(_minimumDamage, _maximumDamage);

            foreach (KeyValuePair <Vector2, double> affectedWorldIndex in affectedWorldIndicies)
            {
                ICreature target = world.GetCreatureAtIndex(affectedWorldIndex.Key);
                if (target != null)
                {
                    int actualDamage = (int)(damage * affectedWorldIndex.Value);
                    Announcer.Instance.Announce(target.Name + " was hit by a fireball for " + actualDamage + " damage!", MessageTypes.Spell);
                    target.Health.Current -= actualDamage;
                }
            }
            world.AddSpecialEffectToWorld(new Inferno(targetWorldIndex, world, affectedArea));

            return(true);
        }
        public bool CastSpell(ICreature caster, Vector2 targetWorldIndex, AreaOfEffect affectedArea, World world)
        {
            affectedWorldIndicies = affectedArea.GetAffectedWorldIndices(targetWorldIndex);
            damage = RandomNumberProvider.GetRandomNumber(_minimumDamage, _maximumDamage);

            foreach (KeyValuePair<Vector2, double> affectedWorldIndex in affectedWorldIndicies)
            {
                ICreature target = world.GetCreatureAtIndex(affectedWorldIndex.Key);
                if (target != null)
                {
                    int actualDamage = (int)(damage * affectedWorldIndex.Value);
                    Announcer.Instance.Announce(target.Name + " was hit by a fireball for " + actualDamage + " damage!", MessageTypes.Spell);
                    target.Health.Current -= actualDamage;
                }
            }
            world.AddSpecialEffectToWorld(new Inferno(targetWorldIndex, world, affectedArea));

            return true;
        }
Beispiel #4
0
        public Inferno(Vector2 targetIndex, World world, AreaOfEffect affectedArea)
        {
            _magicCircleImage = ContentHelper.Content.Load<Texture2D>(@"Magic\MagicCircle3x3");
            _firstUpdate = new TimeSpan();
            _lifespan = new TimeSpan(0, 0, 3);
            _world = world;
            _targetIndex = targetIndex;

            affectedWorldIndices = affectedArea.GetAffectedWorldIndices(targetIndex);

            tileFire = new DodongosQuest.ParticleSystem.TileFireParticleSystem(GameReference.Game, 5);
            GameReference.Game.Components.Add(tileFire);
            tileFire._world = world;
            tileFire.particleSystemFinished += new DodongosQuest.ParticleSystem.ParticleSystem.ParticleSystemFinishedEventHandler(tileFire_particleSystemFinished);
            foreach (KeyValuePair<Vector2, double> affectedWorldIndex in affectedWorldIndices)
            {
                tileFire.AddParticles(affectedWorldIndex.Key, new Vector2(0,0));
            }
        }