WE变量命名规范 |
|
前缀 |
缩写 | 作用域 | 实际前缀 | 说明 |
(无) | local | (无) | 局部变量。注意局部变量与全局变量同名时会产生一些莫名其妙的错误 |
(无) | global | udg_ | 临时变量。只要不用wait,脚本不会同时执行的,所以一般情况下用这种变量 |
g | global | udg_g_ | 全局变量(global/game)。如:g_EnemyTypeArr |
s | global | udg_s_{函数}_ | 静态变量(static/shared)。某些函数需要静态变量 |
a | global | udg_a_{技能}_ | 触发器技能的全局性变量。如:a_CLZ_fDamage |
后缀 |
缩写 | 说明 | |
(无) | 普通变量(非数组) | |
Arr | 数组 | |
变量类型前缀 |
缩写 | WE变量类型 | JASS变量类型 | JASS类型基类 | 类型说明 | 释放(GUI) | 释放(Blizzard.j) | 释放(common.j) |
i | Integer | integer | | 整型 | Automatic | Automatic | Automatic |
f | Real | real | | 实数型 | Automatic | Automatic | Automatic |
b | Boolean | boolean | | 布尔型 | Automatic | Automatic | Automatic |
s | String | string | | 字符串型 | Automatic | Automatic | Automatic |
h | Handle | handle | | 句柄 | | | |
pfn | Function | code | | 程序代码(函数指针) | | | |
icAbi | Ability | *abilcode | integer | 技能(代码) | Automatic | Automatic | Automatic |
icBff | Buff | *buffcode | integer | 魔法效果(代码) | Automatic | Automatic | Automatic |
icDst | Destructible-Type | *destructablecode | integer | 可破坏物-类型(代码) | Automatic | Automatic | Automatic |
icImg | Image Type | *imagetype | integer | 图像类型(代码) | Automatic | Automatic | Automatic |
icItm | Item-Type | *itemcode | integer | 物品-类型(代码) | Automatic | Automatic | Automatic |
scLig | Lightning Type | *lightningtype | string | 闪电类型(代码) | Automatic | Automatic | Automatic |
icOdr | Order | *ordercode | integer | 命令(代码) | Automatic | Automatic | Automatic |
icTch | Tech-Type | *techcode | integer | 科技-类型(代码) | Automatic | Automatic | Automatic |
icTsp | Terrain Shape | *terrainshape | integer | 地形形状(代码) | Automatic | Automatic | Automatic |
icTrn | Terrain Type | *terraintype | integer | 地形类型(代码) | Automatic | Automatic | Automatic |
icUbs | Ubersplat Type | *ubersplattype | integer | 纹理类型(代码) | Automatic | Automatic | Automatic |
icUnt | Unit-Type | *unitcode | integer | 单位-类型(代码) | Automatic | Automatic | Automatic |
evt | Event | event | handle | 事件 | | | |
plr | Player | player | handle | 玩家 | | | |
wgt | | widget | handle | 有血槽物体 | | | |
unt | Unit | unit | widget | 单位 | Unit - Remove | | RemoveUnit |
dst | Destructible | destructable | widget | 可破坏物 | Destructible - Remove | | RemoveDestructable |
itm | Item | item | widget | 物品 | Item - Remove | | RemoveItem |
abi | | ability | handle | 技能 | | | |
bff | | buff | ability | 魔法效果 | | | |
pgp | Player Group | force | handle | 势力(玩家组) | *Player Group - Clear | | DestroyForce |
ugp | Unit Group | group | handle | 单位组 | *Unit Group - Clear | | DestoryGroup |
tgr | Trigger | trigger | handle | 触发器 | *Trigger - Turn Off | | DestroyTrigger |
tcd | Trigger Condition | triggercondition | handle | 触发器条件 | | | TriggerRemoveCondition |
tac | Trigger Action | triggeraction | handle | 触发器动作 | | | TriggerRemoveAction |
tmr | Timer | timer | handle | 计时器 | *Countdown Timer - Pause Timer | DestroyTimerBJ | DestroyTimer |
pt | Point | location | handle | 点 | | | RemoveLocation |
rgn | | region | handle | 区域(不规则几何区域) | | | RemoveRegion |
rct | Region | rect | handle | 地区 | | | RemoveRect |
bex | Boolean Expression | boolexpr | handle | 布尔表达式 | | | DestroyBoolExpr |
snd | Sound | sound | handle | 声音 | Sound - Destroy | KillSoundWhenDoneBJ | KillSoundWhenDone |
cfn | | conditionfunc | boolexpr | 条件函数 | | | DestroyCondition |
ffn | | filterfunc | boolexpr | 过滤函数 | | | DestroyFilter |
upl | | unitpool | handle | 单位池 | | | DestroyUnitPool |
ipl | | itempool | handle | 物品池 | | | DestroyItemPool |
rce | Race | race | handle | 种族 | | | |
alt | Alliance Type | alliancetype | handle | 盟友类型 | | | |
rcp | | racepreference | handle | 种族优选 | | | |
gms | | gamestate | handle | 游戏状态 | | | |
gsi | | igamestate | gamestate | 游戏状态(i) | | | |
gsf | | fgamestate | gamestate | 游戏状态(f) | | | |
pst | Player Property | playerstate | handle | 玩家属性 | | | |
pso | Player Score | playerscore | handle | 玩家得分 | | | |
pgr | Player Game Result | playergameresult | handle | 玩家游戏结果 | | | |
ust | Unit Property | unitstate | handle | 单位属性 | | | |
idf | Aidifficulty | aidifficulty | handle | 对战AI难度 | | | |
eid | | eventid | handle | 事件ID | | | |
gev | Game Event | gameevent | eventid | 游戏事件 | | | |
pev | | playerevent | eventid | 玩家事件 | | | |
pue | Player Unit Event | playerunitevent | eventid | 玩家单位事件 | | | |
uev | Unit Event | unitevent | eventid | 单位事件 | | | |
lop | Limit Operation | limitop | eventid | 判断算符 | | | |
wge | | widgetevent | eventid | 有血槽物体事件 | | | |
dle | | dialogevent | eventid | 对话框事件 | | | |
utp | Unit Classification | unittype | handle | 单位类型 | | | |
gsp | Game Speed | gamespeed | handle | 游戏速度 | | | |
gdf | Game Difficulty | gamedifficulty | handle | 游戏难度 | | | |
gtp | | gametype | handle | 游戏类型 | | | |
mfg | Map Flag | mapflag | handle | 地图标记 | | | |
mvi | | mapvisibility | handle | 地图可见性 | | | |
mst | | mapsetting | handle | 地图设置 | | | |
mds | Map Density | mapdensity | handle | 地图密度 | | | |
mcn | Player Controller | mapcontrol | handle | 玩家控制者 | | | |
pss | Player Slot Status | playerslotstate | handle | 玩家槽状态 | | | |
vgp | Volume Channel | volumegroup | handle | 音量频道 | | | |
cfl | Camera Field | camerafield | handle | 镜头区域 | | | |
csp | Camera Object | camerasetup | handle | 镜头物体 | | | |
pcr | Player Color | playercolor | handle | 玩家颜色 | | | |
slc | | placement | handle | 起始位置 | | | |
slp | | startlocprio | handle | 起始位置优先权 | | | |
rcn | Animation Rarity | raritycontrol | handle | 动画珍品 | | | |
bmd | Blending Method | blendmode | handle | 合成方式 | | | |
tmf | | texmapflags | handle | 地图涂层标志 | | | |
eff | Special Effect | effect | handle | 特效 | Special Effect - Destroy | DestroyEffectBJ | DestroyEffect |
etp | Effect Type | effecttype | handle | 效果类型 | | | |
wef | Weather Effect | weathereffect | handle | 气候效果 | Environment - Remove Weather Effect | RemoveWeatherEffectBJ | RemoveWeatherEffect |
tdf | Terrain Deformation | terraindeformation | handle | 地形变形 | Environment - Stop Terrain Deformation | TerrainDeformationStopBJ | TerrainDeformStop |
vst | Visibility State | fogstate | handle | 可见状态 | | | |
vmd | Visibility Modifier | fogmodifier | handle | 可见修改器 | Visibility Modifier - Destroy Visibility Modifier | DestroyFogModifier |
dlg | Dialog | dialog | handle | 对话框 | *Dialog - Clear | | DialogDestroy |
dbt | Dialog Button | button | handle | 对话框按钮 | | | |
qst | Quest | quest | handle | 任务 | Quest - Destroy | | DestroyQuest |
qre | Quest Requirement | questitem | handle | 任务要求 | | | |
dcd | Defeat Condition | defeatcondition | handle | 失败条件 | | DestroyDefeatConditionBJ | DestroyDefeatCondition |
twd | Timer Window | timerdialog | handle | 计时器窗口 | Countdown Timer - Destroy Timer Window | DestroyTimerDialogBJ | DestroyTimerDialog |
lbd | Leaderboard | leaderboard | handle | 排行榜 | Leaderboard - Destroy | DestroyLeaderboardBJ | DestroyLeaderboard |
mbd | Multiboard | multiboard | handle | 多面板 | Multiboard - Destroy | DestroyMultiboardBJ | DestroyMultiboard |
mbi | | multiboarditem | handle | 多面板项目 | | | |
tck | | trackable | handle | 可跟踪 | | | |
gch | Game Cache | gamecache | handle | 游戏缓存 | *Game Cache - Clear Game Cache | *FlushGameCache |
ver | | version | handle | 版本 | | | |
itp | Item Class | itemtype | handle | 物品类型 | | | |
ttg | Floating Text | texttag | handle | 漂浮文字 | Floating Text - Destroy | DestroyTextTagBJ | DestroyTextTag |
atp | Attack Type | attacktype | handle | 攻击类型 | | | |
dtp | Damage Type | damagetype | handle | 伤害类型 | | | |
wtp | Weapon Type | weapontype | handle | 武器类型 | | | |
stp | Sound Type | soundtype | handle | 声音类型 | | | |
lig | Lightning | lightning | handle | 闪电 | Lightning - Destroy Lightning Effect | DestroyLightning |
ptp | Pathing Type | pathingtype | handle | 移动类型(决定单位是否能位于某种地形上) | | |
img | Image | image | handle | 图像 | Image - Destroy | | DestroyImage |
usp | Ubersplat | ubersplat | handle | 纹理 | Ubersplat - Destroy | | DestroyUbersplat |