找回密码
 点一下
查看: 2680|回复: 8

求解一个升级系统的问题

[复制链接]
发表于 2010-9-15 11:02:50 | 显示全部楼层 |阅读模式
[jass]
function WeaponProficientActions takes nothing returns nothing
local unit u = GetKillingUnitBJ()
local player p = GetOwningPlayer(u)
set udg_Rifle[0] = GetUnitAbilityLevelSwapped('Aven',u)
if GetUnitTypeId(u)=='Hpal' then
call DisplayTextToPlayer(GetOwningPlayer(u),0.0,0.0, I2S(udg_WeaponProficient[1])+ "/30")
set udg_WeaponProficient[1] = udg_WeaponProficient[1]+1
if udg_WeaponProficient[1]>=30 then
set udg_WeaponProficient[1]=0
call SetPlayerTechResearched(p,'Rovs',GetPlayerTechCount(p,'Rovs',true)+1)
call IncUnitAbilityLevel(u,'Aven')
call DisplayTextToPlayer(GetOwningPlayer(u),0.0,0.0, "|cffcd950cALICE|r : 你的武器精通已达到" + I2S(udg_Rifle[0]) + "级")
endif
endif
endfunction

function WeaponProInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterPlayerUnitEventSimple(t,Player(13),EVENT_PLAYER_UNIT_DEATH)
call TriggerRegisterPlayerUnitEventSimple(t,Player(14),EVENT_PLAYER_UNIT_DEATH)
call TriggerAddAction(t,function WeaponProficientActions)
endfunction

//===========================================================================
function InitTrig_Weapon_Proficient takes nothing returns nothing
endfunction
[/jass]

编译无错误,但是在地图运行时不起作用,个人觉得是在取得凶手单位的地方出了问题,但是不知道何解.
发表于 2010-9-15 20:08:58 | 显示全部楼层
call DisplayTextToPlayer(GetOwningPlayer(u),0.0,0.0, I2S(udg_WeaponProficient[1])+ "/30")
set udg_WeaponProficient[1] = udg_WeaponProficient[1]+1
//先显示,后赋值,于是你显示的总比真实的少1

set udg_Rifle[0] = GetUnitAbilityLevelSwapped('Aven',u)
...
call DisplayTextToPlayer(GetOwningPlayer(u),0.0,0.0, "|cffcd950cALICE|r : 你的武器精通已达到" + I2S(udg_Rifle[0]) + "级")
//这两句之间并没有任何能够让udg_Rifle[0]改变的语句,所以显示的等级永远落后实际一级
回复

使用道具 举报

 楼主| 发表于 2010-9-15 20:57:23 | 显示全部楼层
稍微改了下,这样如何

[jass]
if GetUnitTypeId(u)=='Hpal' then
        set udg_WeaponProficient[1] = udg_WeaponProficient[1]+1
        call DisplayTextToPlayer(GetOwningPlayer(u),0.0,0.0, I2S(udg_WeaponProficient[1])+ "/30"
        if udg_WeaponProficient[1]>=30 then
                set udg_WeaponProficient[1]=0
                if GetPlayerTechCount(p,'Rovs',true)==0 then
                    call SetPlayerTechResearched(p,'Rovs',1)
                else
                    call SetPlayerTechResearched(p,'Rovs',GetPlayerTechCount(p,'Rovs',true)+1)
                    call IncUnitAbilityLevel(u,'Aven')
                endif
                call DisplayTextToPlayer(GetOwningPlayer(u),0.0,0.0, "|cffcd950cALICE|r : 你的武器精通已达到" + I2S(udg_Rifle[0]+1) + "级")
         endif
[/jass]
回复

使用道具 举报

发表于 2010-9-15 21:25:02 | 显示全部楼层
call IncUnitAbilityLevel(u,'Aven')
set udg_Rifle[0] = GetUnitAbilityLevelSwapped('Aven',u) //提升技能等级时紧挨着这么一句就好了

以我对1.3和SO的了解,这个应该是一个技能等级随武器精通慢慢提升的东西吧?
而如果按我说的这么改... 可能会出现一个怪现象... 就是一个怪没杀技能等级1,第一次杀满30,提升1级科技,但不会提升技能等级,第二次杀满30时,科技和技能等级提升到2???
回复

使用道具 举报

 楼主| 发表于 2010-9-15 21:59:28 | 显示全部楼层
好吧我在某处加了个+1
[jass]call DisplayTextToPlayer(GetOwningPlayer(u),0.0,0.0, "|cffcd950cALICE|r : 你的步枪精通已达到" + I2S(udg_Rifle[0]+1) + "级")[/jass]

然后调试的时候囧了..
2010915215407.jpg
第一次升级直接2级?
2010915215601.jpg
继续
   2010915215616.jpg
2010915215628.jpg
但是这里没问题了
2010915215644.jpg

也就是说 第一次升级和第二次升级是不会变的(两次所需要的XP都是20而不会像后面继续递增20/40/60/...),我把某地方也变了下代码,但是不至于会出这种问题吧?
[jass]
        call DisplayTextToPlayer(GetOwningPlayer(u),0.0,0.0, I2S(udg_WeaponProficient[1])+ "/" + I2S(20*udg_Rifle[0]))
            if udg_WeaponProficient[1]>=20*udg_Rifle[0] then
[/jass]
回复

使用道具 举报

发表于 2010-9-15 22:09:11 | 显示全部楼层
太喜欢亡者之夜了...
AM哪都好,就是我笨玩不明白...
回复

使用道具 举报

发表于 2010-9-15 22:13:28 | 显示全部楼层

回 4楼(kimjongmin) 的帖子

没看明白...
怎么升级应该是你说了算的啊
...

看了你的签名后,我有点难过...
回复

使用道具 举报

 楼主| 发表于 2010-9-15 22:24:11 | 显示全部楼层
好吧求帮助解决4L说了那问题.
按键盘"←"在地图上方刷10个怪出来.

囧,那签名早该变了我懒得改而已..(我还是改了吧)

Bugreport.w3x

83 KB, 下载次数: 3

回复

使用道具 举报

发表于 2011-12-28 00:31:16 | 显示全部楼层
一起交流!楼主给咱们提供机会了








bet365备用88885188.com
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-2 07:31 , Processed in 0.139166 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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