Example #1
0
    //场景物件按照0点防御来算.
    int CalcDamage(MeteorUnit attacker, AttackDes attack = null)
    {
        //(((武器攻击力 + buff攻击力) x 招式攻击力) / 100) - (敌方武器防御力 + 敌方buff防御力) / 10
        //你的攻击力,和我的防御力之间的计算
        //attacker.damage.PoseIdx;
        if (GameStateMgr.Ins.gameStatus.EnableGodMode)
        {
            return(100000);
        }
        int       DefTmp = 0;
        AttackDes atk    = attacker.CurrentDamage;

        if (atk == null)
        {
            atk = attack;
        }
        if (atk == null)
        {
            Debug.LogError("CalcDamage can not find attackdes");
            return(1);
        }
        int WeaponDamage = attacker.CalcDamage();
        int PoseDamage   = MenuResLoader.Ins.FindOpt(atk.PoseIdx, 3).second[0].flag[6];
        int BuffDamage   = attacker.Attr.CalcBuffDamage();
        int realDamage   = Mathf.FloorToInt((((WeaponDamage + BuffDamage) * PoseDamage) / 100.0f - (DefTmp)));

        return(realDamage);
    }
Example #2
0
    //场景物件按照0点防御来算.
    int CalcDamage(MeteorUnit attacker)
    {
        //(((武器攻击力 + buff攻击力) x 招式攻击力) / 100) - (敌方武器防御力 + 敌方buff防御力) / 10
        //你的攻击力,和我的防御力之间的计算
        //attacker.damage.PoseIdx;
        int       DefTmp       = 0;
        AttackDes atk          = attacker.CurrentDamage;
        int       WeaponDamage = attacker.CalcDamage();
        int       PoseDamage   = MenuResLoader.Instance.FindOpt(atk.PoseIdx, 3).second[0].flag[6];
        int       BuffDamage   = attacker.Attr.CalcBuffDamage();
        int       realDamage   = Mathf.FloorToInt((((WeaponDamage + BuffDamage) * PoseDamage) / 100.0f - (DefTmp)));

        return(realDamage);
    }
 IEnumerator Refresh()
 {
     while (true)
     {
         if (target != null)
         {
             scriptTemplate.text = "脚本文件:" + target.Attr.NpcTemplate + ".pst";
             ID.text             = "角色编号:" + target.InstanceId;
             HP.text             = "气血:" + target.Attr.hpCur + "/" + target.Attr.HpMax;
             Position.text       = "坐标:" + string.Format("{0:f2},{1:f2}, {2:f2}", target.transform.position.x, target.transform.position.y, target.transform.position.z);
             Angry.text          = "怒气:" + target.AngryValue;
             Att.text            = "攻击力:" + (target.CalcDamage() + target.Attr.CalcBuffDamage());
             Def.text            = "防御力:" + (target.CalcDef() + target.Attr.CalcBuffDef());
             Speed.text          = "速度:" + target.Speed;
             Target.text         = "锁定目标:" + (target.GetLockedTarget() != null ? target.GetLockedTarget().name : "-");
             ActionFrame.text    = string.Format("动作源{0:d1}-动作ID{1}-帧:{2}", target.posMng.mActiveAction.SourceIdx, target.posMng.mActiveAction.Idx, target.charLoader.curIndex);
         }
         yield return(0);
     }
 }