public void CallbackCannonballHit(Vector3 location)
    {
        SkillBase skillData = SkillBaseData.GetSkillBaseData(SkillNames.CANNON);
        float     radius    = skillData.radius;

        // TODO FIXME so do we want it to vary per cannonball, or per enemy hit?
        // my initiol reaction is it should be that the physical damage done to each
        // enemy is what varies, even within a single cannonball shot
        gameController.DoAOEGroundDamage(location, radius, skillData);

        // GENERATE PARTICLES :) (needs to me moved / reworked)
        // lots of optimization to happen here
        int numOfParticles = 40;

        for (int i = 0; i < numOfParticles; i++)
        {
            // create ground particles
            Vector2    particleCircle = Random.insideUnitCircle * radius;
            float      particleX      = location.x + particleCircle.x;
            float      particleZ      = location.z + particleCircle.y;
            GameObject particle       = ObjectPoolHelper.Instantiate(pGroundParticle, new Vector3(particleX, 0, particleZ), Quaternion.identity);
            particle.GetComponent <Rigidbody> ().velocity = new Vector3(0, 3, 0);

            float spin = 100f;
            particle.GetComponent <Rigidbody> ().AddTorque(new Vector3(Random.Range(-spin, spin), Random.Range(-spin, spin), Random.Range(-spin, spin)));
        }
    }
    public CdType[] GetCDRealseCondition()
    {
        List <CdType> cdTypes  = new List <CdType>();
        SkillBaseData baseData = m_SkillData.BaseData.Value;

        for (int i = 0; i < baseData.CdDatasLength; ++i)
        {
            CdData cdData = baseData.CdDatas(i).Value;
            cdTypes.Add(cdData.CdType);
        }

        return(cdTypes.ToArray());
    }
    public CdType[] GetSkillReleaseCDTypes(int skillID)
    {
        SkillData     skillData = GetSkillData(skillID);
        SkillBaseData baseData  = skillData.BaseData.Value;

        List <CdType> cdTypes = new List <CdType>();

        for (int i = 0; i < baseData.CdDatasLength; ++i)
        {
            CdData cdData = baseData.CdDatas(i).Value;
            cdTypes.Add(cdData.CdType);
        }

        return(cdTypes.ToArray());
    }
Beispiel #4
0
 public void SetUp(SkillBaseData data)
 {
     if (null != data)
     {
         icon.gameObject.SetActive(true);
         icon.sprite       = Resources.Load <Sprite>("UI/SkillIcon/" + data.Name);
         foreground.sprite = Resources.Load <Sprite>("UI/SkillIcon/" + data.Name);
         maxCooltime       = data.cooltime;
     }
     else
     {
         icon.sprite       = null;
         foreground.sprite = null;
         maxCooltime       = 0.0f;
     }
 }
Beispiel #5
0
    public override BaseData DeepCopy()
    {
        base.DeepCopy();

        SkillBaseData copy = new SkillBaseData();

        copy.skillType  = this.skillType;
        copy.targetType = this.targetType;
        copy.stateName  = this.stateName;
        copy.cooltime   = this.cooltime;
        copy.manaCost   = this.manaCost;
        copy.duration   = this.duration;
        copy.percentage = this.percentage;

        return(copy);
    }
Beispiel #6
0
    private void CheckSkillKeyPress()
    {
        for (int i = 0; i < skillKeybinds.Count; i++)
        {
            if (Input.GetKeyDown(skillKeybinds[i]))
            {
                if (currentSkills[i] == "")
                {
                    Debug.Log("There is no skill bound to this key right now.");
                    continue;
                }

                string pressedSkillName = currentSkills[i];
                Debug.Log(pressedSkillName);
                SkillBase skillBase = SkillBaseData.GetSkillBaseData(pressedSkillName);
                GetComponent <SkillActionController> ().executeSkill(skillBase, i);
            }
        }
    }
 public void SetData(object data)
 {
     m_BaseData   = (SkillBaseData)data;
     m_DataDrawer = new ObjectDrawer("Base Data", m_BaseData);
 }