|
发表于 2008-3-4 12:18:38
|
显示全部楼层
恩,IssueXXXOrder类的函数就是发布命令(有无目标、点目标、单位目标等,就是XXX的内容),这个函数是有返回值的,为布尔类,这个返回值就是指命令发布是否成功的(昨天蕾妮大人解答的,恩)
在这个演示里,把那个IsUnitInvulnerable触发转化成j,用下面的代码覆盖就好了
[codes=jass]function Trig_IsUnitInvulnerable_Func001C takes nothing returns boolean
if ( not ( IssueTargetOrder(gg_unit_e000_0000, "fingerofdeath", GetTriggerUnit()) == false ) ) then
return false
endif
if ( not ( IsUnitHiddenBJ(GetTriggerUnit()) == false ) ) then
return false
endif
return true
endfunction
function Trig_IsUnitInvulnerable_Actions takes nothing returns nothing
if ( Trig_IsUnitInvulnerable_Func001C() ) then
call BJDebugMsg( ( GetUnitName(GetTriggerUnit()) + "是有敌的" ) )
else
call BJDebugMsg( ( GetUnitName(GetTriggerUnit()) + "是无敌的" ) )
endif
call IssueImmediateOrderBJ( gg_unit_e000_0000, "stop" )
endfunction
//===========================================================================
function InitTrig_IsUnitInvulnerable takes nothing returns nothing
set gg_trg_IsUnitInvulnerable = CreateTrigger( )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_IsUnitInvulnerable, Player(0), true )
call TriggerAddAction( gg_trg_IsUnitInvulnerable, function Trig_IsUnitInvulnerable_Actions )
endfunction[/codes] |
|