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

歡迎光臨散文網(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ó)家法律
夏津县| 竹山县| 白朗县| 济阳县| 宣威市| 武定县| 新泰市| 龙里县| 太和县| 莱阳市| 那曲县| 常宁市| 聊城市| 博兴县| 应城市| 台山市| 五原县| 班玛县| 斗六市| 永康市| 郸城县| 嵩明县| 明水县| 连城县| 鄯善县| 项城市| 嵊泗县| 山西省| 缙云县| 金寨县| 海城市| 磐安县| 庐江县| 五家渠市| 庄浪县| 渝北区| 屏边| 绥德县| 涞源县| 鲁山县| 天水市|