支持Jass插件的Notepad++编译器下载连接
打印整型数据
function InitDigits takes nothing returns nothing
set digit_str[0]="0"
set digit_str[1]="1"
set digit_str[2]="2"
set digit_str[3]="3"
set digit_str[4]="4"
set digit_str[5]="5"
set digit_str[6]="6"
set digit_str[7]="7"
set digit_str[8]="8"
set digit_str[9]="9"
endfunction
function Int2Str takes integer ic returns string
local string s = ""
local integer i = ic
local integer ialt = 0
local boolean neg = false
if i == 0 then
return "0"
endif
if i < 0 then
set neg = true
set i = -i
endif
loop
exitwhen i == 0
set ialt = i
set i = i / 10
set s = digit_str[ ialt - 10*i ] + s
endloop
if neg then
return "-"+s
endif
return s
endfunction
使用技能
//----有目标 释放技能------------------------------
function CastTargetSkillByOderStr takes unit TheUnit,integer abilcode,string order,unit TheTarget returns boolean
local player ThePlayer=ai_player
local integer PlayerID=GetPlayerId(ThePlayer)
local boolean Casted
call SetPlayerAbilityAvailable(ThePlayer,abilcode,true)
set Casted=IssueTargetOrder(TheUnit,order,TheTarget)
if Casted then
endif
call SetPlayerAbilityAvailable(ThePlayer,abilcode,false)
return(Casted)
endfunction
//----------无目标释放技能-------------------------
function CastImdSkillByStr takes unit TheUnit,integer abilcode,string order returns boolean
local player ThePlayer=ai_player
local integer PlayerID=GetPlayerId(ThePlayer)
local boolean Casted
call SetPlayerAbilityAvailable(ThePlayer,abilcode,true)
set Casted=IssueImmediateOrder(TheUnit,order)
if Casted then
endif
call SetPlayerAbilityAvailable(ThePlayer,abilcode,false)
return(Casted)
endfunction