[jass]
function HPTZ7 takes integer b returns boolean //任意增加HP
if ( not ( ModuloInteger(b, 1) == 1 ) ) then
return false
endif
return true
endfunction
function HPTZ6 takes integer b returns boolean
if ( not ( ModuloInteger(b, 2) == 1 ) ) then
return false
endif
return true
endfunction
function HPTZ5 takes integer b returns boolean
if ( not ( ModuloInteger(b, 4) == 1 ) ) then
return false
endif
return true
endfunction
function HPTZ4 takes integer b returns boolean
if ( not ( ModuloInteger(b, 8) == 1 ) ) then
return false
endif
return true
endfunction
function HPTZ3 takes integer b returns boolean
if ( not ( ModuloInteger(b, 16) == 1 ) ) then
return false
endif
return true
endfunction
function HPTZ2 takes integer b returns boolean
if ( not ( ModuloInteger(b, 32) == 1 ) ) then
return false
endif
return true
endfunction
function HPTZ1 takes integer b returns boolean
if ( not ( ModuloInteger(b, 64) == 1 ) ) then
return false
endif
return true
endfunction
function HPTZ0 takes unit a,integer b returns nothing
if (HPTZ1(b) ) then
set b = ( b - 64 )
call UnitAddAbilityBJ( 'A006', a )
call SetUnitAbilityLevelSwapped( 'A006', a, 2 )
call UnitRemoveAbilityBJ( 'A006', a )
else
endif
if ( HPTZ2(b) ) then
set b = ( b - 32 )
call UnitAddAbilityBJ( 'A005', a )
call SetUnitAbilityLevelSwapped( 'A005', a, 2 )
call UnitRemoveAbilityBJ( 'A005', a )
else
endif
if ( HPTZ3(b) ) then
set b = ( b - 16 )
call UnitAddAbilityBJ( 'A004', a )
call SetUnitAbilityLevelSwapped( 'A004', a, 2 )
call UnitRemoveAbilityBJ( 'A004', a )
else
endif
if ( HPTZ4(b) ) then
set b = ( b - 8 )
call UnitAddAbilityBJ( 'A003', a )
call SetUnitAbilityLevelSwapped( 'A003', a, 2 )
call UnitRemoveAbilityBJ( 'A003', a )
else
endif
if ( HPTZ5(b) ) then
set b = (b - 4 )
call UnitAddAbilityBJ( 'A002', a )
call SetUnitAbilityLevelSwapped( 'A002', a, 2 )
call UnitRemoveAbilityBJ( 'A002', a )
else
endif
if ( HPTZ6(b) ) then
set b = ( b - 2 )
call UnitAddAbilityBJ( 'A001', a )
call SetUnitAbilityLevelSwapped( 'A001', a, 2 )
call UnitRemoveAbilityBJ( 'A001', a )
else
endif
if ( HPTZ7(b) ) then
call UnitAddAbilityBJ( 'A00A', a )
call SetUnitAbilityLevelSwapped( 'A00A', a, 2 )
call UnitRemoveAbilityBJ( 'A00A', a )
else
endif
endfunction
[/jass] |