|
life,mana,Um是全局变量。
function Wind takes nothing returns nothing
if ( GetUnitTypeId(GetFilterUnit()) == 'XXX1' ) then
set life = GetUnitState( GetFilterUnit(),UNIT_STATE_LIFE)
set mana = GetUnitState( GetFilterUnit(),UNIT_STATE_MANA)
call ReplaceUnitBJ( GetFilterUnit(), 'XXX2, bj_UNIT_STATE_METHOD_RELATIVE )
set Um = GetLastReplacedUnitBJ()
call DisplayTextToPlayer( Player(0), 0, 0, "Um life1"+R2S(life) )
call DisplayTextToPlayer( Player(0), 0, 0, "Um mana1"+R2S(mana) )
call SetUnitLifeBJ(Um,life)
call SetUnitManaBJ(Um,mana)
call DisplayTextToPlayer( Player(0), 0, 0, "Um life2"+R2S(life) )
call DisplayTextToPlayer( Player(0), 0, 0, "Um mana2"+R2S(mana) )
endif
endfunction
Um life1,
Um mana1,
Um life2,
Um mana2,
输出值不一样。
2比1正好大1000(计算小数)
最初使用的是
call SetUnitLifeBJ(Um,GetUnitState( GetFilterUnit(),UNIT_STATE_LIFE) )
也是这个问题 |
|