Merge branch 'master_dev' into master_otnew

master_otnew
grimm 2023-12-25 16:40:24 +08:00
commit c9bd854717
2 changed files with 7 additions and 3 deletions

View File

@ -112,7 +112,7 @@ public class MainLineOrInnerDemonFightHandler implements IFightEventProcesor {
*/
public static void setFailTime(int uid, int type, int time){
int failTime = getFailTime(uid, type);
if (failTime != 0){
if (time != 0 && failTime != 0){
return;
}
// redis记录key
@ -125,14 +125,18 @@ public class MainLineOrInnerDemonFightHandler implements IFightEventProcesor {
*
*/
public static double getDownNum(int uid, int type){
int nowInt = TimeUtils.nowInt();
// 耗时(分)/ 减少比例
int[] timeDowns = SSpecialConfig.getIntegerArrayValue("Level_Time_Down");
// 最大减少比例
int maxDown = SSpecialConfig.getIntegerValue("Level_Time_Maxdown");
// 失败时间
int failTime = getFailTime(uid, type);
if (failTime == 0){
failTime = nowInt;
}
// 按照分钟计算减免系数
int minutesTime = failTime / 1000 / timeDowns[0];
int minutesTime = (nowInt - failTime) / 60 / timeDowns[0];
// 万分比
double downTime = 1 - (Math.min(minutesTime * timeDowns[1], maxDown) / 10000d);
LOGGER.info("关卡挑战战力降低日志uid{},类型:{},系数:{}",uid, type, downTime);

View File

@ -580,10 +580,10 @@ public class CBean2Proto {
StringBuilder monsterSkillList = new StringBuilder(); //火风水地光暗
float[] damageReduceFactor = sMonsterConfig.getElementDamageReduceFactor();
monsterPropertyList.append(sMonsterConfig.getLevel()).append("#"); //等级
monsterPropertyList.append(curHp).append("#"); //生命
// 减免系数
double downNum = MainLineOrInnerDemonFightHandler.getDownNum(uid, type);
// 只减免前这四项
monsterPropertyList.append(Math.round(curHp * downNum)).append("#"); //生命
monsterPropertyList.append(Math.round(sMonsterConfig.getHp() * downNum)).append("#"); //最大生命
monsterPropertyList.append(Math.round(sMonsterConfig.getAttack() * downNum)).append("#");//攻击力
monsterPropertyList.append(Math.round(sMonsterConfig.getPhysicalDefence() * downNum)).append("#"); //护甲