找回密码
 点一下
查看: 1121|回复: 6

一个奇怪问题

[复制链接]
发表于 2008-4-23 21:18:17 | 显示全部楼层 |阅读模式
正常放还好的技能
在时间变为夜晚的瞬间会非常卡
而且在夜晚伤害似乎变得无效了
技能本身没有问题
以上就是最重要的问题了


技能效果为 献祭开启后 范围敌人会得到一个技能 该技能为魔法书
里面包含伤害自己的永久献祭

同时不断检查是否有受到灼伤的单位的友军在他身边
如果有则该单位也会受到灼伤

代码如下


//单位检查传染火焰伤害
function UnStopFire takes nothing returns nothing
    if  ( IsUnitAliveBJ(GetFilterUnit()) == true ) and ( GetUnitAbilityLevel(GetFilterUnit(), 'A02N') == 0 )  and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_Unit)) == false )then
    call UnitAddAbility( GetFilterUnit(), 'A02N' )
    call SetUnitAbilityLevel( GetFilterUnit(), 'A02M', GetUnitAbilityLevel(udg_Unit, 'A02M'))
    call ExecuteFunc( "FireBridge")
    endif
endfunction

function AddUnStopFire takes nothing returns nothing
    local timer t1 =GetExpiredTimer()
    local unit ua =GetHandleUnit(t1,"Fire_ua1")
    if  ( GetUnitAbilityLevel(ua, 'A02N') != 0 ) then
    set udg_Unit = ua
    call GroupEnumUnitsInRange(udg_G_TempGroup, GetUnitX(ua), GetUnitY(ua) , 300, Condition(function UnStopFire) )  
    else
    call PauseTimer( t1 )
    call DestroyTimer( t1 )
    call UnitRemoveAbility( ua , 'A02N' )
    set t1 = null   
    endif
endfunction
//单位检查传染火焰伤害

//单位删除火焰伤害
function DelUnStopFire takes nothing returns nothing
    local timer t2 =GetExpiredTimer()
    local unit ua =GetHandleUnit(t2,"Fire_ua2")
    call PauseTimer( t2 )
    call DestroyTimer( t2 )
    call UnitRemoveAbility( ua , 'A02N' )
    set t2 = null
endfunction
//单位删除火焰伤害

//单位添加火焰伤害
function Fire_Working takes unit ua returns nothing
    local timer t1 = CreateTimer()
    local timer t2 = CreateTimer()
    local integer lv = GetUnitAbilityLevel(ua, 'A02M')
    call SetHandleHandle(t1,"Fire_ua1",ua)
    call TimerStart(t1,1.0,true,function AddUnStopFire)  
    call SetHandleHandle(t2,"Fire_ua2",ua)
    call TimerStart(t2,15.0,false,function DelUnStopFire)  
    set t1 = null
    set t2 = null
endfunction
//单位添加火焰伤害

function FireBridge takes nothing returns nothing
    call Fire_Working(GetFilterUnit())
endfunction




function Fire takes nothing returns nothing
    if ( IsUnitAliveBJ(GetFilterUnit()) == true ) and ( GetUnitAbilityLevel(GetFilterUnit(), 'A02N') == 0 ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_Unit)) == true ) then
    call UnitAddAbility( GetFilterUnit(), 'A02N' )
    call SetUnitAbilityLevel( GetFilterUnit(), 'A02M', GetUnitAbilityLevel(udg_Unit, 'A02L'))
    call Fire_Working(GetFilterUnit())
    endif
endfunction

function EmUnStopFire takes nothing returns nothing
    local timer t =GetExpiredTimer()
    local unit ua =GetHandleUnit(t,"Fire_ua")
    if ( GetUnitAbilityLevel(ua, 'BNeg') != 0 )  then
    set udg_Unit = ua
    call GroupEnumUnitsInRange(udg_G_TempGroup, GetUnitX(ua), GetUnitY(ua) , 300, Condition(function Fire) )  
    else
    call PauseTimer(t)
    call DestroyTimer(t)
    set t = null   
    endif
endfunction

function UnStopFire_Actions takes unit ua returns nothing
    local timer t = CreateTimer()
    call SetHandleHandle(t,"Fire_ua",ua)
    call TimerStart(t,0.75,true,function EmUnStopFire)   
    set t = null
endfunction

function UnStopFire_Conditions takes nothing returns nothing
    if ( ( GetUnitTypeId(GetTriggerUnit()) == 'Nfir' ) and ( GetIssuedOrderIdBJ() == String2OrderIdBJ("immolation")) )  then
    call UnStopFire_Actions(GetTriggerUnit())
    endif
endfunction

//===========================================================================
function InitTrig_UnStopFire takes nothing returns nothing
    set gg_trg_UnStopFire = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_UnStopFire, EVENT_PLAYER_UNIT_ISSUED_ORDER )
    call TriggerAddCondition( gg_trg_UnStopFire, Condition( function UnStopFire_Conditions ) )
endfunction
发表于 2008-4-23 21:47:26 | 显示全部楼层
看着大段的程序代码现在眼睛就发木……
想问LZ一下为什么不直接利用献祭这个技能而一定要用敌方单位获得灼烧自己的魔法书效果呢?
到了夜晚因为有一些东西需要重新计算,所以肯定会卡的吧……
至于到了夜晚无效的问题……暂时没想到什么……
回复

使用道具 举报

 楼主| 发表于 2008-4-23 21:50:59 | 显示全部楼层
回LS 因为献祭技能有图标
不过现在我不添加BUFF说明 用了负生命恢复戒指 效果就正常了
回复

使用道具 举报

发表于 2008-4-23 21:55:11 | 显示全部楼层
引用第2楼280259078于2008-04-23 21:50发表的  :
回LS 因为献祭技能有图标
不过现在我不添加BUFF说明 用了负生命恢复戒指 效果就正常了
恩……懂了,明白LZ的意思了,效果正常了就好,不过如果把那个图标改一下成为隐藏的LZ觉得怎么样呢?个人意见哈……
回复

使用道具 举报

发表于 2008-4-23 23:22:05 | 显示全部楼层
为什么要用永久的献祭?
用施法单位  放  带有持续伤害的 首发伤害为0的技能 可行么?
凤凰火焰 又怎么样?
回复

使用道具 举报

发表于 2008-4-23 23:52:12 | 显示全部楼层
JASS没有高亮看着不爽
SetHandleHandle是什么函数?
回复

使用道具 举报

发表于 2008-4-23 23:53:07 | 显示全部楼层
看这个名字估计是return bug+gamecache的自定义函数吧
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-10-7 03:19 , Processed in 0.033130 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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