Ejemplo n.º 1
0
        public short CalculateJet(ExtendedSpellEffect record, short statdata)
        {
            short jet = (short)(SpellEffectsHandler.GetRandom(record));

            if (record.BaseEffect.SpellLevelId != 0)
            {
                ushort spellId = SpellLevelRecord.GetLevel(record.BaseEffect.SpellLevelId).SpellId;
                jet += GetSpellBoost(spellId);
            }
            return((short)(Math.Floor((double)jet * (100 + statdata + FighterStats.Stats.AllDamagesBonusPercent) / 100) + FighterStats.Stats.AllDamagesBonus));
        }
 public void HandleWeaponEffect(short cellid, List <ExtendedSpellEffect> handledEffects, FightSpellCastCriticalEnum critical)
 {
     foreach (var effect in handledEffects)
     {
         Fight.TryStartSequence(ContextualId, 1);
         short[] cells  = ShapesProvider.Handle(effect.ZoneShape, cellid, CellId, effect.ZoneSize).ToArray();
         var     actors = GetAffectedActors(cells, effect.Targets);
         SpellEffectsHandler.Handle(this, null, effect, actors, cellid);
         Fight.TryEndSequence(1, 0);
     }
     Fight.CheckFightEnd();
 }
Ejemplo n.º 3
0
        public void ActivateOnTurnStart(Fighter fighter)
        {
            var spellLevel = SpellLevelRecord.GetLevel((ushort)AssociatedSpellId, AssociatedSpellGrade);

            DisplayTriggered(fighter);
            foreach (var effect in spellLevel.Effects)
            {
                Caster.Fight.TryStartSequence(Caster.ContextualId, 1);
                short[] cells = ShapesProvider.Handle(effect.ZoneShape, CenterCell, fighter.CellId, effect.ZoneSize).ToArray();
                SpellEffectsHandler.Handle(Caster, spellLevel, effect, new List <Fighter>()
                {
                    fighter
                }, CenterCell);
                Caster.Fight.TryEndSequence(1, 0);
            }
            Caster.Fight.CheckFightEnd();
        }
Ejemplo n.º 4
0
        public void HandleSpellEffects(SpellLevelRecord spell, short cellid, FightSpellCastCriticalEnum critical)
        {
            List <ExtendedSpellEffect> handledEffects = critical == FightSpellCastCriticalEnum.CRITICAL_HIT ? spell.CriticalEffects : spell.Effects;

            Dictionary <ExtendedSpellEffect, List <Fighter> > validatedEffectsDatas = new Dictionary <ExtendedSpellEffect, List <Fighter> >();


            SelectRandomEffect(handledEffects);
            foreach (var effect in handledEffects)
            {
                short[] cells  = ShapesProvider.Handle(effect.ZoneShape, cellid, CellId, effect.ZoneSize).ToArray();
                var     actors = GetAffectedActors(cells, effect.Targets);
                validatedEffectsDatas.Add(effect, actors);
            }
            foreach (var data in validatedEffectsDatas)
            {
                Fight.TryStartSequence(ContextualId, 1);
                SpellEffectsHandler.Handle(this, spell, data.Key, data.Value, cellid);
                Fight.TryEndSequence(1, 0);
            }
        }