2024-09-16 17:09:36 +08:00
|
|
|
/*
|
|
|
|
|
文件名:GetDamageRate.nut
|
|
|
|
|
路径:Base/CallBack/GetDamageRate.nut
|
|
|
|
|
创建日期:2024-08-09 14:10
|
|
|
|
|
文件用途:获取伤害倍率
|
|
|
|
|
*/
|
2024-11-15 10:32:19 +08:00
|
|
|
RindroDamageRate <- 1.0;
|
|
|
|
|
|
2024-09-16 17:09:36 +08:00
|
|
|
function L_getCurrentModuleDamageRate(obj) {
|
|
|
|
|
if (!obj)
|
|
|
|
|
return 1.0;
|
|
|
|
|
|
|
|
|
|
local ClientRat = 1.0;
|
|
|
|
|
try {
|
|
|
|
|
ClientRat = getCurrentModuleDamageRate(obj).tofloat();
|
|
|
|
|
} catch (exception) {
|
|
|
|
|
ClientRat = 1.0;
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-15 10:32:19 +08:00
|
|
|
return (RindroDamageRate * ClientRat);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Lenheart_GetDamageRate_Fun(obj) {
|
|
|
|
|
//在城镇时
|
|
|
|
|
if (sq_GetCurrentModuleType() == 1) {
|
|
|
|
|
RindroDamageRate = 1.0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//修改伤害回调
|
|
|
|
|
function SetDamageRateCallBack(Chunk) {
|
|
|
|
|
local Jso = Json.Decode(Chunk);
|
|
|
|
|
RindroDamageRate = Jso.rate;
|
|
|
|
|
}
|
|
|
|
|
Pack_Control.rawset(2024110902, SetDamageRateCallBack);
|
|
|
|
|
|
|
|
|
|
getroottable()["LenheartFuncTab"].rawset("GetDamageRateFuncN", Lenheart_GetDamageRate_Fun);
|