예제 #1
0
    public override void SetEffect(BattleCharacter target, Dictionary <BattleCharacter, List <FloatingNumberData> > floatingNumberDic)
    {
        HitType hitType = CheckHit(_user, target.Info, target.LiveState);

        if (Data.Target == SkillData.TargetType.Us) //目標為我方則必中
        {
            hitType = HitType.Hit;
        }

        if (hitType != HitType.Miss)
        {
            target.SetBuff(Data.StatusID, Lv);
        }

        string text = "";

        FloatingNumber.Type floatingNumberType = FloatingNumber.Type.Other;

        if (hitType == HitType.Hit)
        {
            floatingNumberType = FloatingNumber.Type.Other;
            text = BattleStatusData.GetData(Data.StatusID).Message;
        }
        else if (hitType == HitType.Miss)
        {
            floatingNumberType = FloatingNumber.Type.Miss;
            text = "Miss";
        }

        _floatingNumberDic = floatingNumberDic;
        SetFloatingNumberDic(target, floatingNumberType, text);

        CheckSubSkill(target, hitType);
    }
예제 #2
0
    public override void SetEffect(BattleCharacter target, Dictionary <BattleCharacter, List <FloatingNumberData> > floatingNumberDic)
    {
        HitType hitType = CheckHit(_user, target.Info, target.LiveState);

        if (hitType != HitType.Miss)
        {
            target.Info.SetPoison(_poison, CalculateDamage(target.Info));
        }

        string text = "";

        FloatingNumber.Type floatingNumberType = FloatingNumber.Type.Other;

        if (hitType == HitType.Hit)
        {
            floatingNumberType = FloatingNumber.Type.Poison;
            text = BattleStatusData.GetData(Data.StatusID).Message;
        }
        else if (hitType == HitType.Miss)
        {
            floatingNumberType = FloatingNumber.Type.Miss;
            text = "Miss";
        }

        _floatingNumberDic = floatingNumberDic;
        SetFloatingNumberDic(target, floatingNumberType, text);

        CheckSubSkill(target, hitType);
    }
예제 #3
0
    public NoDamage(int id)
    {
        Data = BattleStatusData.GetData(id);

        RemainTurn = Data.Turn;
        Comment    = Data.Comment;
        Message    = Data.Message;
        Icon       = Data.Icon;
    }
예제 #4
0
    public override void SetEffect(BattleCharacter target, Dictionary <BattleCharacter, List <FloatingNumberData> > floatingNumberDic)
    {
        HitType hitType = CheckHit(_user, target.Info, target.LiveState);

        if (Data.Target == SkillData.TargetType.Us) //目標為我方則必中
        {
            hitType = HitType.Hit;
        }

        if (hitType != HitType.Miss)
        {
            target.SetStriking(Data.StatusID);
        }

        string text = "";

        FloatingNumber.Type floatingNumberType = FloatingNumber.Type.Other;

        if (hitType == HitType.Hit)
        {
            floatingNumberType = FloatingNumber.Type.Other;
            text = BattleStatusData.GetData(Data.StatusID).Message;
        }
        else if (hitType == HitType.Miss)
        {
            floatingNumberType = FloatingNumber.Type.Miss;
            text = "Miss";
        }

        _floatingNumberDic = floatingNumberDic;
        SetFloatingNumberDic(target, floatingNumberType, text);

        CheckSubSkill(target, hitType);

        //Timer timer1 = new Timer(Data.ShowTime / 2f, () =>
        //{
        //    if (hitType != Skill.HitType.Miss)
        //    {
        //        target.SetStriking(Data.StatusID);

        //        BattleUI.Instance.SetFloatingNumber(target, BattleStatusData.GetData(Data.StatusID).Message, FloatingNumber.Type.Other);
        //    }
        //    else
        //    {
        //        BattleUI.Instance.SetFloatingNumber(target, "Miss", FloatingNumber.Type.Miss);
        //    }
        //});

        //Timer timer2 = new Timer(_floatingNumberTime + Data.ShowTime / 2f, () =>
        //{
        //    CheckSubSkill(target, hitType);
        //});
    }
