找回密码
 点一下
查看: 1230|回复: 3

jass_不知怎么写单位死亡和被暂停.

[复制链接]
发表于 2008-11-23 19:33:49 | 显示全部楼层 |阅读模式
    [codes=jass]
    local timer t = GetExpiredTimer()
    local unit u = I2U(GetStoredInteger(GameCache(),I2S(H2I(t)),"TriggerUnit"))
    local unit ua = CreateUnit(GetOwningPlayer(u),'n00G',GetUnitX(u),GetUnitY(u),0.00)
    local integer steps = GetStoredInteger(GameCache(),I2S(H2I(t)),"steps")
    local real ux = GetUnitX(u)
    local real uy = GetUnitY(u)
    local real angle = GetStoredReal(GameCache(),I2S(H2I(t)),"angle")
    local real x
    local real y
    set steps = steps + 1
    if (not(IsUnitPaused(u) == false)) then
    set steps = 29
    endif
    if (not(GetUnitState(u,UNIT_STATE_LIFE) >= 0)) then
    set steps = 29
    endif
    call StoreInteger(GameCache(),I2S(H2I(t)),"steps",steps)
    if steps < 29 then
    set x = ux+50*Cos(3.14159/180*angle)
    set y = uy+50*Sin(3.14159/180*angle)
        if x > udg_Map_X_Max then
        set x = udg_Map_X_Max
        endif
    call SetUnitX(u,x)
    call SetUnitY(u,y)
    else
    call UnitRemoveType(u,UNIT_TYPE_GIANT)
    call PauseTimer(t)
    call DestroyTimer(t)
    call FlushStoredMission(GameCache(),I2S(H2I(t)))
    call IssueImmediateOrderById(u,852127)
    endif
    endif[/codes]
我想单位被暂停和被杀死(血等于0时)就设置set steps = 50(即停止触发).该怎么写?
    if (not(GetUnitState(u,UNIT_STATE_LIFE) >= 0)) then把这句改为<=0,就是set steps = 50,如果把这句改为
>=0,貌似不等于set steps = 50.我该怎么写.
发表于 2008-11-24 17:45:38 | 显示全部楼层
是并列还是任意成立?前者是:

if (IsUnitPaused(u)) and (GetUnitState(u,UNIT_STATE_LIFE)<=0) then
xxx
endif

后者把and改成or就行了。
回复

使用道具 举报

 楼主| 发表于 2008-11-25 12:37:50 | 显示全部楼层
[codes=jass]if (not())then
[/codes]not是啥?
回复

使用道具 举报

发表于 2008-11-25 17:05:17 | 显示全部楼层
not么就是非,就是true变成false,false变成true
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-7-21 10:30 , Processed in 0.254843 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表