This commit is contained in:
ckcz123 2019-03-18 18:58:00 +08:00
parent 58c0b8f1ce
commit a0538670a5
7 changed files with 233 additions and 212 deletions

View File

@ -803,7 +803,7 @@ control.prototype._drawHero_getDrawObjs = function (direction, x, y, status, off
}); });
} }
// ------ 画布、位置、阻激夹域 ------ // // ------ 画布、位置、阻激夹域,显伤 ------ //
////// 设置画布偏移 ////// 设置画布偏移
control.prototype.setGameCanvasTranslate = function(canvas,x,y){ control.prototype.setGameCanvasTranslate = function(canvas,x,y){
@ -845,20 +845,6 @@ control.prototype.updateViewport = function() {
core.relocateCanvas('route', core.status.automaticRoute.offsetX - core.bigmap.offsetX, core.status.automaticRoute.offsetY - core.bigmap.offsetY); core.relocateCanvas('route', core.status.automaticRoute.offsetX - core.bigmap.offsetX, core.status.automaticRoute.offsetY - core.bigmap.offsetY);
} }
////// 设置勇士的位置 //////
control.prototype.setHeroLoc = function (itemName, itemVal, noGather) {
core.status.hero.loc[itemName] = itemVal;
if ((itemName=='x' || itemName=='y') && !noGather) {
this.gatherFollowers();
}
}
////// 获得勇士的位置 //////
control.prototype.getHeroLoc = function (itemName) {
if (itemName == null) return core.status.hero.loc;
return core.status.hero.loc[itemName];
}
////// 获得勇士面对位置的x坐标 ////// ////// 获得勇士面对位置的x坐标 //////
control.prototype.nextX = function(n) { control.prototype.nextX = function(n) {
return core.getHeroLoc('x')+core.utils.scan[core.getHeroLoc('direction')].x*(n||1); return core.getHeroLoc('x')+core.utils.scan[core.getHeroLoc('direction')].x*(n||1);
@ -964,137 +950,6 @@ control.prototype._checkBlock_ambush = function (ambush) {
core.insertAction(actions); core.insertAction(actions);
} }
////// 更改天气效果 //////
control.prototype.setWeather = function (type, level) {
// 非雨雪
if (type!='rain' && type!='snow' && type!='fog') {
// core.clearMap('weather');
core.deleteCanvas('weather')
core.animateFrame.weather.type = null;
core.animateFrame.weather.level = 0;
core.animateFrame.weather.nodes = [];
return;
}
level = parseInt(level);
// 当前天气:则忽略
if (type==core.animateFrame.weather.type && !core.isset(level)) {
return;
}
if (!core.isset(level)) level=5;
if (level<1) level=1; if (level>10) level=10;
level *= parseInt(20*core.bigmap.width*core.bigmap.height/(core.__SIZE__*core.__SIZE__));
// 计算当前的宽高
core.createCanvas('weather', 0, 0, core.__PIXELS__, core.__PIXELS__, 80);
core.animateFrame.weather.type = type;
core.animateFrame.weather.level = level;
core.animateFrame.weather.nodes = [];
if (type == 'rain') {
for (var a=0;a<level;a++) {
core.animateFrame.weather.nodes.push({
'x': Math.random()*core.bigmap.width*32,
'y': Math.random()*core.bigmap.height*32,
'l': Math.random() * 2.5,
'xs': -4 + Math.random() * 4 + 2,
'ys': Math.random() * 10 + 10
})
}
}
else if (type=='snow') {
for (var a=0;a<level;a++) {
core.animateFrame.weather.nodes.push({
'x': Math.random()*core.bigmap.width*32,
'y': Math.random()*core.bigmap.height*32,
'r': Math.random() * 5 + 1,
'd': Math.random() * Math.min(level, 200),
})
}
}
else if (type=='fog') {
if (core.animateFrame.weather.fog) {
for (var a=0;a<level/10;a++) {
core.animateFrame.weather.nodes.push({
'x': Math.random()*core.bigmap.width*32 - 208,
'y': Math.random()*core.bigmap.height*32 - 208,
'xs': Math.random() * 4 - 2,
'ys': Math.random() * 4 - 2
})
}
}
}
}
////// 更改画面色调 //////
control.prototype.setFg = function(color, time, callback) {
if (!core.isset(time)) time=750;
if (time<=0) time=0;
if (!core.isset(core.status.curtainColor)) {
core.status.curtainColor = [0,0,0,0];
}
var nowColor = core.status.curtainColor;
if (!core.isset(color))
color = [0,0,0,0];
if (!core.isset(color[3])) color[3] = 1;
color[3] = core.clamp(color[3],0,1);
if (time==0) {
// 直接变色
core.clearMap('curtain');
core.fillRect('curtain', 0, 0, core.__PIXELS__, core.__PIXELS__, core.arrayToRGBA(color));
core.status.curtainColor = color;
if (core.isset(callback)) callback();
return;
}
var per_time = 10, step = parseInt(time / per_time);
var changeAnimate = setInterval(function() {
nowColor = [
parseInt(nowColor[0]*(step-1)+color[0])/step,
parseInt(nowColor[1]*(step-1)+color[1])/step,
parseInt(nowColor[2]*(step-1)+color[2])/step,
(nowColor[3]*(step-1)+color[3])/step,
];
core.clearMap('curtain');
core.fillRect('curtain', 0, 0, core.__PIXELS__, core.__PIXELS__, core.arrayToRGBA(nowColor));
step--;
if (step <= 0) {
delete core.animateFrame.asyncId[changeAnimate];
clearInterval(changeAnimate);
core.status.curtainColor = color;
// core.status.replay.animate=false;
if (core.isset(callback)) callback();
}
}, per_time);
core.animateFrame.asyncId[changeAnimate] = true;
}
////// 画面闪烁 //////
control.prototype.screenFlash = function (color, time, times, callback) {
times = times || 1;
time = time/3;
var nowColor = core.clone(core.status.curtainColor);
core.setFg(color, time, function() {
core.setFg(nowColor, time * 2, function() {
if (times > 1)
core.screenFlash(color, time * 3, times - 1, callback);
else {
if (core.isset(callback)) callback();
}
});
});
}
////// 更新全地图显伤 ////// ////// 更新全地图显伤 //////
control.prototype.updateDamage = function (floorId, canvas) { control.prototype.updateDamage = function (floorId, canvas) {
floorId = floorId || core.status.floorId; floorId = floorId || core.status.floorId;
@ -1191,12 +1046,6 @@ control.prototype.doEffect = function (effect, need, times) {
}); });
} }
////// 开启debug模式 //////
control.prototype.debug = function() {
core.setFlag('debug', true);
core.drawText("\t[调试模式开启]此模式下按住Ctrl键或Ctrl+Shift键可以穿墙并忽略一切事件。\n同时录像将失效也无法上传成绩。");
}
////// 选择录像文件 ////// ////// 选择录像文件 //////
control.prototype.chooseReplayFile = function () { control.prototype.chooseReplayFile = function () {
core.readFile(function (obj) { core.readFile(function (obj) {
@ -2197,77 +2046,116 @@ control.prototype.hasSave = function (index) {
return core.saves.ids[index]||false; return core.saves.ids[index]||false;
} }
// ------ 属性状态位置buff变量锁定控制等 ------ //
////// 设置勇士属性 ////// ////// 设置勇士属性 //////
control.prototype.setStatus = function (statusName, statusVal) { control.prototype.setStatus = function (name, value) {
if (!core.isset(core.status.hero)) return; if (!core.status.hero) return;
if (statusName == 'exp') statusName = 'experience'; if (name == 'exp') name = 'experience';
if (core.isset(core.status.hero.loc[statusName])) if (name == 'x' || name == 'y' || name == 'direction')
core.status.hero.loc[statusName] = statusVal; this.setHeroLoc(name, value);
else else
core.status.hero[statusName] = statusVal; core.status.hero[name] = value;
}
////// 增减勇士属性 //////
control.prototype.addStatus = function (name, value) {
this.setStatus(name, this.getStatus(name) + value);
} }
////// 获得勇士属性 ////// ////// 获得勇士属性 //////
control.prototype.getStatus = function (name) { control.prototype.getStatus = function (name) {
if (!core.isset(core.status.hero)) return null; if (!core.status.hero) return null;
// support status:x if (name == 'x' || name == 'y' || name == 'direction')
if (core.isset(core.status.hero.loc[name])) return this.getHeroLoc('x');
return core.status.hero.loc[name];
if (name == 'exp') name = 'experience'; if (name == 'exp') name = 'experience';
return core.status.hero[name]; return core.status.hero[name];
} }
////// 从status中获得属性如果不存在则从勇士属性中获取 //////
control.prototype.getStatusOrDefault = function (status, name) { control.prototype.getStatusOrDefault = function (status, name) {
if (core.isset(status) && name in status) if (status && name in status)
return status[name]; return status[name];
return this.getStatus(name); return this.getStatus(name);
} }
////// 获得勇士实际属性(增幅后的) //////
control.prototype.getRealStatus = function (name) { control.prototype.getRealStatus = function (name) {
return this.getRealStatusOrDefault(null, name); return this.getRealStatusOrDefault(null, name);
} }
////// 从status中获得实际属性增幅后的如果不存在则从勇士属性中获取 //////
control.prototype.getRealStatusOrDefault = function (status, name) { control.prototype.getRealStatusOrDefault = function (status, name) {
return this.getStatusOrDefault(status, name) * core.getFlag('__'+name+'_buff__', 1); return this.getStatusOrDefault(status, name) * this.getBuff(name);
}
////// 设置某个属性的增幅值 //////
control.prototype.setBuff = function (name, value) {
this.setFlag('flag:__'+name+'_buff__', value);
}
////// 加减某个属性的增幅值 //////
control.prototype.addBuff = function (name, value) {
this.setFlag('flag:__'+name+'_buff__', this.getBuff(name) + value);
}
////// 获得某个属性的增幅值 //////
control.prototype.getBuff = function (name) {
return core.getFlag('__'+name+'_buff__', 1);
}
////// 设置勇士的位置 //////
control.prototype.setHeroLoc = function (name, value, noGather) {
if (!core.status.hero) return;
core.status.hero.loc[name] = value;
if ((name=='x' || name=='y') && !noGather) {
this.gatherFollowers();
}
}
////// 获得勇士的位置 //////
control.prototype.getHeroLoc = function (name) {
if (!core.status.hero) return;
if (name == null) return core.status.hero.loc;
return core.status.hero.loc[name];
} }
////// 获得某个等级的名称 ////// ////// 获得某个等级的名称 //////
control.prototype.getLvName = function () { control.prototype.getLvName = function (lv) {
if (!core.isset(core.status.hero)) return null; if (!core.status.hero) return null;
return ((core.firstData.levelUp||[])[core.status.hero.lv-1]||{}).title || core.status.hero.lv; if (lv == null) lv = core.status.hero.lv;
return ((core.firstData.levelUp||[])[lv-1]||{}).title || lv;
} }
////// 设置某个自定义变量或flag ////// ////// 设置某个自定义变量或flag //////
control.prototype.setFlag = function(flag, value) { control.prototype.setFlag = function(name, value) {
if (!core.isset(value)) return this.removeFlag(flag); if (value == null) return this.removeFlag(name);
if (!core.isset(core.status.hero)) return; if (!core.status.hero) return;
core.status.hero.flags[flag]=value; core.status.hero.flags[name]=value;
}
////// 获得某个自定义变量或flag //////
control.prototype.getFlag = function(flag, defaultValue) {
if (!core.isset(core.status.hero)) return defaultValue;
var value = core.status.hero.flags[flag];
if (core.isset(value)) return value;
return defaultValue;
}
////// 是否存在某个自定义变量或flag且值为true //////
control.prototype.hasFlag = function(flag) {
if (core.getFlag(flag)) return true;
return false;
}
////// 删除某个自定义变量或flag //////
control.prototype.removeFlag = function(flag) {
if (!core.isset(core.status.hero)) return;
delete core.status.hero.flags[flag];
} }
////// 增加某个flag数值 ////// ////// 增加某个flag数值 //////
control.prototype.addFlag = function(flag, delta) { control.prototype.addFlag = function(name, value) {
if (!core.isset(core.status.hero)) return; if (!core.status.hero) return;
core.setFlag(flag, core.getFlag(flag, 0) + delta); core.setFlag(name, core.getFlag(name, 0) + value);
}
////// 获得某个自定义变量或flag //////
control.prototype.getFlag = function(name, defaultValue) {
if (!core.status.hero) return defaultValue;
var value = core.status.hero.flags[name];
return value != null ? value : defaultValue;
}
////// 是否存在某个自定义变量或flag且值为true //////
control.prototype.hasFlag = function(name) {
return !!core.getFlag(name);
}
////// 删除某个自定义变量或flag //////
control.prototype.removeFlag = function(name) {
if (!core.status.hero) return;
delete core.status.hero.flags[name];
} }
////// 锁定状态栏,常常用于事件处理 ////// ////// 锁定状态栏,常常用于事件处理 //////
@ -2280,6 +2168,145 @@ control.prototype.unLockControl = function () {
core.status.lockControl = false; core.status.lockControl = false;
} }
////// 开启debug模式 //////
control.prototype.debug = function() {
core.setFlag('debug', true);
core.drawText("\t[调试模式开启]此模式下按住Ctrl键或Ctrl+Shift键可以穿墙并忽略一切事件。\n同时录像将失效也无法上传成绩。");
}
// ------ 天气色调BGM ------ //
////// 更改天气效果 //////
control.prototype.setWeather = function (type, level) {
// 非雨雪
if (type!='rain' && type!='snow' && type!='fog') {
// core.clearMap('weather');
core.deleteCanvas('weather')
core.animateFrame.weather.type = null;
core.animateFrame.weather.level = 0;
core.animateFrame.weather.nodes = [];
return;
}
level = parseInt(level);
// 当前天气:则忽略
if (type==core.animateFrame.weather.type && !core.isset(level)) {
return;
}
if (!core.isset(level)) level=5;
if (level<1) level=1; if (level>10) level=10;
level *= parseInt(20*core.bigmap.width*core.bigmap.height/(core.__SIZE__*core.__SIZE__));
// 计算当前的宽高
core.createCanvas('weather', 0, 0, core.__PIXELS__, core.__PIXELS__, 80);
core.animateFrame.weather.type = type;
core.animateFrame.weather.level = level;
core.animateFrame.weather.nodes = [];
if (type == 'rain') {
for (var a=0;a<level;a++) {
core.animateFrame.weather.nodes.push({
'x': Math.random()*core.bigmap.width*32,
'y': Math.random()*core.bigmap.height*32,
'l': Math.random() * 2.5,
'xs': -4 + Math.random() * 4 + 2,
'ys': Math.random() * 10 + 10
})
}
}
else if (type=='snow') {
for (var a=0;a<level;a++) {
core.animateFrame.weather.nodes.push({
'x': Math.random()*core.bigmap.width*32,
'y': Math.random()*core.bigmap.height*32,
'r': Math.random() * 5 + 1,
'd': Math.random() * Math.min(level, 200),
})
}
}
else if (type=='fog') {
if (core.animateFrame.weather.fog) {
for (var a=0;a<level/10;a++) {
core.animateFrame.weather.nodes.push({
'x': Math.random()*core.bigmap.width*32 - 208,
'y': Math.random()*core.bigmap.height*32 - 208,
'xs': Math.random() * 4 - 2,
'ys': Math.random() * 4 - 2
})
}
}
}
}
////// 更改画面色调 //////
control.prototype.setFg = function(color, time, callback) {
if (!core.isset(time)) time=750;
if (time<=0) time=0;
if (!core.isset(core.status.curtainColor)) {
core.status.curtainColor = [0,0,0,0];
}
var nowColor = core.status.curtainColor;
if (!core.isset(color))
color = [0,0,0,0];
if (!core.isset(color[3])) color[3] = 1;
color[3] = core.clamp(color[3],0,1);
if (time==0) {
// 直接变色
core.clearMap('curtain');
core.fillRect('curtain', 0, 0, core.__PIXELS__, core.__PIXELS__, core.arrayToRGBA(color));
core.status.curtainColor = color;
if (core.isset(callback)) callback();
return;
}
var per_time = 10, step = parseInt(time / per_time);
var changeAnimate = setInterval(function() {
nowColor = [
parseInt(nowColor[0]*(step-1)+color[0])/step,
parseInt(nowColor[1]*(step-1)+color[1])/step,
parseInt(nowColor[2]*(step-1)+color[2])/step,
(nowColor[3]*(step-1)+color[3])/step,
];
core.clearMap('curtain');
core.fillRect('curtain', 0, 0, core.__PIXELS__, core.__PIXELS__, core.arrayToRGBA(nowColor));
step--;
if (step <= 0) {
delete core.animateFrame.asyncId[changeAnimate];
clearInterval(changeAnimate);
core.status.curtainColor = color;
// core.status.replay.animate=false;
if (core.isset(callback)) callback();
}
}, per_time);
core.animateFrame.asyncId[changeAnimate] = true;
}
////// 画面闪烁 //////
control.prototype.screenFlash = function (color, time, times, callback) {
times = times || 1;
time = time/3;
var nowColor = core.clone(core.status.curtainColor);
core.setFg(color, time, function() {
core.setFg(nowColor, time * 2, function() {
if (times > 1)
core.screenFlash(color, time * 3, times - 1, callback);
else {
if (core.isset(callback)) callback();
}
});
});
}
////// 播放背景音乐 ////// ////// 播放背景音乐 //////
control.prototype.playBgm = function (bgm, startTime) { control.prototype.playBgm = function (bgm, startTime) {
if (main.mode!='play')return; if (main.mode!='play')return;

View File

@ -245,7 +245,7 @@ enemys.prototype._nextCriticals_useTurn = function (enemy, info, number, x, y, f
for (var t = turn - 1; t >= 1; t--) { for (var t = turn - 1; t >= 1; t--) {
var nextAtk = Math.ceil(mon_hp / t) + mon_def; var nextAtk = Math.ceil(mon_hp / t) + mon_def;
// 装备提升比例的计算临界 // 装备提升比例的计算临界
nextAtk = Math.ceil(nextAtk / core.getFlag('__atk_buff__', 1)); nextAtk = Math.ceil(nextAtk / core.getBuff('atk'));
if (nextAtk <= hero_atk) break; if (nextAtk <= hero_atk) break;
if (nextAtk != pre) { if (nextAtk != pre) {
var nextInfo = this.getDamageInfo(enemy, {"atk": nextAtk}, x, y, floorId); var nextInfo = this.getDamageInfo(enemy, {"atk": nextAtk}, x, y, floorId);

View File

@ -333,12 +333,12 @@ items.prototype._loadEquipEffect = function (equipId, unloadEquipId, isPercentag
var result = core.compareEquipment(equipId, unloadEquipId); var result = core.compareEquipment(equipId, unloadEquipId);
if (isPercentage) { if (isPercentage) {
for (var v in result) for (var name in result)
core.addFlag('__' + v + '_buff__', result[v] / 100); core.addBuff(name, result[name] / 100);
} }
else { else {
for (var v in result) for (var name in result)
core.status.hero[v] += result[v]; core.status.hero[name] += result[name];
} }
} }

View File

@ -2059,7 +2059,7 @@ ui.prototype.drawEquipbox = function(index) {
if (compare[name]<0) color = '#FF0000'; if (compare[name]<0) color = '#FF0000';
var nowValue = core.getStatus(name), newValue = nowValue + compare[name]; var nowValue = core.getStatus(name), newValue = nowValue + compare[name];
if (equip.equip.percentage) { if (equip.equip.percentage) {
var nowBuff = core.getFlag('__'+name+"_buff__", 1), newBuff = nowBuff+compare[name]/100; var nowBuff = core.getBuff(name), newBuff = nowBuff+compare[name]/100;
nowValue = Math.floor(nowBuff*core.getStatus(name)); nowValue = Math.floor(nowBuff*core.getStatus(name));
newValue = Math.floor(newBuff*core.getStatus(name)); newValue = Math.floor(newBuff*core.getStatus(name));
} }

View File

@ -118,14 +118,12 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 =
"text": "<1扣比例" "text": "<1扣比例"
}, },
{ {
"type": "setValue2", "type": "function",
"name": "flag:__atk_buff__", "function": "function(){\ncore.addBuff('atk', -core.values.weakValue);\n}"
"value": "-core.values.weakValue"
}, },
{ {
"type": "setValue2", "type": "function",
"name": "flag:__def_buff__", "function": "function(){\ncore.addBuff('def', -core.values.weakValue);\n}"
"value": "-core.values.weakValue"
} }
] ]
} }

View File

@ -60,10 +60,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
core.setFlag('hard', 4); // 可以用flag:hard来获得当前难度 core.setFlag('hard', 4); // 可以用flag:hard来获得当前难度
} }
// 设置三围的初始增幅属性均为1
["atk", "def", "mdef"].forEach(function (name) {
core.setFlag("__" + name + "_buff__", 1);
});
// 设置已经到过的楼层 // 设置已经到过的楼层
core.setFlag("__visited__", {}); core.setFlag("__visited__", {});

View File

@ -372,9 +372,9 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"upFly": "var loc = {'direction': core.status.hero.loc.direction, 'x': core.status.event.ui.x, 'y': core.status.event.ui.y};\nif (core.status.event.id == 'action') {\n\tcore.insertAction([\n\t\t{\"type\": \"changeFloor\", \"loc\": [loc.x, loc.y], \"direction\": loc.direction, \"floorId\": core.status.event.ui.id},\n\t\t{\"type\": \"tip\", \"text\": core.material.items[itemId].name + '使用成功'}\n\t]);\n}\nelse {\n\tcore.changeFloor(core.status.event.ui.id, null, loc, null, function (){\n\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n\t\tcore.replay();\n\t});\n}", "upFly": "var loc = {'direction': core.status.hero.loc.direction, 'x': core.status.event.ui.x, 'y': core.status.event.ui.y};\nif (core.status.event.id == 'action') {\n\tcore.insertAction([\n\t\t{\"type\": \"changeFloor\", \"loc\": [loc.x, loc.y], \"direction\": loc.direction, \"floorId\": core.status.event.ui.id},\n\t\t{\"type\": \"tip\", \"text\": core.material.items[itemId].name + '使用成功'}\n\t]);\n}\nelse {\n\tcore.changeFloor(core.status.event.ui.id, null, loc, null, function (){\n\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n\t\tcore.replay();\n\t});\n}",
"downFly": "var loc = {'direction': core.status.hero.loc.direction, 'x': core.status.event.ui.x, 'y': core.status.event.ui.y};\nif (core.status.event.id == 'action') {\n\tcore.insertAction([\n\t\t{\"type\": \"changeFloor\", \"loc\": [loc.x, loc.y], \"direction\": loc.direction, \"floorId\": core.status.event.ui.id},\n\t\t{\"type\": \"tip\", \"text\": core.material.items[itemId].name + '使用成功'}\n\t]);\n}\nelse {\n\tcore.changeFloor(core.status.event.ui.id, null, loc, null, function (){\n\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n\t\tcore.replay();\n\t});\n}\n", "downFly": "var loc = {'direction': core.status.hero.loc.direction, 'x': core.status.event.ui.x, 'y': core.status.event.ui.y};\nif (core.status.event.id == 'action') {\n\tcore.insertAction([\n\t\t{\"type\": \"changeFloor\", \"loc\": [loc.x, loc.y], \"direction\": loc.direction, \"floorId\": core.status.event.ui.id},\n\t\t{\"type\": \"tip\", \"text\": core.material.items[itemId].name + '使用成功'}\n\t]);\n}\nelse {\n\tcore.changeFloor(core.status.event.ui.id, null, loc, null, function (){\n\tcore.drawTip(core.material.items[itemId].name + '使用成功');\n\t\tcore.replay();\n\t});\n}\n",
"poisonWine": "core.removeFlag('poison');", "poisonWine": "core.removeFlag('poison');",
"weakWine": "core.removeFlag('weak');\nif (core.values.weakValue>=1) { // >=1直接扣数值\n\tcore.status.hero.atk += core.values.weakValue;\n\tcore.status.hero.def += core.values.weakValue;\n}\nelse { // <1扣比例\n\tcore.addFlag(\"__atk_buff__\", core.values.weakValue);\n\tcore.addFlag(\"__def_buff__\", core.values.weakValue);\n}", "weakWine": "core.removeFlag('weak');\nif (core.values.weakValue>=1) { // >=1直接扣数值\n\tcore.status.hero.atk += core.values.weakValue;\n\tcore.status.hero.def += core.values.weakValue;\n}\nelse { // <1扣比例\n\tcore.addBuff(\"atk\", core.values.weakValue);\n\tcore.addBuff(\"def\", core.values.weakValue);\n}",
"curseWine": "core.removeFlag('curse');", "curseWine": "core.removeFlag('curse');",
"superWine": "core.removeFlag('poison');\nif (core.hasFlag('weak')) {\n\tcore.removeFlag('weak');\n\tif (core.values.weakValue>=1) { // >=1直接扣数值\n\t\tcore.status.hero.atk += core.values.weakValue;\n\t\tcore.status.hero.def += core.values.weakValue;\n\t}\n\telse { // <1扣比例\n\t\tcore.addFlag(\"__atk_buff__\", core.values.weakValue);\n\t\tcore.addFlag(\"__def_buff__\", core.values.weakValue);\n\t}\n}\ncore.removeFlag('curse');", "superWine": "core.removeFlag('poison');\nif (core.hasFlag('weak')) {\n\tcore.removeFlag('weak');\n\tif (core.values.weakValue>=1) { // >=1直接扣数值\n\t\tcore.status.hero.atk += core.values.weakValue;\n\t\tcore.status.hero.def += core.values.weakValue;\n\t}\n\telse { // <1扣比例\n\t\tcore.addBuff(\"atk\", core.values.weakValue);\n\t\tcore.addBuff(\"def\", core.values.weakValue);\n\t}\n}\ncore.removeFlag('curse');",
"lifeWand": "core.insertAction([\n\t{\"type\": \"input\", \"text\": \"请输入生命魔杖使用次数:(0-${item:lifeWand})\"},\n\t{\"type\": \"if\", \"condition\": \"flag:input<=item:lifeWand\",\n\t\t\"true\": [\n\t\t\t{\"type\": \"setValue\", \"name\": \"item:lifeWand\", \"value\": \"item:lifeWand-flag:input\"},\n\t\t\t{\"type\": \"setValue\", \"name\": \"status:hp\", \"value\": \"status:hp+flag:input*100\"},\n\t\t\t\"成功使用${flag:input}次生命魔杖,恢复${flag:input*100}点生命。\"\n\t\t],\n\t\t\"false\": [\"输入不合法!\"]\n\t},\n]);\ncore.addItem('lifeWand', 1);", "lifeWand": "core.insertAction([\n\t{\"type\": \"input\", \"text\": \"请输入生命魔杖使用次数:(0-${item:lifeWand})\"},\n\t{\"type\": \"if\", \"condition\": \"flag:input<=item:lifeWand\",\n\t\t\"true\": [\n\t\t\t{\"type\": \"setValue\", \"name\": \"item:lifeWand\", \"value\": \"item:lifeWand-flag:input\"},\n\t\t\t{\"type\": \"setValue\", \"name\": \"status:hp\", \"value\": \"status:hp+flag:input*100\"},\n\t\t\t\"成功使用${flag:input}次生命魔杖,恢复${flag:input*100}点生命。\"\n\t\t],\n\t\t\"false\": [\"输入不合法!\"]\n\t},\n]);\ncore.addItem('lifeWand', 1);",
"jumpShoes": "core.insertAction({\"type\":\"jumpHero\",\"loc\":[core.nextX(2),core.nextY(2)]});", "jumpShoes": "core.insertAction({\"type\":\"jumpHero\",\"loc\":[core.nextX(2),core.nextY(2)]});",
"redPotion": "core.status.hero.hp += core.values.redPotion", "redPotion": "core.status.hero.hp += core.values.redPotion",