From 29aba766298c3856435694652d0288a2b227870b Mon Sep 17 00:00:00 2001 From: bdf1 Date: Fri, 19 Jul 2024 19:56:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=A0=8F=E4=BC=9A=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=9C=A3=E9=AA=91=E5=A3=AB=E4=BA=B2=E5=AF=86=E5=BA=A6?= =?UTF-8?q?=EF=BC=9B=E8=83=BD=E8=A2=AB=E5=9C=A3=E9=AA=91=E5=A3=AB=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E6=89=93=E8=B4=A5=E7=9A=84=E6=98=BE=E4=BC=A4=E4=BC=9A?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=8E=B7=E5=BE=97=E7=9A=84=E7=89=A9=E5=93=81?= =?UTF-8?q?=EF=BC=9B=E4=BC=98=E5=8C=96=E7=99=BD=E5=AE=9D=E7=9F=B3=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/enemys.js | 4 +- project/floors/XY1.js | 6 +-- project/floors/XY7.js | 2 +- project/plugins.js | 94 ++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 98 insertions(+), 8 deletions(-) diff --git a/project/enemys.js b/project/enemys.js index facd52e..b447e34 100644 --- a/project/enemys.js +++ b/project/enemys.js @@ -20,7 +20,7 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 = "swordsman": {"name":"双手剑士","hp":850,"atk":545,"def":120,"money":32,"exp":0,"point":0,"special":[],"level":"武品初阶"}, "soldier": {"name":"冥战士","hp":1224,"atk":485,"def":185,"money":44,"exp":0,"point":0,"special":[],"Y":20,"level":"武品中阶"}, "yellowKnight": {"name":"金骑士","hp":1200,"atk":560,"def":156,"money":26,"exp":0,"point":0,"special":[37],"Y":10}, - "redKnight": {"name":"红骑士","hp":3000,"atk":465,"def":135,"money":42,"exp":0,"point":0,"special":[36,37],"Y":10,"displayIdInBook":null,"X":30,"level":"武品高阶","beforeBattle":[{"type":"if","condition":"(flag:shengqishi>4)","true":[{"type":"animate","name":"sword"},{"type":"setBlock","number":"N472"},"\t[唐佳成,N472]\b[this]此等骑士,不堪一击!",{"type":"setValue","name":"status:atk","operator":"+=","value":"2"},{"type":"setValue","name":"status:def","operator":"+=","value":"2"},{"type":"setValue","name":"status:mdef","operator":"+=","value":"4"},"唐佳成击杀骑士,获得二阶红蓝绿宝石各一枚。",{"type":"hide","remove":true}],"false":[]}]}, + "redKnight": {"name":"红骑士","hp":3000,"atk":465,"def":135,"money":42,"exp":0,"point":0,"special":[36,37],"Y":10,"displayIdInBook":null,"X":30,"level":"武品高阶","beforeBattle":[{"type":"if","condition":"(flag:shengqishi>4)","true":[{"type":"animate","name":"sword"},{"type":"setBlock","number":"N472"},"\t[${flag:shengqishi_name},N472]\b[this]此等骑士,不堪一击!",{"type":"setValue","name":"status:atk","operator":"+=","value":"2"},{"type":"setValue","name":"status:def","operator":"+=","value":"2"},{"type":"setValue","name":"status:mdef","operator":"+=","value":"4"},"${flag:shengqishi_name}击杀骑士,获得二阶红蓝绿宝石各一枚。",{"type":"hide","remove":true}],"false":[]}]}, "darkKnight": {"name":"黑骑士","hp":1650,"atk":800,"def":200,"money":34,"exp":0,"point":0,"special":[36],"X":40}, "blueKnight": {"name":"蓝骑士","hp":1200,"atk":420,"def":156,"money":26,"exp":0,"point":0,"special":[9,37],"Y":30,"displayIdInBook":null,"purify":1}, "goldSlime": {"name":"金史莱姆","hp":888,"atk":525,"def":95,"money":20,"exp":0,"point":0,"special":[21,39],"mdefValue":20,"Atkvalue":2,"Defvalue":2,"Mdefvalue":null}, @@ -562,7 +562,7 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 = "E1023": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "E1024": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "E1025": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, - "E1027": {"name":"考核法师","hp":10400,"atk":840,"def":425,"money":150,"exp":0,"point":0,"special":[],"level":"地品初阶","notBomb":true,"displayIdInBook":null,"beforeBattle":[{"type":"if","condition":"(flag:shengqishi===8)","true":[{"type":"animate","name":"sword"},{"type":"setBlock","number":"N472"},"\t[唐佳成,N472]\b[this]考你麻痹!圣子殿下也是你能考的?","\t[考核法师,E1027]哎呦……圣子殿下,你不讲武德!","\t[唐佳成,N472]\b[this]连我都打不过,还考圣子殿下?还不快把通关奖励拿出来!","\t[考核法师,E1027]可恶的小子,你给我等着,我定要让教皇陛下做主!",{"type":"setBlock","number":"I612","loc":[[4,7]]},{"type":"setBlock","number":"I416","loc":[[8,7]]},{"type":"setBlock","number":"I625","loc":[[6,3]]},"考核法师逃跑了!","\t[唐佳成,N472]\b[this]嘿嘿,圣子殿下,看我的鬼手掏了多少?","金币+300",{"type":"setValue","name":"status:money","operator":"+=","value":"300"},"\t[莫析辉,hero]\b[hero]不错,不过下次可别这样了。","\t[唐佳成,N472]\b[this]知道啦!嘿嘿。","考核法师又回来了。","\t[唐佳成,N472]\b[this]你还来干嘛?","\t[考核法师,E1027]哼,教皇陛下准备让圣子殿下、圣女殿下、准圣子殿下进入隐世学院交流。","\t[莫析辉,hero]\b[hero]隐世学院?","\t[考核法师,E1027]回圣子殿下,隐世学院是一个不逊于光明学院的学院,只是常年隐居,很少有人知道罢了。但是很多强大势力的少主都送到隐世学院交流,教皇陛下有意让你们三人前去交流……emmm,唐佳成,你也可以去。","\t[莫析辉,hero]\b[hero]好吧。那我们去就是了,入口在哪里?","\t[考核法师,E1027]在光明学院6,有一个传送阵,圣子殿下赶快启程吧!",{"type":"hide","remove":true}],"false":[]}]}, + "E1027": {"name":"考核法师","hp":10400,"atk":840,"def":425,"money":150,"exp":0,"point":0,"special":[],"level":"地品初阶","notBomb":true,"displayIdInBook":null,"beforeBattle":[{"type":"if","condition":"(flag:shengqishi===8)","true":[{"type":"animate","name":"sword"},{"type":"setBlock","number":"N472"},"\t[${flag:shengqishi_name},N472]\b[this]考你麻痹!圣子殿下也是你能考的?","\t[考核法师,E1027]哎呦……圣子殿下,你不讲武德!","\t[${flag:shengqishi_name},N472]\b[this]连我都打不过,还考圣子殿下?还不快把通关奖励拿出来!","\t[考核法师,E1027]可恶的小子,你给我等着,我定要让教皇陛下做主!",{"type":"setBlock","number":"I612","loc":[[4,7]]},{"type":"setBlock","number":"I416","loc":[[8,7]]},{"type":"setBlock","number":"I625","loc":[[6,3]]},"考核法师逃跑了!","\t[${flag:shengqishi_name},N472]\b[this]嘿嘿,圣子殿下,看我的鬼手掏了多少?","金币+300",{"type":"setValue","name":"status:money","operator":"+=","value":"300"},"\t[莫析辉,hero]\b[hero]不错,不过下次可别这样了。","\t[${flag:shengqishi_name},N472]\b[this]知道啦!嘿嘿。","考核法师又回来了。","\t[${flag:shengqishi_name},N472]\b[this]你还来干嘛?","\t[考核法师,E1027]哼,教皇陛下准备让圣子殿下、圣女殿下、准圣子殿下进入隐世学院交流。","\t[莫析辉,hero]\b[hero]隐世学院?","\t[考核法师,E1027]回圣子殿下,隐世学院是一个不逊于光明学院的学院,只是常年隐居,很少有人知道罢了。但是很多强大势力的少主都送到隐世学院交流,教皇陛下有意让你们三人前去交流……emmm,${flag:shengqishi_name},你也可以去。","\t[莫析辉,hero]\b[hero]好吧。那我们去就是了,入口在哪里?","\t[考核法师,E1027]在光明学院6,有一个传送阵,圣子殿下赶快启程吧!",{"type":"hide","remove":true}],"false":[]}]}, "E1028": {"name":"提灯幽灵","hp":12000,"atk":650,"def":340,"money":200,"exp":0,"point":0,"special":[6],"level":"地品初阶","notBomb":true,"n":5}, "E1029": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "E1030": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, diff --git a/project/floors/XY1.js b/project/floors/XY1.js index a2eb378..503a89f 100644 --- a/project/floors/XY1.js +++ b/project/floors/XY1.js @@ -243,11 +243,11 @@ main.floors.XY1= "shadow": 0 }, "data": [ - "\t[唐佳成,N472]\b[this]圣子殿下。", + "\t[${flag:shengqishi_name},N472]\b[this]圣子殿下。", "\t[莫析辉,hero]\b[hero]你怎么也进来了。", - "\t[唐佳成,N472]\b[this]嘿嘿,是教皇陛下看我天赋很高,让我进入光明学院的,嘻嘻", + "\t[${flag:shengqishi_name},N472]\b[this]嘿嘿,是教皇陛下看我天赋很高,让我进入光明学院的,嘻嘻", "\t[莫析辉,hero]\b[hero]那还不错,希望你能尽快变强,成为光明骑士!", - "\t[唐佳成,N472]\b[this]光明骑士?不,我要成为圣子殿下的守护骑士……", + "\t[${flag:shengqishi_name},N472]\b[this]光明骑士?不,我要成为圣子殿下的守护骑士……", "\t[莫析辉,hero]\b[hero]好,我很期待。", { "type": "hide", diff --git a/project/floors/XY7.js b/project/floors/XY7.js index 94791b2..4e1bda1 100644 --- a/project/floors/XY7.js +++ b/project/floors/XY7.js @@ -119,7 +119,7 @@ main.floors.XY7= "type": "if", "condition": "(flag:shengqishi>1)", "true": [ - "\t[唐佳成,N472]\b[this]可恶,那准圣子殿下,你能告诉我是谁吗?", + "\t[${flag:shengqishi_name},N472]\b[this]可恶,那准圣子殿下,你能告诉我是谁吗?", "\t[葛尔丹,N566]\b[this,5,4]呵呵", "\t[葛尔丹,N566]\b[this,5,4]这内奸啊,不仅敢对光明圣子干坏事,他啊,嗨忠于光明圣女呢。圣子弟弟,你可要小心点咯。" ], diff --git a/project/plugins.js b/project/plugins.js index a1a75fb..5ef3940 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -1743,6 +1743,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = if (!num && name != 'key1' && name != 'key2' && name != 'potion1' && name != 'potion2') { num = hero[name] + if(name == 'shengqishi') num = flags[name] num = num.toString() if (name === 'atk2') { num = Math.max(0, (hero[name] * 0.01 + 1)).toFixed(2); @@ -2142,7 +2143,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = for (var i in heroStatus) core.mystatusNumber(ctx, heroStatus[i], null, 80, 100 + 100 + 60 * Number(i), Scol[i]); //魔力 - core.mystatusNumber(ctx, 'mana', null, 80 + 152 + 422, 122, 20); + core.mystatusNumber(ctx, 'shengqishi', null, 80 + 152 + 422, 122, 20); core.setAlpha(ctx, 0.4) core.drawImage(ctx, 'manaLt.png', 0, 0, 128 * hero.mana / hero.manamax, 32, 60 - 16 + 4 + 152 + 422, 142, 128 * hero.mana / hero.manamax, 32) core.setAlpha(ctx, 1) @@ -2640,6 +2641,87 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.getItemDetail(floorId); // 宝石血瓶详细信息 this.drawDamage(ctx); }; + core.control._updateDamage_damage = function (floorId, onMap) { + core.status.damage.data = []; + if (!core.flags.displayEnemyDamage && !core.flags.displayExtraDamage) return; + + core.extractBlocks(floorId); + core.status.maps[floorId].blocks.forEach(function (block) { + var x = block.x, + y = block.y; + + // v2优化,只绘制范围内的部分 + if (onMap && core.bigmap.v2) { + if (x < core.bigmap.posX - core.bigmap.extend || x > core.bigmap.posX + core._WIDTH_ + core.bigmap.extend || + y < core.bigmap.posY - core.bigmap.extend || y > core.bigmap.posY + core._HEIGHT_ + core.bigmap.extend) { + return; + } + } + + if (!block.disable && block.event.cls.indexOf('enemy') == 0 && block.event.displayDamage !== false) { + if (core.flags.displayCritical) { + var critical = core.enemys.nextCriticals(block.event.id, 1, x, y, floorId); + critical = core.formatBigNumber((critical[0] || [])[0], true); + if (critical == '???') critical = '?'; + core.status.damage.data.push({ text: critical, px: 32 * x + 1, py: 32 * (y + 1) - 11, color: '#FFFFFF' }); + } + if (core.flags.displayEnemyDamage) { + var damageString = core.enemys.getDamageString(block.event.id, x, y, floorId); + core.status.damage.data.push({ text: damageString.damage, px: 32 * x + 1, py: 32 * (y + 1) - 1, color: damageString.color }); + if (core.material.enemys[block.event.id].beforeBattle) { + var t = core.material.enemys[block.event.id].beforeBattle[0].condition; + if (t[0] == '(') t = t.substring(1, t.length - 1); + t = t.replace('flag:shengqishi', ''); + core.status.damage.data.push({ text: t, px: 32 * x + 1, py: 32 * (y + 1) - 21, color: '#FFFFFF' }); + t = core.material.enemys[block.event.id].beforeBattle[0].condition; + t = t.replace('flag:shengqishi', flags.shengqishi || 0); + if (eval(t)) { + core.status.damage.data = core.status.damage.data.filter(t => (t.px != 32 * x + 1 || (t.py != 32 * (y + 1) - 1 && t.py != 32 * (y + 1) - 11 && t.py != 32 * (y + 1) - 21))) + diff = {} + const before = core.status.hero; + const hero = core.clone(core.status.hero); + const handler = { + set(target, key, v) { + diff[key] = (diff[key] || 0) + v - (target[key] || 0); + if (!diff[key]) diff[key] = void 0; + return true; + } + }; + core.status.hero = new Proxy(hero, handler); + for (var i of (core.material.enemys[block.event.id].beforeBattle[0].true)) + if (i.type == 'setValue') { + var value = core.events._updateValueByOperator(core.calValue(i.value), core.calValue(i.name), i.operator); + core.events._setValue_setStatus(i.name, value); + if ((i.name.indexOf("item:") == 0)) { + var itemId = i.name.substring(5), + count = core.itemCount(itemId); + if (core.material.items[itemId].itemEffect) { + for (var i = count; i < value; i++) eval(core.material.items[itemId].itemEffect); + } else diff[itemId] = value - count; + } + + //core.events._setValue_setBuff(i.name, value); + //core.events._setValue_setItem(i.name, value); + //core.events._setValue_setFlag(i.name, value); + //core.events._setValue_setSwitch(i.name, value); + //core.events._setValue_setTemp(i.name, value); + //core.events._setValue_setGlobal(i.name, value); + //core.events.setValue(i.name, i.operator, i.value); + }; + var addPoint = { 'I359': 1, 'I598': 2, 'I599': 4, 'I600': 8, 'I601': 16, 'I602': 32, 'I603': 64, 'I604': 100 }; + diff['point'] = 0; + for (var i in addPoint) + if (diff[i]) diff['point'] += diff[i] * addPoint[i], diff[i] = 0; + drawItemDetail(diff, x, y); + core.status.hero = before; + window.hero = before; + window.flags = before.flags; + } + } + } + } + }); + } // 获取宝石信息 并绘制 this.getItemDetail = function (floorId) { if (!core.getFlag('itemDetail')) return; @@ -2723,8 +2805,13 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = diff['point'] = 0; for (var i in addPoint) if (diff[i]) diff['point'] += diff[i] * addPoint[i], diff[i] = 0; - } else + } else { + eval(item.itemEffect); + var addPoint = { 'I359': 1, 'I598': 2, 'I599': 4, 'I600': 8, 'I601': 16, 'I602': 32, 'I603': 64, 'I604': 100 }; + if (addPoint[block.event.id]) + diff['point'] = addPoint[block.event.id] + } } catch (error) {} drawItemDetail(diff, x, y); }); @@ -2785,6 +2872,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = case 'point': content = '+' + content; break; + case 'money': + color = '#7f7f7f' + break; default: console.log(name, diff[name]) if (diff[name] == 1) content = core.material.items[name].name;