Compare commits

...

3 Commits

Author SHA1 Message Date
67d75b4ef3 同步之前的提交 2023-01-04 00:50:46 +08:00
ee336525b2 Merge branch 'noAnimate' of https://gitea.mota.press/bdf1/tianta into noAnimate 2023-01-04 00:38:51 +08:00
3ddb5b876c Esc-系统设置中增加“游戏设置”选项,整合了血瓶显示、RM楼传、RM显伤
跳过剧情优化:存在异步事件时不响应跳过且弹出等待提示
屏蔽装备栏,
修改函数允许Equips类型道具触发即捡即用效果,方便获取装备时 弹出文本框提示
增加白色打击动画用于攻击动画、增加被击怪物发亮
重置hand动画
9层事件,NPC一边移动一边消失(透明),适用了ad新写的插件
重置流汗(han)动画并用于13层、9层
优化了魔防在状态栏中的显示
开头剧情公主的粉色对话颜色修改为与RM一致的粉色
2023-01-04 00:01:17 +08:00
6 changed files with 677 additions and 591 deletions

View File

@ -417,6 +417,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"baofa",
"daizhi",
"daji",
"daji_bai",
"dajian",
"daluoleitian",
"daluoleitianhong",

View File

@ -55,15 +55,8 @@ main.floors.MT9=
"function": "function(){\ncore.Confirmskip_On();\n}"
},
{
"type": "move",
"loc": [
9,
3
],
"time": 500,
"steps": [
"right:3"
]
"type": "function",
"function": "function(){\ncore.moveHidingBlock(9,3,[\"right:3\"],500,0);\n}"
},
{
"type": "showImage2",
@ -142,7 +135,7 @@ main.floors.MT9=
},
{
"type": "animate",
"name": "hanyou",
"name": "han",
"loc": [
8,
3
@ -185,15 +178,8 @@ main.floors.MT9=
"time": 500
},
{
"type": "move",
"loc": [
8,
3
],
"time": 500,
"steps": [
"right:4"
]
"type": "function",
"function": "function(){\ncore.moveHidingBlock(8,3,[\"right:4\"],500,0);\n}"
},
{
"type": "function",

View File

@ -75,8 +75,8 @@ main.floors.QISHI=
],
"text": [
255,
0,
244,
128,
255,
1
],
"background": "winskin.png",

View File

@ -257,74 +257,74 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
return true;
},
"afterBattle": function (enemyId, x, y) {
// 战斗结束后触发的事件
// 战斗结束后触发的事件
var enemy = core.material.enemys[enemyId];
var special = enemy.special;
var enemy = core.material.enemys[enemyId];
var special = enemy.special;
// 播放战斗音效和动画
// 默认播放的动画;你也可以使用
var animate = 'hand'; // 默认动画
// 检查当前装备是否存在攻击动画
var equipId = core.getEquip(0);
if (equipId && (core.material.items[equipId].equip || {}).animate)
animate = core.material.items[equipId].equip.animate;
// 你也可以在这里根据自己的需要比如enemyId或special或flag来修改播放的动画效果
// if (enemyId == '...') animate = '...';
// 播放战斗音效和动画
// 默认播放的动画;你也可以使用
var animate = 'daji_bai'; // 默认动画
// 检查当前装备是否存在攻击动画
var equipId = core.getEquip(0);
if (equipId && (core.material.items[equipId].equip || {}).animate)
animate = core.material.items[equipId].equip.animate;
// 你也可以在这里根据自己的需要比如enemyId或special或flag来修改播放的动画效果
// if (enemyId == '...') animate = '...';
// 检查该动画是否存在SE如果不存在则使用默认音效
if (!(core.material.animates[animate] || {}).se)
core.playSound('attack.mp3');
// 检查该动画是否存在SE如果不存在则使用默认音效
if (!(core.material.animates[animate] || {}).se)
core.playSound('attack.mp3');
// 播放动画;如果不存在坐标(强制战斗)则播放到勇士自身
if (x != null && y != null)
core.drawAnimate(animate, x, y);
else
core.drawHeroAnimate(animate);
// 播放动画;如果不存在坐标(强制战斗)则播放到勇士自身
if (x != null && y != null)
core.drawAnimate(animate, x, y);
else
core.drawHeroAnimate(animate);
// 获得战斗伤害信息
var damageInfo = core.getDamageInfo(enemyId, null, x, y) || {};
// 战斗伤害
var damage = damageInfo.damage;
// 当前战斗回合数,可用于战后所需的判定
var turn = damageInfo.turn;
// 判定是否致死
if (damage == null || damage >= core.status.hero.hp) {
core.status.hero.hp = 0;
core.updateStatusBar(false, true);
core.events.lose('战斗失败');
return;
}
// 获得战斗伤害信息
var damageInfo = core.getDamageInfo(enemyId, null, x, y) || {};
// 战斗伤害
var damage = damageInfo.damage;
// 当前战斗回合数,可用于战后所需的判定
var turn = damageInfo.turn;
// 判定是否致死
if (damage == null || damage >= core.status.hero.hp) {
core.status.hero.hp = 0;
core.updateStatusBar(false, true);
core.events.lose('战斗失败');
return;
}
// 扣减体力值并记录统计数据
core.status.hero.hp -= damage;
core.status.hero.statistics.battleDamage += damage;
core.status.hero.statistics.battle++;
// 扣减体力值并记录统计数据
core.status.hero.hp -= damage;
core.status.hero.statistics.battleDamage += damage;
core.status.hero.statistics.battle++;
// 计算当前怪物的支援怪物
var guards = [];
if (x != null && y != null) {
guards = core.getFlag("__guards__" + x + "_" + y, []);
core.removeFlag("__guards__" + x + "_" + y);
}
// 计算当前怪物的支援怪物
var guards = [];
if (x != null && y != null) {
guards = core.getFlag("__guards__" + x + "_" + y, []);
core.removeFlag("__guards__" + x + "_" + y);
}
core.status.hero.mdef += [20, 3, 2, 1, 0, 20][core.getFlag('hard', 0)];
// 获得金币
var money = guards.reduce(function (curr, g) {
return curr + core.material.enemys[g[2]].money;
}, core.getEnemyValue(enemy, "money", x, y));
if (core.hasItem('coin')) money *= 2; // 幸运金币:双倍
if (core.hasFlag('curse')) money = 0; // 诅咒效果
core.status.hero.money += money;
core.status.hero.statistics.money += money;
core.status.hero.mdef += [20, 3, 2, 1, 0, 20][core.getFlag('hard', 0)];
// 获得金币
var money = guards.reduce(function (curr, g) {
return curr + core.material.enemys[g[2]].money;
}, core.getEnemyValue(enemy, "money", x, y));
if (core.hasItem('coin')) money *= 2; // 幸运金币:双倍
if (core.hasFlag('curse')) money = 0; // 诅咒效果
core.status.hero.money += money;
core.status.hero.statistics.money += money;
// 获得经验
var exp = guards.reduce(function (curr, g) {
return curr + core.material.enemys[g[2]].exp;
}, core.getEnemyValue(enemy, "exp", x, y));
if (core.hasFlag('curse')) exp = 0;
core.status.hero.exp += exp;
core.status.hero.statistics.exp += exp;
// 获得经验
var exp = guards.reduce(function (curr, g) {
return curr + core.material.enemys[g[2]].exp;
}, core.getEnemyValue(enemy, "exp", x, y));
if (core.hasFlag('curse')) exp = 0;
core.status.hero.exp += exp;
core.status.hero.statistics.exp += exp;
var hint = "打败 " + core.getEnemyValue(enemy, "name", x, y);
if (core.flags.statusBarItems.indexOf('enableMoney') >= 0)
@ -333,101 +333,101 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
hint += ',' + core.getStatusLabel('exp') + '+' + exp; // hint += ",经验+" + exp;
if (!core.getFlag("isNoTip")) core.drawTip(hint, enemy.id);
// 中毒
if (core.enemys.hasSpecial(special, 12)) {
core.triggerDebuff('get', 'poison');
}
// 衰弱
if (core.enemys.hasSpecial(special, 13)) {
core.triggerDebuff('get', 'weak');
}
// 诅咒
if (core.enemys.hasSpecial(special, 14)) {
core.triggerDebuff('get', 'curse');
}
// 仇恨怪物将仇恨值减半
if (core.enemys.hasSpecial(special, 17)) {
core.setFlag('hatred', Math.floor(core.getFlag('hatred', 0) / 2));
}
// 自爆
if (core.enemys.hasSpecial(special, 19)) {
core.status.hero.statistics.battleDamage += core.status.hero.hp - 1;
core.status.hero.hp = 1;
}
// 退化
if (core.enemys.hasSpecial(special, 21)) {
core.status.hero.atk -= (enemy.atkValue || 0);
core.status.hero.def -= (enemy.defValue || 0);
if (core.status.hero.atk < 0) core.status.hero.atk = 0;
if (core.status.hero.def < 0) core.status.hero.def = 0;
}
// 增加仇恨值
core.setFlag('hatred', core.getFlag('hatred', 0) + core.values.hatred);
// 中毒
if (core.enemys.hasSpecial(special, 12)) {
core.triggerDebuff('get', 'poison');
}
// 衰弱
if (core.enemys.hasSpecial(special, 13)) {
core.triggerDebuff('get', 'weak');
}
// 诅咒
if (core.enemys.hasSpecial(special, 14)) {
core.triggerDebuff('get', 'curse');
}
// 仇恨怪物将仇恨值减半
if (core.enemys.hasSpecial(special, 17)) {
core.setFlag('hatred', Math.floor(core.getFlag('hatred', 0) / 2));
}
// 自爆
if (core.enemys.hasSpecial(special, 19)) {
core.status.hero.statistics.battleDamage += core.status.hero.hp - 1;
core.status.hero.hp = 1;
}
// 退化
if (core.enemys.hasSpecial(special, 21)) {
core.status.hero.atk -= (enemy.atkValue || 0);
core.status.hero.def -= (enemy.defValue || 0);
if (core.status.hero.atk < 0) core.status.hero.atk = 0;
if (core.status.hero.def < 0) core.status.hero.def = 0;
}
// 增加仇恨值
core.setFlag('hatred', core.getFlag('hatred', 0) + core.values.hatred);
// 战后的技能处理,比如扣除魔力值
if (core.flags.statusBarItems.indexOf('enableSkill') >= 0) {
// 检测当前开启的技能类型
var skill = core.getFlag('skill', 0);
if (skill == 1) { // 技能1二倍斩
core.status.hero.mana -= 5; // 扣除5点魔力值
}
// 关闭技能
core.setFlag('skill', 0);
core.setFlag('skillName', '无');
}
// 战后的技能处理,比如扣除魔力值
if (core.flags.statusBarItems.indexOf('enableSkill') >= 0) {
// 检测当前开启的技能类型
var skill = core.getFlag('skill', 0);
if (skill == 1) { // 技能1二倍斩
core.status.hero.mana -= 5; // 扣除5点魔力值
}
// 关闭技能
core.setFlag('skill', 0);
core.setFlag('skillName', '无');
}
core.addPop(x * 32, y * 32, core.getBlockId(x, y));
// 事件的处理
var todo = [];
// 事件的处理
var todo = [];
// 加点事件
var point = guards.reduce(function (curr, g) {
return curr + core.material.enemys[g[2]].point;
}, core.getEnemyValue(enemy, "point", x, y)) || 0;
if (core.flags.enableAddPoint && point > 0) {
core.push(todo, [{ "type": "insert", "name": "加点事件", "args": [point] }]);
}
// 加点事件
var point = guards.reduce(function (curr, g) {
return curr + core.material.enemys[g[2]].point;
}, core.getEnemyValue(enemy, "point", x, y)) || 0;
if (core.flags.enableAddPoint && point > 0) {
core.push(todo, [{ "type": "insert", "name": "加点事件", "args": [point] }]);
}
// 战后事件
if (core.status.floorId != null) {
core.push(todo, core.floors[core.status.floorId].afterBattle[x + "," + y]);
}
core.push(todo, enemy.afterBattle);
// 战后事件
if (core.status.floorId != null) {
core.push(todo, core.floors[core.status.floorId].afterBattle[x + "," + y]);
}
core.push(todo, enemy.afterBattle);
// 在这里增加其他的自定义事件需求
/*
if (enemyId=='xxx') {
core.push(todo, [
{"type": "...", ...},
]);
}
*/
// 在这里增加其他的自定义事件需求
/*
if (enemyId=='xxx') {
core.push(todo, [
{"type": "...", ...},
]);
}
*/
// 如果事件不为空,将其插入
if (todo.length > 0) core.insertAction(todo, x, y);
// 如果事件不为空,将其插入
if (todo.length > 0) core.insertAction(todo, x, y);
// 删除该点设置的怪物信息
delete((flags.enemyOnPoint || {})[core.status.floorId] || {})[x + "," + y];
// 删除该点设置的怪物信息
delete ((flags.enemyOnPoint || {})[core.status.floorId] || {})[x + "," + y];
// 因为removeBlock和hideBlock都会刷新状态栏因此将删除部分移动到这里并保证刷新只执行一次以提升效率
if (core.getBlock(x, y) != null) {
// 检查是否是重生怪物;如果是则仅隐藏不删除
if (core.hasSpecial(enemy.special, 23)) {
core.hideBlock(x, y);
} else {
core.removeBlock(x, y);
}
} else {
core.updateStatusBar();
}
// 因为removeBlock和hideBlock都会刷新状态栏因此将删除部分移动到这里并保证刷新只执行一次以提升效率
if (core.getBlock(x, y) != null) {
// 检查是否是重生怪物;如果是则仅隐藏不删除
if (core.hasSpecial(enemy.special, 23)) {
core.hideBlock(x, y);
} else {
core.removeBlock(x, y);
}
} else {
core.updateStatusBar();
}
// 如果已有事件正在处理中
if (core.status.event.id == null)
core.continueAutomaticRoute();
else
core.clearContinueAutomaticRoute();
// 如果已有事件正在处理中
if (core.status.event.id == null)
core.continueAutomaticRoute();
else
core.clearContinueAutomaticRoute();
},
},
"afterOpenDoor": function (doorId, x, y) {
// 开一个门后触发的事件
@ -450,27 +450,29 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
core.clearContinueAutomaticRoute();
},
"afterGetItem": function (itemId, x, y, isGentleClick) {
// 获得一个道具后触发的事件
// itemId获得的道具IDx和y是该道具所在的坐标
// isGentleClick是否是轻按触发的
if (itemId.endsWith('Potion') && core.material.items[itemId].cls == 'items')
core.playSound('回血');
else if (itemId.endsWith('Gem') && core.material.items[itemId].cls == 'items')
core.playSound('宝石')
else
core.playSound('获得道具');
// 获得一个道具后触发的事件
// itemId获得的道具IDx和y是该道具所在的坐标
// isGentleClick是否是轻按触发的
if (itemId.endsWith('Potion') && core.material.items[itemId].cls == 'items')
core.playSound('回血');
else if (itemId.endsWith('Gem') && core.material.items[itemId].cls == 'items')
core.playSound('宝石')
else
core.playSound('获得道具');
var todo = [];
// 检查该点的获得道具后事件。
if (core.status.floorId == null) return;
var event = core.floors[core.status.floorId].afterGetItem[x + "," + y];
if (event && (event instanceof Array || !isGentleClick || !event.disableOnGentleClick)) {
if (event.data) event = event.data;
core.unshift(todo, event);
}
if (todo.length > 0) core.insertAction(todo, x, y);
},
var todo = [];
// 检查该点的获得道具后事件。
if (core.status.floorId == null) return;
var event = core.floors[core.status.floorId].afterGetItem[x + "," + y];
if (event && (event instanceof Array || !isGentleClick || !event.disableOnGentleClick)) {
if (event.data) event = event.data;
core.unshift(todo, event);
}
if (todo.length > 0) core.insertAction(todo, x, y);
},
"afterPushBox": function () {
// 推箱子后的事件
if (core.searchBlock('box').length == 0) {
@ -1653,7 +1655,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
core.ui.fillText(ctx, text, x, y, style);
},
fill1 = function (text, x, y, style) {
core.ui.setFont(ctx, '10px fzchyjw');
core.ui.setFont(ctx, '14px fzchyjw');
core.ui.fillText(ctx, text, x, y, style);
};
@ -1709,7 +1711,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
fill(core.formatBigNumber(core.status.hero.money), 107, 91 + 35 + 36 + 34 + 32, '#000000');
fill(core.getFlag("juqing", 0), 107, 91 + 35 + 36 + 34 + 32 + 32, '#FF0000');
ctx.textAlign = 'left';
if (flags.hard - 4) fill1('[' + core.formatBigNumber(core.getRealStatus('mdef')) + ']', 76, 174, '#FF1495');
if (flags.hard - 4) fill1('[' + core.formatBigNumber(core.getRealStatus('mdef')) + ']', 72, 176, '#c800c8');
if (core.status.event.id !== 'book' && core.status.event.id !== 'book-detail' && core.status.event.id !== 'toolbox') {
core.drawImage(ctx, core.material.images.items, 0, 0, 32, 128, 13, 300, 28, 112);
fill('黄钥匙', 50, 320, '#FFFF80');
@ -1743,7 +1745,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
//else
fill(hour + ':' + minutes + ':' + seconds, 140, 360, "#ffffff");
fill(step, 140, 455, '#ffffff');
setTimeout(function(){core.ui.drawStatusBar();}, 100);
setTimeout(function () { core.ui.drawStatusBar(); }, 100);
}
if (core.status.floorId == "nandu") {
core.dom.statusCanvas.width *= 1;

View File

@ -144,9 +144,9 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"itemEffectTip": ",攻击+0"
},
"sword1": {
"cls": "items",
"cls": "equips",
"name": "铁剑",
"text": "一把很普通的铁剑",
"text": "得到铁剑,攻击力+10",
"equip": {
"type": 0,
"animate": "sword",

File diff suppressed because it is too large Load Diff