最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

jass基礎(chǔ)-農(nóng)場(chǎng)加錢漂字

2023-08-12 23:15 作者:龐各莊大棚  | 我要投稿

#include "../../jass/BlizzardAPI.j"

library demo initializer test

? ? // 漂浮文字案例 - 農(nóng)場(chǎng)加錢漂字

? ? globals

? ? ? ? integer nm = 'h003'

? ? ? ? integer nc1 = 'h001'

? ? ? ? integer nc2 = 'h002'

? ? ? ? integer nc3 = 'h000'


? ? ? ? integer maxCount = 5

? ? ? ? hashtable ht

? ? ? ? timer tm = null

? ? ? ? unit array farmArr

? ? endglobals


? ? function doSomething takes nothing returns nothing


? ? endfunction


? ? function addMoney takes nothing returns nothing

? ? ? ? local integer i = 0

? ? ? ? local texttag tt

? ? ? ? loop

? ? ? ? ? ? exitwhen i >= maxCount

? ? ? ? ? ? if farmArr[i] != null then

? ? ? ? ? ? ? ? call SetPlayerState(Player(0), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(Player(0), PLAYER_STATE_RESOURCE_GOLD) + LoadInteger(ht, StringHash("農(nóng)場(chǎng)"), GetUnitTypeId(farmArr[i])))

? ? ? ? ? ? ? ? set tt = CreateTextTagUnitBJ("+" + I2S(LoadInteger(ht, StringHash("農(nóng)場(chǎng)"), GetUnitTypeId(farmArr[i]))), farmArr[i], 0, 14, 0, 100, 0, 0)

? ? ? ? ? ? ? ? call SetTextTagVelocityBJ(tt, 50, 90)

? ? ? ? ? ? ? ? call SetTextTagLifespan(tt, 2)

? ? ? ? ? ? ? ? call SetTextTagFadepoint(tt, 1)

? ? ? ? ? ? ? ? call SetTextTagPermanent(tt, false)

? ? ? ? ? ? endif

? ? ? ? ? ? set i = i + 1

? ? ? ? endloop

? ? ? ? set tt = null

? ? endfunction


? ? function getFreeIndex takes nothing returns integer

? ? ? ? local integer i = 0

? ? ? ? loop

? ? ? ? ? ? exitwhen i >= maxCount

? ? ? ? ? ? if farmArr[i] == null then

? ? ? ? ? ? ? ? return i

? ? ? ? ? ? endif

? ? ? ? ? ? set i = i + 1

? ? ? ? endloop

? ? ? ? return - 1

? ? endfunction


? ? function buildAction takes nothing returns nothing

? ? ? ? local integer index = getFreeIndex()

? ? ? ? if tm == null then

? ? ? ? ? ? set tm = CreateTimer()

? ? ? ? ? ? call TimerStart(tm, 1, true, function addMoney)

? ? ? ? endif

? ? ? ? set farmArr[index] = GetTriggerUnit()

? ? endfunction


? ? function deathAction takes nothing returns nothing

? ? ? ? local unit u = GetTriggerUnit()

? ? ? ? local integer i = 0

? ? ? ? loop

? ? ? ? ? ? exitwhen i >= maxCount

? ? ? ? ? ? if farmArr[i] == u then

? ? ? ? ? ? ? ? set farmArr[i] = null

? ? ? ? ? ? ? ? return

? ? ? ? ? ? endif

? ? ? ? ? ? set i = i + 1

? ? ? ? endloop

? ? ? ? set u = null

? ? endfunction


? ? function triggerInit takes nothing returns nothing

? ? ? ? local trigger t = CreateTrigger()

? ? ? ? local trigger t2 = CreateTrigger()

? ? ? ? local trigger t3 = CreateTrigger()

? ? ? ? call TriggerRegisterPlayerChatEvent(t, Player(0), "1", true)

? ? ? ? call TriggerAddAction(t, function doSomething)


? ? ? ? call TriggerRegisterAnyUnitEventBJ(t2, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH)

? ? ? ? call TriggerAddAction(t2, function buildAction)


? ? ? ? call TriggerRegisterAnyUnitEventBJ(t3, EVENT_PLAYER_UNIT_DEATH)

? ? ? ? call TriggerAddAction(t3, function deathAction)

? ? ? ? set t = null

? ? ? ? set t2 = null

? ? ? ? set t3 = null

? ? endfunction


? ? function gameInit takes nothing returns nothing

? ? ? ? call FogEnable(false)

? ? ? ? call FogMaskEnable(false)

? ? ? ? set ht = InitHashtable()

? ? ? ? call SaveInteger(ht, StringHash("農(nóng)場(chǎng)"), nc1, 5)

? ? ? ? call SaveInteger(ht, StringHash("農(nóng)場(chǎng)"), nc2, 10)

? ? ? ? call SaveInteger(ht, StringHash("農(nóng)場(chǎng)"), nc3, 15)

? ? ? ? call CreateUnit(Player(0), nm, 0, 0, 0)

? ? ? ? call SetPlayerState(Player(0), PLAYER_STATE_RESOURCE_GOLD, 10000)

? ? ? ? call SetPlayerState(Player(0), PLAYER_STATE_RESOURCE_LUMBER, 10000)

? ? ? ? call SetPlayerTechMaxAllowed(Player(0), nc1, maxCount)

? ? endfunction


? ? function test takes nothing returns nothing

? ? ? ? call gameInit()

? ? ? ? call triggerInit()

? ? endfunction

endlibrary

jass基礎(chǔ)-農(nóng)場(chǎng)加錢漂字的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
河西区| 屯昌县| 靖安县| 德江县| 衢州市| 石渠县| 保康县| 聊城市| 安平县| 长汀县| 永城市| 新源县| 扶风县| 东乡族自治县| 荆门市| 余姚市| 麻阳| 临潭县| 荣昌县| 嫩江县| 黎平县| 富蕴县| 贞丰县| 即墨市| 景德镇市| 深水埗区| 平谷区| 黑龙江省| 西华县| 桂东县| 化州市| 南召县| 玉屏| 沁水县| 股票| 贵德县| 额尔古纳市| 故城县| 金溪县| 庆安县| 金平|