Example #1
0
    private static void FillMonsterSpellInfo(DevMobSpellBase devSpell, JSONNode node)
    {
        node["key"] = devSpell.Key.ToString();

        for (int b = 0; b < devSpell.Perks.Count; b++)
        {
            node["perks"][b]["key"]   = devSpell.Perks[b].Key.ToString();
            node["perks"][b]["value"] = devSpell.Perks[b].Value.ToString();
        }

        for (int b = 0; b < devSpell.SpawnMobs.Length; b++)
        {
            node["spawnMobs"][b] = devSpell.SpawnMobs[b];
        }

        for (int b = 0; b < devSpell.HitIfTargetHasBuff.Count; b++)
        {
            node["hitIfTargetHasBuff"][b] = devSpell.HitIfTargetHasBuff[b];
        }

        for (int b = 0; b < devSpell.ClearTargetBuffs.Count; b++)
        {
            node["clearTargetBuffs"][b] = devSpell.ClearTargetBuffs[b];
        }
    }
Example #2
0
File: Enemy.cs Project: Tzook/lel
    public virtual void Initialize(string instanceID, DevMonsterInfo givenInfo, int currentHP = 0)
    {
        Info = new EnemyInfo(givenInfo, instanceID);
        Info.CurrentHealth = currentHP;
        SpellInCast        = null;

        if (Body != null && initScale == Vector3.zero)
        {
            initScale = Body.localScale;
        }

        RegisterEnemy();

        if (m_AlphaGroup != null)
        {
            m_AlphaGroup.SetAlpha(1f);
        }

        CheckMobAggro();
    }
Example #3
0
File: Enemy.cs Project: Tzook/lel
    public void CastSpellComplete()
    {
        if (SpellInCast == null || string.IsNullOrEmpty(SpellInCast.ColliderPrefab))
        {
            SpellInCast = null;
            return;
        }

        GameObject tempObj = ResourcesLoader.Instance.GetRecycledObject(SpellInCast.ColliderPrefab);

        if (SpellSource != null)
        {
            tempObj.transform.position = SpellSource.position;
        }
        else
        {
            tempObj.transform.position = transform.position;
        }

        tempObj.GetComponent <EnemyDamageInstance>().SetInfo(this, SpellInCast.Key);

        Anim.SetBool("CastingSpell", false);
        SpellInCast = null;
    }
Example #4
0
File: Enemy.cs Project: Tzook/lel
 public void ActivateSpell(DevMobSpellBase spellRef)
 {
     Anim.SetTrigger(spellRef.Key);
     SpellInCast = spellRef;
 }