예제 #1
0
    public void Recover(bool all)
    {
        if (!IsAlive)
        {
            return;
        }
        if (all)
        {
            if (status.Count != 0)
            {
                StatuInfo temp_f = new StatuInfo(Statu.Falled, status.Find(s => s.Statu == Statu.Falled).Duration);
                status.Clear();
                if (temp_f != null)
                {
                    status.Add(temp_f);
                }
            }

            /*if (buffs.Count != 0)
             *  for (int i = 0; i < buffs.Count; i++)
             *  {
             *      if (buffs[i].isDebuff) buffs.Remove(buffs[i]);
             *  }*/
            IsTired     = false;
            IsExhausted = false;
        }
        Current_HP          = HP;
        Current_MP          = MP;
        Current_Endurance   = Endurance;
        current_BlockAmount = BlockAmount;
    }
 bool SetStatu(StatuInfo sinfo)
 {
     if (PlayerInfo.status == null)
     {
         PlayerInfo.status = new List <StatuInfo>();
     }
     return(PlayerInfo.SetStatu(sinfo));
 }
예제 #3
0
    bool SetStatu(StatuInfo sinfo)
    {
        if (sinfo == null || SuperArmor)
        {
            return(false);
        }
        if (status == null)
        {
            status = new List <StatuInfo>();
        }
        if (CheckStatuRes(sinfo.Statu)) /* Debug.Log("抵抗了状态" + sinfo.statu_name);*/ return {
            (false);
        }                                                                                           //如果抵抗了该状态
        //Debug.Log("设置了状态:" + sinfo.Statu.ToString() + ",持续时间为:" + sinfo.Duration);
        if (sinfo.Statu == Statu.Giddy && status.Exists(s => s.Statu == Statu.Falled))
        {
            return(false);
        }
        if (sinfo.Statu == Statu.Falled && status.Exists(s => s.Statu == Statu.Giddy))
        {
            CleanStatu(Statu.Giddy);
        }
        if (status.Exists(s => s.Statu == sinfo.Statu))
        {
            return(false);
        }
        status.Add(sinfo);
        switch (sinfo.Statu)
        {
        case Statu.BlockBroken: IsBlockBroken = true; break;

        case Statu.Giddy: IsGiddy = true; break;

        case Statu.Falled: IsDown = true; break;

        case Statu.Rigidity:
            IsRigid = true;
            enemyLocmAgent.enemyAnima.speed            = 0;
            enemyLocmAgent.enemyController.controlAble = false;
            break;
        }
        status.Sort((x, y) => { if (x.Statu > y.Statu)
                                {
                                    return(-1);
                                }
                                else if (x.Statu == y.Statu)
                                {
                                    return(0);
                                }
                                else
                                {
                                    return(1);
                                } });
        return(true);
    }
예제 #4
0
    public string GetEffectText(bool next)
    {
        bool   getFormat = false;
        string temp      = string.Empty;
        string format    = string.Empty;

        foreach (char c in effectFormat)
        {
            if (c == '[' && !getFormat)
            {
                getFormat = true;
            }
            else
            {
                if (getFormat)
                {
                    if (c != ']')
                    {
                        format += c;
                    }
                    else
                    {
                        getFormat = false;
                        if (!next)
                        {
                            switch (format)
                            {
                            case "ATKM": temp += "<color=red>" + attackMultiple + "%</color>"; break;

                            case "ATKS": temp += "<color=red>" + subMultiple + "%</color>"; break;

                            case "HREC": temp += "<color=red>" + recHPWhenHit + "</color>"; break;

                            case "MREC": temp += "<color=red>" + recMPWhenHit + "</color>"; break;

                            case "STA": temp += "<color=red>" + StatuInfo.GetStatuName(attachStatu) + "</color>"; break;

                            case "STAR": temp += "<color=red>" + statuRate + "%</color>"; break;

                            case "STAD": temp += "<color=red>" + statuDuration + "秒</color>"; break;
                            }
                        }
                        else
                        {
                            switch (format)
                            {
                            case "ATKM": temp += "<color=red>" + (attackMultiple + Add_ATKMult) + "%</color>"; break;

                            case "ATKS": temp += "<color=red>" + subMultiple + "%</color>"; break;

                            case "HREC": temp += "<color=red>" + (recHPWhenHit + Add_ATKMult) + "</color>"; break;

                            case "MREC": temp += "<color=red>" + (recMPWhenHit + Add_MPRec) + "</color>"; break;

                            case "STA": temp += "<color=red>" + StatuInfo.GetStatuName(attachStatu) + "</color>"; break;

                            case "STAR": temp += "<color=red>" + (statuRate + Add_StatuRate) + "%</color>"; break;

                            case "STAD": temp += "<color=red>" + (statuDuration + Add_StatuDura) + "秒</color>"; break;
                            }
                        }
                        format = string.Empty;
                    }
                }
                else
                {
                    temp += c;
                }
            }
        }
        return(temp);
    }
