新将,血量计算修改

back_recharge
duhui 2020-12-28 11:03:39 +08:00
parent 70dec4bc49
commit 225e58e5ee
1 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,7 @@ public class NewGeneralAttackHandler extends BaseHandler<ActivityProto.NewGenera
// 读表
int monsterGroupId = newHeroConfig.getMonsterGroup(); //怪物id
float bossBlood = 0; //怪物血量
long bossBlood = 0; //怪物血量
int[][] hurtList = newHeroConfig.getDropCell(); //伤害奖励表
SMonsterGroup sMonsterGroup = SMonsterGroup.getsMonsterGroupMap().get(monsterGroupId);
@ -101,7 +101,7 @@ public class NewGeneralAttackHandler extends BaseHandler<ActivityProto.NewGenera
// 设置小数点后4位
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(4);
float lessBlood = 0;
long lessBlood = 0;
// checkResult第一位输赢1赢其他输
if (checkResult[0] == 1){
lessBlood = bossBlood;
@ -114,7 +114,7 @@ public class NewGeneralAttackHandler extends BaseHandler<ActivityProto.NewGenera
}
// 伤害/血量 用float表示
String blood = numberFormat.format(lessBlood/bossBlood);
String blood = numberFormat.format((float)lessBlood/(float)bossBlood);
// 表里面配置的伤害是万分比所以这里的概率乘以10000
float b = Float.parseFloat(blood)*10000;