Ejemplo n.º 1
0
        // returns all the cells affected by the spell at the targeted location
        public List <Cell> getSpellEffectAffectedCells(EffectSpell effect, Entity origin, Cell target, bool priority)
        {
            int areaType = effect.areaType[priority ? 0 : 1];
            int minArea  = effect.minArea[priority ? 0 : 1];
            int maxArea  = effect.maxArea[priority ? 0 : 1];

            return(grid.getCellsInRange(target, minArea, maxArea, areaType));
        }
Ejemplo n.º 2
0
 public static EffectSpell[] buildEffectSpells(ArrayJSON effects)
 {
     if (effects != null)
     {
         EffectSpell[] output = new EffectSpell[effects.Length];
         for (int i = 0; i < effects.Length; i++)
         {
             output[i] = buildEffectSpell(effects.getObjectJSONAt(i));
         }
         return(output);
     }
     return(new EffectSpell[0]);
 }
Ejemplo n.º 3
0
    /// <summary>
    /// 实例化弹道特效
    /// </summary>
    /// <param name="effectName">特效名称</param>
    /// <param name="MasterObj">发起者对象</param>
    /// <param name="TargetObj">目标对象</param>
    /// <param name="_SpellInfo">子弹的技能信息</param>
    public void InstanceEffect_Bullet(string effectName, ObjectCreature MasterObj, ObjectCreature TargetObj, SpellInfo _SpellInfo, EffectHit_Callback HitHandle = null)
    {
        //子弹释放中音效
        AudioControler.Inst.PlaySound(_SpellInfo.GetSpellRow().getBulletsFiredSound());
        //技能弹道的音效
        AudioControler.Inst.PlaySound(_SpellInfo.GetSpellRow().getBallIsticSound());

        EffectSpell _effect = GetFreeEffectSpell(effectName);

        if (_effect != null && _effect.GetGameObject() != null)
        {
            GameObject obj = _effect.GetGameObject();
            _effect.ResetTime();
            _effect.InitBornPoint(MasterObj);
            _effect.InitTargetPoint(TargetObj);
            _effect.SetHitEffectHandle(HitHandle);
            _effect.SetGameObject(obj);
        }
        else
        {
            GameObject _AssetRes = AssetLoader.Inst.GetAssetRes(effectName);
            if (_AssetRes == null)
            {
                return;
            }

            EffectSpell _newEffect = new EffectSpell(_SpellInfo);
            _newEffect.InitBornPoint(MasterObj);
            _newEffect.InitTargetPoint(TargetObj);

            GameObject _obj = Instantiate(_AssetRes, _newEffect.GetInitialLocation(), Quaternion.identity) as GameObject;
            if (MasterObj is ObjectMonster)
            {
                float _scale = ((ObjectMonster)MasterObj).GetMonsterRow().getMonsterEnlarge();
                _obj.transform.localScale = new UnityEngine.Vector3(_scale, _scale, _scale);
            }
            GameUtils.AttachParticleCS(_obj.transform);
            _newEffect.SetGameObject(_obj);
            _newEffect.SetEffectName(effectName);
            _newEffect.SetHitEffectHandle(HitHandle);

            m_EffectSpellList.Add(_newEffect);
        }
        //技能震动
        if (FightEditorContrler.GetInstantiate() != null)
        {
            FightEditorContrler.GetInstantiate().SkillShake(_SpellInfo.GetSpellRow().getVibrationScreen(), EM_SPELL_SHAKE_TYPE.EM_SPELL_SHAKE_TYPE_RELEASE);
        }
    }
Ejemplo n.º 4
0
    public Netero() : base("Netero")
    {
        Spell palmOfBuddha = new OffensiveSpell(stats, 20f, "Palm of Buddha");
        Spell nen          = new EffectSpell(stats, new PhysicalAttack(25f, 5), 10f, "Nen");
        Spell rdef         = new EffectSpell(stats, new ReduceDefense(25f, 2), 10f, "Reduce Defense");
        Spell protect      = new EffectSpell(stats, new Protect(15f), 30f, "Protect");

        magicSkills.Add(palmOfBuddha);
        magicSkills.Add(nen);
        magicSkills.Add(rdef);
        magicSkills.Add(protect);

        special = new SpecialSkill(stats, 10f, new List <Spell> {
            new EffectSpell(stats, new OccultPower(), 0f, "")
        }, "OccultPower");
    }
Ejemplo n.º 5
0
    public Aragorn() : base("Aragorn")
    {
        Spell protect     = new EffectSpell(stats, new Protect(15f), 30f, "Protect");
        Spell focus       = new EffectSpell(stats, new PhysicalAttack(25f, 5), 10f, "Focused Rage");
        Spell inner       = new EffectSpell(stats, new Heal(30f, 1), 10f, "Inner Rage");
        Spell mortalCombo = new OffensiveSpell(stats, 30f, "Mortal Combo");

        magicSkills.Add(protect);
        magicSkills.Add(inner);
        magicSkills.Add(focus);
        magicSkills.Add(mortalCombo);

        special = new SpecialSkill(stats, 10f, new List <Spell> {
            new OffensiveSpell(stats, 65f, "")
        }, "Mortal");
    }
