Beispiel #1
0
    //船体摧毁率
    //lb 建筑损失数
    //fb 建筑总数
    //lh 英雄损失数
    //fh 英雄总数
    //ls 炮弹兵损失数
    //fs 炮弹兵总数
    //策划文档:PVP战斗胜负结算说明
    private static int CALC_BOAT_DESTROYRATE(int lb, int fb, int lh, int fh, int ls, int fs)
    {
        /*
         * UnityEngine.Debug.Log(String.Format(
         *      "建筑损失数={0},建筑总数={1},英雄损失数={2},  英雄总数={3},炮弹兵损失数={4} , 炮弹兵总数={5}",
         *                                  lb,fb,lh,fh,ls,fs));
         */
        int   k1     = ConfigM.GetBoatCombatK(1);
        int   k2     = ConfigM.GetBoatCombatK(2);
        int   k3     = ConfigM.GetBoatCombatK(3);
        float a      = k1 * lb + k2 * lh + k3 * ls;
        float b      = k1 * fb + k2 * fh + k3 * fs;
        int   result = (int)(NdUtil.IDivide(a, b) * 100);

        //UnityEngine.Debug.Log("boatDamate="+result);
        return(result);
    }
Beispiel #2
0
 /// <summary>
 /// 魔法暴击率
 /// </summary>
 /// <param name="Attackphycrit">攻击方魔法暴击值</param>
 /// <param name="Defensecritagainst">防御方暴击调整值</param>
 private static float CALC_SOLDIER_MAGICCRITS(int AttackMagiccrit, int DefenseCritagainst)
 {
     return(NdUtil.IDivide(AttackMagiccrit, DefenseCritagainst));
 }
Beispiel #3
0
 /// <summary>
 /// 物理暴击率
 /// </summary>
 /// <param name="Attackphycrit">攻击方物理暴击值</param>
 /// <param name="DefenseCritagainst">防御方暴击调整值</param>
 private static float CALC_SOLDIER_PHYCRITS(int AttackPhycrit, int DefenseCritagainst)
 {
     return(NdUtil.IDivide(AttackPhycrit, DefenseCritagainst));
 }