예제 #5
0
    public override void SetEffect(BattleCharacter target, Dictionary <BattleCharacter, List <FloatingNumberData> > floatingNumberDic)
    {
        HitType hitType = HitType.Hit;

        BattleController.Instance.ActAgain(target);

        string text = "";

        FloatingNumber.Type floatingNumberType = FloatingNumber.Type.Other;

        floatingNumberType = FloatingNumber.Type.Other;
        text = BattleStatusData.GetData(Data.StatusID).Message;
        _floatingNumberDic = floatingNumberDic;
        SetFloatingNumberDic(target, floatingNumberType, text);

        CheckSubSkill(target, hitType);
    }
예제 #6
0
    public void SetBuff(int id, int lv)
    {
        if (Status == null)
        {
            BattleController.Instance.TurnEndHandler += CheckRemainTurn;
        }

        BattleStatusData.RootObject data = BattleStatusData.GetData(id);
        if ((int)data.ValueType <= 7)
        {
            Status = new Buff(id, lv);
        }
        else if (data.ValueType == BattleStatusData.TypeEnum.NoDamage)
        {
            Status = new NoDamage(id);
        }
        BuffTileName = data.Field;
        TilePainter.Instance.Painting(data.Field, 1, Position);
    }
예제 #7
0
    public Paralysis(int id, int lv)
    {
        int value = 0;

        Data = BattleStatusData.GetData(id);
        if (Data.ValueList.Count > lv)
        {
            value = Data.ValueList[lv - 1];
        }
        else
        {
            value = Data.ValueList[0];
        }

        Probability = value;
        RemainTurn  = Data.Turn;
        Comment     = Data.Comment;
        Message     = Data.Message;
        Icon        = Data.Icon;
    }
예제 #8
0
    public Buff(int id, int lv)
    {
        Data = BattleStatusData.GetData(id);
        Type = Data.ValueType;
        if (Data.ValueList.Count >= lv)
        {
            Value = Data.ValueList[lv - 1];
        }
        else
        {
            Value = Data.ValueList[0];
        }

        if (Data.ValueType != BattleStatusData.TypeEnum.MOV)
        {
            Value /= 100f;
        }

        RemainTurn = Data.Turn;
        Message    = Data.Message;
        Icon       = Data.Icon;

        Comment = Data.GetComment(lv);
    }
예제 #9
0
    public void SetData(SkillData.RootObject data, int lv)
    {
        NameLabel.text      = data.GetName();
        LvLabel.text        = "Lv." + lv;
        MPLabel.text        = "MP:" + data.MP;
        CDLabel.text        = "冷卻:" + data.CD;
        AddPowerLabel.text  = "增加 Power:" + data.AddPower;
        NeedPowerLabel.text = "需要 Power:" + data.NeedPower;
        CommentLabel.text   = data.GetComment();

        if (data.ValueList.Count > 0)
        {
            if (data.Type == SkillData.TypeEnum.Attack)
            {
                DamageLabel.text = "傷害:" + data.ValueList[lv - 1];
            }
            else
            {
                DamageLabel.text = "回復:" + data.ValueList[lv - 1];
            }
        }
        else
        {
            DamageLabel.text = "傷害:" + 0;
        }
        if (data.Target == SkillData.TargetType.Us)
        {
            TargetLabel.text = "目標:我方";
        }
        else if (data.Target == SkillData.TargetType.Them)
        {
            TargetLabel.text = "目標:敵方";
        }
        else if (data.Target == SkillData.TargetType.All)
        {
            TargetLabel.text = "目標:全體";
        }

        BattleStatusTitlle.gameObject.SetActive(true);
        for (int i = 0; i < BattleStatusComment.Length; i++)
        {
            if (data != null)
            {
                if (data.StatusID != 0)
                {
                    BattleStatusData.RootObject statusData = BattleStatusData.GetData(data.StatusID);
                    if ((int)statusData.ValueType <= 7)
                    {
                        BattleStatusComment[i].gameObject.SetActive(true);
                        BattleStatusComment[i].text = statusData.GetComment(lv);
                    }
                    else
                    {
                        BattleStatusComment[i].gameObject.SetActive(false);
                    }
                }
                else
                {
                    BattleStatusComment[i].gameObject.SetActive(false);
                }

                if (data.SubID != 0)
                {
                    data = SkillData.GetData(data.SubID);
                }
                else
                {
                    data = null;
                }
            }
            else
            {
                BattleStatusComment[i].gameObject.SetActive(false);
            }
        }
    }
