|
楼主 |
发表于 2024-10-14 12:43:53
|
显示全部楼层
//重新改进了下代码,之前写的有些情况没考虑全
if(passiveobj.getPassiveObjectIndex() == 48081)
{
local BonusRate = sq_GetCurrentAttackBonusRate(passiveobj) ;
local attackInfo = sq_GetCurrentAttackInfo(passiveobj);
local DamageRate = getCurrentModuleDamageRate(parentChr);
local ReduceRate = 0;
local FinalRate = BonusRate;
if (DamageRate == 1 )
{
FinalRate = BonusRate;
}else if(DamageRate < 1 ){
ReduceRate = (100/DamageRate).tointeger();
FinalRate = ReduceRate - 100;
}else if(DamageRate > 1 ){
ReduceRate = (100/DamageRate).tointeger();
FinalRate = BonusRate - ReduceRate;
}
sq_SetCurrentAttackBonusRate(attackInfo, FinalRate);
} |
|