예제 #5
0
 public static int GetDamaged(bool forPlayer, PlayerInfo player, EnemyInfoAgent enemy, SkillInfoAgent skillInfo, out DamageType damageType, out StatuInfo statuInfo, bool hurtForward)
 {
     if (!enemy || !skillInfo)
     {
         Debug.Log(skillInfo);
         damageType = DamageType.Miss;
         statuInfo  = new StatuInfo(Statu.None, 0);
         return(0);
     }
     statuInfo = new StatuInfo(Statu.None, 0);
     if (!forPlayer)
     {
         if (!Probability(80 + player.Hit - enemy.Dodge - player.Level - enemy.Level))
         {
             damageType = DamageType.Miss; return(0);
         }
         damageType = DamageType.Hit;
         float finallyValue = (player.ATK - enemy.DEF * (skillInfo.isCD ? skillInfo.attackMultiple / 100 : (skillInfo.attackMultiple * (1 - skillInfo.subMultiple * 0.01f) / 100)));
         //Debug.Log(skillInfo.attackMultiple * (1 - skillInfo.subMultiple * 0.01f) / 100);
         finallyValue = finallyValue > 1 ? finallyValue : 1;
         if (enemy.IsDown /*|| player.IsFloat*/ || !hurtForward)
         {
             finallyValue *= 2;
             if (!hurtForward)
             {
                 damageType = DamageType.HurtBackward;
             }
         }
         else if (enemy.IsGiddy)
         {
             finallyValue = finallyValue * 1.5f;
         }
         if (Probability((20 + enemy.Crit) < 60 ? (20 + enemy.Crit) : 60))
         {
             finallyValue *= 2; damageType = DamageType.Crit;
         }
         if (enemy.IsBlocking && hurtForward)
         {
             damageType = DamageType.Block;
             enemy.Current_BlockAmount -= System.Convert.ToInt32(finallyValue);
             if (enemy.Current_BlockAmount == 0)
             {
                 damageType = DamageType.BlockBroken;
             }
             return(0);
         }
         if (skillInfo.statuEffcted && skillInfo.isCDWhenUse)
         {
             statuInfo.Statu    = skillInfo.attachStatu;
             statuInfo.Duration = skillInfo.statuDuration;
         }
         if (skillInfo.isCDWhenUse)
         {
             player.Current_HP += skillInfo.recHPWhenHit;
             player.Current_MP += skillInfo.recMPWhenHit;
         }
         return(System.Convert.ToInt32(finallyValue));
     }
     else
     {
         if (!Probability(80 + enemy.Hit - player.Dodge - enemy.Level - player.Level))
         {
             damageType = DamageType.Miss; return(0);
         }
         damageType = DamageType.Hit;
         float finallyValue = (enemy.ATK - player.DEF * (skillInfo.isCD ? skillInfo.attackMultiple / 100 : (skillInfo.attackMultiple * (1 - skillInfo.subMultiple * 0.01f) / 100)));
         finallyValue = finallyValue > 1 ? finallyValue : 1;
         if (player.IsDown /*|| player.IsFloat*/ || !hurtForward)
         {
             finallyValue *= 2;
             if (!hurtForward)
             {
                 damageType = DamageType.HurtBackward;
             }
         }
         else if (player.IsGiddy)
         {
             finallyValue = finallyValue * 1.5f;
         }
         if (Probability((20 + player.Crit) < 60 ? (20 + player.Crit) : 60))
         {
             finallyValue *= 2; damageType = DamageType.Crit;
         }
         if (player.IsBlocking && hurtForward)
         {
             damageType                  = DamageType.Block;
             player.Current_MP          += System.Convert.ToInt32(player.MP * 0.05f);
             player.Current_BlockAmount -= System.Convert.ToInt32(finallyValue);
             if (player.Current_BlockAmount == 0)
             {
                 damageType = DamageType.BlockBroken;
             }
             return(0);
         }
         if (skillInfo.statuEffcted)
         {
             statuInfo.Statu    = skillInfo.attachStatu;
             statuInfo.Duration = skillInfo.statuDuration;
         }
         return(System.Convert.ToInt32(finallyValue));
     }
 }