|
想满足多个条件后,才执行XXXXX
在WE 里很形象的。。但是把它转成 jass(这里不清楚到底叫什么GUI还是jass)
然后发现。。。怎么就不是if xxx and xxx and xxx then xxx呢?
这是原触发:
[codes=jass]function Trig_yyy_______u_Func001Func001C takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(0) ) ) then
return false
endif
if ( not ( IsUnitAliveBJ(GetTriggerUnit()) == true ) ) then
return false
endif
return true
endfunction
function Trig_yyy_______u_Func001C takes nothing returns boolean
if ( not Trig_yyy_______u_Func001Func001C() ) then
return false
endif
return true
endfunction
function Trig_yyy_______u_Actions takes nothing returns nothing
if ( Trig_yyy_______u_Func001C() ) then
call CreateNUnitsAtLoc( 1, 'hfoo', Player(0), GetUnitLoc(GetTriggerUnit()), bj_UNIT_FACING )
else
endif
endfunction
//===========================================================================
function InitTrig_yyy_______u takes nothing returns nothing
set gg_trg_yyy_______u = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_yyy_______u, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddAction( gg_trg_yyy_______u, function Trig_yyy_______u_Actions )
endfunction
[/codes]
能不能写成这样啊?
[codes=jass]function Trig_yyy_______u_Actions takes nothing returns nothing
if ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) and ( GetOwningPlayer(GetTriggerUnit()) == Player(0) ) and ( IsUnitAliveBJ(GetTriggerUnit()) == true ) then
call CreateNUnitsAtLoc( 1, 'hfoo', Player(0), GetUnitLoc(GetTriggerUnit()), bj_UNIT_FACING )
endif
endfunction
[/codes] |
|