Ejemplo n.º 6
0
    public Tyrande() : base("Tyrande")
    {
        Spell velocity = new EffectSpell(stats, new Velocity(1f), 10f, "Velocity");
        Spell heal     = new EffectSpell(stats, new Heal(3f, 4), 15f, "Touch of Elune");
        Spell poison   = new EffectSpell(stats, new Poison(), 20f, "Poison");
        Spell protect  = new EffectSpell(stats, new Protect(10f), 40f, "Protect");

        magicSkills.Add(protect);
        magicSkills.Add(poison);
        magicSkills.Add(heal);
        magicSkills.Add(velocity);

        special = new SpecialSkill(stats, 10f, new List <Spell> {
            new EffectSpell(stats, new Heal(99f, 1), 0f, "")
        }, "For Elune");
    }
Ejemplo n.º 7
0
    public Kvothe() : base("Kvothe")
    {
        Spell fireball   = new OffensiveSpell(stats, 15f, "Fire ball");
        Spell songOfWind = new EffectSpell(stats, new Velocity(3f), 10f, "Song of wind");
        Spell waterball  = new OffensiveSpell(stats, 25f, "Water ball");
        Spell memory     = new EffectSpell(stats, new MagicalAttack(30f, 2), 10f, "Memory");

        magicSkills.Add(fireball);
        magicSkills.Add(waterball);
        magicSkills.Add(songOfWind);
        magicSkills.Add(memory);

        special = new SpecialSkill(stats, 10f, new List <Spell> {
            new EffectSpell(stats, new Velocity(4f), 0f, ""), new EffectSpell(stats, new Heal(3f, 4), 0f, "")
        }, "Denna song");
    }
Ejemplo n.º 8
0
        public static EffectSpell buildEffectSpell(ObjectJSON effect)
        {
            EffectSpell output = new EffectSpell();

            output.affectAlly   = effect.getBoolArray("affectAlly");
            output.affectEnemy  = effect.getBoolArray("affectEnemy");
            output.affectSelf   = effect.getBoolArray("affectSelf");
            output.affectCell   = effect.getBoolArray("affectCell");
            output.minArea      = effect.getIntArray("minArea");
            output.maxArea      = effect.getIntArray("maxArea");
            output.areaType     = SpellData.stringToRangeAreaType(effect.getStringArray("areaType"));
            output.quickHandler = buildEffectHandler(effect.getObjectJSON("quickHandler"));
            output.slowHandler  = buildEffectHandler(effect.getObjectJSON("slowHandler"));
            output.conditions   = buildEffectConditions(effect.getArrayJSON("conditions"));
            return(output);
        }
Ejemplo n.º 9
0
 // this function will check the conditions for each affected entity, and apply if the effect if necessary
 public void resolveSpellEffect(EffectSpell effect, Entity origin, Cell target, bool priority)
 {
     if (areGlobalConditionsValid(effect.conditions))
     {
         if (areOriginConditionsValid(effect.conditions, origin))
         {
             foreach (Cell c in getSpellEffectAffectedCells(effect, origin, target, priority))
             {
                 Entity e = c.currentEntity; // get entity on cell
                 if (e != null)
                 {
                     if (e == origin && effect.affectSelf[priority ? 0 : 1] ||
                         e.teamId != origin.teamId && effect.affectEnemy[priority ? 0 : 1] ||
                         e != origin && e.teamId == origin.teamId && effect.affectAlly[priority ? 0 : 1])
                     {
                         if (areTargetConditionsValid(effect.conditions, e))
                         {
                             if (priority)
                             {
                                 handleEntityEffect(effect.quickHandler, origin, e);
                             }
                             else
                             {
                                 handleEntityEffect(effect.slowHandler, origin, e);
                             }
                         }
                     }
                 }
                 if (effect.affectCell[priority ? 0 : 1])
                 {
                     if (priority)
                     {
                         handleCellEffect(effect.quickHandler, origin, c);
                     }
                     else
                     {
                         handleCellEffect(effect.slowHandler, origin, c);
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 10
0
        public void ParseEffect(string datas, bool CC)
        {
            var List = datas.Split('|');

            foreach (var actualEffect in List)
            {
                if (actualEffect == "-1" | actualEffect == "")
                {
                    continue;
                }

                var effect = new EffectSpell();
                var infos  = actualEffect.Split(';');

                effect.ID     = int.Parse(infos[0]);
                effect.Value  = int.Parse(infos[1]);
                effect.Value2 = int.Parse(infos[2]);
                effect.Value3 = int.Parse(infos[3]);

                if (infos.Length >= 8)
                {
                    effect.Round  = int.Parse(infos[4]);
                    effect.Chance = int.Parse(infos[5]);
                    effect.Effect = infos[6];
                    effect.Target = new EffectSpellTarget(int.Parse(infos[7]));
                }
                else if (infos.Length >= 7)
                {
                    effect.Round  = int.Parse(infos[4]);
                    effect.Chance = int.Parse(infos[5]);
                    effect.Effect = infos[6];
                    effect.Target = new EffectSpellTarget(23);
                }
                else if (infos.Length >= 6)
                {
                    effect.Round  = int.Parse(infos[4]);
                    effect.Chance = int.Parse(infos[5]);
                    effect.Effect = "0d0+0";
                    effect.Target = new EffectSpellTarget(23);
                }
                else if (infos.Length >= 5)
                {
                    effect.Round  = int.Parse(infos[4]);
                    effect.Chance = -1;
                    effect.Effect = "0d0+0";
                    effect.Target = new EffectSpellTarget(23);
                }
                else
                {
                    effect.Round  = 0;
                    effect.Chance = -1;
                    effect.Effect = "0d0+0";
                    effect.Target = new EffectSpellTarget(23);
                }

                if (CC == true)
                {
                    lock (CriticalEffects)
                        CriticalEffects.Add(effect);
                }
                else
                {
                    lock (Effects)
                        Effects.Add(effect);
                }
            }
        }