爆率控制日志说明:
const char* dropResult = (fAccumulatedProb > fRandom) ? "DROP!" : "MISS";
CacheLog(34, "[Drop] BoxID=%d Prob=%.2f%% Roll=%.2f%% Control=%.0f%% => %s",pDropBox[0], fAccumulatedProb * 100.0, fRandom * 100.0, fControlValue * 100.0, dropResult);
| 参数 |
变量 |
含义 |
%d |
pDropBox[0] |
掉落箱配置ID |
%.2f%% |
fAccumulatedProb * 100.0 |
最终掉落概率(保留2位小数) |
%.2f%% |
fRandom * 100.0 |
本次随机数(保留2位小数) |
%.0f%% |
fControlValue * 100.0 |
个人爆率系数(不保留小数) |
%s |
dropResult |
结果:"DROP!" 或 "MISS" |
判定逻辑:Prob > Roll 则掉落
Prob = Probability = 掉落概率(掉落几率)
Roll = 随机掷骰子的结果(系统随机数)
|