예제 #10
0
    private void SetData(SkillData.RootObject data, int lv)
    {
        _data          = data;
        NameLabel.text = data.GetName();
        NameLabel.transform.parent.gameObject.SetActive(true);
        LvLabel.text = lv.ToString();
        LvLabel.transform.parent.gameObject.SetActive(true);
        MPLabel.text = data.MP.ToString();
        MPLabel.transform.parent.gameObject.SetActive(true);
        HitRateLabel.text   = "命中:" + data.HitRate + "%";
        CDLabel.text        = "冷卻:" + data.CD;
        AddPowerLabel.text  = "增加 Power:" + data.AddPower;
        NeedPowerLabel.text = "需要 Power:" + data.NeedPower;
        CommentLabel.text   = data.GetComment();

        if (data.ValueList.Count > 0)
        {
            if (data.Type == SkillData.TypeEnum.Attack)
            {
                DamageLabel.text = "傷害:" + data.ValueList[lv - 1];
            }
            else
            {
                DamageLabel.text = "回復:" + data.ValueList[lv - 1];
            }
        }
        else
        {
            DamageLabel.text = "傷害:" + 0;
        }
        if (data.Target == SkillData.TargetType.Us)
        {
            TargetLabel.text = "目標:我方";
        }
        else if (data.Target == SkillData.TargetType.Them)
        {
            TargetLabel.text = "目標:敵方";
        }
        else if (data.Target == SkillData.TargetType.All)
        {
            TargetLabel.text = "目標:全體";
        }

        if (lv < data.MaxLv)
        {
            ItemAmountLabel.gameObject.SetActive(true);
            UpgradeButton.gameObject.SetActive(true);

            if (lv == 1)
            {
                _currentItemAmount          = ItemManager.Instance.GetItemAmount(_bookId_1, _itemManagerType);
                NeedBookLabel.text          = "初級技能書";
                NeedBookIcon.overrideSprite = Resources.Load <Sprite>("Image/Item/Book_1");
                _consumeBookId = _bookId_1;
            }
            else if (lv == 2)
            {
                _currentItemAmount          = ItemManager.Instance.GetItemAmount(_bookId_2, _itemManagerType);
                NeedBookLabel.text          = "中級技能書";
                NeedBookIcon.overrideSprite = Resources.Load <Sprite>("Image/Item/Book_2");
                _consumeBookId = _bookId_2;
            }
            else if (lv == 3)
            {
                _currentItemAmount          = ItemManager.Instance.GetItemAmount(_bookId_3, _itemManagerType);
                NeedBookLabel.text          = "高級技能書";
                NeedBookIcon.overrideSprite = Resources.Load <Sprite>("Image/Item/Book_3");
                _consumeBookId = _bookId_3;
            }

            if (_currentItemAmount < 1)
            {
                UpgradeButton.GetComponent <Image>().color = Color.gray;
                ItemAmountLabel.text = "<color=#FF0000>" + _currentItemAmount + "</color>/" + 1;
            }
            else
            {
                UpgradeButton.GetComponent <Image>().color = Color.white;
                ItemAmountLabel.text = _currentItemAmount + "/" + 1;
            }
        }
        else
        {
            ItemAmountLabel.gameObject.SetActive(false);
            UpgradeButton.gameObject.SetActive(false);
        }

        BattleStatusTitlle.gameObject.SetActive(true);

        for (int i = 0; i < BattleStatusComment.Length; i++)
        {
            BattleStatusComment[i].gameObject.SetActive(false);
        }

        for (int i = 0; i < BattleStatusComment.Length; i++)
        {
            if (data != null)
            {
                if (data.StatusID != 0)
                {
                    BattleStatusData.RootObject statusData = BattleStatusData.GetData(data.StatusID);
                    BattleStatusComment[i].gameObject.SetActive(true);
                    BattleStatusComment[i].text = statusData.GetComment(lv);
                }
                else
                {
                    i--;
                }

                if (data.SubID != 0)
                {
                    data = SkillData.GetData(data.SubID);
                }
                else
                {
                    data = null;
                }
            }
            else
            {
                break;
            }
        }
    }