Example #1
0
    public void Setld(int id)
    {
        this.id = id;
        info    = skillsinfo._instance.GetSkillInfoById(id);
        icon_name_sprite.spriteName = info.icon_name;
        name_label.text             = info.name;
        switch (info.applytype)
        {
        case ApplyType.Passive:
            applytype_label.text = "增益";
            break;

        case ApplyType.Buff:
            applytype_label.text = "增强";
            break;

        case ApplyType.SingleTarget:
            applytype_label.text = "单个目标";
            break;

        case ApplyType.MultiTarget:
            applytype_label.text = "群体技能";
            break;
        }
        des_label.text = info.des;
        mp_label.text  = info.mp + "MP";
    }
Example #2
0
    public SillInfo GetSkillInfoById(int id)
    {
        SillInfo info = null;

        skillinfodict.TryGetValue(id, out info);
        return(info);
    }
Example #3
0
 private void OnMultiTargetSkillUse(SillInfo info)
 {
     state = PlayerState.SillAttak;
     cursoumanager._instance.SetLockTarget();
     isLockingTaret = true;
     this.info      = info;
 }
Example #4
0
 void Onsingletargetskilluse(SillInfo info)
 {
     state = PlayerState.SillAttak;
     cursoumanager._instance.SetLockTarget();
     isLockingTaret = true;
     this.info      = info;
 }
Example #5
0
 public void SetSkill(int id)
 {
     this.id        = id;
     this.skillinfo = skillsinfo._instance.GetSkillInfoById(id);
     icon.gameObject.SetActive(true);
     icon.spriteName = skillinfo.icon_name;
     type            = shortcuttype.Skill;
 }
Example #6
0
    IEnumerator OnbuffskillUse(SillInfo info)
    {
        state = PlayerState.SillAttak;
        animation.CrossFade(info.aniname);
        yield return(new WaitForSeconds(info.anitime));

        state = PlayerState.ControlWalk;
        GameObject prefab = null;

        efxdict.TryGetValue(info.efx_name, out prefab);
        GameObject.Instantiate(prefab, transform.position, Quaternion.identity);

        switch (info.applyProperty)
        {
        case ApplyProperty.Attack:
            ps.attack *= (info.applyValue / 100f);
            break;

        case ApplyProperty.Def:
            ps.def *= (info.applyValue / 100f);
            break;

        case ApplyProperty.Speed:
            move.speed *= (info.applyValue / 100f);
            break;

        case ApplyProperty.AttackSpeed:
            rate_normalattack *= (info.applyValue / 100f);
            break;
        }

        yield return(new WaitForSeconds(info.applyTime));

        switch (info.applyProperty)
        {
        case ApplyProperty.Attack:
            ps.attack /= (info.applyValue / 100f);
            break;

        case ApplyProperty.Def:
            ps.def /= (info.applyValue / 100f);
            break;

        case ApplyProperty.Speed:
            move.speed /= (info.applyValue / 100f);
            break;

        case ApplyProperty.AttackSpeed:
            rate_normalattack /= (info.applyValue / 100f);
            break;
        }
    }
Example #7
0
    public void OndrugUse()
    {
        bool success = inventory._instance.MinusId(id, 1);

        if (success)
        {
            ps.GetDrug(objectinfo.hp, objectinfo.mp);
        }
        else
        {
            type = shortcuttype.None;
            icon.gameObject.SetActive(false);
            id         = 0;
            skillinfo  = null;
            objectinfo = null;
        }
    }
Example #8
0
    IEnumerator OnpassiveSkillUse(SillInfo info)
    {
        state = PlayerState.SillAttak;
        animation.CrossFade(info.aniname);
        yield return(new WaitForSeconds(info.anitime));

        state = PlayerState.ControlWalk;
        int hp = 0, mp = 0;

        if (info.applyProperty == ApplyProperty.HP)
        {
            hp = info.applyValue;
        }
        else if (info.applyProperty == ApplyProperty.MP)
        {
            mp = info.applyValue;
        }
        ps.GetDrug(hp, mp);
        GameObject prefab = null;

        efxdict.TryGetValue(info.efx_name, out prefab);
        GameObject.Instantiate(prefab, transform.position, Quaternion.identity);
    }
Example #9
0
    public void UseSkill(SillInfo info)
    {
        if (ps.heroType == HeroType.Megiclan)
        {
            if (info.applicableRole == ApplicableRole.Swordman)
            {
                return;
            }
        }
        if (ps.heroType == HeroType.Swordman)
        {
            if (info.applicableRole == ApplicableRole.Magician)
            {
                return;
            }
        }

        switch (info.applytype)
        {
        case ApplyType.Passive:
            StartCoroutine(OnpassiveSkillUse(info));
            break;

        case ApplyType.Buff:
            StartCoroutine(OnbuffskillUse(info));
            break;

        case ApplyType.SingleTarget:
            Onsingletargetskilluse(info);
            break;

        case ApplyType.MultiTarget:
            OnMultiTargetSkillUse(info);
            break;
        }
    }
Example #10
0
    void initSkillinfodict()
    {
        string text = skillsinfotext.text;

        string[] skillinfoArray = text.Split('\n');
        foreach (string skillinfoStr in skillinfoArray)
        {
            string[] pa   = skillinfoStr.Split(',');
            SillInfo info = new SillInfo();
            info.id        = int.Parse(pa[0]);
            info.name      = pa[1];
            info.icon_name = pa[2];
            info.des       = pa[3];
            string str_applytype = pa[4];
            switch (str_applytype)
            {
            case "Passive":
                info.applytype = ApplyType.Passive;
                break;

            case "Buff":
                info.applytype = ApplyType.Buff;
                break;

            case "SingleTarget":
                info.applytype = ApplyType.SingleTarget;
                break;

            case "MultiTarget":
                info.applytype = ApplyType.MultiTarget;
                break;
            }
            string str_applypro = pa[5];
            switch (str_applypro)
            {
            case "Attack":
                info.applyProperty = ApplyProperty.Attack;
                break;

            case "Def":
                info.applyProperty = ApplyProperty.Def;
                break;

            case "Speed":
                info.applyProperty = ApplyProperty.Speed;
                break;

            case "AttackSpeed":
                info.applyProperty = ApplyProperty.AttackSpeed;
                break;

            case "HP":
                info.applyProperty = ApplyProperty.HP;
                break;

            case "MP":
                info.applyProperty = ApplyProperty.MP;
                break;
            }
            info.applyValue = int.Parse(pa[6]);
            info.applyTime  = int.Parse(pa[7]);
            info.mp         = int.Parse(pa[8]);
            info.coldTime   = int.Parse(pa[9]);
            switch (pa[10])
            {
            case "Swordman":
                info.applicableRole = ApplicableRole.Swordman;
                break;

            case "Magician":
                info.applicableRole = ApplicableRole.Magician;
                break;
            }
            info.level = int.Parse(pa[11]);
            switch (pa[12])
            {
            case "Self":
                info.releaseType = ReleaseType.Self;
                break;

            case "Enemy":
                info.releaseType = ReleaseType.Enemy;
                break;

            case "Position":
                info.releaseType = ReleaseType.Position;
                break;
            }
            info.distance = float.Parse(pa[13]);
            info.efx_name = pa[14];
            info.aniname  = pa[15];
            info.anitime  = float.Parse(pa[16]);
            skillinfodict.Add(info.id, info);
        }
    }