From e506a4343733806010c2b08e8687d6804f046ffc Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Sun, 4 Feb 2024 23:58:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8A=A5=E9=94=99=E5=92=8C=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/_server/table/data.comment.js | 8 +- public/libs/control.js | 62 +++- public/libs/enemys.js | 2 +- public/libs/events.js | 9 +- public/project/data.js | 13 +- public/project/enemys.js | 128 ++++---- public/project/floors/empty.js | 6 +- public/project/functions.js | 220 +++----------- public/project/plugins.js | 229 +++++++++++++- public/styles.css | 2 +- src/App.vue | 2 +- src/components/box.vue | 5 +- src/components/colomn.vue | 2 - src/core/main/init/ui.ts | 6 - src/core/main/setting.ts | 11 - src/game/enemy/battle.ts | 7 +- src/game/enemy/damage.ts | 284 ++++++++--------- src/game/game.ts | 21 +- src/game/hero.ts | 28 +- src/game/index.ts | 3 +- src/game/system.ts | 13 +- src/panel/enemyCritical.vue | 9 - src/plugin/fx/frag.ts | 1 - src/plugin/game/dev/hotReload.js | 129 -------- src/plugin/game/enemy/checkblock.ts | 191 +----------- src/plugin/game/fx/halo.ts | 65 ---- src/plugin/game/fx/itemDetail.ts | 11 +- src/plugin/game/index.ts | 6 - src/plugin/game/ui.ts | 74 ----- src/plugin/ui/fly.ts | 1 + src/plugin/use.ts | 12 +- src/styles.less | 1 - src/ui/achievement.vue | 339 --------------------- src/ui/bgmList.vue | 90 ------ src/ui/book.vue | 2 - src/ui/bookDetail.vue | 3 +- src/ui/chapter.vue | 1 - src/ui/completeAchievement.vue | 117 ------- src/ui/desc.vue | 79 ----- src/ui/equipbox.vue | 4 - src/ui/fixed.vue | 1 - src/ui/fly.vue | 2 - src/ui/index.ts | 8 - src/ui/settings.vue | 1 - src/ui/shop.vue | 1 - src/ui/skill.vue | 81 ----- src/ui/skillTree.vue | 436 -------------------------- src/ui/start.vue | 2 - src/ui/statusBar.vue | 439 +++++++++++++-------------- src/ui/studied.vue | 82 ----- src/ui/study.vue | 14 - src/ui/toolEditor.vue | 2 - src/ui/toolbox.vue | 2 - 53 files changed, 790 insertions(+), 2477 deletions(-) delete mode 100644 src/plugin/game/dev/hotReload.js delete mode 100644 src/plugin/game/fx/halo.ts delete mode 100644 src/ui/achievement.vue delete mode 100644 src/ui/bgmList.vue delete mode 100644 src/ui/completeAchievement.vue delete mode 100644 src/ui/desc.vue delete mode 100644 src/ui/skill.vue delete mode 100644 src/ui/skillTree.vue delete mode 100644 src/ui/studied.vue delete mode 100644 src/ui/study.vue diff --git a/public/_server/table/data.comment.js b/public/_server/table/data.comment.js index beebb7d..1a745da 100644 --- a/public/_server/table/data.comment.js +++ b/public/_server/table/data.comment.js @@ -531,12 +531,10 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "金币", "
经验", "升级", - "
升级扣除模式", "
钥匙", "绿钥", "
破炸", - "负面", - "
技能" + "负面" ], "key": [ "enableFloor", @@ -551,12 +549,10 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "enableMoney", "enableExp", "enableLevelUp", - "levelUpLeftMode", "enableKeys", "enableGreenKey", "enablePZF", - "enableDebuff", - "enableSkill" + "enableDebuff" ] }, "_data": "状态栏显示项" diff --git a/public/libs/control.js b/public/libs/control.js index 2cb62f5..abffea1 100644 --- a/public/libs/control.js +++ b/public/libs/control.js @@ -884,7 +884,12 @@ control.prototype._moveAction_popAutomaticRoute = function () { ////// 让勇士开始移动 ////// control.prototype.moveHero = function (direction, callback) { - // see src/plugin/game/popup.js + // 如果正在移动,直接return + if (core.status.heroMoving != 0) return; + if (core.isset(direction)) core.setHeroLoc('direction', direction); + + if (callback) return this.moveAction(callback); + this._moveHero_moving(); }; control.prototype._moveHero_moving = function () { @@ -1444,7 +1449,7 @@ control.prototype.updateCheckBlock = function (floorId) { ////// 检查并执行领域、夹击、阻击事件 ////// control.prototype.checkBlock = function () { - // see src/plugin/game/popup.js + // see src/plugin/game/enemy/checkblock.js }; control.prototype._checkBlock_disableQuickShop = function () { @@ -1501,7 +1506,46 @@ control.prototype.drawDamage = function (ctx, floorId = core.status.floorId) { }; control.prototype._drawDamage_draw = function (ctx, onMap) { - // Deprecated. See src/plugin/game/fx/checkblock.js + if (!core.hasItem('book')) return; + + core.setFont(ctx, 'bold 11px Arial'); + core.setTextAlign(ctx, 'left'); + core.status.damage.data.forEach(function (one) { + var px = one.px, + py = one.py; + if (onMap && core.bigmap.v2) { + px -= core.bigmap.posX * 32; + py -= core.bigmap.posY * 32; + if ( + px < -32 * 2 || + px > core._PX_ + 32 || + py < -32 || + py > core._PY_ + 32 + ) + return; + } + core.fillBoldText(ctx, one.text, px, py, one.color); + }); + + core.setTextAlign(ctx, 'center'); + core.status.damage.extraData.forEach(function (one) { + var px = one.px, + py = one.py; + if (onMap && core.bigmap.v2) { + px -= core.bigmap.posX * 32; + py -= core.bigmap.posY * 32; + if ( + px < -32 || + px > core._PX_ + 32 || + py < -32 || + py > core._PY_ + 32 + ) + return; + } + var alpha = core.setAlpha(ctx, one.alpha); + core.fillBoldText(ctx, one.text, px, py, one.color); + core.setAlpha(ctx, alpha); + }); }; // ------ 录像相关 ------ // @@ -2334,9 +2378,6 @@ control.prototype._doSL_load = function (id, callback) { id == 'autoSave' ? id : 'save' + id, null, function (data) { - if (!main.replayChecking && data) { - Mota.require('var', 'fixedUi').closeByName('start'); - } if (id == 'autoSave' && data != null) { core.saves.autosave.data = data; if (!(core.saves.autosave.data instanceof Array)) { @@ -2393,6 +2434,9 @@ control.prototype._doSL_load_afterGet = function (id, data) { } core.ui.closePanel(); core.loadData(data, function () { + if (!main.replayChecking) { + Mota.require('var', 'fixedUi').closeByName('start'); + } core.removeFlag('__fromLoad__'); core.drawTip('读档成功'); if (id != 'autoSave') { @@ -2812,17 +2856,17 @@ control.prototype.getStatus = function (name) { ////// 从status中获得属性,如果不存在则从勇士属性中获取 ////// control.prototype.getStatusOrDefault = function (status, name) { - // Deprecated. See src/plugin/game/hero.ts + // Deprecated. See src/game/hero.ts }; ////// 获得勇士实际属性(增幅后的) ////// control.prototype.getRealStatus = function (name) { - // Deprecated. See src/plugin/game/hero.ts + // Deprecated. See src/game/hero.ts }; ////// 从status中获得实际属性(增幅后的),如果不存在则从勇士属性中获取 ////// control.prototype.getRealStatusOrDefault = function (status, name) { - // Deprecated. See src/plugin/game/hero.ts + // Deprecated. See src/game/hero.ts }; ////// 获得勇士原始属性(无装备和衰弱影响) ////// diff --git a/public/libs/enemys.js b/public/libs/enemys.js index 4980a2e..5745983 100644 --- a/public/libs/enemys.js +++ b/public/libs/enemys.js @@ -94,7 +94,7 @@ enemys.prototype.getEnemyValue = function (enemy, name, x, y, floorId) { ////// 能否获胜 ////// enemys.prototype.canBattle = function (enemy, x, y, floorId) { - // Deprecated. See src/plugin/game/enemy/battle.ts + // Deprecated. See src/game/enemy/battle.ts }; enemys.prototype.getDamageString = function (enemy, x, y, floorId, hero) { diff --git a/public/libs/events.js b/public/libs/events.js index c0e0e11..81ce140 100644 --- a/public/libs/events.js +++ b/public/libs/events.js @@ -30,7 +30,6 @@ events.prototype.startGame = function (hard, seed, route, callback) { } if (main.mode != 'play') return; - Mota.Plugin.require('skillTree_g').resetSkillLevel(); // 无动画的开始游戏 if (core.flags.startUsingCanvas || route != null) { @@ -495,22 +494,22 @@ events.prototype._trigger_ignoreChangeFloor = function (block) { }; events.prototype._sys_battle = function (data, callback) { - // Deprecated. See /src/plugin/game/enemy/battle.ts + // Deprecated. See /src/game/enemy/battle.ts }; ////// 战斗 ////// events.prototype.battle = function (id, x, y, force, callback) { - // Deprecated. See src/plugin/game/enemy/battle.ts + // Deprecated. See src/game/enemy/battle.ts }; ////// 战斗前触发的事件 ////// events.prototype.beforeBattle = function (enemyId, x, y) { - // Deprecated. See src/plugin/game/enemy/battle.ts + // Deprecated. See src/game/enemy/battle.ts }; ////// 战斗结束后触发的事件 ////// events.prototype.afterBattle = function (enemyId, x, y) { - // Deprecated. See src/plugin/game/enemy/battle.ts + // Deprecated. See src/game/enemy/battle.ts }; events.prototype._sys_openDoor = function (data, callback) { diff --git a/public/project/data.js b/public/project/data.js index 82a874f..6792963 100644 --- a/public/project/data.js +++ b/public/project/data.js @@ -742,14 +742,23 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "flags": { "statusBarItems": [ "enableFloor", + "enableName", + "enableLv", + "enableHPMax", "enableHP", + "enableMana", "enableAtk", "enableDef", "enableMDef", "enableMoney", - "enableKeys" + "enableExp", + "enableLevelUp", + "enableKeys", + "enableGreenKey", + "enablePZF", + "enableDebuff" ], - "extendToolbar": false, + "extendToolbar": true, "flyNearStair": true, "flyRecordPosition": false, "itemFirstText": false, diff --git a/public/project/enemys.js b/public/project/enemys.js index 17cde5a..eb693bb 100644 --- a/public/project/enemys.js +++ b/public/project/enemys.js @@ -1,82 +1,82 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 = { - "greenSlime": {"name":"绿头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "greenSlime": {"name":"绿头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "redSlime": {"name":"红头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[16,18],"value":10}, - "blackSlime": {"name":"青头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "blackSlime": {"name":"青头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "slimelord": {"name":"怪王","hp":100,"atk":120,"def":0,"money":10,"exp":0,"point":0,"special":[1,9]}, "bat": {"name":"小蝙蝠","hp":100,"atk":120,"def":0,"money":2,"exp":0,"point":0,"special":[1]}, - "bigBat": {"name":"大蝙蝠","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "bigBat": {"name":"大蝙蝠","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "redBat": {"name":"红蝙蝠","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "vampire": {"name":"冥灵魔王","hp":888,"atk":888,"def":888,"money":888,"exp":888,"point":0,"special":[6],"n":8}, - "skeleton": {"name":"骷髅人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "skeletonCaptain": {"name":"骷髅队长","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "zombie": {"name":"兽人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "zombieKnight": {"name":"兽人武士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "rock": {"name":"石头人","hp":50,"atk":50,"def":0,"money":3,"exp":0,"point":0,"special":3}, + "skeleton": {"name":"骷髅人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "skeletonCaptain": {"name":"骷髅队长","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "zombie": {"name":"兽人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "zombieKnight": {"name":"兽人武士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "rock": {"name":"石头人","hp":50,"atk":50,"def":0,"money":3,"exp":0,"point":0,"special":[3]}, "bluePriest": {"name":"初级法师","hp":100,"atk":120,"def":0,"money":3,"exp":0,"point":1,"special":[9]}, - "redPriest": {"name":"高级法师","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "brownWizard": {"name":"初级巫师","hp":100,"atk":120,"def":0,"money":16,"exp":0,"point":0,"special":15,"value":100,"range":2}, - "redWizard": {"name":"高级巫师","hp":1000,"atk":1200,"def":0,"money":160,"exp":0,"point":0,"special":15,"value":200,"zoneSquare":true}, - "swordsman": {"name":"双手剑士","hp":100,"atk":120,"def":0,"money":6,"exp":0,"point":0,"special":4}, - "soldier": {"name":"冥战士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "yellowKnight": {"name":"金骑士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "redPriest": {"name":"高级法师","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "brownWizard": {"name":"初级巫师","hp":100,"atk":120,"def":0,"money":16,"exp":0,"point":0,"special":[15],"value":100,"range":2}, + "redWizard": {"name":"高级巫师","hp":1000,"atk":1200,"def":0,"money":160,"exp":0,"point":0,"special":[15],"value":200,"zoneSquare":true}, + "swordsman": {"name":"双手剑士","hp":100,"atk":120,"def":0,"money":6,"exp":0,"point":0,"special":[4]}, + "soldier": {"name":"冥战士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "yellowKnight": {"name":"金骑士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "redKnight": {"name":"红骑士","hp":500,"atk":200,"def":50,"money":0,"exp":0,"point":0,"special":[7]}, - "darkKnight": {"name":"黑骑士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "blueKnight": {"name":"蓝骑士","hp":100,"atk":120,"def":0,"money":9,"exp":0,"point":0,"special":8}, - "goldSlime": {"name":"黄头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "poisonSkeleton": {"name":"紫骷髅","hp":50,"atk":60,"def":70,"money":80,"exp":0,"point":0,"special":13}, - "poisonBat": {"name":"紫蝙蝠","hp":100,"atk":120,"def":0,"money":14,"exp":0,"point":0,"special":13}, - "skeletonPriest": {"name":"骷髅法师","hp":100,"atk":100,"def":0,"money":0,"exp":0,"point":0,"special":18,"value":20}, - "skeletonKing": {"name":"骷髅王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "evilHero": {"name":"迷失勇者","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "demonPriest": {"name":"魔神法师","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "goldHornSlime": {"name":"金角怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "silverSlime": {"name":"银头怪","hp":100,"atk":120,"def":0,"money":15,"exp":0,"point":0,"special":14}, - "whiteHornSlime": {"name":"尖角怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "darkKnight": {"name":"黑骑士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "blueKnight": {"name":"蓝骑士","hp":100,"atk":120,"def":0,"money":9,"exp":0,"point":0,"special":[8]}, + "goldSlime": {"name":"黄头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "poisonSkeleton": {"name":"紫骷髅","hp":50,"atk":60,"def":70,"money":80,"exp":0,"point":0,"special":[13]}, + "poisonBat": {"name":"紫蝙蝠","hp":100,"atk":120,"def":0,"money":14,"exp":0,"point":0,"special":[13]}, + "skeletonPriest": {"name":"骷髅法师","hp":100,"atk":100,"def":0,"money":0,"exp":0,"point":0,"special":[18],"value":20}, + "skeletonKing": {"name":"骷髅王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "evilHero": {"name":"迷失勇者","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "demonPriest": {"name":"魔神法师","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "goldHornSlime": {"name":"金角怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "silverSlime": {"name":"银头怪","hp":100,"atk":120,"def":0,"money":15,"exp":0,"point":0,"special":[14]}, + "whiteHornSlime": {"name":"尖角怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "redSwordsman": {"name":"剑王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "poisonZombie": {"name":"绿兽人","hp":100,"atk":120,"def":0,"money":13,"exp":0,"point":0,"special":[12]}, - "octopus": {"name":"血影","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"bigImage":"dragon_1.png"}, - "princessEnemy": {"name":"假公主","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "angel": {"name":"天使","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "elemental": {"name":"元素生物","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "octopus": {"name":"血影","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[],"bigImage":"dragon_1.png"}, + "princessEnemy": {"name":"假公主","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "angel": {"name":"天使","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "elemental": {"name":"元素生物","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "steelGuard": {"name":"铁守卫","hp":50,"atk":50,"def":50,"money":0,"exp":0,"point":0,"special":[18],"value":20}, - "evilBat": {"name":"邪恶蝙蝠","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "silverSlimelord": {"name":"银怪王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "goldSlimelord": {"name":"金怪王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "skeletonWarrior": {"name":"骷髅士兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "whiteSlimeman": {"name":"水银战士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "evilBat": {"name":"邪恶蝙蝠","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "silverSlimelord": {"name":"银怪王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "goldSlimelord": {"name":"金怪王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "skeletonWarrior": {"name":"骷髅士兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "whiteSlimeman": {"name":"水银战士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "slimeman": {"name":"影子战士","hp":100,"atk":0,"def":0,"money":11,"exp":0,"point":0,"special":[9],"atkValue":2,"defValue":3}, - "yellowGateKeeper": {"name":"初级卫兵","hp":100,"atk":120,"def":0,"money":10,"exp":0,"point":0,"special":0}, - "blueGateKeeper": {"name":"中级卫兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "redGateKeeper": {"name":"高级卫兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "magicMaster": {"name":"黑暗大法师","hp":100,"atk":120,"def":0,"money":12,"exp":0,"point":0,"special":11,"value":0.3333333333333333,"add":true,"notBomb":true}, - "devilWarrior": {"name":"魔神武士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "fairyEnemy": {"name":"仙子","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "dragon": {"name":"魔龙","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0,"bigImage":"dragon_0.png"}, - "skeletonKnight": {"name":"骷髅武士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "skeletonPresbyter": {"name":"骷髅巫师","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "ironRock": {"name":"铁面人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "grayRock": {"name":"灰色石头人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "yellowPriest": {"name":"中级法师","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "yellowGateKeeper": {"name":"初级卫兵","hp":100,"atk":120,"def":0,"money":10,"exp":0,"point":0,"special":[]}, + "blueGateKeeper": {"name":"中级卫兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "redGateKeeper": {"name":"高级卫兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "magicMaster": {"name":"黑暗大法师","hp":100,"atk":120,"def":0,"money":12,"exp":0,"point":0,"special":[11],"value":0.3333333333333333,"add":true,"notBomb":true}, + "devilWarrior": {"name":"魔神武士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "fairyEnemy": {"name":"仙子","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "dragon": {"name":"魔龙","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[],"bigImage":"dragon_0.png"}, + "skeletonKnight": {"name":"骷髅武士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "skeletonPresbyter": {"name":"骷髅巫师","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "ironRock": {"name":"铁面人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "grayRock": {"name":"灰色石头人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "yellowPriest": {"name":"中级法师","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "evilPrincess": {"name":"痛苦魔女","hp":1000,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[10]}, - "blademaster": {"name":"剑圣","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "evilFairy": {"name":"黑暗仙子","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "greenKnight": {"name":"强盾骑士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "bowman": {"name":"初级弓兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "watcherSlime": {"name":"邪眼怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "blademaster": {"name":"剑圣","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "evilFairy": {"name":"黑暗仙子","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "greenKnight": {"name":"强盾骑士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "bowman": {"name":"初级弓兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "watcherSlime": {"name":"邪眼怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "devilKnight": {"name":"恶灵骑士","hp":150,"atk":100,"def":50,"money":0,"exp":0,"point":0,"special":[1,5,7,8]}, - "grayPriest": {"name":"混沌法师","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "greenGateKeeper": {"name":"卫兵队长","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "ghostSoldier": {"name":"冥队长","hp":200,"atk":100,"def":50,"money":0,"exp":0,"point":0,"special":8}, - "frostBat": {"name":"寒蝙蝠","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "blackKing": {"name":"黑衣魔王","hp":1000,"atk":500,"def":0,"money":1000,"exp":1000,"point":0,"special":0,"notBomb":true}, - "yellowKing": {"name":"黄衣魔王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "greenKing": {"name":"青衣武士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "redKing": {"name":"红衣魔王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "blueKing": {"name":"白衣武士","hp":100,"atk":120,"def":0,"money":17,"exp":0,"point":0,"special":16}, - "keiskeiFairy": {"name":"铃兰花妖","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "tulipFairy": {"name":"郁金香花妖","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, - "purpleBowman": {"name":"高级弓兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, + "grayPriest": {"name":"混沌法师","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "greenGateKeeper": {"name":"卫兵队长","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "ghostSoldier": {"name":"冥队长","hp":200,"atk":100,"def":50,"money":0,"exp":0,"point":0,"special":[8]}, + "frostBat": {"name":"寒蝙蝠","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "blackKing": {"name":"黑衣魔王","hp":1000,"atk":500,"def":0,"money":1000,"exp":1000,"point":0,"special":[],"notBomb":true}, + "yellowKing": {"name":"黄衣魔王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "greenKing": {"name":"青衣武士","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "redKing": {"name":"红衣魔王","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "blueKing": {"name":"白衣武士","hp":100,"atk":120,"def":0,"money":17,"exp":0,"point":0,"special":[16]}, + "keiskeiFairy": {"name":"铃兰花妖","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "tulipFairy": {"name":"郁金香花妖","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, + "purpleBowman": {"name":"高级弓兵","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "bearDown": {"name":"熊出没","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[],"faceIds":{"down":"bearDown","left":"bearLeft","right":"bearRight","up":"bearUp"},"bigImage":"bear.png"}, "bearLeft": {"name":"熊出没","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[],"faceIds":{"down":"bearDown","left":"bearLeft","right":"bearRight","up":"bearUp"}}, "bearRight": {"name":"熊出没","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[],"faceIds":{"down":"bearDown","left":"bearLeft","right":"bearRight","up":"bearUp"}}, diff --git a/public/project/floors/empty.js b/public/project/floors/empty.js index 6390299..95fad01 100644 --- a/public/project/floors/empty.js +++ b/public/project/floors/empty.js @@ -1,8 +1,8 @@ main.floors.empty= { "floorId": "empty", - "title": "山脚", - "name": "13", + "title": "空地图", + "name": "空地图", "width": 15, "height": 15, "canFlyTo": false, @@ -11,7 +11,7 @@ main.floors.empty= "cannotViewMap": true, "images": [], "ratio": 1, - "defaultGround": "grass", + "defaultGround": "ground", "bgm": "mount.mp3", "weather": [ "sun", diff --git a/public/project/functions.js b/public/project/functions.js index 9bd6959..3af2b28 100644 --- a/public/project/functions.js +++ b/public/project/functions.js @@ -49,12 +49,10 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { if (core.hasFlag('hideStatusBar')) core.hideStatusBar(core.hasFlag('showToolbox')); else core.showStatusBar(); - if (main.mode === 'play' && !main.replayChecking) { + Mota.r(() => { Mota.Plugin.require('fly_r').splitArea(); Mota.require('var', 'hook').emit('reset'); - } else { - flags.autoSkill ??= true; - } + }); }, win: function (reason, norank, noexit) { // 游戏获胜事件 @@ -66,12 +64,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { core.status.extraEvent = core.clone(core.status.event); } - if (reason === '智慧之始') { - core.status.hero.hp += - core.itemCount('yellowKey') * 5000 + - core.itemCount('blueKey') * 15000; - } - // 游戏获胜事件 core.ui.closePanel(); var replaying = core.isReplaying(); @@ -113,8 +105,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { // 正在切换楼层过程中执行的操作;此函数的执行时间是“屏幕完全变黑“的那一刻 // floorId为要切换到的楼层ID;heroLoc表示勇士切换到的位置 - const { checkLoopMap } = Mota.Plugin.require('loopMap_g'); - flags.floorChanging = true; // ---------- 此时还没有进行切换,当前floorId还是原来的 ---------- // @@ -170,8 +160,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { if (weather) core.setWeather(weather[0], weather[1]); else core.setWeather(); - checkLoopMap(); - // ...可以新增一些其他内容,比如创建个画布在右上角显示什么内容等等 }, afterChangeFloor: function (floorId) { @@ -322,18 +310,13 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { values: values, version: core.firstData.version, guid: core.getGuid(), - time: new Date().getTime(), - skills: Mota.Plugin.require('skillTree_g').saveSkillTree() + time: new Date().getTime() }; return data; }, loadData: function (data, callback) { // 读档操作;从存储中读取了内容后的行为 - if (window.flags && flags.onChase) { - flags.chase.end(); - flags.onChase = true; - } // 重置游戏和路线 core.resetGame( data.hero, @@ -371,8 +354,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { } core.setFlag('__fromLoad__', true); - Mota.Plugin.require('skillTree_g').loadSkillTree(data.skills); - // 切换到对应的楼层 core.changeFloor(data.floorId, null, data.hero.loc, 0, function () { if (core.hasFlag('__bgm__')) { @@ -382,13 +363,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { core.removeFlag('__fromLoad__'); if (callback) callback(); - - if (flags.onChase) { - Mota.Plugin.require('chase_r').startChase(flags.chaseIndex); - if (flags.chaseIndex === 1) { - core.playBgm('escape.mp3', 43.5); - } - } }); }, updateStatusBar: function () { @@ -397,32 +371,58 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { // 检查等级 core.events.checkLvUp(); - // 如果是自定义添加的状态栏,也需要在这里进行设置显示的数值 + const getHeroStatusOn = Mota.require('fn', 'getHeroStatusOn'); + + // 检查HP上限 + if (core.flags.statusBarItems.indexOf('enableHPMax') >= 0) { + core.setStatus( + 'hp', + Math.min(getHeroStatusOn('hpmax'), core.getStatus('hp')) + ); + } + + // 设置生命上限、生命值、攻防护盾金币和经验值 + var statusList = [ + 'hpmax', + 'hp', + 'mana', + 'atk', + 'def', + 'mdef', + 'money', + 'exp' + ]; + statusList.forEach(function (item) { + // 向下取整 + core.status.hero[item] = Math.floor(core.status.hero[item]); + }); + + // 设置魔力值; status:manamax 只有在非负时才生效。 + if ( + core.status.hero.manamax != null && + core.getRealStatus('manamax') >= 0 + ) { + core.status.hero.mana = Math.min( + core.status.hero.mana, + core.getRealStatus('manamax') + ); + } // 难度 if (core.statusBar.hard.innerText != core.status.hard) { core.statusBar.hard.innerText = core.status.hard; } - var hardColor = core.getFlag('__hardColor__', 'red'); + var hardColor = core.getFlag('__hardColor__'); + if (hardColor == null) core.statusBar.hard.innerText = ''; if (core.statusBar.hard.getAttribute('_style') != hardColor) { core.statusBar.hard.style.color = hardColor; core.statusBar.hard.setAttribute('_style', hardColor); } - // 更新全地图显伤 + // 更新阻激夹域的伤害值 + core.updateCheckBlock(); + // updateDamage只能在此处执行!!更新全地图显伤 core.updateDamage(); - - if (main.replayChecking) return; - - // 已学习的技能 - // if ( - // core.plugin.skillTree.getSkillLevel(11) > 0 && - // (core.status.hero.special?.num ?? []).length > 0 - // ) { - // mota.plugin.ui.showStudiedSkill.value = true; - // } else { - // mota.plugin.ui.showStudiedSkill.value = false; - // } }, moveOneStep: function (callback) { // 勇士每走一步后执行的操作。callback为行走完毕后的回调 @@ -432,8 +432,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { // 2, 将楼层属性中的cannotMoveDirectly这个开关勾上,即禁止在该层楼使用瞬移。 // 3. 将flag:cannotMoveDirectly置为true,即可使用flag控制在某段剧情范围内禁止瞬移。 - const { checkLoopMap } = Mota.Plugin.require('loopMap_g'); - // 增加步数 core.status.hero.steps++; // 更新跟随者状态,并绘制 @@ -480,136 +478,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { ); } - checkLoopMap(); - - // 追猎 - // todo: 重写 - if ( - core.status.checkBlock.haveHunt && - !core - .getBlockId(core.status.hero.loc.x, core.status.hero.loc.y) - ?.endsWith('Portal') - ) { - var x = core.status.hero.loc.x, - y = core.status.hero.loc.y; - core.status.maps[core.status.floorId].blocks.forEach(function ( - block - ) { - if (block.x != x && block.y != y) return; - var id = block.event.id, - enemy = core.material.enemys[id]; - if (enemy && core.hasSpecial(enemy.special, 12)) { - var nx = block.x, - ny = block.y; - var dx = Math.abs(x - nx), - dy = Math.abs(y - ny); - if (x == block.x) { - if ( - y > block.y && - !core.noPass(block.x, block.y + 1) && - core.getBlockCls(block.x, block.y + 1) != - 'items' - ) { - dy--; - ny++; - core.insertAction([ - { - type: 'move', - loc: [block.x, block.y], - time: 200, - keep: true, - steps: ['down:1'] - }, - { - type: 'if', - condition: dy + '<=1', - true: [ - { type: 'battle', loc: [nx, ny] } - ] - } - ]); - } - if ( - y < block.y && - !core.noPass(block.x, block.y - 1) && - core.getBlockCls(block.x, block.y - 1) != - 'items' - ) { - dy--; - ny--; - core.insertAction([ - { - type: 'move', - loc: [block.x, block.y], - time: 200, - keep: true, - steps: ['up:1'] - }, - { - type: 'if', - condition: dy + '<=1', - true: [ - { type: 'battle', loc: [nx, ny] } - ] - } - ]); - } - } else { - if ( - x > block.x && - !core.noPass(block.x + 1, block.y) && - core.getBlockCls(block.x + 1, block.y) != - 'items' - ) { - dx--; - nx++; - core.insertAction([ - { - type: 'move', - loc: [block.x, block.y], - time: 200, - keep: true, - steps: ['right:1'] - }, - { - type: 'if', - condition: dx + '<=1', - true: [ - { type: 'battle', loc: [nx, ny] } - ] - } - ]); - } - if ( - x < block.x && - !core.noPass(block.x - 1, block.y) && - core.getBlockCls(block.x - 1, block.y) != - 'items' - ) { - dx--; - nx--; - core.insertAction([ - { - type: 'move', - loc: [block.x, block.y], - time: 200, - keep: true, - steps: ['left:1'] - }, - { - type: 'if', - condition: dx + '<=1', - true: [ - { type: 'battle', loc: [nx, ny] } - ] - } - ]); - } - } - } - }); - } - // 如需强行终止行走可以在这里条件判定: // core.stopAutomaticRoute(); }, diff --git a/public/project/plugins.js b/public/project/plugins.js index 0ceac9d..a8e06c9 100644 --- a/public/project/plugins.js +++ b/public/project/plugins.js @@ -1,10 +1,4 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = { - init: function () { - // 对于一部分的常用插件,样板已经内置,同时配有开关,可以在设置里面开关 - // 以及那些只提供api的插件也是已经内置 - // 这里内置的插件只有不容易开关的插件 - this._afterLoadResources = function () {}; - }, fiveLayer: function () { // 注册插件 Mota.Plugin.register('fiveLayer_g', { init }, init); @@ -225,5 +219,228 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = { }; }; } + }, + uiRewrite: function () { + Mota.Plugin.register('ui_g', { init }, init); + + function init() { + const { mainUi, fixedUi } = Mota.requireAll('var'); + + ui.prototype.drawBook = function () { + if (!core.isReplaying()) return mainUi.open('book'); + }; + + ui.prototype._drawToolbox = function () { + if (!core.isReplaying()) return mainUi.open('toolbox'); + }; + + ui.prototype._drawEquipbox = function () { + if (!core.isReplaying()) return mainUi.open('equipbox'); + }; + + ui.prototype.drawFly = function () { + if (!core.isReplaying()) return mainUi.open('fly'); + }; + + control.prototype.updateStatusBar_update = function () { + core.control.updateNextFrame = false; + if (!core.isPlaying() || core.hasFlag('__statistics__')) return; + core.control.controldata.updateStatusBar(); + if (!core.control.noAutoEvents) core.checkAutoEvents(); + core.control._updateStatusBar_setToolboxIcon(); + core.clearRouteFolding(); + core.control.noAutoEvents = true; + // 更新vue状态栏 + updateVueStatusBar(); + Mota.require('var', 'hook').emit('statusBarUpdate'); + }; + + // todo: 多个状态栏分离与控制 + control.prototype.showStatusBar = function () { + if (main.mode == 'editor') return; + core.removeFlag('hideStatusBar'); + if (!fixedUi.hasName('statusBar')) { + fixedUi.open('statusBar'); + } + core.dom.tools.hard.style.display = 'block'; + core.dom.toolBar.style.display = 'block'; + }; + + control.prototype.hideStatusBar = function (showToolbox) { + if (main.mode == 'editor') return; + + // 如果原本就是隐藏的,则先显示 + if (!core.domStyle.showStatusBar) this.showStatusBar(); + if (core.isReplaying()) showToolbox = true; + fixedUi.closeByName('statusBar'); + + var toolItems = core.dom.tools; + core.setFlag('hideStatusBar', true); + core.setFlag('showToolbox', showToolbox || null); + if ( + (!core.domStyle.isVertical && !core.flags.extendToolbar) || + !showToolbox + ) { + for (var i = 0; i < toolItems.length; ++i) + toolItems[i].style.display = 'none'; + } + if (!core.domStyle.isVertical && !core.flags.extendToolbar) { + core.dom.toolBar.style.display = 'none'; + } + }; + } + + function updateVueStatusBar() { + Mota.r(() => { + const status = Mota.require('var', 'status'); + status.value = !status.value; + }); + } + }, + battle: function () { + // 这个插件负责战斗相关内容 + + // --------------- 战斗伤害 + + const Damage = Mota.require('module', 'Damage'); + // 这个数组常量控制着在战斗时哪些属性计算真实属性,也就是经过buff加成的属性 + // 如果有属性不会经过buff加成等,请将其去除,可以提高性能表现 + Damage.realStatus = ['atk', 'def', 'mdef', 'hpmax']; + + // 复写系统的伤害计算函数即可,全量复写 + // 函数接受两个参数,分别是怪物信息和勇士信息,返回一个数字作为伤害 + // 返回null表示不能战斗,返回Infinity也可以 + Mota.rewrite(Damage, 'calDamageWith', 'full', (info, hero) => { + // 获取勇士属性,这几个属性直接从core.status.hero获取 + const { hp, mana } = core.status.hero; + // 获取勇士属性,这几个属性从勇士真实属性获取 + // 分开获取是因为获取勇士真实属性会对性能造成一定影响 + let { atk, def, mdef, hpmax } = hero; + // 获取怪物信息,是在某点的信息 + let { hp: monHp, atk: monAtk, def: monDef, special, enemy } = info; + + /** 总伤害 */ + let damage = 0; + /** 勇士单回合伤害 */ + let heroPerDamage; + + if (special.includes(3)) { + // 由于坚固的特性,只能放到这来计算了 + if (atk > enemy.def) heroPerDamage = 1; + else return null; + } else { + heroPerDamage = atk - monDef; + if (heroPerDamage <= 0) return null; + } + + /** 怪物单回合伤害 */ + let enemyPerDamage; + + // 魔攻 + if (special.includes(2) || special.includes(13)) { + enemyPerDamage = monAtk; + } else { + enemyPerDamage = monAtk - def; + if (enemyPerDamage < 0) enemyPerDamage = 0; + } + + // 先攻 + if (special.includes(17)) { + damage += enemyPerDamage; + } + + // 连击 + if (special.includes(4)) enemyPerDamage *= 2; + if (special.includes(5)) enemyPerDamage *= 3; + if (special.includes(6)) enemyPerDamage *= enemy.n; + + /** 战斗回合 */ + let turn = Math.ceil(monHp / heroPerDamage); + + damage += (turn - 1) * enemyPerDamage; + damage -= mdef; + if (!core.flags.enableNegativeDamage) damage = Math.max(0, damage); + + return damage; + }); + + // --------------- 地图伤害 + // 全量复写地图伤害的计算函数,注意此处不能使用箭头函数,因为这是在原型上的函数,其this指向实例,也即怪物(DamageEnemy实例) + // 函数接收两个参数,damage和hero,前者表示要将结果存入的对象,后者是勇士真实属性 + // 直接将damage返回即可,返回其他值有可能会引起出错 + // 计算出伤害后直接调用this.setMapDamage即可将伤害传到对象中 + Mota.rewrite( + Mota.require('class', 'DamageEnemy').prototype, + 'calMapDamage', + 'full', + function (damage = {}, hero = getHeroStatusOn(Damage.realStatus)) { + // 功能函数,计算曼哈顿距离,和判断一个值是否存在 + const { manhattan, has } = Mota.Plugin.require('utils_g'); + // 判断这个怪物是不是在地图上 + if (!has(this.x) || !has(this.y) || !has(this.floorId)) + return damage; + const enemy = this.enemy; + const floor = core.status.maps[this.floorId]; + const w = floor.width; + const h = floor.height; + + // 突刺 + if (this.info.special.includes(15)) { + const range = enemy.range ?? 1; + const startX = Math.max(0, this.x - range); + const startY = Math.max(0, this.y - range); + const endX = Math.min(floor.width - 1, this.x + range); + const endY = Math.min(floor.height - 1, this.y + range); + const dam = Math.max((enemy.value ?? 0) - hero.def, 0); + + for (let x = startX; x <= endX; x++) { + for (let y = startY; y <= endY; y++) { + if ( + !enemy.zoneSquare && + manhattan(x, y, this.x, this.y) > range + ) { + continue; + } + const loc = `${x},${y}`; + this.setMapDamage(damage, loc, dam, '突刺'); + } + } + } + + // 射击 + if (this.info.special.includes(24)) { + const dirs = ['left', 'down', 'up', 'right']; + const dam = Math.max((enemy.atk ?? 0) - hero.def, 0); + const objs = core.getMapBlocksObj(this.floorId); + + for (const dir of dirs) { + let x = this.x; + let y = this.y; + const { x: dx, y: dy } = core.utils.scan[dir]; + while (x >= 0 && y >= 0 && x < w && y < h) { + x += dx; + y += dy; + const loc = `${x},${y}`; + const block = objs[loc]; + if ( + block && + block.event.noPass && + block.event.cls !== 'enemys' && + block.event.cls !== 'enemy48' && + block.id !== 141 && + block.id !== 151 + ) { + break; + } + this.setMapDamage(damage, loc, dam, '射击'); + } + } + } + + return damage; + } + ); + + // --------------- 光环处理 } }; diff --git a/public/styles.css b/public/styles.css index 03c3ed0..3398040 100644 --- a/public/styles.css +++ b/public/styles.css @@ -149,7 +149,6 @@ body { position: absolute; text-align: center; font-size: 1.4em; - font-family: 'normal'; display: none; z-index: 310; bottom: 0; @@ -450,6 +449,7 @@ p#name { background: white; width: 250px; min-height: 50px; + color: #000d; } #inputMessage { diff --git a/src/App.vue b/src/App.vue index 7db7cc4..b8cadd5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -48,7 +48,7 @@ function show(index: number) { position: fixed; overflow: visible; display: block; - font-family: 'normal'; + font-size: 80%; } #ui-main { diff --git a/src/components/box.vue b/src/components/box.vue index 565b7df..762996e 100644 --- a/src/components/box.vue +++ b/src/components/box.vue @@ -43,7 +43,7 @@ - - diff --git a/src/ui/bgmList.vue b/src/ui/bgmList.vue deleted file mode 100644 index 1d02372..0000000 --- a/src/ui/bgmList.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - - - diff --git a/src/ui/book.vue b/src/ui/book.vue index 7c479ef..722921e 100644 --- a/src/ui/book.vue +++ b/src/ui/book.vue @@ -188,7 +188,6 @@ onUnmounted(() => { user-select: none; width: 80%; height: 100%; - font-family: 'normal'; overflow: hidden; transition: opacity 0.6s linear; display: flex; @@ -208,7 +207,6 @@ onUnmounted(() => { display: flex; justify-content: center; align-items: center; - font-family: 'normal'; } .enemy { diff --git a/src/ui/bookDetail.vue b/src/ui/bookDetail.vue index 595cb2f..e84076b 100644 --- a/src/ui/bookDetail.vue +++ b/src/ui/bookDetail.vue @@ -167,12 +167,11 @@ onUnmounted(() => { opacity: 0; position: absolute; left: 14%; - font-family: 'normal'; display: flex; flex-direction: column; align-items: center; width: 72%; - height: 90%; + height: 100%; transition: all 0.6s ease; user-select: none; } diff --git a/src/ui/chapter.vue b/src/ui/chapter.vue index 8b2a30c..1b59d21 100644 --- a/src/ui/chapter.vue +++ b/src/ui/chapter.vue @@ -141,7 +141,6 @@ onMounted(async () => { #chapter-text { position: relative; - font-family: 'normal'; font-size: 5vh; text-shadow: 0px 0px 5px #fff; } diff --git a/src/ui/completeAchievement.vue b/src/ui/completeAchievement.vue deleted file mode 100644 index 23ab899..0000000 --- a/src/ui/completeAchievement.vue +++ /dev/null @@ -1,117 +0,0 @@ - - - - - diff --git a/src/ui/desc.vue b/src/ui/desc.vue deleted file mode 100644 index 355d776..0000000 --- a/src/ui/desc.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - - - diff --git a/src/ui/equipbox.vue b/src/ui/equipbox.vue index a6138a4..4b84605 100644 --- a/src/ui/equipbox.vue +++ b/src/ui/equipbox.vue @@ -484,8 +484,6 @@ onUnmounted(() => { font-size: 3.2vh; height: 5vh; justify-content: space-between; - font-family: 'normal'; - .tools { white-space: nowrap; } @@ -496,7 +494,6 @@ onUnmounted(() => { width: 100%; display: flex; flex-direction: row; - font-family: 'normal'; font-size: 150%; } @@ -518,7 +515,6 @@ onUnmounted(() => { .select { width: 100%; - font-family: 'normal'; font-size: 75%; } diff --git a/src/ui/fixed.vue b/src/ui/fixed.vue index 6cf7aeb..fc76359 100644 --- a/src/ui/fixed.vue +++ b/src/ui/fixed.vue @@ -135,7 +135,6 @@ onMounted(() => { diff --git a/src/ui/skillTree.vue b/src/ui/skillTree.vue deleted file mode 100644 index a6bdb72..0000000 --- a/src/ui/skillTree.vue +++ /dev/null @@ -1,436 +0,0 @@ - - - - - diff --git a/src/ui/start.vue b/src/ui/start.vue index db120a9..8a90d38 100644 --- a/src/ui/start.vue +++ b/src/ui/start.vue @@ -109,7 +109,6 @@ function resize() { nextFrame(() => { const scale = core.domStyle.scale; - console.log(scale); const h = core._PY_; const height = h * scale; const width = height * 1.5; @@ -169,7 +168,6 @@ function bgm() { core.triggerBgm(); soundChecked.value = !soundChecked.value; mainSetting.setValue('audio.bgmEnabled', soundChecked.value); - console.log(mainSetting.getValue('audio.bgmEnabled')); } async function setFullscreen() { diff --git a/src/ui/statusBar.vue b/src/ui/statusBar.vue index f96df96..e44b490 100644 --- a/src/ui/statusBar.vue +++ b/src/ui/statusBar.vue @@ -12,116 +12,164 @@ :no-scroll="true" >
- {{ floor }} - {{ lvName }} -
- - {{ skill }} - 剩余{{ spring }} + + + + {{ floor }}
-
- - {{ - format(hero.hp!) - }} - +{{ format(hero.hpmax!) }}/t - 跳跃剩余{{ jumpCnt }} +
+ + + + {{ hero.name }}
-
- - {{ - format(hero.atk!) - }} - +{{ format(hero.mana!) }} +
+ + + + {{ lvName }}
-
- - {{ format(hero.def!) }} -
-
- - {{ format(hero.mdef!) }} -
-
- - {{ format(hero.money!) }} -
-
- - {{ format(up) }} -
-
- {{ - keys[0]?.toString().padStart(2, '0') - }} - {{ - keys[1]?.toString().padStart(2, '0') - }} - {{ - keys[2]?.toString().padStart(2, '0') +
+ + + + {{ + format(hero.hpmax ?? 0) }}
-
- 技能树 + + + + {{ + format(hero.hp ?? 0) + }} +
+
+ + + + {{ format(hero.mana ?? 0) }} / + {{ format(hero.manamax ?? 0) }}
-
+
+ + + + {{ + format(hero.atk ?? 0) + }} +
+
+ + + + {{ + format(hero.def ?? 0) + }} +
+
+ + + + {{ + format(hero.mdef ?? 0) + }} +
+
+ + + + {{ + format(hero.money ?? 0) + }} +
+
+ + + + {{ + format(hero.exp ?? 0) + }} +
+
+ + + + {{ format(up ?? 0) }} +
+
查看技能{{ + keys[i]?.toString().padStart(2, '0') ?? '00' + }}
-
+
学习 + {{ name }} {{ pzf[i] ?? 0 }} + +
+
+
@@ -135,9 +183,9 @@ import Box from '../components/box.vue'; import Scroll from '../components/scroll.vue'; import { status } from '../plugin/ui/statusBar'; import { isMobile } from '../plugin/use'; -import { has } from '../plugin/utils'; -const skillTree = Mota.Plugin.require('skillTree_g'); +const items = core.flags.statusBarItems; +const icons = core.statusBar.icons; const width = ref( isMobile ? window.innerWidth - 60 : window.innerWidth * 0.175 @@ -151,27 +199,28 @@ watch(height, n => (updateStatus.value = !updateStatus.value)); const hero = shallowReactive>({}); const keys = shallowReactive([]); +const pzf = shallowReactive([]); +const debuff = shallowReactive([]); const floor = ref(); const lvName = ref(); -const skill = ref(flags.autoSkill ? '自动切换' : '无'); const up = ref(0); -const spring = ref(); -const skillOpened = ref(core.getFlag('chapter', 0) > 0); -const studyOpened = ref(skillTree.getSkillLevel(11) > 0); -const jumpCnt = ref(); +const keyColor = ['yellow', 'blue', 'red']; +const pzfName = ['破', '炸', '飞']; +const debuffName = ['毒', '衰', '咒']; +if (items.includes('enableGreenKey')) keyColor.push('green'); /** * 要展示的勇士属性 */ const toShow: (keyof NumbericHeroStatus)[] = [ - 'hp', // 生命 - 'atk', // 攻击 - 'def', // 防御 - 'mdef', // 智力 - 'hpmax', // 生命回复 - 'mana', // 额外攻击 - 'money', // 金币 - 'exp', // 经验 - 'lv' // 等级 + 'atk', + 'def', + 'mdef', + 'hpmax', + 'mana', + 'money', + 'exp', + 'lv', + 'manamax' ]; watch(status, update); @@ -183,53 +232,23 @@ function update() { toShow.forEach(v => { hero[v] = Mota.requireAll('fn').getHeroStatusOn(v); }); + hero.name = core.status.hero.name; + hero.hp = core.status.hero.hp; keys[0] = core.itemCount('yellowKey'); keys[1] = core.itemCount('blueKey'); keys[2] = core.itemCount('redKey'); + keys[3] = core.itemCount('greenKey'); + debuff[0] = core.getFlag('poison'); + debuff[1] = core.getFlag('weak'); + debuff[2] = core.getFlag('curse'); + pzf[0] = core.itemCount('pickaxe'); + pzf[1] = core.itemCount('bomb'); + pzf[2] = core.itemCount('centerFly'); floor.value = core.status.thisMap?.title; lvName.value = core.getLvName(hero.lv); - if (flags.autoSkill) { - skill.value = '自动切换'; - } else { - if (flags.blade && flags.bladeOn) { - skill.value = '断灭之刃'; - } else if (flags.shield && flags.shieldOn) { - skill.value = '铸剑为盾'; - } else { - skill.value = '无'; - } - } up.value = core.getNextLvUpNeed() ?? 0; - if (core.hasFlag('spring')) { - spring.value = 50 - (flags.springCount ?? 0); - } else { - spring.value = void 0; - } - skillOpened.value = core.getFlag('chapter', 0) > 0; - studyOpened.value = skillTree.getSkillLevel(11) > 0; - jumpCnt.value = - flags.skill2 && - !Mota.Plugin.require('skill_g').jumpIgnoreFloor.includes( - core.status.floorId - ) - ? 3 - (flags[`jump_${core.status.floorId}`] ?? 0) - : void 0; } -function openSkillTree() { - core.useItem('skill1'); -} - -function openSkill() { - core.useItem('cross'); -} - -function viewMap() { - core.ui._drawViewMaps(); -} - -function openStudy() {} - onMounted(() => { update(); }); @@ -244,11 +263,12 @@ onMounted(() => { } .status-item { - position: relative; + display: flex; + flex-direction: row; max-width: 17.5vw; - font-size: 200%; + font-size: 150%; width: 100%; - margin-bottom: 1vh; + margin-bottom: 14px; text-shadow: 3px 2px 3px #000, 0px 0px 3px #111; display: flex; flex-direction: row; @@ -260,12 +280,14 @@ onMounted(() => { } .status-icon { - width: 2.8vw; - height: 2.8vw; margin-right: 10%; margin-left: 10%; } +.status-value { + transform: translateY(2px); +} + #status-header { width: 100%; display: flex; @@ -280,85 +302,44 @@ onMounted(() => { height: 100%; } -#status-floor { - max-width: 17.5vw; - font-size: 200%; - width: 100%; - text-align: center; - text-shadow: 3px 2px 3px #000, 0px 0px 3px #111; -} - -#status-lv { - max-width: 17.5vw; - font-size: 200%; - width: 100%; - text-align: center; - text-shadow: 3px 2px 3px #000, 0px 0px 3px #111; -} - -.status-extra { - position: absolute; - right: 10%; - bottom: 0; - font-size: 75%; -} - -#status-mana { - line-height: 0; - color: rgb(255, 211, 211); -} - -#status-hpmax { - line-height: 0; - color: rgb(167, 255, 167); -} - -#status-spring { - line-height: 0; - color: rgb(167, 255, 167); - top: 0; - font-size: 75%; -} - -#status-jump { - line-height: 0; - top: 0; - font-size: 75%; -} - -#status-key { +#status-key, +.status-pzf, +.status-debuff { display: flex; flex-direction: row; justify-content: space-around; } -#skill-tree, -#status-skill { - text-align: center; - width: 100%; +.status-key[color='yellow'] { + color: #fca; +} +.status-key[color='blue'] { + color: #aad; +} +.status-key[color='red'] { + color: #f88; +} +.status-key[color='green'] { + color: #8f8; } -@media screen and (max-width: 600px) { - .status-item { - max-width: 40vw; - font-size: 120%; - } +.status-pzf-value[index='0'] { + color: #bc6e27; +} +.status-pzf-value[index='1'] { + color: #fa14b9; +} +.status-pzf-value[index='2'] { + color: #8db600; +} - #status-floor { - max-width: 40vw; - font-size: 120%; - width: 100%; - } - - #status-lv { - max-width: 40vw; - font-size: 120%; - width: 100%; - } - - .status-icon { - width: 28px; - height: 28px; - } +.status-debuff-value[index='0'] { + color: #affca8; +} +.status-debuff-value[index='1'] { + color: #feccd0; +} +.status-debuff-value[index='2'] { + color: #c2f4e7; } diff --git a/src/ui/studied.vue b/src/ui/studied.vue deleted file mode 100644 index ffe2cd2..0000000 --- a/src/ui/studied.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - - - diff --git a/src/ui/study.vue b/src/ui/study.vue deleted file mode 100644 index 3a8c6b5..0000000 --- a/src/ui/study.vue +++ /dev/null @@ -1,14 +0,0 @@ - - - - - diff --git a/src/ui/toolEditor.vue b/src/ui/toolEditor.vue index 2030876..755e2aa 100644 --- a/src/ui/toolEditor.vue +++ b/src/ui/toolEditor.vue @@ -303,7 +303,6 @@ onUnmounted(() => {