示例#1
0
    void Fire()
    {
        //GameInformation.PlayerEnergy -= 20;
        //Soon it will be subtracting from the player information.
        // for stuff like thatr
        // Creates to many of them, i have to destroy the floating text before, etc.
        //AbilityCreatorClass abilityCreator = new AbilityCreatorClass(ID, projector);
        CalcDamage();
        AbilityInformation ability = new AbilityInformation();

        ability.channelled            = new ChannelledAbilities();
        bulletInst                    = Instantiate(bullet, GameObject.Find("BulletSpawn").transform.position, GameObject.Find("BulletSpawn").transform.rotation);
        bulletInst.transform.position = GameObject.Find("BulletSpawn").transform.position;
        bulletInst.GetComponent <Rigidbody>().velocity = bulletInst.transform.forward * 50;
        bulletInst.AddComponent <Damage>();
        bulletInst.AddComponent <AbiliyCont>();
        bulletInst.GetComponent <Damage>().SetDamage((int)ability.channelled.GetDamage(damage, (int)GameInformation.CritChance));// will change this number to a crit modifer * the scalar.
        if (GameObject.FindGameObjectWithTag("Summon"))
        {
            GameObject[] temp = GameObject.FindGameObjectsWithTag("Summon");
            for (int i = 0; i < temp.Length; i++)
            {
                Physics.IgnoreCollision(temp[i].GetComponent <Collider>(), bulletInst.GetComponent <Collider>());
            }
        }
        hasAttacked = true;
    }
示例#2
0
    public static List <List <Skill> > LoadCharacterAbilitySets()
    {
        List <List <Skill> > characterAbilitySetArray = new List <List <Skill> >();
        Ability abilityInstance = Ability.Instance;

        for (int i = 0; i < GameManager.numberOfCharacters; i++)
        {
            List <Skill> abilitySet = new List <Skill>();

            try {
                string   jsonString  = File.ReadAllText(Application.persistentDataPath + characterAbilitySetSavePaths[i]);
                string[] separator   = new string[] { "}" };
                string[] jsonStrings = jsonString.Split(separator, StringSplitOptions.RemoveEmptyEntries);

                // Append the "}" back onto each string
                for (int j = 0; j < 3; j++)
                {
                    jsonStrings[j] += "}";
                }

                foreach (string js in jsonStrings)
                {
                    AbilityInformation ai = JsonUtility.FromJson <AbilityInformation>(js);
                    Skill s = abilityInstance.GetSkillsByUniqueId(ai.stylesEnum, ai.uniqueId);
                    abilitySet.Add(s);
                }

                characterAbilitySetArray.Add(abilitySet);
            } catch (Exception e) {
                characterAbilitySetArray.Add(abilitySet);
            }
        }
        return(characterAbilitySetArray);
    }
示例#3
0
    void Fire() // Blast Ability
    {
        AbilityInformation ability = new AbilityInformation();

        ability.blast = new BlastAbilities();
        bulletInst    = Instantiate(projectile, gameObject.transform.GetChild(0).transform.position, gameObject.transform.GetChild(0).transform.rotation);
        bulletInst.transform.position = gameObject.transform.GetChild(0).transform.position;
        bulletInst.GetComponent <Rigidbody>().velocity = bulletInst.transform.forward * 50;
        bulletInst.AddComponent <Damage>();
        bulletInst.AddComponent <AbiliyCont>();
        GameObject[] temp = GameObject.FindGameObjectsWithTag("Summon");
        for (int i = 0; i < temp.Length; i++)
        {
            Physics.IgnoreCollision(bulletInst.GetComponent <Collider>(), temp[i].GetComponent <Collider>());
        }
        Physics.IgnoreCollision(bulletInst.GetComponent <Collider>(), summoner.GetComponent <Collider>());
        bulletInst.GetComponent <Damage>().SetDamage(((int)ability.blast.GetDamage(summon.BaseDamage, (int)GameInformation.CritChance)) / 5);// will change this number to a crit modifer * the scalar.
        if (isAttackHeals)
        {
            if (GameInformation.PlayerHealth + summon.HealAmount > GameInformation.PlayerMaxHp)
            {
                GameInformation.PlayerHealth = GameInformation.PlayerMaxHp;
            }
            else
            {
                float tempAmount = summon.HealAmount * Random.Range(0.95f, 0.98f);
                GameInformation.PlayerHealth += (int)tempAmount;
            }
        }
    }
