|
发表于 2006-4-23 14:09:10
|
显示全部楼层
1.17 -> 1.18 Jass函数改动列表 by Soar Chin
Common.j:
a)增加类型
type pathingtype extends handle // 地形路径类型
type image extends handle // 图像类型
type ubersplat extends handle // 地面纹理类型
b)增加常量
constant pathingtype PATHING_TYPE_ANY = ConvertPathingType(0) // 任何单位都能通过的地形
constant pathingtype PATHING_TYPE_WALKABILITY = ConvertPathingType(1) // 只有步行单位才能通过的地形
constant pathingtype PATHING_TYPE_FLYABILITY = ConvertPathingType(2) // 只有飞行单位才能通过的地形
constant pathingtype PATHING_TYPE_BUILDABILITY = ConvertPathingType(3) // 可以建造建筑的地形
constant pathingtype PATHING_TYPE_PEONHARVESTPATHING = ConvertPathingType(4) // 采矿和伐木中的农民可以穿过的地形
constant pathingtype PATHING_TYPE_BLIGHTPATHING = ConvertPathingType(5) // 不死族的腐蚀地表的地形
constant pathingtype PATHING_TYPE_FLOATABILITY = ConvertPathingType(6) // 允许漂浮水面行走的地形
constant pathingtype PATHING_TYPE_AMPHIBIOUSPATHING = ConvertPathingType(7) // 允许两栖行走的地形
constant unittype UNIT_TYPE_TAUREN = ConvertUnitType(20) // 单位类型-牛头族
constant unittype UNIT_TYPE_POISONED = ConvertUnitType(21) // 单位类型-中毒的
constant unittype UNIT_TYPE_POLYMORPHED = ConvertUnitType(22) // 单位类型-变成小羊的
constant unittype UNIT_TYPE_SLEEPING = ConvertUnitType(23) // 单位类型-睡眠的
constant unittype UNIT_TYPE_RESISTANT = ConvertUnitType(24) // 单位类型-魔法抵抗的
constant unittype UNIT_TYPE_ETHEREAL = ConvertUnitType(25) // 单位类型-无形的
constant unittype UNIT_TYPE_MAGIC_IMMUNE = ConvertUnitType(26) // 单位类型-魔法免疫的
c)增加函数
// 获得坐标的Z方向值(和镜头有关), 在不同的电脑上可能得到不同的值, 请勿用于联机游戏中需要同步数据的场合
native GetLocationZ takes location whichLocation returns real
// Text Tag 系列
// 设置文字标签是否停止运动
native SetTextTagSuspended takes texttag t, boolean flag returns nothing
// 设置文字标签是否永久存在
native SetTextTagPermanent takes texttag t, boolean flag returns nothing
// 设置文字标签的已存在的时间长度
native SetTextTagAge takes texttag t, real age returns nothing
// 设置文字标签的允许存在时间
native SetTextTagLifespan takes texttag t, real lifespan returns nothing
// 设置文字标签的淡化点
native SetTextTagFadepoint takes texttag t, real fadepoint returns nothing
// 选择系列
// 设置是否框选单位以及允许框选单位后是否显示在界面上
native EnableDragSelect takes boolean state, boolean ui returns nothing
// 设置是否预选单位以及允许预选单位后是否显示在界面上(也就是鼠标移到一个单位身上时显示其生命)
native EnablePreSelect takes boolean state, boolean ui returns nothing
// 设置是否选择单位以及允许框选后是否显示在界面上
native EnableSelect takes boolean state, boolean ui returns nothing
// Lighting 系列
// 添加闪电效果, 和AddLightning比多了Z方向参数
native AddLightningEx takes string codeName, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns lightning
// 移动闪电, 和MoveLightning比多了Z方向参数
native MoveLightningEx takes lightning whichBolt, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns boolean
// 地形系列
// 得到对应坐标的地形类型
native GetTerrainType takes real x, real y returns integer
// 得到对应坐标的地形的高低差指数
native GetTerrainVariance takes real x, real y returns integer
// 得到对应坐标的地形类型
native SetTerrainType takes real x, real y, integer terrainType, integer variation, integer area, integer shape returns nothing
// 检查对应坐标的地形是否符合地形路径类型
native IsTerrainPathable takes real x, real y, pathingtype t returns boolean
// 设置对应坐标的地形的路径类型
native SetTerrainPathable takes real x, real y, pathingtype t, boolean flag returns nothing
// 图像系列
// 从文件创建图像
// 变量imageType的值对应: 0 - 影子, 1 - 选择圈, 2 - 指示器(?鼠标or what?), 3 - 碰撞标志, 4 - 地面纹理, 5 - 上一次使用的值(仅用于GetImageType)
native CreateImage takes string file, real sizeX, real sizeY, real sizeZ, real posX, real posY, real posZ, real originX, real originY, real originZ, integer imageType returns image
// 删除图像变量并释放内存
native DestroyImage takes image whichImage returns nothing
// 显示图像
native ShowImage takes image whichImage, boolean flag returns nothing
// 设置图像高度
native SetImageConstantHeight takes image whichImage, boolean flag, real height returns nothing
// 设置图像位置
native SetImagePosition takes image whichImage, real x, real y, real z returns nothing
// 设置图像颜色
native SetImageColor takes image whichImage, integer red, integer green, integer blue, integer alpha returns nothing
// 设置图像是否着色
native SetImageRender takes image whichImage, boolean flag returns nothing
// 设置图像是否总是着色
native SetImageRenderAlways takes image whichImage, boolean flag returns nothing
// 这是图像是否高于水平面
native SetImageAboveWater takes image whichImage, boolean flag, boolean useWaterAlpha returns nothing
// 设置图像类型, imageType取值见CreateImage
native SetImageType takes image whichImage, integer imageType returns nothing
// 地面纹理系列
// 创建地面纹理(可以模拟从头开始建造的过程)
native CreateUbersplat takes real x, real y, string name, integer red, integer green, integer blue, integer alpha, boolean forcePaused, boolean noBirthTime returns ubersplat
// 删除地面纹理变量并释放内存
native DestroyUbersplat takes ubersplat whichSplat returns nothing
// 重置地面纹理
native ResetUbersplat takes ubersplat whichSplat returns nothing
// 完成地面纹理(相当于直接完成建造后的地面纹理)
native FinishUbersplat takes ubersplat whichSplat returns nothing
// 显示地面纹理
native ShowUbersplat takes ubersplat whichSplat, boolean flag returns nothing
// 设置地面纹理是否着色
native SetUbersplatRender takes ubersplat whichSplat, boolean flag returns nothing
// 设置地面纹理是否总是着色
native SetUbersplatRenderAlways takes ubersplat whichSplat, boolean flag returns nothing
Blizzard.j:
a)增加全局变量
image bj_lastCreatedImage = null // 用于CreateImageBJ
ubersplat bj_lastCreatedUbersplat = null // 用于CreateUbersplatBJ
b) 改变的函数
// 改为使用AddLightningEx
function AddLightningLoc takes string codeName, location where1, location where2 returns lightning
set bj_lastCreatedLightning = AddLightningEx(codeName, true, GetLocationX(where1), GetLocationY(where1), GetLocationZ(where1), GetLocationX(where2), GetLocationY(where2), GetLocationZ(where2))
return bj_lastCreatedLightning
endfunction
// 改为使用MoveLightningEx
function MoveLightningLoc takes lightning whichBolt, location where1, location where2 returns boolean
return MoveLightningEx(whichBolt, true, GetLocationX(where1), GetLocationY(where1), GetLocationZ(where1), GetLocationX(where2), GetLocationY(where2), GetLocationZ(where2))
endfunction
// 第一个参数从原来的string abilString变为integer abilcode
function GetAbilityEffectBJ takes integer abilcode, effecttype t, integer index returns string
return GetAbilityEffectById(abilcode, t, index)
endfunction
// 第一个参数从原来的string abilString变为integer abilcode
function GetAbilitySoundBJ takes integer abilcode, soundtype t returns string
return GetAbilitySoundById(abilcode, t)
endfunction
// 由SetTextTagText改为使用SetTextTagTextBJ
function CreateTextTagLocBJ takes string s, location loc, real zOffset, real size, real red, real green, real blue, real transparency returns texttag
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagTextBJ(bj_lastCreatedTextTag, s, size)
call SetTextTagPosBJ(bj_lastCreatedTextTag, loc, zOffset)
call SetTextTagColorBJ(bj_lastCreatedTextTag, red, green, blue, transparency)
return bj_lastCreatedTextTag
endfunction
// 由SetTextTagText改为使用SetTextTagTextBJ
function CreateTextTagUnitBJ takes string s, unit whichUnit, real zOffset, real size, real red, real green, real blue, real transparency returns texttag
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagTextBJ(bj_lastCreatedTextTag, s, size)
call SetTextTagPosUnitBJ(bj_lastCreatedTextTag, whichUnit, zOffset)
call SetTextTagColorBJ(bj_lastCreatedTextTag, red, green, blue, transparency)
return bj_lastCreatedTextTag
endfunction
c)增加的函数
// 以下为地形函数对应的BJ系列
function GetTerrainTypeBJ takes location where returns integer
return GetTerrainType(GetLocationX(where), GetLocationY(where))
endfunction
function GetTerrainVarianceBJ takes location where returns integer
return GetTerrainVariance(GetLocationX(where), GetLocationY(where))
endfunction
function SetTerrainTypeBJ takes location where, integer terrainType, integer variation, integer area, integer shape returns nothing
call SetTerrainType(GetLocationX(where), GetLocationY(where), terrainType, variation, area, shape)
endfunction
function IsTerrainPathableBJ takes location where, pathingtype t returns boolean
return IsTerrainPathable(GetLocationX(where), GetLocationY(where), t)
endfunction
function SetTerrainPathableBJ takes location where, pathingtype t, boolean flag returns nothing
call SetTerrainPathable(GetLocationX(where), GetLocationY(where), t, flag)
endfunction
// 以下为图像函数对应的BJ系列
function CreateImageBJ takes string file, real size, location where, real zOffset, integer imageType returns image
set bj_lastCreatedImage = CreateImage(file, size, size, size, GetLocationX(where), GetLocationY(where), zOffset, 0, 0, 0, imageType)
return bj_lastCreatedImage
endfunction
function ShowImageBJ takes boolean flag, image whichImage returns nothing
call ShowImage(whichImage, flag)
endfunction
function SetImagePositionBJ takes image whichImage, location where, real zOffset returns nothing
call SetImagePosition(whichImage, GetLocationX(where), GetLocationY(where), zOffset)
endfunction
function SetImageColorBJ takes image whichImage, real red, real green, real blue, real alpha returns nothing
call SetImageColor(whichImage, PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100.0-alpha))
endfunction
function GetLastCreatedImage takes nothing returns image
return bj_lastCreatedImage
endfunction
// 以下为地面纹理函数对应的BJ系列
function CreateUbersplatBJ takes location where, string name, real red, real green, real blue, real alpha, boolean forcePaused, boolean noBirthTime returns ubersplat
set bj_lastCreatedUbersplat = CreateUbersplat(GetLocationX(where), GetLocationY(where), name, PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100.0-alpha), forcePaused, noBirthTime)
return bj_lastCreatedUbersplat
endfunction
function ShowUbersplatBJ takes boolean flag, ubersplat whichSplat returns nothing
call ShowUbersplat(whichSplat, flag)
endfunction
function GetLastCreatedUbersplat takes nothing returns ubersplat
return bj_lastCreatedUbersplat
endfunction
// 以下为TextTag函数对应的BJ系列
function SetTextTagTextBJ takes texttag tt, string s, real size returns nothing
local real textHeight = TextTagSize2Height(size)
call SetTextTagText(tt, s, textHeight)
endfunction
function SetTextTagPosBJ takes texttag tt, location loc, real zOffset returns nothing
call SetTextTagPos(tt, GetLocationX(loc), GetLocationY(loc), zOffset)
endfunction
function SetTextTagPosUnitBJ takes texttag tt, unit whichUnit, real zOffset returns nothing
call SetTextTagPosUnit(tt, whichUnit, zOffset)
endfunction
function SetTextTagSuspendedBJ takes texttag tt, boolean flag returns nothing
call SetTextTagSuspended(tt, flag)
endfunction
function SetTextTagPermanentBJ takes texttag tt, boolean flag returns nothing
call SetTextTagPermanent(tt, flag)
endfunction
function SetTextTagAgeBJ takes texttag tt, real age returns nothing
call SetTextTagAge(tt, age)
endfunction
function SetTextTagLifespanBJ takes texttag tt, real lifespan returns nothing
call SetTextTagLifespan(tt, lifespan)
endfunction
function SetTextTagFadepointBJ takes texttag tt, real fadepoint returns nothing
call SetTextTagFadepoint(tt, fadepoint)
endfunction
Common.ai:
没有改动 |
|