更新自动补全信息

This commit is contained in:
ckcz123 2020-06-06 00:27:02 +08:00
parent eba9b80d68
commit 923f16e77e
3 changed files with 1914 additions and 1621 deletions

View File

@ -1,5 +1,5 @@
var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
{
{
"!name": "browser",
"Node": {
"!type": "fn()",
@ -609,8 +609,8 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
"!type": "fn(width?: number, height?: number) -> +HTMLImageElement",
"!doc": "Image Element constructor. Accepts two optional parameters: Image([unsigned long width, unsigned long height]). Returns an HTMLImageElement instance just as document.createElement('img') would."
}
},
{
},
{
"!name": "ecmascript",
"Infinity": {
"!type": "number",
@ -1178,11 +1178,12 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
},
"!doc": "JSON (JavaScript Object Notation) is a data-interchange format. It closely resembles a subset of JavaScript syntax, although it is not a strict subset. (See JSON in the JavaScript Reference for full details.) It is useful when writing any kind of JavaScript-based application, including websites and browser extensions. For example, you might store user information in JSON format in a cookie, or you might store extension preferences in JSON in a string-valued browser preference."
}
},
{
},
{
"!name": "core",
"!define": {
"hero": {
"!doc": "勇士当前属性",
"image": {
"!type": "string",
"!doc": "行走图"
@ -1205,7 +1206,7 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
},
"hp": {
"!type": "number",
"!doc": "勇士当前生命值 "
"!doc": "勇士当前生命值"
},
"atk": {
"!type": "number",
@ -1217,7 +1218,7 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
},
"manamax": {
"!type": "number",
"!doc": "勇士当前魔力上线"
"!doc": "勇士当前魔力上限,负数无效"
},
"mana": {
"!type": "number",
@ -1279,6 +1280,7 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
}
},
"block": {
"!doc": "地图图块信息",
"x": {
"!type": "number",
"!doc": "图块的x坐标"
@ -1292,13 +1294,14 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
"!doc": "图块的数字"
},
"event": {
"!doc": "图块上的事件信息",
"id": {
"!type": "string",
"!doc": "图块的ID"
},
"cls": {
"!type": "string",
"!doc": "图块的类别"
"!doc": "图块的类别,一般为所在图片名去掉后缀"
},
"disabled": {
"!type": "bool",
@ -1307,6 +1310,7 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
}
},
"enemy": {
"!doc": "怪物信息",
"id": {
"!type": "string",
"!doc": "怪物ID"
@ -1385,6 +1389,7 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
},
},
"item":{
"!doc": "道具信息",
"id": {
"!type": "string",
"!doc": "道具ID"
@ -1428,6 +1433,7 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
},
},
"floor": {
"!doc": "楼层信息",
"floorId": {
"!type": "string",
"!doc": "楼层ID"
@ -1450,7 +1456,7 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
},
"canFlyTo": {
"!type": "bool",
"!doc": "该楼是否可以楼传"
"!doc": "该楼是否可以楼传,包括飞来和飞走"
},
"canUseQuickShop": {
"!type": "bool",
@ -1458,7 +1464,7 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
},
"cannotViewMap": {
"!type": "bool",
"!doc": "该层是否不允许被浏览地图看到"
"!doc": "该层是否不允许被浏览地图看到,也不统计"
},
"cannotMoveDirectly": {
"!type": "bool",
@ -1500,7 +1506,7 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
}
},
"animate": {
"!doc": "动画",
"!doc": "动画信息",
"se": {
"!type": "string",
"!doc": "动画音效"
@ -1508,20 +1514,26 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
}
},
"core": {
"!doc": "核心游戏控制",
"__SIZE__": {
"!type": "number",
"!doc": "窗口宽度为13或15"
"!doc": "窗口宽度为13或15"
},
"__PIXELS__": {
"!type": "number",
"!doc": "窗口像素宽度为416或480"
},
"__HALF_SIZE__": {
"!type": "number",
"!doc": "窗口宽度的一半为6或7"
},
"material": {
"!doc": "游戏所用到的资源",
"animates": {
"!doc": "注册的动画"
},
"images": {
"!doc": "注册的图片"
"!doc": "注册的图片"
},
"bgms": {
"!doc": "注册的背景音乐"
@ -1536,7 +1548,17 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
"!doc": "道具定义"
}
},
"timeout": {
"!doc": "当前异步事件句柄"
},
"interval": {
"!doc": "当前异步事件延时"
},
"animateFrame": {
"!doc": "当前各个帧动画"
},
"musicStatus": {
"!doc": "音乐音效状态",
"bgmStatus": {
"!type": "bool",
"!doc": "是否播放BGM"
@ -1558,7 +1580,7 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
},
"volume": {
"!type": "number",
"!doc": "当前音量"
"!doc": "当前bgm音量"
}
},
"platform": {
@ -1586,19 +1608,245 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
"!type": "bool",
"!doc": "当前是否显示状态栏"
},
"showStatusBar": {
"toolbarBtn": {
"!type": "bool",
"!doc": "当前工具栏是否是1-8的按钮"
},
},
"bigmap": {
"!doc": "大地图信息",
"canvas": {
"!type": "[string]",
"!doc": "大地图的画布"
},
"width": {
"!type": "number",
"!doc": "大地图高度"
},
"height": {
"!type": "number",
"!doc": "大地图宽度"
},
"offsetX": {
"!type": "number",
"!doc": "大地图视角横向偏移量"
},
"offsetY": {
"!type": "number",
"!doc": "大地图视角纵向偏移量"
},
"tempCanvas": {
"!type": "CanvasRenderingContext2D",
"!doc": "临时画布"
}
},
"saves": {
"!doc": "当前存档信息"
},
"dymCanvas": {
"!doc": "各个自定义画布"
},
"statusBar": {
"!doc": "状态栏信息"
},
"canvas": {
"!doc": "系统画布"
},
"flags": {
"!doc": "系统开关"
},
"values": {
"!doc": "全局数值,如毒衰效果"
},
"firstData": {
"!doc": "初始属性,如出生点"
},
"status": {
"!doc": "状态信息",
"hero": {
"!type": "hero",
"!doc": "勇士信息"
},
"automaticRoute": {
"!doc": "自动寻路信息"
},
"bgmaps": {
"!doc": "各地图背景层"
},
"fgmaps": {
"!doc": "各地图前景层"
},
"boxAnimateObjs": {
"!doc": "(手册和剧情文本的)帧动画对象"
},
"checkBlock": {
"!doc": "阻激夹域捕捉信息",
"damage": {
"!doc": "每个点的伤害信息"
},
"type": {
"!doc": "每个点的伤害类型"
},
"repluse": {
"!doc": "每个点的阻击信息"
},
"ambush": {
"!doc": "每个点的捕捉信息"
},
"needCache": {
"!type": "bool",
"!doc": "该楼层是否需要计算缓存"
},
"cache": {
"!doc": "每个点的光环缓存"
},
},
"ctrlDown": {
"!type": "bool",
"!doc": "Ctrl键是否被按下"
},
"curtainColor": {
"!doc": "当前画面色调"
},
"event": {
"!doc": "当前事件",
"data": {
"!doc": "事件信息,如坐标等"
},
"id": {
"!type": "string",
"!doc": "事件类型,如选择项/确认框"
},
"interval": {
"!type": "number",
"!doc": "打字机效果的定时器"
},
"selection": {
"!type": "number",
"!doc": "选择项和确认框的当前选中项"
},
"ui": {
"!doc": "当前事件的界面信息,如楼传/手册/SL"
}
},
"floorAnimateObjs": {
"!doc": "楼层贴图的帧动画"
},
"floorId": {
"!type": "string",
"!doc": "当前楼层ID"
},
"gameOver": {
"!type": "bool",
"!doc": "游戏是否已结束"
},
"globalAnimateObjs": {
"!doc": "各全局动画"
},
"globalAnimateStatus": {
"!type": "number",
"!doc": "全局动画的帧状态"
},
"globalAttribute": {
"!type": "Object",
"!doc": "全局css属性"
},
"hard": {
"!type": "string",
"!doc": "状态栏一角的难度名"
},
"downTime": {
"!type": "number",
"!doc": "方向键已按下的时间"
},
"heroCenter": {
"!doc": "勇士中心像素坐标",
"px": {
"!type": "number",
"!doc": "勇士中心的横坐标"
},
"py": {
"!type": "number",
"!doc": "勇士中心的纵坐标"
},
},
"heroMoving": {
"!type": "number",
"!doc": "勇士行走的状态值"
},
"heroStop": {
"!type": "bool",
"!doc": "勇士是否已停下"
},
"holdingKeys": {
"!type": "[number]",
"!doc": "当前按下的键"
},
"id2number": {
"!doc": "图块ID到数字的对应关系"
},
"lockControl": {
"!type": "bool",
"!doc": "当前是否是锁定操作状态"
},
"maps": {
"!doc": "当前各地图信息"
},
"number2Block": {
"!doc": "数字到图块对象的对应关系"
},
"openingDoor": {
"!doc": "正在开关的门"
},
"played": {
"!type": "bool",
"!doc": "当前是否游戏中(不包括标题画面和录像回放)"
},
"replay": {
"!doc": "当前录像回放信息",
"animate": {
"!type": "bool",
"!doc": "回放是否正处于动画中"
},
"pausing": {
"!type": "bool",
"!doc": "回放是否暂停中"
},
"replaying": {
"!type": "bool",
"!doc": "当前是否回放中"
},
"save": {
"!type": "[]",
"!doc": "录像中的存档"
},
"speed": {
"!type": "number",
"!doc": "回放速度"
},
"steps": {
"!type": "number",
"!doc": "回放步数"
},
"toReplay": {
"!type": "[string]",
"!doc": "待回放的列表"
},
"totalList": {
"!type": "[string]",
"!doc": "回放总列表"
}
},
"route": {
"!type": "[string]",
"!doc": "当前录像内容"
},
"shops": {
"!doc": "全局商店列表"
},
"textAttribute": {
"!doc": "当前剧情文本属性"
},
"thisMap": {
"!type": "floor",
"!doc": "当前地图信息"
@ -1613,5 +1861,5 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
"_doc": "返回地图上某个点的图块信息"
}
},
}
}
];

View File

@ -76,6 +76,50 @@ editor_multi = function () {
if (name instanceof Function) name = name({});
coredef.core.hasSpecial["!doc"] += name + "(" + one[0] + "); ";
});
Object.keys(core.canvas).forEach(function (name) {
coredef.core.canvas[name] = {
"!type": "CanvasRenderingContext2D",
"!doc": "系统画布"
}
});
Object.keys(core.status.maps).forEach(function (name) {
coredef.core.status.maps[name] = {
"!type": "floor",
"!doc": core.status.maps[name].title || ''
}
coredef.core.status.bgmaps[name] = {
"!type": "[[number]]",
"!doc": core.status.maps[name].title || ''
}
coredef.core.status.fgmaps[name] = {
"!type": "[[number]]",
"!doc": core.status.maps[name].title || ''
}
});
Object.keys(core.status.shops).forEach(function (id) {
coredef.core.status.shops[id] = {
"!doc": core.status.shops[id].textInList || "全局商店"
}
});
Object.keys(core.status.textAttribute).forEach(function (id) {
coredef.core.status.textAttribute[id] = {};
});
Object.keys(core.values).forEach(function (id) {
var one = data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc._data.values._data[id];
if (!one) return;
coredef.core.values[id] = {
"!type": "number",
"!doc": one._data,
}
});
Object.keys(core.flags).forEach(function (id) {
var one = data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc._data.flags._data[id];
if (!one) return;
coredef.core.flags[id] = {
"!type": id == 'statusBarItems' ? '[string]' : 'bool',
"!doc": one._data,
}
});
var ternServer = new CodeMirror.TernServer({
defs: terndefs_f6783a0a_522d_417e_8407_94c67b692e50,

11
runtime.d.ts vendored
View File

@ -473,7 +473,8 @@ declare class control {
* @returns name ? core.status.hero.loc[name] : core.status.hero.loc
*/
getHeroLoc(): { x: number, y: number, direction: direction }
getHeroLoc(name: 'direction'): | direction
getHeroLoc(name: 'x' | 'y'): number
getHeroLoc(name: 'direction'): direction
/**
*
@ -557,7 +558,7 @@ declare class control {
* @param needPlaying
* @param func timestamp
*/
registerAnimationFrame(name: string, needPlaying: bool, func?: (timestamp: number) => void): void
registerAnimationFrame(name: string, needPlaying: boolean, func?: (timestamp: number) => void): void
/** 注销一个animationFrame */
unregisterAnimationFrame(name: string): void
@ -677,7 +678,7 @@ declare class control {
* action参数
* func返回true代表成功处理了此录像行为false代表没有处理此录像行为
*/
registerReplayAction(name: string, func: (action?: string) => bool): void
registerReplayAction(name: string, func: (action?: string) => boolean): void
/** 注销一个录像行为 */
unregisterReplayAction(name: string): void
@ -1005,7 +1006,7 @@ declare class events {
resetGame(hero?: any, hard?: any, floorId?: string, maps?: any, values?: any): void
/** 游戏获胜事件 */
win(reason?: anstringy, norank?: boolean, noexit?: boolean): void
win(reason?: string, norank?: boolean, noexit?: boolean): void
/** 游戏失败事件 */
lose(reason?: string): void
@ -2554,7 +2555,7 @@ declare class utils {
hideWithAnimate(obj?: any, speed?: number, callback?: () => any): void
/** 解压一段内容 */
unzip(blobOrUrl?: any, success?: (data: any) => void, error?: (error: string) => void, convertToText?: bool, onprogress?: (loaded: number, total: number) => void): void
unzip(blobOrUrl?: any, success?: (data: any) => void, error?: (error: string) => void, convertToText?: boolean, onprogress?: (loaded: number, total: number) => void): void
}
/** 和图标相关的函数 */