示例#4
0
    void ChannelledAttack()
    {
        AbilityInformation ability = new AbilityInformation()
        {
            channelled = new ChannelledAbilities()
        };

        if (!channelledProj.activeInHierarchy)
        {
            // Going to be set from the suit so its not implemented yet
            channelledProj.SetActive(true);
            StartCoroutine(Duration(summon.ChannelledDuration, channelledProj));
        }
    }
示例#5
0
    void HealFire() // Healing ability..but it is a blast
    {
        AbilityInformation ability = new AbilityInformation();

        ability.sustained           = new SustainedAbilities();
        healInst                    = Instantiate(healprojectile, gameObject.transform.GetChild(0).transform.position, gameObject.transform.GetChild(0).transform.rotation);
        healInst.transform.position = gameObject.transform.GetChild(0).transform.position;
        healInst.GetComponent <Rigidbody>().velocity = healInst.transform.forward * 50;
        if (!healInst.GetComponent <Healing>())
        {
            healInst.AddComponent <Healing>();
        }
        healInst.AddComponent <AbiliyCont>();
        healInst.GetComponent <Healing>().SetHealing(((int)ability.sustained.GetHealing((int)(summon.CritChance))) / 5, this.gameObject);// will change this number to a crit modifer * the scalar.
    }
示例#6
0
    void Fire()
    {
        AbilityInformation ability = new AbilityInformation();

        ability.blast = new BlastAbilities();
        GameObject bulletSpawn = transform.GetChild(1).gameObject;

        bulletSpawn.tag = "EnemyProj";
        // Going to be on enemy change this.
        bulletInst = Instantiate(bullet, bulletSpawn.transform.position, bulletSpawn.transform.rotation);
        bulletInst.transform.position = bulletSpawn.transform.position;
        bulletInst.GetComponent <Rigidbody>().velocity = bulletInst.transform.forward * 50;
        bulletInst.AddComponent <Damage>();
        bulletInst.GetComponent <Damage>().SetDamage((int)ability.blast.GetEnemyDamage(30, 2, enemy));
        //Debug.Log("Once");
        //bulletInst.GetComponent<Damage>().SetDamage((enemy.MainStat*enemy.PlayerLevel)*enemy.Agility);
    }
示例#7
0
    void Fire()
    {
        CalcDamage();
        AbilityInformation ability = new AbilityInformation();

        ability.blast = new BlastAbilities();
        bulletInst    = Instantiate(bullet, GameObject.Find("BulletSpawn").transform.position, GameObject.Find("BulletSpawn").transform.rotation);
        bulletInst.transform.position = GameObject.Find("BulletSpawn").transform.position;
        bulletInst.GetComponent <Rigidbody>().velocity = bulletInst.transform.forward * 50;
        bulletInst.AddComponent <Damage>();
        bulletInst.GetComponent <Damage>().SetDamage((int)ability.blast.GetDamage(damage, (int)GameInformation.CritChance));
        if (GameObject.FindGameObjectWithTag("Summon"))
        {
            GameObject[] temp = GameObject.FindGameObjectsWithTag("Summon");
            for (int i = 0; i < temp.Length; i++)
            {
                Physics.IgnoreCollision(temp[i].GetComponent <Collider>(), bulletInst.GetComponent <Collider>());
            }
        }
        hasAttacked = true;
    }
示例#8
0
 public void GetShieldBuff()
 {
     ability      = new AbilityInformation();
     ability.buff = new BuffAbilities();
     ability.buff.SetCase(BuffAbilities.BuffTtype.SHIELD, 0.3f, duration);
 }