From 0982780cd1e46aaafdb2fe1cdd81be2853792bc2 Mon Sep 17 00:00:00 2001 From: strawberry42271 <2806566736@qq.com> Date: Tue, 14 Jan 2025 17:48:17 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A3=85=E5=A4=87=E6=A0=8F=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _saves/Eustia_autoSave | 2 +- _server/MotaAction.g4 | 4 +- _server/config.json | 2 +- project/data.js | 5 +- project/floors/street01.js | 2 +- project/floors/yiqu8.js | 60 +- project/items.js | 15 +- project/plugins.js | 2741 +++++++++++++++++++----------------- 8 files changed, 1497 insertions(+), 1334 deletions(-) diff --git a/_saves/Eustia_autoSave b/_saves/Eustia_autoSave index f31acdb..cedd650 100644 --- a/_saves/Eustia_autoSave +++ b/_saves/Eustia_autoSave @@ -1 +1 @@ -N4IgZgNg9lBOCSATEAuEBnALrApjzADAIwgA0IAFjrFKqAJYC2AhgOY6qXVQB0ADgDtWZEMwFNmmDijDMI6HOQHNG0kAGFmTERABuqIuQp8WADwMFLRvhasgWysxfIPmqAuUkBrZyEQ4wX0Z/QJQiD3soARwAT3dyHFMbFAicAEcAV3oTHAFMVABtAF1yeilGdDoQAGMorDFMSpRQACMYHzDySDiwgF9yTBh5On6QdKy+JuBe0ehqqsR6XGrMeijODJtycxQAVnIe8NHINimQMpxGABF8LQhUbAzFEAyFACF8AHc8AQAZelYFHyKEezwA+mCFDhEBDUABOAAsuwRAGYCAAmAgADnIENgYhhYPhSNRGOxnlwzCaBVAjjUAB0MgicAQWozdtUEeiRCxJoUNFpGBQoKoQEV+rSVAymSy2RkOVyecw+SgCiAAFb0DKsDJiMUSkB0ziM5ms9mc7kuZXUkAAaQAKgA1fWkSWitCMgDs6IAbOiveiwCQrSq1Q7HQAxbni12GqXGjLev0BoNK0MgVhQCCILyxF1u6WmuUKy32a38lr0CivDK0GMFhOm5jmxUhm2a5hQTBiYT1uPukAmlnN+UWtM29BUIQCXTC0V9o0emUEEcl8f8yf0GdzjgL+NLpP+xOB4Nl9Oa6Gd/P96WHlOn3kT7B4QinrC4fAYkQ6nvVCg979dSEP8e2jA1F0HY9k2PVM235Ux6E7BCe2Ia8IIDaDvVgs8bWQqBkKEL9xRKDAvGyVBZHkZ5/1gZAUlxMEaMQdQszgWE0FwZAGIuRgAAkt0wdjigYiAcGYXQcF+KBqnY6YGN0eh0AuQkqnfF9UJBWAnlGFovh+ABBTBu2qLwrkkNwUAEDIIAgY4s2gb5YGpEisBwFVDDLTAOgidA+DwOjwnId9fDYehfAE3xagEIJQvmGQ5AUILu1WLB6GqM5Bm7CB7SYaR0SIIhfThH0eEsMriCxT1PXIaoMlgWAcvdFFPSxAgeCIOFOq6rqsXRfZKGSCIWkkTBRPiSJoh6VIknG4ajNEsyWHYca+CgRSokWthpGm7BmE25b6MiCSriWHAVggKbSlYAQ4BwABlKQVR87tYGBdFfRRLEER4BEZiMZhaM4ddmlGGgMikThbSgKN1ARVgAF4RF0OQnimUYJKctZoqXOEcBRRB2RaXYCC9Zg4QJjI4TJdksWRc0CDARliqIQJyB1eg6JAFEWlkHBdiIFEwV2RBECIMFmU5ME4QFsWfWqIgcA6nBPTJ5qRFWd0iE9FFdhRKm4U9XYDZ9XogA +N4IgZgNg9lBOCSATEAuEBnALrApjzADAIwgA0IAFjrFKqAJYC2AhgOY6qXVQB0A7jgBGABzIhmAOybNMHFGGYR0OchOaM5IAMLMmYiADdURchWEsAHqgBMBO6dEoidguRZrLN1yHfNU3mQBrL3JEHDAQnzCIlFs3KAkcAE9/chwLR28cAEcAV3pzHAlMVABtAF1yellGdDoQAGMErElMOpRQQRhgp3JIFKcAX3JMGCU6YZAc/OF20HQ+OEQSIcnoBvrEelwGzHoEzlzRcisUAFZyAedJyDY5kGqcRgARfF0IVGxclRBc5QAhfACIoAGXorAoJRQXx+AH1YcocIh4cYACxEVEADgIAGYAGyYkwgeGwSTI2FojHY/GE8jMXDMdqlUAeTQAHVyqJwBEEHLODVR1jELFmZW0ukYFCgGhA5WGLPU7M53N5uX5guFzFFKFKIAAVvRcqxcpJZfKQKzOByuTy+QKhW4tUyQABpAAqADUzaQFTK0ByAOzWPHWQPWMAkR3a3Xuj0AMSFcp9FsVVtyQZDYYjmujIFYUAgiECyW9vqVNtV6odPidYsE9Aof1ytCTZbTNuYdo1UedBuYUEwklYpZTfpA1u5nbV9pzzvQVAkrAkBilMtbo/Lk671ZFc4o9GXq4468t/vTwdD5+zPbFBqR/ZHp/H58zV8jNdzWFw+GIYi/eEIatjSHBoKCHMRgMXUCh2rCx6H7OCh1/E54KgRDFwIWDUPQ1gcUfVMUAkXIIAgG8dRAJJ6DyEgTwIoiSLI3VKLyRNzVPejSI/Z1mNyPDaL9DjGIoqjOXwgTiM43cxR4s4xLkQSuOkkS8Tk1AFKk8ieIDVTCIkoSeMxHT1NrTSRIATiMvTFNM6iCDNSoMECApUAUJQfjA2BkBQbx4Q8xAtALOAUTQXBkHIeFHkYAAJA9MGCipwthCAcGYAwcBBKAGmC4BJnhAx6HQR5yXqf8fxWGFJkEIE8AkABBTBBwaQJnhkPxdIY4lYWYHB6Hihz4S2dBmEEZLio6DBsAA38dVKIgcTOSoKjlG4C2gARYCZBysBwbUiRYTAem8dBhDwLy4gm2BjACVh6CuqpijuxoDicbwWBujZ5EUZRyBaPYsHoBp7lGQcIDdJg5Dm6wzOsM5MQDMyeDMsy8TxIgzKIC5GlyWBYDBv0MdRBGzJcEmScxsxUhAQQZEwZLKcYBIS28tIMkp6mGuSlq3rkbxhCgAqEi5tgeZZ7BmCF9h6agNLnm2HBdggAZvHBCQ4BwABlWRtSOwdYChaG8TOHg8UGSY/M4WcSsmsr6hFMpXAd0hHedp3XdKABaExPdIb3fZMVw/Z9r3g6DoPKgd5byBoXJZE4F0oATLRUVYABeMQDEUb45kmNKNv2CQ0zMnAcUQPlBDOAhA2YMzS9yYnbD5TEzlRO0CDADlkaICJyGNegvJAPFBC5QREADTFYSIZhUWYWFUTAeHYUxRAcUEWEznm6xwlRRBEDAMzUTEPZ8YDGlBSRgg8SxQYgA= \ No newline at end of file diff --git a/_server/MotaAction.g4 b/_server/MotaAction.g4 index 296d8a1..4ee806d 100644 --- a/_server/MotaAction.g4 +++ b/_server/MotaAction.g4 @@ -4596,8 +4596,8 @@ EnemyPoint_List /*EnemyPoint_List ['hp','atk','def','money','exp','point','name']*/; Equip_List - : '生命'|'生命上限'|'攻击'|'防御'|'护盾'|'魔力'|'魔力上限' - /*Equip_List ['hp','hpmax','atk','def','mdef','mana','manamax']*/; + : '力量'|'敏捷'|'智力'|'体质'|'生命'|'生命上限'|'攻击'|'物理防御'|'魔法防御'|'魔力'|'魔力上限'|'速度' + /*Equip_List ['str','agi','int','con','hp','hpmax','atk','def','mdef','mana','manamax','speed']*/; Key_List : '黄钥匙'|'蓝钥匙'|'红钥匙'|'绿钥匙'|'铁门钥匙' diff --git a/_server/config.json b/_server/config.json index 2f57734..3ec33d6 100644 --- a/_server/config.json +++ b/_server/config.json @@ -1 +1 @@ -{"viewportLoc":[0,0],"editorLastFloorId":"shinvhome","lastUsed":[{"idnum":210,"id":"skeletonWarrior","images":"enemys","y":9,"recent":1735825145197,"frequent":4},{"idnum":21,"id":"yellowKey","images":"items","y":0,"recent":1735824906066,"frequent":14},{"idnum":81,"id":"yellowDoor","images":"animates","y":4,"recent":1735824901122,"frequent":26},{"idnum":214,"id":"zombieKnight","images":"enemys","y":13,"recent":1735824888165,"frequent":2},{"idnum":82,"id":"blueDoor","images":"animates","y":5,"recent":1735824878838,"frequent":4},{"idnum":32,"id":"bluePotion","images":"items","y":21,"recent":1735824871469,"frequent":2},{"idnum":28,"id":"blueGem","images":"items","y":17,"recent":1735824867878,"frequent":6},{"idnum":27,"id":"redGem","images":"items","y":16,"recent":1735824864181,"frequent":5},{"idnum":22,"id":"blueKey","images":"items","y":1,"recent":1735824852246,"frequent":4},{"idnum":140,"id":"autotile4","images":"autotile","y":0,"recent":1735824840165,"frequent":138},{"idnum":209,"id":"skeleton","images":"enemys","y":8,"recent":1735824813505,"frequent":2},{"idnum":94,"id":"rightPortal","images":"animates","y":25,"recent":1735824733893,"frequent":6},{"idnum":92,"id":"leftPortal","images":"animates","y":24,"recent":1735824084823,"frequent":2},{"idnum":91,"id":"upPortal","images":"animates","y":26,"recent":1735821889246,"frequent":2},{"idnum":85,"id":"specialDoor","images":"animates","y":8,"recent":1735820976103,"frequent":3},{"idnum":93,"id":"downPortal","images":"animates","y":23,"recent":1735820969951,"frequent":2},{"idnum":89,"id":"portal","images":"animates","y":17,"recent":1735820958612,"frequent":1},{"idnum":26,"id":"bigKey","images":"items","y":6,"recent":1735820920269,"frequent":1},{"idnum":34,"id":"yellowPotion","images":"items","y":23,"recent":1735820909149,"frequent":1},{"idnum":33,"id":"greenPotion","images":"items","y":22,"recent":1735820906301,"frequent":1},{"idnum":83,"id":"redDoor","images":"animates","y":6,"recent":1735820844323,"frequent":2},{"idnum":247,"id":"magicMaster","images":"enemys","y":46,"recent":1735820830425,"frequent":1},{"idnum":20160,"id":"X20160","images":"5.png","x":0,"y":20,"isTile":true,"recent":1735398503013,"frequent":2},{"idnum":20168,"id":"X20168","images":"5.png","x":0,"y":21,"isTile":true,"recent":1735398496973,"frequent":3},{"idnum":20176,"id":"X20176","images":"5.png","x":0,"y":22,"isTile":true,"recent":1735398485125,"frequent":1},{"idnum":71742,"id":"X71742","images":"11.png","x":6,"y":217,"isTile":true,"recent":1735398452693,"frequent":1},{"idnum":71750,"id":"X71750","images":"11.png","x":6,"y":218,"isTile":true,"recent":1735398448325,"frequent":1},{"idnum":71751,"id":"X71751","images":"11.png","x":7,"y":218,"isTile":true,"recent":1735398443645,"frequent":1},{"idnum":71783,"id":"X71783","images":"11.png","x":7,"y":222,"isTile":true,"recent":1735398426909,"frequent":7},{"idnum":71799,"id":"X71799","images":"11.png","x":7,"y":224,"isTile":true,"recent":1735398421365,"frequent":5},{"idnum":71826,"id":"X71826","images":"11.png","x":2,"y":228,"isTile":true,"recent":1735398415661,"frequent":2},{"idnum":71818,"id":"X71818","images":"11.png","x":2,"y":227,"isTile":true,"recent":1735398413269,"frequent":3},{"idnum":224,"id":"swordsman","images":"enemys","y":23,"recent":1735398341974,"frequent":6},{"idnum":71842,"id":"X71842","images":"11.png","x":2,"y":230,"isTile":true,"recent":1735398315069,"frequent":1},{"idnum":71834,"id":"X71834","images":"11.png","x":2,"y":229,"isTile":true,"recent":1735398312437,"frequent":1},{"idnum":110114,"id":"X110114","images":"C4.png","x":2,"y":14,"isTile":true,"recent":1735398246502,"frequent":6},{"idnum":110122,"id":"X110122","images":"C4.png","x":2,"y":15,"isTile":true,"recent":1735398239998,"frequent":1},{"idnum":110028,"id":"X110028","images":"C4.png","x":4,"y":3,"isTile":true,"recent":1735398198709,"frequent":2},{"idnum":110020,"id":"X110020","images":"C4.png","x":4,"y":2,"isTile":true,"recent":1735398191398,"frequent":2},{"idnum":71791,"id":"X71791","images":"11.png","x":7,"y":223,"isTile":true,"recent":1735398163774,"frequent":3},{"idnum":71785,"id":"X71785","images":"11.png","x":1,"y":223,"isTile":true,"recent":1735398120734,"frequent":2},{"idnum":71784,"id":"X71784","images":"11.png","x":0,"y":223,"isTile":true,"recent":1735398118318,"frequent":3},{"idnum":71793,"id":"X71793","images":"11.png","x":1,"y":224,"isTile":true,"recent":1735398115446,"frequent":2},{"idnum":71792,"id":"X71792","images":"11.png","x":0,"y":224,"isTile":true,"recent":1735398113142,"frequent":2},{"idnum":71787,"id":"X71787","images":"11.png","x":3,"y":223,"isTile":true,"recent":1735398102326,"frequent":1},{"idnum":71786,"id":"X71786","images":"11.png","x":2,"y":223,"isTile":true,"recent":1735398099430,"frequent":1},{"idnum":71795,"id":"X71795","images":"11.png","x":3,"y":224,"isTile":true,"recent":1735398097359,"frequent":1},{"idnum":71794,"id":"X71794","images":"11.png","x":2,"y":224,"isTile":true,"recent":1735398094982,"frequent":1},{"idnum":130006,"id":"X130006","images":"C2.png","x":6,"y":0,"isTile":true,"recent":1735398082894,"frequent":3},{"idnum":130011,"id":"X130011","images":"C2.png","x":3,"y":1,"isTile":true,"recent":1735398078792,"frequent":2},{"idnum":71817,"id":"X71817","images":"11.png","x":1,"y":227,"isTile":true,"recent":1735398027294,"frequent":3},{"idnum":71837,"id":"X71837","images":"11.png","x":5,"y":229,"isTile":true,"recent":1735398013126,"frequent":1},{"idnum":71829,"id":"X71829","images":"11.png","x":5,"y":228,"isTile":true,"recent":1735398008166,"frequent":1},{"idnum":71821,"id":"X71821","images":"11.png","x":5,"y":227,"isTile":true,"recent":1735398005430,"frequent":1},{"idnum":71836,"id":"X71836","images":"11.png","x":4,"y":229,"isTile":true,"recent":1735397997622,"frequent":1},{"idnum":71828,"id":"X71828","images":"11.png","x":4,"y":228,"isTile":true,"recent":1735397993455,"frequent":1},{"idnum":71820,"id":"X71820","images":"11.png","x":4,"y":227,"isTile":true,"recent":1735397989903,"frequent":1},{"idnum":30217,"id":"X30217","images":"4.png","x":1,"y":27,"isTile":true,"recent":1735397944838,"frequent":3},{"idnum":110012,"id":"X110012","images":"C4.png","x":4,"y":1,"isTile":true,"recent":1735397929366,"frequent":2},{"idnum":100485,"id":"X100485","images":"Outside_B.png","x":5,"y":20,"isTile":true,"recent":1735397919927,"frequent":2},{"idnum":100436,"id":"X100436","images":"Outside_B.png","x":4,"y":18,"isTile":true,"recent":1735397880486,"frequent":1},{"idnum":100437,"id":"X100437","images":"Outside_B.png","x":5,"y":18,"isTile":true,"recent":1735397877086,"frequent":1},{"idnum":100461,"id":"X100461","images":"Outside_B.png","x":5,"y":19,"isTile":true,"recent":1735397868606,"frequent":1},{"idnum":100460,"id":"X100460","images":"Outside_B.png","x":4,"y":19,"isTile":true,"recent":1735397843448,"frequent":2},{"idnum":100484,"id":"X100484","images":"Outside_B.png","x":4,"y":20,"isTile":true,"recent":1735397840545,"frequent":2},{"idnum":40136,"id":"X40136","images":"3.png","x":0,"y":17,"isTile":true,"recent":1735397799150,"frequent":1},{"idnum":40144,"id":"X40144","images":"3.png","x":0,"y":18,"isTile":true,"recent":1735397796038,"frequent":2},{"idnum":30227,"id":"X30227","images":"4.png","x":3,"y":28,"isTile":true,"recent":1735397775591,"frequent":2},{"idnum":30214,"id":"X30214","images":"4.png","x":6,"y":26,"isTile":true,"recent":1735397768303,"frequent":1},{"idnum":30218,"id":"X30218","images":"4.png","x":2,"y":27,"isTile":true,"recent":1735397761062,"frequent":1},{"idnum":120041,"id":"X120041","images":"C3.png","x":1,"y":5,"isTile":true,"recent":1735397710494,"frequent":1},{"idnum":120042,"id":"X120042","images":"C3.png","x":2,"y":5,"isTile":true,"recent":1735397702167,"frequent":2},{"idnum":120006,"id":"X120006","images":"C3.png","x":6,"y":0,"isTile":true,"recent":1735397659951,"frequent":5},{"idnum":120014,"id":"X120014","images":"C3.png","x":6,"y":1,"isTile":true,"recent":1735397644591,"frequent":4},{"idnum":120090,"id":"X120090","images":"C3.png","x":2,"y":11,"isTile":true,"recent":1735397629759,"frequent":3},{"idnum":120150,"id":"X120150","images":"C3.png","x":6,"y":18,"isTile":true,"recent":1735397613207,"frequent":3},{"idnum":120166,"id":"X120166","images":"C3.png","x":6,"y":20,"isTile":true,"recent":1735397574639,"frequent":1},{"idnum":140170,"id":"X140170","images":"C1.png","x":2,"y":21,"isTile":true,"recent":1735397516295,"frequent":1},{"idnum":110119,"id":"X110119","images":"C4.png","x":7,"y":14,"isTile":true,"recent":1735397434752,"frequent":3},{"idnum":80083,"id":"X80083","images":"6.png","x":3,"y":10,"isTile":true,"recent":1735397403120,"frequent":6},{"idnum":80082,"id":"X80082","images":"6.png","x":2,"y":10,"isTile":true,"recent":1735397393215,"frequent":2},{"idnum":71824,"id":"X71824","images":"11.png","x":0,"y":228,"isTile":true,"recent":1735397302354,"frequent":1},{"idnum":71816,"id":"X71816","images":"11.png","x":0,"y":227,"isTile":true,"recent":1735397300089,"frequent":1},{"idnum":71825,"id":"X71825","images":"11.png","x":1,"y":228,"isTile":true,"recent":1735397296728,"frequent":1},{"idnum":71841,"id":"X71841","images":"11.png","x":1,"y":230,"isTile":true,"recent":1735397274905,"frequent":1},{"idnum":71840,"id":"X71840","images":"11.png","x":0,"y":230,"isTile":true,"recent":1735397272160,"frequent":1},{"idnum":71833,"id":"X71833","images":"11.png","x":1,"y":229,"isTile":true,"recent":1735397269433,"frequent":1},{"idnum":71832,"id":"X71832","images":"11.png","x":0,"y":229,"isTile":true,"recent":1735397266704,"frequent":1},{"idnum":71815,"id":"X71815","images":"11.png","x":7,"y":226,"isTile":true,"recent":1735397232288,"frequent":1},{"idnum":71807,"id":"X71807","images":"11.png","x":7,"y":225,"isTile":true,"recent":1735397229624,"frequent":1},{"idnum":71827,"id":"X71827","images":"11.png","x":3,"y":228,"isTile":true,"recent":1735397220728,"frequent":1},{"idnum":71819,"id":"X71819","images":"11.png","x":3,"y":227,"isTile":true,"recent":1735397218496,"frequent":1},{"idnum":120173,"id":"X120173","images":"C3.png","x":5,"y":21,"isTile":true,"recent":1735397183385,"frequent":3},{"idnum":120174,"id":"X120174","images":"C3.png","x":6,"y":21,"isTile":true,"recent":1735397125953,"frequent":6},{"idnum":120134,"id":"X120134","images":"C3.png","x":6,"y":16,"isTile":true,"recent":1735396971049,"frequent":1},{"idnum":130173,"id":"X130173","images":"C2.png","x":5,"y":21,"isTile":true,"recent":1735396958897,"frequent":1},{"idnum":120109,"id":"X120109","images":"C3.png","x":5,"y":13,"isTile":true,"recent":1735396928298,"frequent":2},{"idnum":120117,"id":"X120117","images":"C3.png","x":5,"y":14,"isTile":true,"recent":1735396877690,"frequent":1},{"idnum":120125,"id":"X120125","images":"C3.png","x":5,"y":15,"isTile":true,"recent":1735396864194,"frequent":6},{"idnum":70169,"id":"X70169","images":"11.png","x":1,"y":21,"isTile":true,"recent":1735396825666,"frequent":3},{"idnum":70161,"id":"X70161","images":"11.png","x":1,"y":20,"isTile":true,"recent":1735396814418,"frequent":3},{"idnum":70145,"id":"X70145","images":"11.png","x":1,"y":18,"isTile":true,"recent":1735396802466,"frequent":14},{"idnum":70146,"id":"X70146","images":"11.png","x":2,"y":18,"isTile":true,"recent":1735396788810,"frequent":1},{"idnum":70144,"id":"X70144","images":"11.png","x":0,"y":18,"isTile":true,"recent":1735396782475,"frequent":4},{"idnum":100386,"id":"X100386","images":"Outside_B.png","x":2,"y":16,"isTile":true,"recent":1735396757386,"frequent":1},{"idnum":100362,"id":"X100362","images":"Outside_B.png","x":2,"y":15,"isTile":true,"recent":1735396754546,"frequent":1},{"idnum":100385,"id":"X100385","images":"Outside_B.png","x":1,"y":16,"isTile":true,"recent":1735396751066,"frequent":1},{"idnum":100384,"id":"X100384","images":"Outside_B.png","x":0,"y":16,"isTile":true,"recent":1735396747826,"frequent":1},{"idnum":100361,"id":"X100361","images":"Outside_B.png","x":1,"y":15,"isTile":true,"recent":1735396745106,"frequent":2},{"idnum":100360,"id":"X100360","images":"Outside_B.png","x":0,"y":15,"isTile":true,"recent":1735396742682,"frequent":3},{"idnum":90196,"id":"X90196","images":"12.png","x":4,"y":24,"isTile":true,"recent":1735396698234,"frequent":1},{"idnum":90195,"id":"X90195","images":"12.png","x":3,"y":24,"isTile":true,"recent":1735396695530,"frequent":1},{"idnum":90194,"id":"X90194","images":"12.png","x":2,"y":24,"isTile":true,"recent":1735396691098,"frequent":1},{"idnum":90187,"id":"X90187","images":"12.png","x":3,"y":23,"isTile":true,"recent":1735396687866,"frequent":3},{"idnum":90186,"id":"X90186","images":"12.png","x":2,"y":23,"isTile":true,"recent":1735396672410,"frequent":1},{"idnum":31,"id":"redPotion","images":"items","y":20,"recent":1735396611866,"frequent":7},{"idnum":221,"id":"yellowGateKeeper","images":"enemys","y":20,"recent":1735396537794,"frequent":4},{"idnum":222,"id":"blueGateKeeper","images":"enemys","y":21,"recent":1735396534626,"frequent":3},{"idnum":226,"id":"yellowKnight","images":"enemys","y":25,"recent":1735396460524,"frequent":1},{"idnum":225,"id":"soldier","images":"enemys","y":24,"recent":1735396456036,"frequent":1},{"idnum":326,"id":"tulipFairy","images":"enemys","y":72,"recent":1735396229196,"frequent":1},{"idnum":141,"id":"autotile8","images":"autotile","y":0,"recent":1735391328901,"frequent":2},{"idnum":30,"id":"yellowGem","images":"items","y":19,"recent":1735391294213,"frequent":1},{"idnum":44,"id":"shield5","images":"items","y":59,"recent":1735391193096,"frequent":1},{"idnum":138,"id":"blueTrader","images":"npcs","y":13,"recent":1735391190680,"frequent":1},{"idnum":43,"id":"sword5","images":"items","y":54,"recent":1735391188576,"frequent":1}]} \ No newline at end of file +{"viewportLoc":[0,0],"editorLastFloorId":"street01","lastUsed":[{"idnum":35,"id":"sword1","images":"items","y":50,"recent":1736842979937,"frequent":1},{"idnum":210,"id":"skeletonWarrior","images":"enemys","y":9,"recent":1735825145197,"frequent":4},{"idnum":21,"id":"yellowKey","images":"items","y":0,"recent":1735824906066,"frequent":14},{"idnum":81,"id":"yellowDoor","images":"animates","y":4,"recent":1735824901122,"frequent":26},{"idnum":214,"id":"zombieKnight","images":"enemys","y":13,"recent":1735824888165,"frequent":2},{"idnum":82,"id":"blueDoor","images":"animates","y":5,"recent":1735824878838,"frequent":4},{"idnum":32,"id":"bluePotion","images":"items","y":21,"recent":1735824871469,"frequent":2},{"idnum":28,"id":"blueGem","images":"items","y":17,"recent":1735824867878,"frequent":6},{"idnum":27,"id":"redGem","images":"items","y":16,"recent":1735824864181,"frequent":5},{"idnum":22,"id":"blueKey","images":"items","y":1,"recent":1735824852246,"frequent":4},{"idnum":140,"id":"autotile4","images":"autotile","y":0,"recent":1735824840165,"frequent":138},{"idnum":209,"id":"skeleton","images":"enemys","y":8,"recent":1735824813505,"frequent":2},{"idnum":94,"id":"rightPortal","images":"animates","y":25,"recent":1735824733893,"frequent":6},{"idnum":92,"id":"leftPortal","images":"animates","y":24,"recent":1735824084823,"frequent":2},{"idnum":91,"id":"upPortal","images":"animates","y":26,"recent":1735821889246,"frequent":2},{"idnum":85,"id":"specialDoor","images":"animates","y":8,"recent":1735820976103,"frequent":3},{"idnum":93,"id":"downPortal","images":"animates","y":23,"recent":1735820969951,"frequent":2},{"idnum":89,"id":"portal","images":"animates","y":17,"recent":1735820958612,"frequent":1},{"idnum":26,"id":"bigKey","images":"items","y":6,"recent":1735820920269,"frequent":1},{"idnum":34,"id":"yellowPotion","images":"items","y":23,"recent":1735820909149,"frequent":1},{"idnum":33,"id":"greenPotion","images":"items","y":22,"recent":1735820906301,"frequent":1},{"idnum":83,"id":"redDoor","images":"animates","y":6,"recent":1735820844323,"frequent":2},{"idnum":247,"id":"magicMaster","images":"enemys","y":46,"recent":1735820830425,"frequent":1},{"idnum":20160,"id":"X20160","images":"5.png","x":0,"y":20,"isTile":true,"recent":1735398503013,"frequent":2},{"idnum":20168,"id":"X20168","images":"5.png","x":0,"y":21,"isTile":true,"recent":1735398496973,"frequent":3},{"idnum":20176,"id":"X20176","images":"5.png","x":0,"y":22,"isTile":true,"recent":1735398485125,"frequent":1},{"idnum":71742,"id":"X71742","images":"11.png","x":6,"y":217,"isTile":true,"recent":1735398452693,"frequent":1},{"idnum":71750,"id":"X71750","images":"11.png","x":6,"y":218,"isTile":true,"recent":1735398448325,"frequent":1},{"idnum":71751,"id":"X71751","images":"11.png","x":7,"y":218,"isTile":true,"recent":1735398443645,"frequent":1},{"idnum":71783,"id":"X71783","images":"11.png","x":7,"y":222,"isTile":true,"recent":1735398426909,"frequent":7},{"idnum":71799,"id":"X71799","images":"11.png","x":7,"y":224,"isTile":true,"recent":1735398421365,"frequent":5},{"idnum":71826,"id":"X71826","images":"11.png","x":2,"y":228,"isTile":true,"recent":1735398415661,"frequent":2},{"idnum":71818,"id":"X71818","images":"11.png","x":2,"y":227,"isTile":true,"recent":1735398413269,"frequent":3},{"idnum":224,"id":"swordsman","images":"enemys","y":23,"recent":1735398341974,"frequent":6},{"idnum":71842,"id":"X71842","images":"11.png","x":2,"y":230,"isTile":true,"recent":1735398315069,"frequent":1},{"idnum":71834,"id":"X71834","images":"11.png","x":2,"y":229,"isTile":true,"recent":1735398312437,"frequent":1},{"idnum":110114,"id":"X110114","images":"C4.png","x":2,"y":14,"isTile":true,"recent":1735398246502,"frequent":6},{"idnum":110122,"id":"X110122","images":"C4.png","x":2,"y":15,"isTile":true,"recent":1735398239998,"frequent":1},{"idnum":110028,"id":"X110028","images":"C4.png","x":4,"y":3,"isTile":true,"recent":1735398198709,"frequent":2},{"idnum":110020,"id":"X110020","images":"C4.png","x":4,"y":2,"isTile":true,"recent":1735398191398,"frequent":2},{"idnum":71791,"id":"X71791","images":"11.png","x":7,"y":223,"isTile":true,"recent":1735398163774,"frequent":3},{"idnum":71785,"id":"X71785","images":"11.png","x":1,"y":223,"isTile":true,"recent":1735398120734,"frequent":2},{"idnum":71784,"id":"X71784","images":"11.png","x":0,"y":223,"isTile":true,"recent":1735398118318,"frequent":3},{"idnum":71793,"id":"X71793","images":"11.png","x":1,"y":224,"isTile":true,"recent":1735398115446,"frequent":2},{"idnum":71792,"id":"X71792","images":"11.png","x":0,"y":224,"isTile":true,"recent":1735398113142,"frequent":2},{"idnum":71787,"id":"X71787","images":"11.png","x":3,"y":223,"isTile":true,"recent":1735398102326,"frequent":1},{"idnum":71786,"id":"X71786","images":"11.png","x":2,"y":223,"isTile":true,"recent":1735398099430,"frequent":1},{"idnum":71795,"id":"X71795","images":"11.png","x":3,"y":224,"isTile":true,"recent":1735398097359,"frequent":1},{"idnum":71794,"id":"X71794","images":"11.png","x":2,"y":224,"isTile":true,"recent":1735398094982,"frequent":1},{"idnum":130006,"id":"X130006","images":"C2.png","x":6,"y":0,"isTile":true,"recent":1735398082894,"frequent":3},{"idnum":130011,"id":"X130011","images":"C2.png","x":3,"y":1,"isTile":true,"recent":1735398078792,"frequent":2},{"idnum":71817,"id":"X71817","images":"11.png","x":1,"y":227,"isTile":true,"recent":1735398027294,"frequent":3},{"idnum":71837,"id":"X71837","images":"11.png","x":5,"y":229,"isTile":true,"recent":1735398013126,"frequent":1},{"idnum":71829,"id":"X71829","images":"11.png","x":5,"y":228,"isTile":true,"recent":1735398008166,"frequent":1},{"idnum":71821,"id":"X71821","images":"11.png","x":5,"y":227,"isTile":true,"recent":1735398005430,"frequent":1},{"idnum":71836,"id":"X71836","images":"11.png","x":4,"y":229,"isTile":true,"recent":1735397997622,"frequent":1},{"idnum":71828,"id":"X71828","images":"11.png","x":4,"y":228,"isTile":true,"recent":1735397993455,"frequent":1},{"idnum":71820,"id":"X71820","images":"11.png","x":4,"y":227,"isTile":true,"recent":1735397989903,"frequent":1},{"idnum":30217,"id":"X30217","images":"4.png","x":1,"y":27,"isTile":true,"recent":1735397944838,"frequent":3},{"idnum":110012,"id":"X110012","images":"C4.png","x":4,"y":1,"isTile":true,"recent":1735397929366,"frequent":2},{"idnum":100485,"id":"X100485","images":"Outside_B.png","x":5,"y":20,"isTile":true,"recent":1735397919927,"frequent":2},{"idnum":100436,"id":"X100436","images":"Outside_B.png","x":4,"y":18,"isTile":true,"recent":1735397880486,"frequent":1},{"idnum":100437,"id":"X100437","images":"Outside_B.png","x":5,"y":18,"isTile":true,"recent":1735397877086,"frequent":1},{"idnum":100461,"id":"X100461","images":"Outside_B.png","x":5,"y":19,"isTile":true,"recent":1735397868606,"frequent":1},{"idnum":100460,"id":"X100460","images":"Outside_B.png","x":4,"y":19,"isTile":true,"recent":1735397843448,"frequent":2},{"idnum":100484,"id":"X100484","images":"Outside_B.png","x":4,"y":20,"isTile":true,"recent":1735397840545,"frequent":2},{"idnum":40136,"id":"X40136","images":"3.png","x":0,"y":17,"isTile":true,"recent":1735397799150,"frequent":1},{"idnum":40144,"id":"X40144","images":"3.png","x":0,"y":18,"isTile":true,"recent":1735397796038,"frequent":2},{"idnum":30227,"id":"X30227","images":"4.png","x":3,"y":28,"isTile":true,"recent":1735397775591,"frequent":2},{"idnum":30214,"id":"X30214","images":"4.png","x":6,"y":26,"isTile":true,"recent":1735397768303,"frequent":1},{"idnum":30218,"id":"X30218","images":"4.png","x":2,"y":27,"isTile":true,"recent":1735397761062,"frequent":1},{"idnum":120041,"id":"X120041","images":"C3.png","x":1,"y":5,"isTile":true,"recent":1735397710494,"frequent":1},{"idnum":120042,"id":"X120042","images":"C3.png","x":2,"y":5,"isTile":true,"recent":1735397702167,"frequent":2},{"idnum":120006,"id":"X120006","images":"C3.png","x":6,"y":0,"isTile":true,"recent":1735397659951,"frequent":5},{"idnum":120014,"id":"X120014","images":"C3.png","x":6,"y":1,"isTile":true,"recent":1735397644591,"frequent":4},{"idnum":120090,"id":"X120090","images":"C3.png","x":2,"y":11,"isTile":true,"recent":1735397629759,"frequent":3},{"idnum":120150,"id":"X120150","images":"C3.png","x":6,"y":18,"isTile":true,"recent":1735397613207,"frequent":3},{"idnum":120166,"id":"X120166","images":"C3.png","x":6,"y":20,"isTile":true,"recent":1735397574639,"frequent":1},{"idnum":140170,"id":"X140170","images":"C1.png","x":2,"y":21,"isTile":true,"recent":1735397516295,"frequent":1},{"idnum":110119,"id":"X110119","images":"C4.png","x":7,"y":14,"isTile":true,"recent":1735397434752,"frequent":3},{"idnum":80083,"id":"X80083","images":"6.png","x":3,"y":10,"isTile":true,"recent":1735397403120,"frequent":6},{"idnum":80082,"id":"X80082","images":"6.png","x":2,"y":10,"isTile":true,"recent":1735397393215,"frequent":2},{"idnum":71824,"id":"X71824","images":"11.png","x":0,"y":228,"isTile":true,"recent":1735397302354,"frequent":1},{"idnum":71816,"id":"X71816","images":"11.png","x":0,"y":227,"isTile":true,"recent":1735397300089,"frequent":1},{"idnum":71825,"id":"X71825","images":"11.png","x":1,"y":228,"isTile":true,"recent":1735397296728,"frequent":1},{"idnum":71841,"id":"X71841","images":"11.png","x":1,"y":230,"isTile":true,"recent":1735397274905,"frequent":1},{"idnum":71840,"id":"X71840","images":"11.png","x":0,"y":230,"isTile":true,"recent":1735397272160,"frequent":1},{"idnum":71833,"id":"X71833","images":"11.png","x":1,"y":229,"isTile":true,"recent":1735397269433,"frequent":1},{"idnum":71832,"id":"X71832","images":"11.png","x":0,"y":229,"isTile":true,"recent":1735397266704,"frequent":1},{"idnum":71815,"id":"X71815","images":"11.png","x":7,"y":226,"isTile":true,"recent":1735397232288,"frequent":1},{"idnum":71807,"id":"X71807","images":"11.png","x":7,"y":225,"isTile":true,"recent":1735397229624,"frequent":1},{"idnum":71827,"id":"X71827","images":"11.png","x":3,"y":228,"isTile":true,"recent":1735397220728,"frequent":1},{"idnum":71819,"id":"X71819","images":"11.png","x":3,"y":227,"isTile":true,"recent":1735397218496,"frequent":1},{"idnum":120173,"id":"X120173","images":"C3.png","x":5,"y":21,"isTile":true,"recent":1735397183385,"frequent":3},{"idnum":120174,"id":"X120174","images":"C3.png","x":6,"y":21,"isTile":true,"recent":1735397125953,"frequent":6},{"idnum":120134,"id":"X120134","images":"C3.png","x":6,"y":16,"isTile":true,"recent":1735396971049,"frequent":1},{"idnum":130173,"id":"X130173","images":"C2.png","x":5,"y":21,"isTile":true,"recent":1735396958897,"frequent":1},{"idnum":120109,"id":"X120109","images":"C3.png","x":5,"y":13,"isTile":true,"recent":1735396928298,"frequent":2},{"idnum":120117,"id":"X120117","images":"C3.png","x":5,"y":14,"isTile":true,"recent":1735396877690,"frequent":1},{"idnum":120125,"id":"X120125","images":"C3.png","x":5,"y":15,"isTile":true,"recent":1735396864194,"frequent":6},{"idnum":70169,"id":"X70169","images":"11.png","x":1,"y":21,"isTile":true,"recent":1735396825666,"frequent":3},{"idnum":70161,"id":"X70161","images":"11.png","x":1,"y":20,"isTile":true,"recent":1735396814418,"frequent":3},{"idnum":70145,"id":"X70145","images":"11.png","x":1,"y":18,"isTile":true,"recent":1735396802466,"frequent":14},{"idnum":70146,"id":"X70146","images":"11.png","x":2,"y":18,"isTile":true,"recent":1735396788810,"frequent":1},{"idnum":70144,"id":"X70144","images":"11.png","x":0,"y":18,"isTile":true,"recent":1735396782475,"frequent":4},{"idnum":100386,"id":"X100386","images":"Outside_B.png","x":2,"y":16,"isTile":true,"recent":1735396757386,"frequent":1},{"idnum":100362,"id":"X100362","images":"Outside_B.png","x":2,"y":15,"isTile":true,"recent":1735396754546,"frequent":1},{"idnum":100385,"id":"X100385","images":"Outside_B.png","x":1,"y":16,"isTile":true,"recent":1735396751066,"frequent":1},{"idnum":100384,"id":"X100384","images":"Outside_B.png","x":0,"y":16,"isTile":true,"recent":1735396747826,"frequent":1},{"idnum":100361,"id":"X100361","images":"Outside_B.png","x":1,"y":15,"isTile":true,"recent":1735396745106,"frequent":2},{"idnum":100360,"id":"X100360","images":"Outside_B.png","x":0,"y":15,"isTile":true,"recent":1735396742682,"frequent":3},{"idnum":90196,"id":"X90196","images":"12.png","x":4,"y":24,"isTile":true,"recent":1735396698234,"frequent":1},{"idnum":90195,"id":"X90195","images":"12.png","x":3,"y":24,"isTile":true,"recent":1735396695530,"frequent":1},{"idnum":90194,"id":"X90194","images":"12.png","x":2,"y":24,"isTile":true,"recent":1735396691098,"frequent":1},{"idnum":90187,"id":"X90187","images":"12.png","x":3,"y":23,"isTile":true,"recent":1735396687866,"frequent":3},{"idnum":90186,"id":"X90186","images":"12.png","x":2,"y":23,"isTile":true,"recent":1735396672410,"frequent":1},{"idnum":31,"id":"redPotion","images":"items","y":20,"recent":1735396611866,"frequent":7},{"idnum":221,"id":"yellowGateKeeper","images":"enemys","y":20,"recent":1735396537794,"frequent":4},{"idnum":222,"id":"blueGateKeeper","images":"enemys","y":21,"recent":1735396534626,"frequent":3},{"idnum":226,"id":"yellowKnight","images":"enemys","y":25,"recent":1735396460524,"frequent":1},{"idnum":225,"id":"soldier","images":"enemys","y":24,"recent":1735396456036,"frequent":1},{"idnum":326,"id":"tulipFairy","images":"enemys","y":72,"recent":1735396229196,"frequent":1},{"idnum":141,"id":"autotile8","images":"autotile","y":0,"recent":1735391328901,"frequent":2},{"idnum":30,"id":"yellowGem","images":"items","y":19,"recent":1735391294213,"frequent":1},{"idnum":44,"id":"shield5","images":"items","y":59,"recent":1735391193096,"frequent":1},{"idnum":138,"id":"blueTrader","images":"npcs","y":13,"recent":1735391190680,"frequent":1},{"idnum":43,"id":"sword5","images":"items","y":54,"recent":1735391188576,"frequent":1},{"idnum":71,"id":"shield0","images":"items","y":61,"recent":1736844410720,"frequent":1}]} \ No newline at end of file diff --git a/project/data.js b/project/data.js index 9e210c8..f01d01b 100644 --- a/project/data.js +++ b/project/data.js @@ -978,7 +978,8 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "equipName": [ "武器", "武器", - "防具", + "护具", + "饰品", "饰品" ], "startBgm": "theme.mp3", @@ -1051,7 +1052,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "steps": 0, "matk": 0, "speed": 0, - "str": 10, + "str": 5, "agi": 10, "int": 10, "con": 10, diff --git a/project/floors/street01.js b/project/floors/street01.js index 9ba3619..7edc884 100644 --- a/project/floors/street01.js +++ b/project/floors/street01.js @@ -118,7 +118,7 @@ main.floors.street01= [110118,110118,200096,110116,110020, 0,200014, 0, 0, 0, 0, 0,110125], [ 92, 0, 0,110124, 0,201, 0, 0,110125,110122,110122,110122,110122], [ 0, 0, 0,110118,110118,202,110118,110118,110122, 0, 0, 0, 94], - [130170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [130170, 0, 0, 0, 71, 35, 0, 0, 0, 0, 0, 0, 0], [130178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,130168,130169], [130225,130169,130169,130169,130169,130170,110122,110122,130168,130169,130169,130224,130177] ], diff --git a/project/floors/yiqu8.js b/project/floors/yiqu8.js index 3174759..18bb1e8 100644 --- a/project/floors/yiqu8.js +++ b/project/floors/yiqu8.js @@ -1,29 +1,29 @@ main.floors.yiqu8= { -"floorId": "yiqu8", -"title": "主塔 8 层", -"name": "8", -"width": 13, -"height": 13, -"canFlyTo": true, -"canFlyFrom": true, -"canUseQuickShop": true, -"images": [], -"ratio": 1, -"defaultGround": "grass2", -"firstArrive": [], -"eachArrive": [], -"parallelDo": "", -"events": {}, -"changeFloor": {}, -"beforeBattle": {}, -"afterBattle": {}, -"afterGetItem": {}, -"afterOpenDoor": {}, -"autoEvent": {}, -"cannotMove": {}, -"cannotMoveIn": {}, -"map": [ + "floorId": "yiqu8", + "title": "主塔 8 层", + "name": "8", + "width": 13, + "height": 13, + "canFlyTo": true, + "canFlyFrom": true, + "canUseQuickShop": true, + "images": [], + "ratio": 1, + "defaultGround": "grass2", + "firstArrive": [], + "eachArrive": [], + "parallelDo": "", + "events": {}, + "changeFloor": {}, + "beforeBattle": {}, + "afterBattle": {}, + "afterGetItem": {}, + "afterOpenDoor": {}, + "autoEvent": {}, + "cannotMove": {}, + "cannotMoveIn": {}, + "map": [ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], @@ -38,4 +38,16 @@ main.floors.yiqu8= [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] ], + "bgmap": [ + +], + "fgmap": [ + +], + "bg2map": [ + +], + "fg2map": [ + +] } \ No newline at end of file diff --git a/project/items.js b/project/items.js index 05dcc9c..0ca9007 100644 --- a/project/items.js +++ b/project/items.js @@ -151,7 +151,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "type": 0, "animate": "sword", "value": { - "atk": 10 + "str": 10 }, "percentage": {} }, @@ -224,17 +224,22 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "equipCls": "匕首" }, "shield0": { - "cls": "items", + "cls": "equips", "name": "破旧的盾", "text": "一个很破旧的铁盾", "equip": { - "type": 1, + "type": 2, "value": { - "def": 0 + "str": 10, + "agi": -5 + }, + "percentage": { + "speed": 10 } }, "itemEffect": "core.status.hero.def += 0", - "itemEffectTip": ",防御+0" + "itemEffectTip": ",防御+0", + "equipCls": "护具" }, "shield1": { "cls": "equips", diff --git a/project/plugins.js b/project/plugins.js index 37f1b38..f09c2cf 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -4881,435 +4881,436 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }; }, "新道具栏/装备栏": function () { - // 在此增加新插件 - // 注:///// *** 裹起来的区域: 该区域内参数可以随意更改调整ui绘制 不会影响总体布局 - // 请尽量修改该区域而不是其他区域 修改的时候最好可以对照现有ui修改 + // 在此增加新插件 + // 注:///// *** 裹起来的区域: 该区域内参数可以随意更改调整ui绘制 不会影响总体布局 + // 请尽量修改该区域而不是其他区域 修改的时候最好可以对照现有ui修改 - ///// *** 道具类型 - // cls对应name - var itemClsName = { - constants: "永久道具", - tools: "消耗道具", - }; - // 一页最大放的道具数量 将把整个道具左栏分成num份 每份是一个道具项 - var itemNum = 12; - ///// *** + ///// *** 道具类型 + // cls对应name + var itemClsName = { + constants: "永久道具", + tools: "消耗道具", + }; + // 一页最大放的道具数量 将把整个道具左栏分成num份 每份是一个道具项 + var itemNum = 12; + ///// *** - // 背景设置 - this.drawBoxBackground = function (ctx) { - core.setTextAlign(ctx, "left"); - core.clearMap(ctx); - core.deleteCanvas("_selector"); - var info = core.status.thisUIEventInfo || {}; + // 背景设置 + this.drawBoxBackground = function (ctx) { + core.setTextAlign(ctx, "left"); + core.clearMap(ctx); + core.deleteCanvas("_selector"); + var info = core.status.thisUIEventInfo || {}; - ///// *** 背景设置 - var max = core.__PIXELS__; - var x = 2, - y = x, - w = max - x * 2, - h = w; - var borderWidth = 2, - borderRadius = 5, // radius:圆角矩形的圆角半径 - borderStyle = "#fff"; - var backgroundColor = "gray"; - // 设置背景不透明度(0.85) - var backgroundAlpha = 0.85; - ///// *** + ///// *** 背景设置 + var max = core.__PIXELS__; + var x = 2, + y = x, + w = max - x * 2, + h = w; + var borderWidth = 2, + borderRadius = 5, // radius:圆角矩形的圆角半径 + borderStyle = "#fff"; + var backgroundColor = "gray"; + // 设置背景不透明度(0.85) + var backgroundAlpha = 0.85; + ///// *** - var start_x = x + borderWidth / 2, - start_y = y + borderWidth / 2, - width = max - start_x * 2, - height = max - start_y * 2; + var start_x = x + borderWidth / 2, + start_y = y + borderWidth / 2, + width = max - start_x * 2, + height = max - start_y * 2; - // 渐变色背景的一个例子(黑色渐变白色): - // 有关渐变色的具体知识请网上搜索canvas createGradient了解 - /* + // 渐变色背景的一个例子(黑色渐变白色): + // 有关渐变色的具体知识请网上搜索canvas createGradient了解 + /* var grd = ctx.createLinearGradient(x, y, x + w, y); grd.addColorStop(0, "black"); grd.addColorStop(1, "white"); backgroundColor = grd; */ - // 使用图片背景要注释掉下面的strokeRect和fillRoundRect - // 图片背景的一个例子: - /* + // 使用图片背景要注释掉下面的strokeRect和fillRoundRect + // 图片背景的一个例子: + /* core.drawImage(ctx, "xxx.png", x, y, w, h); core.strokeRect(ctx, x, y, w, h, borderStyle, borderWidth); */ - core.setAlpha(ctx, backgroundAlpha); - core.strokeRoundRect( - ctx, - x, - y, - w, - h, - borderRadius, - borderStyle, - borderWidth - ); - core.fillRoundRect( - ctx, - start_x, - start_y, - width, - height, - borderRadius, - backgroundColor - ); - core.setAlpha(ctx, 1); + core.setAlpha(ctx, backgroundAlpha); + core.strokeRoundRect( + ctx, + x, + y, + w, + h, + borderRadius, + borderStyle, + borderWidth + ); + core.fillRoundRect( + ctx, + start_x, + start_y, + width, + height, + borderRadius, + backgroundColor + ); + core.setAlpha(ctx, 1); - ///// *** 左栏配置 - var leftbar_height = height; - // 左边栏宽度(width*0.6) 本身仅为坐标使用 需要与底下的rightbar_width(width*0.4)同时更改 - var leftbar_width = width * 0.6; - ///// *** + ///// *** 左栏配置 + var leftbar_height = height; + // 左边栏宽度(width*0.6) 本身仅为坐标使用 需要与底下的rightbar_width(width*0.4)同时更改 + var leftbar_width = width * 0.6; + ///// *** - // xxx_right参数 代表最右侧坐标 - var leftbar_right = start_x + leftbar_width - borderWidth / 2; - var leftbar_bottom = start_y + leftbar_height; - var leftbar_x = start_x; - var leftbar_y = start_y; + // xxx_right参数 代表最右侧坐标 + var leftbar_right = start_x + leftbar_width - borderWidth / 2; + var leftbar_bottom = start_y + leftbar_height; + var leftbar_x = start_x; + var leftbar_y = start_y; - ///// *** 道具栏配置 - var boxName_color = "#fff"; - var boxName_fontSize = 15; - var boxName_font = core.ui._buildFont(boxName_fontSize, true); - var arrow_x = 10 + start_x; - var arrow_y = 10 + start_y; - var arrow_width = 20; - var arrow_style = "white"; - // 暂时只能是1 否则不太行 等待新样板(2.7.3)之后对drawArrow做优化 - var arrow_lineWidth = 1; - // 右箭头 - var rightArrow_right = leftbar_right - 10; - // 道具内栏顶部坐标 本质是通过该项 控制(道具栏顶部文字和箭头)与道具内栏顶部的间隔 - var itembar_top = arrow_y + 15; - ///// *** + ///// *** 道具栏配置 + var boxName_color = "#fff"; + var boxName_fontSize = 15; + var boxName_font = core.ui._buildFont(boxName_fontSize, true); + var arrow_x = 10 + start_x; + var arrow_y = 10 + start_y; + var arrow_width = 20; + var arrow_style = "white"; + // 暂时只能是1 否则不太行 等待新样板(2.7.3)之后对drawArrow做优化 + var arrow_lineWidth = 1; + // 右箭头 + var rightArrow_right = leftbar_right - 10; + // 道具内栏顶部坐标 本质是通过该项 控制(道具栏顶部文字和箭头)与道具内栏顶部的间隔 + var itembar_top = arrow_y + 15; + ///// *** - var itembar_right = rightArrow_right; - var boxName = - core.status.event.id == "toolbox" - ? "\r[yellow]道具栏\r | 装备栏" - : "道具栏 | \r[yellow]装备栏\r"; - core.drawArrow( - ctx, - arrow_x + arrow_width, - arrow_y, - arrow_x, - arrow_y, - arrow_style, - arrow_lineWidth - ); - core.drawArrow( - ctx, - rightArrow_right - arrow_width, - arrow_y, - rightArrow_right, - arrow_y, - arrow_style, - arrow_lineWidth - ); - core.setTextAlign(ctx, "center"); - core.setTextBaseline(ctx, "middle"); - var changeBox = function () { - var id = core.status.event.id; - core.closePanel(); - if (id == "toolbox") core.openEquipbox(); - else core.openToolbox(); - }; - core.fillText( - ctx, - boxName, - (leftbar_right + leftbar_x) / 2, - arrow_y + 2, - boxName_color, - boxName_font - ); + var itembar_right = rightArrow_right; + var boxName = + core.status.event.id == "toolbox" ? + "\r[yellow]道具栏\r | 装备栏" : + "道具栏 | \r[yellow]装备栏\r"; + core.drawArrow( + ctx, + arrow_x + arrow_width, + arrow_y, + arrow_x, + arrow_y, + arrow_style, + arrow_lineWidth + ); + core.drawArrow( + ctx, + rightArrow_right - arrow_width, + arrow_y, + rightArrow_right, + arrow_y, + arrow_style, + arrow_lineWidth + ); + core.setTextAlign(ctx, "center"); + core.setTextBaseline(ctx, "middle"); + var changeBox = function () { + var id = core.status.event.id; + core.closePanel(); + if (id == "toolbox") core.openEquipbox(); + else core.openToolbox(); + }; + core.fillText( + ctx, + boxName, + (leftbar_right + leftbar_x) / 2, + arrow_y + 2, + boxName_color, + boxName_font + ); - ///// *** 底栏按钮 - var pageBtn_radius = 8; - // xxx_left 最左侧坐标 - var pageBtn_left = leftbar_x + 3; - var pageBtn_right = leftbar_right - 3; - // xxx_bottom 最底部坐标 - var pageBtn_bottom = leftbar_bottom - 2; - var pageBtn_borderStyle = "#fff"; - var pageBtn_borderWidth = 2; - var pageText_color = "#fff"; - // 底部按钮与上面的道具内栏的间隔大小 - var bottomSpace = 8; - ///// *** + ///// *** 底栏按钮 + var pageBtn_radius = 8; + // xxx_left 最左侧坐标 + var pageBtn_left = leftbar_x + 3; + var pageBtn_right = leftbar_right - 3; + // xxx_bottom 最底部坐标 + var pageBtn_bottom = leftbar_bottom - 2; + var pageBtn_borderStyle = "#fff"; + var pageBtn_borderWidth = 2; + var pageText_color = "#fff"; + // 底部按钮与上面的道具内栏的间隔大小 + var bottomSpace = 8; + ///// *** - core.drawItemListbox_setPageBtn( - ctx, - pageBtn_left, - pageBtn_right, - pageBtn_bottom, - pageBtn_radius, - pageBtn_borderStyle, - pageBtn_borderWidth - ); - var page = info.page || 1; - var pageFontSize = pageBtn_radius * 2 - 4; - var pageFont = core.ui._buildFont(pageFontSize); - core.setPageItems(page); - var num = itemNum; - if (core.status.event.id == "equipbox") num -= 5; - var maxPage = info.maxPage; - var pageText = page + " / " + maxPage; - core.setTextAlign(ctx, "center"); - core.setTextBaseline(ctx, "bottom"); - core.fillText( - ctx, - pageText, - (leftbar_x + leftbar_right) / 2, - pageBtn_bottom, - pageText_color, - pageFont - ); - core.addUIEventListener( - start_x, - start_y, - leftbar_right - start_x, - arrow_y - start_y + 13, - changeBox - ); - var itembar_height = Math.ceil( - pageBtn_bottom - - pageBtn_radius * 2 - - pageBtn_borderWidth / 2 - - bottomSpace - - itembar_top - ); - var oneItemHeight = (itembar_height - 4) / itemNum; - return { - x: start_x, - y: start_y, - width: width, - height: height, - leftbar_right: leftbar_right, - obj: { - x: arrow_x, - y: itembar_top, - width: itembar_right - arrow_x, - height: itembar_height, - oneItemHeight: oneItemHeight, - }, - }; - }; + core.drawItemListbox_setPageBtn( + ctx, + pageBtn_left, + pageBtn_right, + pageBtn_bottom, + pageBtn_radius, + pageBtn_borderStyle, + pageBtn_borderWidth + ); + var page = info.page || 1; + var pageFontSize = pageBtn_radius * 2 - 4; + var pageFont = core.ui._buildFont(pageFontSize); + core.setPageItems(page); + var num = itemNum; + if (core.status.event.id == "equipbox") num -= 5; + var maxPage = info.maxPage; + var pageText = page + " / " + maxPage; + core.setTextAlign(ctx, "center"); + core.setTextBaseline(ctx, "bottom"); + core.fillText( + ctx, + pageText, + (leftbar_x + leftbar_right) / 2, + pageBtn_bottom, + pageText_color, + pageFont + ); + core.addUIEventListener( + start_x, + start_y, + leftbar_right - start_x, + arrow_y - start_y + 13, + changeBox + ); + var itembar_height = Math.ceil( + pageBtn_bottom - + pageBtn_radius * 2 - + pageBtn_borderWidth / 2 - + bottomSpace - + itembar_top + ); + var oneItemHeight = (itembar_height - 4) / itemNum; + return { + x: start_x, + y: start_y, + width: width, + height: height, + leftbar_right: leftbar_right, + obj: { + x: arrow_x, + y: itembar_top, + width: itembar_right - arrow_x, + height: itembar_height, + oneItemHeight: oneItemHeight, + }, + }; + }; - this.drawItemListbox = function (ctx, obj) { - ctx = ctx || core.canvas.ui; - var itembar_x = obj.x, - itembar_y = obj.y, - itembar_width = obj.width, - itembar_height = obj.height, - itemNum = obj.itemNum, - oneItemHeight = obj.oneItemHeight; - var itembar_right = itembar_x + itembar_width; - var info = core.status.thisUIEventInfo || {}; - var obj = {}; - var page = info.page || 1, - index = info.index, - select = info.select || {}; + this.drawItemListbox = function (ctx, obj) { + ctx = ctx || core.canvas.ui; + var itembar_x = obj.x, + itembar_y = obj.y, + itembar_width = obj.width, + itembar_height = obj.height, + itemNum = obj.itemNum, + oneItemHeight = obj.oneItemHeight; + var itembar_right = itembar_x + itembar_width; + var info = core.status.thisUIEventInfo || {}; + var obj = {}; + var page = info.page || 1, + index = info.index, + select = info.select || {}; - ///// *** 道具栏内栏配置 - var itembar_style = "black"; - var itembar_alpha = 0.7; - // 一个竖屏下减少道具显示的例子: - // if (core.domStyle.isVertical) itemNum = 10; - // 每个道具项的上下空隙占总高度的比例 - var itembar_marginHeightRatio = 0.2; - // 左右间隔空隙 - var item_marginLeft = 2; - var item_x = itembar_x + 2, - item_y = itembar_y + 2, - item_right = itembar_right - 2, - itemName_color = "#fff"; - // 修改此项以更换闪烁光标 - var item_selector = "winskin.webp"; - ///// *** + ///// *** 道具栏内栏配置 + var itembar_style = "black"; + var itembar_alpha = 0.7; + // 一个竖屏下减少道具显示的例子: + // if (core.domStyle.isVertical) itemNum = 10; + // 每个道具项的上下空隙占总高度的比例 + var itembar_marginHeightRatio = 0.2; + // 左右间隔空隙 + var item_marginLeft = 2; + var item_x = itembar_x + 2, + item_y = itembar_y + 2, + item_right = itembar_right - 2, + itemName_color = "#fff"; + // 修改此项以更换闪烁光标 + var item_selector = "winskin.webp"; + ///// *** - core.setAlpha(ctx, itembar_alpha); - core.fillRect( - ctx, - itembar_x, - itembar_y, - itembar_width, - itembar_height, - itembar_style - ); - core.setAlpha(ctx, 1); - var pageItems = core.setPageItems(page); - var marginHeight = itembar_marginHeightRatio * oneItemHeight; - core.setTextBaseline(ctx, "middle"); - var originColor = itemName_color; - for (var i = 0; i < pageItems.length; i++) { - itemName_color = originColor; - var item = pageItems[i]; - // 设置某个的字体颜色的一个例子 - // if (item.id == "xxx") itemName_color = "green"; - core.drawItemListbox_drawItem( - ctx, - item_x, - item_right, - item_y, - oneItemHeight, - item_marginLeft, - marginHeight, - itemName_color, - pageItems[i] - ); - if (index == i + 1) - core.ui._drawWindowSelector( - item_selector, - item_x + 1, - item_y - 1, - item_right - item_x - 2, - oneItemHeight - 2 - ); - item_y += oneItemHeight; - } - }; + core.setAlpha(ctx, itembar_alpha); + core.fillRect( + ctx, + itembar_x, + itembar_y, + itembar_width, + itembar_height, + itembar_style + ); + core.setAlpha(ctx, 1); + var pageItems = core.setPageItems(page); + var marginHeight = itembar_marginHeightRatio * oneItemHeight; + core.setTextBaseline(ctx, "middle"); + var originColor = itemName_color; + for (var i = 0; i < pageItems.length; i++) { + itemName_color = originColor; + var item = pageItems[i]; + // 设置某个的字体颜色的一个例子 + // if (item.id == "xxx") itemName_color = "green"; + core.drawItemListbox_drawItem( + ctx, + item_x, + item_right, + item_y, + oneItemHeight, + item_marginLeft, + marginHeight, + itemName_color, + pageItems[i] + ); + if (index == i + 1) + core.ui._drawWindowSelector( + item_selector, + item_x + 1, + item_y - 1, + item_right - item_x - 2, + oneItemHeight - 2 + ); + item_y += oneItemHeight; + } + }; - this.drawToolboxRightbar = function (ctx, obj) { - ctx = ctx || core.canvas.ui; - var info = core.status.thisUIEventInfo || {}; - var page = info.page || 1, - index = info.index || 1, - select = info.select || {}; - var start_x = obj.x, - start_y = obj.y, - width = obj.width, - height = obj.height; - var toolboxRight = start_x + width, - toolboxBottom = start_y + height; + this.drawToolboxRightbar = function (ctx, obj) { + ctx = ctx || core.canvas.ui; + var info = core.status.thisUIEventInfo || {}; + var page = info.page || 1, + index = info.index || 1, + select = info.select || {}; + var start_x = obj.x, + start_y = obj.y, + width = obj.width, + height = obj.height; + var toolboxRight = start_x + width, + toolboxBottom = start_y + height; - ///// *** 侧边栏(rightbar)背景设置(物品介绍) - var rightbar_width = width * 0.4; - var rightbar_height = height; - var rightbar_lineWidth = 2; - var rightbar_lineStyle = "#fff"; - ///// *** + ///// *** 侧边栏(rightbar)背景设置(物品介绍) + var rightbar_width = width * 0.4; + var rightbar_height = height; + var rightbar_lineWidth = 2; + var rightbar_lineStyle = "#fff"; + ///// *** - var rightbar_x = toolboxRight - rightbar_width - rightbar_lineWidth / 2; - var rightbar_y = start_y; - core.drawLine( - ctx, - rightbar_x, - rightbar_y, - rightbar_x, - rightbar_y + rightbar_height, - rightbar_lineStyle, - rightbar_lineWidth - ); + var rightbar_x = toolboxRight - rightbar_width - rightbar_lineWidth / 2; + var rightbar_y = start_y; + core.drawLine( + ctx, + rightbar_x, + rightbar_y, + rightbar_x, + rightbar_y + rightbar_height, + rightbar_lineStyle, + rightbar_lineWidth + ); - // 获取道具id(有可能为null) - var itemId = select.id; - var item = core.material.items[itemId]; + // 获取道具id(有可能为null) + var itemId = select.id; + var item = core.material.items[itemId]; - ///// *** 侧边栏物品Icon信息 - var iconRect_y = rightbar_y + 10; - // space:间距 - // 这里布局设定iconRect与侧边栏左边框 itemName与工具栏右边框 itemRect与itemName的间距均为space - var space = 15; - var iconRect_x = rightbar_x + space; - var iconRect_radius = 2, - iconRect_width = 32, - iconRect_height = 32, - iconRect_style = "#fff", - iconRect_lineWidth = 2; - ///// *** + ///// *** 侧边栏物品Icon信息 + var iconRect_y = rightbar_y + 10; + // space:间距 + // 这里布局设定iconRect与侧边栏左边框 itemName与工具栏右边框 itemRect与itemName的间距均为space + var space = 15; + var iconRect_x = rightbar_x + space; + var iconRect_radius = 2, + iconRect_width = 32, + iconRect_height = 32, + iconRect_style = "#fff", + iconRect_lineWidth = 2; + ///// *** - var iconRect_bottom = iconRect_y + iconRect_height, - iconRect_right = iconRect_x + iconRect_width; + var iconRect_bottom = iconRect_y + iconRect_height, + iconRect_right = iconRect_x + iconRect_width; - ///// *** 侧边栏各项信息 - var itemTextFontSize = 15, - itemText_x = iconRect_x - 4, - itemText_y = Math.floor(start_y + rightbar_height * 0.25), // 坐标取整防止模糊 - itemClsFontSize = 15, - itemClsFont = core.ui._buildFont(itemClsFontSize), - itemClsColor = "#fff", - itemCls_x = itemText_x - itemClsFontSize / 2, - itemCls_middle = (iconRect_bottom + itemText_y) / 2, //_middle代表文字的中心y坐标 - itemNameFontSize = 18, - itemNameColor = "#fff", - itemNameFont = core.ui._buildFont(itemNameFontSize, true); - var itemName_x = iconRect_right + space; - var itemName_middle = - iconRect_y + iconRect_height / 2 + iconRect_lineWidth; - // 修改这里可以编辑未选中道具时的默认值 - var defaultItem = { - cls: "constants", - name: "未知道具", - text: "没有道具最永久", - }; - var defaultEquip = { - cls: "equips", - name: "未知装备", - text: "一无所有,又何尝不是一种装备", - equipCls: "无", - equip: { - type: "装备", - }, - }; - ///// *** + ///// *** 侧边栏各项信息 + var itemTextFontSize = 15, + itemText_x = iconRect_x - 4, + itemText_y = Math.floor(start_y + rightbar_height * 0.25), // 坐标取整防止模糊 + itemClsFontSize = 15, + itemClsFont = core.ui._buildFont(itemClsFontSize), + itemClsColor = "#fff", + itemCls_x = itemText_x - itemClsFontSize / 2, + itemCls_middle = (iconRect_bottom + itemText_y) / 2, //_middle代表文字的中心y坐标 + itemNameFontSize = 18, + itemNameColor = "#fff", + itemNameFont = core.ui._buildFont(itemNameFontSize, true); + var itemName_x = iconRect_right + space; + var itemName_middle = + iconRect_y + iconRect_height / 2 + iconRect_lineWidth; + // 修改这里可以编辑未选中道具时的默认值 + var defaultItem = { + cls: "constants", + name: "未知道具", + text: "没有道具最永久", + }; + var defaultEquip = { + cls: "equips", + name: "未知装备", + text: "一无所有,又何尝不是一种装备", + equipCls: "无", + equip: { + type: "装备", + }, + }; + ///// *** - var originItem = item; - if (core.status.event.id == "equipbox") item = item || defaultEquip; - item = item || defaultItem; - var itemCls = item.cls, - itemName = item.name, - itemText = item.text; - itemText = core.replaceText(itemText); - if (itemText[0] == "," || itemText[0] == ",") - itemText = itemText.substring(1); - /* 一个根据道具id修改道具名字(右栏)的例子 - * if (item.id == "xxx") itemNameColor = "red"; - */ - var itemClsName = core.getItemClsName(item); - var itemNameMaxWidth = - rightbar_width - iconRect_width - iconRect_lineWidth * 2 - space * 2; - core.strokeRoundRect( - ctx, - iconRect_x, - iconRect_y, - iconRect_width, - iconRect_height, - iconRect_radius, - iconRect_style, - iconRect_lineWidth - ); - if (item.id) - core.drawIcon( - ctx, - item.id, - iconRect_x + iconRect_lineWidth / 2, - iconRect_y + iconRect_lineWidth / 2, - iconRect_width - iconRect_lineWidth, - iconRect_height - iconRect_lineWidth - ); - core.setTextAlign(ctx, "left"); - core.setTextBaseline(ctx, "middle"); - core.fillText( - ctx, - itemName, - itemName_x, - itemName_middle, - itemNameColor, - itemNameFont, - itemNameMaxWidth - ); - core.fillText( - ctx, - "【" + itemClsName + "】", - itemCls_x, - itemCls_middle, - itemClsColor, - itemClsFont - ); - var statusText = "【装备类型】" + item.equipCls + "\n\n"; - /*if (core.status.event.id == "equipbox") { + var originItem = item; + if (core.status.event.id == "equipbox") item = item || defaultEquip; + item = item || defaultItem; + var itemCls = item.cls, + itemName = item.name, + itemText = item.text; + itemText = core.replaceText(itemText); + if (itemText[0] == "," || itemText[0] == ",") + itemText = itemText.substring(1); + /* 一个根据道具id修改道具名字(右栏)的例子 + * if (item.id == "xxx") itemNameColor = "red"; + */ + var itemClsName = core.getItemClsName(item); + var itemNameMaxWidth = + rightbar_width - iconRect_width - iconRect_lineWidth * 2 - space * 2; + core.strokeRoundRect( + ctx, + iconRect_x, + iconRect_y, + iconRect_width, + iconRect_height, + iconRect_radius, + iconRect_style, + iconRect_lineWidth + ); + if (item.id) + core.drawIcon( + ctx, + item.id, + iconRect_x + iconRect_lineWidth / 2, + iconRect_y + iconRect_lineWidth / 2, + iconRect_width - iconRect_lineWidth, + iconRect_height - iconRect_lineWidth + ); + core.setTextAlign(ctx, "left"); + core.setTextBaseline(ctx, "middle"); + core.fillText( + ctx, + itemName, + itemName_x, + itemName_middle, + itemNameColor, + itemNameFont, + itemNameMaxWidth + ); + if (!item.equip) core.fillText( + ctx, + "【" + itemClsName + "】", + itemCls_x, + itemCls_middle, + itemClsColor, + itemClsFont + ); + + var statusText = "【装备类型】" + item.equipCls + "\n\n"; + /*if (core.status.event.id == "equipbox") { var type = item.equip.type; if (typeof type == "string") type = core.getEquipTypeByName(type); var compare = core.compareEquipment(item.id, core.getEquip(type)); @@ -5328,956 +5329,1095 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = statusText += core.getStatusLabel(name) + " " + nowValue + "->\r[" + color + "]" + newValue + "\r\n"; } }*/ - itemText = statusText + itemText; - core.drawTextContent(ctx, itemText, { - left: itemText_x, - top: itemText_y, - bold: false, - color: "white", - align: "left", - fontSize: itemTextFontSize, - maxWidth: - rightbar_width - (itemText_x - rightbar_x) * 2 + itemTextFontSize / 2, - }); + let shuxing = "【装备属性】\n" + const equipValue = core.material.items[item.id]?.equip + if (equipValue) { + let value = "" + for (const a in equipValue.value) { + switch (a) { + case "str": + value += equipValue.value[a] > 0 ? "力量+" + equipValue.value[a] + '\n' : "力量" + equipValue.value[a] + '\n' + break; + case "agi": + value += equipValue.value[a] > 0 ? "敏捷+" + equipValue.value[a] + '\n' : "敏捷" + equipValue.value[a] + '\n' + break; + case "int": + value += equipValue.value[a] > 0 ? "智力+" + equipValue.value[a] + '\n' : "智力" + equipValue.value[a] + '\n' + break; + case "con": + value += equipValue.value[a] > 0 ? "体质+" + equipValue.value[a] + '\n' : "体质" + equipValue.value[a] + '\n' + break; + case "hpmax": + value += equipValue.value[a] > 0 ? "生命上限+" + equipValue.value[a] + '\n' : "生命上限" + equipValue.value[a] + '\n' + break; + case "manamax": + value += equipValue.value[a] > 0 ? "魔力上限+" + equipValue.value[a] + '\n' : "魔力上限" + equipValue.value[a] + '\n' + break; + case "atk": + value += equipValue.value[a] > 0 ? "攻击+" + equipValue.value[a] + '\n' : "攻击" + equipValue.value[a] + '\n' + break; + case "def": + value += equipValue.value[a] > 0 ? "物理防御+" + equipValue.value[a] + '\n' : "物理防御" + equipValue.value[a] + '\n' + break; + case "mdef": + value += equipValue.value[a] > 0 ? "魔法防御+" + equipValue.value[a] + '\n' : "魔法防御" + equipValue.value[a] + '\n' + break; + case "speed": + value += equipValue.value[a] > 0 ? "速度+" + equipValue.value[a] + '\n' : "速度" + equipValue.value[a] + '\n' + break; - ///// *** 退出按钮设置 - var btnRadius = 10; - var btnBorderWidth = 2; - var btnRight = toolboxRight - 2; - var btnBottom = toolboxBottom - 2; - var btnBorderStyle = "#fff"; - ///// *** + } + } + for (const a in equipValue.percentage) { + switch (a) { + case "str": + value += equipValue.percentage[a] > 0 ? "力量+" + equipValue.percentage[a] + '%\n' : "力量" + equipValue.percentage[a] + '%\n' + break; + case "agi": + value += equipValue.percentage[a] > 0 ? "敏捷+" + equipValue.percentage[a] + '%\n' : "敏捷" + equipValue.percentage[a] + '%\n' + break; + case "int": + value += equipValue.percentage[a] > 0 ? "智力+" + equipValue.percentage[a] + '%\n' : "智力" + equipValue.percentage[a] + '%\n' + break; + case "con": + value += equipValue.percentage[a] > 0 ? "体质+" + equipValue.percentage[a] + '%\n' : "体质" + equipValue.percentage[a] + '%\n' + break; + case "hpmax": + value += equipValue.percentage[a] > 0 ? "生命上限+" + equipValue.percentage[a] + '%\n' : "生命上限" + equipValue.percentage[a] + '%\n' + break; + case "manamax": + value += equipValue.percentage[a] > 0 ? "魔力上限+" + equipValue.percentage[a] + '%\n' : "魔力上限" + equipValue.percentage[a] + '%\n' + break; + case "atk": + value += equipValue.percentage[a] > 0 ? "攻击+" + equipValue.percentage[a] + '%\n' : "攻击" + equipValue.percentage[a] + '%\n' + break; + case "def": + value += equipValue.percentage[a] > 0 ? "物理防御+" + equipValue.percentage[a] + '%\n' : "物理防御" + equipValue.percentage[a] + '%\n' + break; + case "mdef": + value += equipValue.percentage[a] > 0 ? "魔法防御+" + equipValue.percentage[a] + '%\n' : "魔法防御" + equipValue.percentage[a] + '%\n' + break; + case "speed": + value += equipValue.percentage[a] > 0 ? "速度+" + equipValue.percentage[a] + '%\n' : "速度" + equipValue.percentage[a] + '%\n' + break; - // 获取圆心位置 - var btn_x = btnRight - btnRadius - btnBorderWidth / 2, - btn_y = btnBottom - btnRadius - btnBorderWidth / 2; - core.drawToolbox_setExitBtn( - ctx, - btn_x, - btn_y, - btnRadius, - btnBorderStyle, - btnBorderWidth - ); + } + } + if (value !== '') itemText += "\n\n" + shuxing + value + } - ///// *** 使用按钮设置 - var useBtnHeight = btnRadius * 2; - // 这里不设置useBtnWidth而是根据各项数据自动得出width - var useBtnRadius = useBtnHeight / 2; - var useBtn_x = rightbar_x + 4, - useBtn_y = btnBottom - useBtnHeight; - var useBtnBorderStyle = "#fff"; - var useBtnBorderWidth = btnBorderWidth; - ///// *** + itemText = item.equipCls ? statusText + itemText : itemText - core.drawToolbox_setUseBtn( - ctx, - useBtn_x, - useBtn_y, - useBtnRadius, - useBtnHeight, - useBtnBorderStyle, - useBtnBorderWidth - ); - }; - this.drawEquipbox_drawOthers = function (ctx, obj) { - var info = core.status.thisUIEventInfo; + let needText = '\n【装备需求】\n' - ///// *** 装备格设置 - var equipList_lineWidth = 2; - var equipList_boxSize = 32; - var equipList_borderWidth = 2; - var equipList_borderStyle = "#fff"; - var equipList_nameColor = "#fff"; - ///// *** + const need = core.plugin.equipNeed[item.id] + if (need) { + for (const a in need) { + switch (a) { + case "str": + needText += "力量【" + need[a] + '】\n' + break; + case "agi": + needText += "敏捷【" + need[a] + '】\n' + break; + case "int": + needText += "智力【" + need[a] + '】\n' + break; + case "con": + needText += "体质【" + need[a] + '】\n' + break; - var equipList_x = obj.x + 4, - equipList_bottom = obj.obj.y - equipList_lineWidth, - equipList_y = equipList_bottom - obj.obj.oneItemHeight * reduceItem - 2, - equipList_height = equipList_bottom - equipList_y; - var equipList_right = obj.leftbar_right, - equipList_width = equipList_right - equipList_x; - core.drawLine( - ctx, - obj.x, - equipList_bottom + equipList_lineWidth / 2, - equipList_right, - equipList_bottom + equipList_lineWidth / 2, - equipList_borderStyle, - equipList_lineWidth - ); - var toDrawList = core.status.globalAttribute.equipName, - len = toDrawList.length; + } + } + } + itemText = need ? itemText + needText : itemText + if (item.equip) { + core.drawTextContent(ctx, itemText, { + left: itemText_x, + top: itemCls_middle, + bold: false, + color: "white", + align: "left", + fontSize: itemTextFontSize, + maxWidth: rightbar_width - (itemText_x - rightbar_x) * 2 + itemTextFontSize / 2, + }); + } else { + core.drawTextContent(ctx, itemText, { + left: itemText_x, + top: itemText_y, + bold: false, + color: "white", + align: "left", + fontSize: itemTextFontSize, + maxWidth: rightbar_width - (itemText_x - rightbar_x) * 2 + itemTextFontSize / 2, + }); + } - ///// *** 装备格设置 - var maxItem = 4; - var box_width = 32, - box_height = 32, - box_borderStyle = "#fff", - box_selectBorderStyle = "gold", // 选中的装备格的颜色 - box_borderWidth = 2; - var boxName_fontSize = 14, - boxName_space = 2, - boxName_color = "#fff"; // 装备格名称与上面的装备格框的距离 - var maxLine = Math.ceil(len / maxItem); - ///// *** - var l = Math.sqrt(len); - if (Math.pow(l) == len && len != 4) { - if (l <= maxItem) maxItem = l; - } - maxItem = Math.min(toDrawList.length, maxItem); - info.equips = maxItem; + ///// *** 退出按钮设置 + var btnRadius = 10; + var btnBorderWidth = 2; + var btnRight = toolboxRight - 2; + var btnBottom = toolboxBottom - 2; + var btnBorderStyle = "#fff"; + ///// *** - var boxName_font = core.ui._buildFont(boxName_fontSize); - // 总宽高减去所有装备格宽高得到空隙大小 - var oneBoxWidth = box_width + box_borderWidth * 2; - var oneBoxHeight = - box_height + boxName_fontSize + boxName_space + 2 * box_borderWidth; - var space_y = (equipList_height - maxLine * oneBoxHeight) / (1 + maxLine), - space_x = (equipList_width - maxItem * oneBoxWidth) / (1 + maxItem); - var box_x = equipList_x + space_x, - box_y = equipList_y + space_y; - for (var i = 0; i < len; i++) { - var id = core.getEquip(i), - name = toDrawList[i]; - if (i === 0) name = "主手"; - if (i === 1) name = "副手"; - var selectBorder = false; - if (core.status.thisUIEventInfo.select.type == i) selectBorder = true; - var borderStyle = selectBorder - ? box_selectBorderStyle - : box_borderStyle; - core.drawEquipbox_drawOne( - ctx, - name, - id, - box_x, - box_y, - box_width, - box_height, - boxName_space, - boxName_font, - boxName_color, - borderStyle, - box_borderWidth - ); - var todo = new Function( - "core.clickOneEquipbox('" + id + "'," + i + ")" - ); - core.addUIEventListener( - box_x - box_borderWidth / 2, - box_y - box_borderWidth / 2, - oneBoxWidth, - oneBoxHeight, - todo - ); - box_x += space_x + oneBoxWidth; - if ((i + 1) % maxItem == 0) { - box_x = equipList_x + space_x; - box_y += space_y + oneBoxHeight; - } - } - if (core.material.items[core.getEquip(0)]?.equipCls === "双手剑") { - core.drawLine( - ctx, - equipList_x + space_x + space_x + oneBoxWidth, - equipList_y + space_y, - equipList_x + - space_x + - space_x + - oneBoxWidth + - box_width + - box_borderWidth, - equipList_y + space_y + box_height - ); - core.drawLine( - ctx, - equipList_x + space_x + space_x + oneBoxWidth, - equipList_y + space_y + box_height, - equipList_x + - space_x + - space_x + - oneBoxWidth + - box_width + - box_borderWidth, - equipList_y + space_y - ); - } - }; + // 获取圆心位置 + var btn_x = btnRight - btnRadius - btnBorderWidth / 2, + btn_y = btnBottom - btnRadius - btnBorderWidth / 2; + core.drawToolbox_setExitBtn( + ctx, + btn_x, + btn_y, + btnRadius, + btnBorderStyle, + btnBorderWidth + ); - this.drawToolbox = function (ctx) { - ctx = ctx || core.canvas.ui; - core.status.thisEventClickArea = []; + ///// *** 使用按钮设置 + var useBtnHeight = btnRadius * 2; + // 这里不设置useBtnWidth而是根据各项数据自动得出width + var useBtnRadius = useBtnHeight / 2; + var useBtn_x = rightbar_x + 4, + useBtn_y = btnBottom - useBtnHeight; + var useBtnBorderStyle = "#fff"; + var useBtnBorderWidth = btnBorderWidth; + ///// *** - var info = core.drawBoxBackground(ctx); - info.itemNum = itemNum; - core.drawItemListbox(ctx, info.obj); - core.drawToolboxRightbar(ctx, info); - core.setTextBaseline(ctx, "alphabetic"); - core.setTextAlign("left"); - }; + core.drawToolbox_setUseBtn( + ctx, + useBtn_x, + useBtn_y, + useBtnRadius, + useBtnHeight, + useBtnBorderStyle, + useBtnBorderWidth + ); + }; - var reduceItem = 4; - this.drawEquipbox = function (ctx) { - ctx = ctx || core.canvas.ui; - core.status.thisEventClickArea = []; - var info = core.drawBoxBackground(ctx); - info.itemNum = itemNum - reduceItem; - info.obj.y += info.obj.oneItemHeight * reduceItem; - info.obj.height -= info.obj.oneItemHeight * reduceItem; - core.drawItemListbox(ctx, info.obj); - core.drawEquipbox_drawOthers(ctx, info); - core.drawToolboxRightbar(ctx, info); - core.setTextBaseline(ctx, "alphabetic"); - core.setTextAlign("left"); - }; + this.drawEquipbox_drawOthers = function (ctx, obj) { + var info = core.status.thisUIEventInfo; - this.drawEquipbox_drawOne = function ( - ctx, - name, - id, - x, - y, - width, - height, - space, - font, - color, - style, - lineWidth - ) { - if (id) - core.drawIcon( - ctx, - id, - x + lineWidth / 2, - y + lineWidth / 2, - width, - height - ); - core.strokeRect( - ctx, - x, - y, - width + lineWidth, - height + lineWidth, - style, - lineWidth - ); - core.setTextAlign(ctx, "center"); - core.setTextBaseline(ctx, "top"); - var tx = (x + x + lineWidth / 2 + width) / 2, - ty = y + height + (lineWidth / 2) * 3 + space; - core.fillText(ctx, name, tx, ty, color, font); - core.setTextBaseline(ctx, "alphabetic"); - core.setTextAlign("left"); - }; + ///// *** 装备格设置 + var equipList_lineWidth = 2; + var equipList_boxSize = 32; + var equipList_borderWidth = 2; + var equipList_borderStyle = "#fff"; + var equipList_nameColor = "#fff"; + ///// *** - this.drawItemListbox_drawItem = function ( - ctx, - left, - right, - top, - height, - marginLeft, - marginHeight, - style, - id - ) { - var info = core.status.thisUIEventInfo; - var nowClick = info.index; - var item = core.material.items[id] || {}; - var name = item.name || "???"; - var num = core.itemCount(id) || 0; - var fontSize = Math.floor(height - marginHeight * 2); - core.setTextAlign(ctx, "right"); - var numText = "x" + num; - core.fillText( - ctx, - numText, - right - marginLeft, - top + height / 2, - style, - core.ui._buildFont(fontSize) - ); - if (name != "???") - core.drawIcon( - ctx, - id, - left + marginLeft, - top + marginHeight, - fontSize, - fontSize - ); - var text_x = left + marginLeft + fontSize + 2; - var maxWidth = right - core.calWidth(ctx, numText) - text_x; - core.setTextAlign(ctx, "left"); - core.fillText( - ctx, - name, - text_x, - top + height / 2, - style, - core.ui._buildFont(fontSize), - maxWidth - ); - var todo = new Function("core.clickItemFunc('" + id + "');"); - core.addUIEventListener(left, top, right - left, height, todo); - }; + var equipList_x = obj.x + 4, + equipList_bottom = obj.obj.y - equipList_lineWidth, + equipList_y = equipList_bottom - obj.obj.oneItemHeight * reduceItem - 2, + equipList_height = equipList_bottom - equipList_y; + var equipList_right = obj.leftbar_right, + equipList_width = equipList_right - equipList_x; + core.drawLine( + ctx, + obj.x, + equipList_bottom + equipList_lineWidth / 2, + equipList_right, + equipList_bottom + equipList_lineWidth / 2, + equipList_borderStyle, + equipList_lineWidth + ); + var toDrawList = core.status.globalAttribute.equipName, + len = toDrawList.length; - this.setPageItems = function (page) { - var num = itemNum; - if (core.status.event.id == "equipbox") num -= reduceItem; - var info = core.status.thisUIEventInfo; - if (!info) return; - page = page || info.page; - var items = core.getToolboxItems( - core.status.event.id == "toolbox" ? "all" : "equips" - ); - info.allItems = items; - var maxPage = Math.ceil(items.length / num); - info.maxPage = maxPage; - var pageItems = items.slice((page - 1) * num, page * num); - info.pageItems = pageItems; - info.maxItem = pageItems.length; - if (items.length == 0 && pageItems.length == 0) info.index = null; - if (pageItems.length == 0 && info.page > 1) { - info.page = Math.max(1, info.page - 1); - return core.setPageItems(info.page); - } - return pageItems; - }; + ///// *** 装备格设置 + var maxItem = 4; + var box_width = 32, + box_height = 32, + box_borderStyle = "#fff", + box_selectBorderStyle = "gold", // 选中的装备格的颜色 + box_borderWidth = 2; + var boxName_fontSize = 14, + boxName_space = 2, + boxName_color = "#fff"; // 装备格名称与上面的装备格框的距离 + var maxLine = Math.ceil(len / maxItem); + ///// *** + var l = Math.sqrt(len); + if (Math.pow(l) == len && len != 4) { + if (l <= maxItem) maxItem = l; + } + maxItem = Math.min(toDrawList.length, maxItem); + info.equips = maxItem; - this.drawToolbox_setExitBtn = function (ctx, x, y, r, style, lineWidth) { - core.strokeCircle(ctx, x, y, r, style, lineWidth); - ctx.textAlign = "center"; - ctx.textBaseline = "middle"; - var textSize = Math.sqrt(2) * r; - core.fillText( - ctx, - "x", - x, - y, - style, - core.ui._buildFont(textSize), - textSize - ); - core.setTextAlign(ctx, "start"); - core.setTextBaseline(ctx, "top"); + var boxName_font = core.ui._buildFont(boxName_fontSize); + // 总宽高减去所有装备格宽高得到空隙大小 + var oneBoxWidth = box_width + box_borderWidth * 2; + var oneBoxHeight = + box_height + boxName_fontSize + boxName_space + 2 * box_borderWidth; + var space_y = (equipList_height - maxLine * oneBoxHeight) / (1 + maxLine), + space_x = (equipList_width - maxItem * oneBoxWidth) / (1 + maxItem); + var box_x = equipList_x + space_x, + box_y = equipList_y + space_y; + for (var i = 0; i < len; i++) { + var id = core.getEquip(i), + name = toDrawList[i]; + if (i === 0) name = "主手"; + if (i === 1) name = "副手"; + var selectBorder = false; + if (core.status.thisUIEventInfo.select.type == i) selectBorder = true; + var borderStyle = selectBorder ? + box_selectBorderStyle : + box_borderStyle; + core.drawEquipbox_drawOne( + ctx, + name, + id, + box_x, + box_y, + box_width, + box_height, + boxName_space, + boxName_font, + boxName_color, + borderStyle, + box_borderWidth + ); + var todo = new Function( + "core.clickOneEquipbox('" + id + "'," + i + ")" + ); + core.addUIEventListener( + box_x - box_borderWidth / 2, + box_y - box_borderWidth / 2, + oneBoxWidth, + oneBoxHeight, + todo + ); + box_x += space_x + oneBoxWidth; + if ((i + 1) % maxItem == 0) { + box_x = equipList_x + space_x; + box_y += space_y + oneBoxHeight; + } + } + if (core.material.items[core.getEquip(0)]?.equipCls === "双手剑") { + core.drawLine( + ctx, + equipList_x + space_x + space_x + oneBoxWidth, + equipList_y + space_y, + equipList_x + + space_x + + space_x + + oneBoxWidth + + box_width + + box_borderWidth, + equipList_y + space_y + box_height + ); + core.drawLine( + ctx, + equipList_x + space_x + space_x + oneBoxWidth, + equipList_y + space_y + box_height, + equipList_x + + space_x + + space_x + + oneBoxWidth + + box_width + + box_borderWidth, + equipList_y + space_y + ); + } + }; - var todo = function () { - core.closePanel(); - }; - core.addUIEventListener(x - r, y - r, r * 2, r * 2, todo); - }; + this.drawToolbox = function (ctx) { + ctx = ctx || core.canvas.ui; + core.status.thisEventClickArea = []; - this.drawToolbox_setUseBtn = function (ctx, x, y, r, h, style, lineWidth) { - core.setTextAlign(ctx, "left"); - core.setTextBaseline(ctx, "top"); - var fontSize = h - 4; - var font = core.ui._buildFont(fontSize); - var text = core.status.event.id == "toolbox" ? "使用" : "装备"; - if (core.status.thisUIEventInfo.select.action == "unload") text = "卸下"; - var w = core.calWidth(ctx, text, font) + 2 * r + lineWidth / 2; + var info = core.drawBoxBackground(ctx); + info.itemNum = itemNum; + core.drawItemListbox(ctx, info.obj); + core.drawToolboxRightbar(ctx, info); + core.setTextBaseline(ctx, "alphabetic"); + core.setTextAlign("left"); + }; - core.strokeRoundRect(ctx, x, y, w, h, r, style, lineWidth); - core.fillText(ctx, text, x + r, y + lineWidth / 2 + 2, style, font); + var reduceItem = 4; + this.drawEquipbox = function (ctx) { + ctx = ctx || core.canvas.ui; + core.status.thisEventClickArea = []; + var info = core.drawBoxBackground(ctx); + info.itemNum = itemNum - reduceItem; + info.obj.y += info.obj.oneItemHeight * reduceItem; + info.obj.height -= info.obj.oneItemHeight * reduceItem; + core.drawItemListbox(ctx, info.obj); + core.drawEquipbox_drawOthers(ctx, info); + core.drawToolboxRightbar(ctx, info); + core.setTextBaseline(ctx, "alphabetic"); + core.setTextAlign("left"); + }; - var todo = function () { - core.useSelectItemInBox(); - }; - core.addUIEventListener(x, y, w, h, todo); - }; + this.drawEquipbox_drawOne = function ( + ctx, + name, + id, + x, + y, + width, + height, + space, + font, + color, + style, + lineWidth + ) { + if (id) + core.drawIcon( + ctx, + id, + x + lineWidth / 2, + y + lineWidth / 2, + width, + height + ); + core.strokeRect( + ctx, + x, + y, + width + lineWidth, + height + lineWidth, + style, + lineWidth + ); + core.setTextAlign(ctx, "center"); + core.setTextBaseline(ctx, "top"); + var tx = (x + x + lineWidth / 2 + width) / 2, + ty = y + height + (lineWidth / 2) * 3 + space; + core.fillText(ctx, name, tx, ty, color, font); + core.setTextBaseline(ctx, "alphabetic"); + core.setTextAlign("left"); + }; - this.drawItemListbox_setPageBtn = function ( - ctx, - left, - right, - bottom, - r, - style, - lineWidth - ) { - var offset = lineWidth / 2 + r; + this.drawItemListbox_drawItem = function ( + ctx, + left, + right, + top, + height, + marginLeft, + marginHeight, + style, + id + ) { + var info = core.status.thisUIEventInfo; + var nowClick = info.index; + var item = core.material.items[id] || {}; + var name = item.name || "???"; + var num = core.itemCount(id) || 0; + var fontSize = Math.floor(height - marginHeight * 2); + core.setTextAlign(ctx, "right"); + var numText = "x" + num; + core.fillText( + ctx, + numText, + right - marginLeft, + top + height / 2, + style, + core.ui._buildFont(fontSize) + ); + if (name != "???") + core.drawIcon( + ctx, + id, + left + marginLeft, + top + marginHeight, + fontSize, + fontSize + ); + var text_x = left + marginLeft + fontSize + 2; + var maxWidth = right - core.calWidth(ctx, numText) - text_x; + core.setTextAlign(ctx, "left"); + core.fillText( + ctx, + name, + text_x, + top + height / 2, + style, + core.ui._buildFont(fontSize), + maxWidth + ); + var todo = new Function("core.clickItemFunc('" + id + "');"); + core.addUIEventListener(left, top, right - left, height, todo); + }; - var x = left + offset; - var y = bottom - offset; - var pos = (Math.sqrt(2) / 2) * (r - lineWidth / 2); - core.fillPolygon( - ctx, - [ - [x - pos, y], - [x + pos - 2, y - pos], - [x + pos - 2, y + pos], - ], - style - ); - core.strokeCircle(ctx, x, y, r, style, lineWidth); - var todo = function () { - core.addItemListboxPage(-1); - }; - core.addUIEventListener(x - r - 2, y - r - 2, r * 2 + 4, r * 2 + 4, todo); + this.setPageItems = function (page) { + var num = itemNum; + if (core.status.event.id == "equipbox") num -= reduceItem; + var info = core.status.thisUIEventInfo; + if (!info) return; + page = page || info.page; + var items = core.getToolboxItems( + core.status.event.id == "toolbox" ? "all" : "equips" + ); + info.allItems = items; + var maxPage = Math.ceil(items.length / num); + info.maxPage = maxPage; + var pageItems = items.slice((page - 1) * num, page * num); + info.pageItems = pageItems; + info.maxItem = pageItems.length; + if (items.length == 0 && pageItems.length == 0) info.index = null; + if (pageItems.length == 0 && info.page > 1) { + info.page = Math.max(1, info.page - 1); + return core.setPageItems(info.page); + } + return pageItems; + }; - x = right - offset; - core.fillPolygon( - ctx, - [ - [x + pos, y], - [x - pos + 2, y - pos], - [x - pos + 2, y + pos], - ], - style - ); - core.strokeCircle(ctx, x, y, r, style, lineWidth); - var todo = function () { - core.addItemListboxPage(1); - }; - core.addUIEventListener(x - r - 2, y - r - 2, r * 2 + 4, r * 2 + 4, todo); - }; + this.drawToolbox_setExitBtn = function (ctx, x, y, r, style, lineWidth) { + core.strokeCircle(ctx, x, y, r, style, lineWidth); + ctx.textAlign = "center"; + ctx.textBaseline = "middle"; + var textSize = Math.sqrt(2) * r; + core.fillText( + ctx, + "x", + x, + y, + style, + core.ui._buildFont(textSize), + textSize + ); + core.setTextAlign(ctx, "start"); + core.setTextBaseline(ctx, "top"); - this.clickItemFunc = function (id) { - var info = core.status.thisUIEventInfo; - if (!info) return; - if (info.select.id == id) return core.useSelectItemInBox(); - info.select = {}; - info.select.id = id; - core.setIndexAndSelect("index"); - core.refreshBox(); - }; + var todo = function () { + core.closePanel(); + }; + core.addUIEventListener(x - r, y - r, r * 2, r * 2, todo); + }; - this.clickOneEquipbox = function (id, type) { - var info = core.status.thisUIEventInfo; - if (!info) return; - if (info.select.id == id && info.select.type == type) - core.useSelectItemInBox(); - else - core.status.thisUIEventInfo.select = { - id: id, - type: type, - action: "unload", - }; - return core.refreshBox(); - }; + this.drawToolbox_setUseBtn = function (ctx, x, y, r, h, style, lineWidth) { + core.setTextAlign(ctx, "left"); + core.setTextBaseline(ctx, "top"); + var fontSize = h - 4; + var font = core.ui._buildFont(fontSize); + var text = core.status.event.id == "toolbox" ? "使用" : "装备"; + if (core.status.thisUIEventInfo.select.action == "unload") text = "卸下"; + var w = core.calWidth(ctx, text, font) + 2 * r + lineWidth / 2; - core.ui.getToolboxItems = function (cls) { - var list = Object.keys(core.status.hero.items[cls] || {}); - if (cls == "all") { - for (var name in core.status.hero.items) { - if (name == "equips") continue; - list = list.concat(Object.keys(core.status.hero.items[name])); - } - return list - .filter(function (id) { - return !core.material.items[id].hideInToolbox; - }) - .sort(); - } + core.strokeRoundRect(ctx, x, y, w, h, r, style, lineWidth); + core.fillText(ctx, text, x + r, y + lineWidth / 2 + 2, style, font); - if (this.uidata.getToolboxItems) { - return this.uidata.getToolboxItems(cls); - } - return list - .filter(function (id) { - return !core.material.items[id].hideInToolbox; - }) - .sort(); - }; + var todo = function () { + core.useSelectItemInBox(); + }; + core.addUIEventListener(x, y, w, h, todo); + }; - this.useSelectItemInBox = function () { - var info = core.status.thisUIEventInfo; - if (!info) return; - if (!info.select.id) return; - var id = info.select.id; - if (core.status.event.id == "toolbox") { - core.events.tryUseItem(id); - // core.closePanel(); - } else if (core.status.event.id == "equipbox") { - var action = info.select.action || "load"; - info.index = 1; - if (action == "load") { - var type = core.getEquipTypeById(id); - let equipClsid = core.material.items[id]?.equipCls; - let equipCls0 = core.material.items[core.getEquip(0)]?.equipCls; - let equipCls1 = core.material.items[core.getEquip(1)]?.equipCls; - if (equipCls0 === "双手剑") { - core.unloadEquip(0, function () { - core.status.route.push("unEquip:" + 0); - }); - } - if (equipClsid === "单手剑") { - if ( - equipCls1 !== "单手剑" && - equipCls1 !== "匕首" && - equipCls1 !== "盾牌" - ) { - core.unloadEquip(0, function () { - core.status.route.push("unEquip:" + 0); - }); - core.unloadEquip(1, function () { - core.status.route.push("unEquip:" + 1); - }); - } else if (equipCls0 !== "单手剑") { - core.unloadEquip(0, function () { - core.status.route.push("unEquip:" + 0); - }); - } - } - if (equipClsid === "法杖") { - if (equipCls1 !== "匕首" && equipCls1 !== "盾牌") { - core.unloadEquip(0, function () { - core.status.route.push("unEquip:" + 0); - }); - core.unloadEquip(1, function () { - core.status.route.push("unEquip:" + 1); - }); - } else { - core.unloadEquip(0, function () { - core.status.route.push("unEquip:" + 0); - }); - } - } - if (equipClsid === "双手剑") { - core.unloadEquip(0, function () { - core.status.route.push("unEquip:" + 0); - }); - core.unloadEquip(1, function () { - core.status.route.push("unEquip:" + 1); - }); - } - if (equipClsid === "匕首") { - if (equipCls0 !== "匕首") { - core.unloadEquip(0, function () { - core.status.route.push("unEquip:" + 0); - }); - core.unloadEquip(1, function () { - core.status.route.push("unEquip:" + 1); - }); - } else { - core.unloadEquip(1, function () { - core.status.route.push("unEquip:" + 1); - }); - } - } - if (equipClsid === "盾牌") { - if (equipCls0 !== "单手剑" && equipCls0 !== "法杖") { - core.unloadEquip(0, function () { - core.status.route.push("unEquip:" + 0); - }); - core.unloadEquip(1, function () { - core.status.route.push("unEquip:" + 1); - }); - } else { - core.unloadEquip(1, function () { - core.status.route.push("unEquip:" + 1); - }); - } - } - core.loadEquip(id, function () { - core.status.route.push("equip:" + id); - info.select.type = type; - core.setIndexAndSelect("select"); - core.drawEquipbox(); - }); - } else { - var type = info.select.type; - core.unloadEquip(type, function () { - core.status.route.push("unEquip:" + type); - info.select.type = type; - //info.select.action = 'load' - core.setIndexAndSelect("select"); - core.drawEquipbox(); - }); - } - } - core.updateStatusBar(); - }; - this.setIndexAndSelect = function (toChange) { - var info = core.status.thisUIEventInfo; - if (!info) return; - core.setPageItems(info.page); - var index = info.index || 1; - var items = info.pageItems; - if (info.select.type != null) { - var type = info.select.type; - id = core.getEquip(type); - info.index = null; - info.select = { - id: id, - action: "unload", - type: type, - }; - return; - } else { - info.select.action = null; - info.select.type = null; - if (toChange == "index") info.index = items.indexOf(info.select.id) + 1; - info.select.id = items[info.index - 1]; - } - }; + this.drawItemListbox_setPageBtn = function ( + ctx, + left, + right, + bottom, + r, + style, + lineWidth + ) { + var offset = lineWidth / 2 + r; - this.addItemListboxPage = function (num) { - var info = core.status.thisUIEventInfo; - if (!info) return; - var maxPage = info.maxPage || 1; - info.page = info.page || 1; - info.page += num; - if (info.page <= 0) info.page = maxPage; - if (info.page > maxPage) info.page = 1; - info.index = 1; - core.setPageItems(info.page); - core.setIndexAndSelect("select"); - core.refreshBox(); - }; + var x = left + offset; + var y = bottom - offset; + var pos = (Math.sqrt(2) / 2) * (r - lineWidth / 2); + core.fillPolygon( + ctx, + [ + [x - pos, y], + [x + pos - 2, y - pos], + [x + pos - 2, y + pos], + ], + style + ); + core.strokeCircle(ctx, x, y, r, style, lineWidth); + var todo = function () { + core.addItemListboxPage(-1); + }; + core.addUIEventListener(x - r - 2, y - r - 2, r * 2 + 4, r * 2 + 4, todo); - this.addItemListboxIndex = function (num) { - var info = core.status.thisUIEventInfo; - if (!info) return; - var maxItem = info.maxItem || 0; - info.index = info.index || 0; - info.index += num; - if (info.index <= 0) info.index = 1; - if (info.index > maxItem) info.index = maxItem; - core.setIndexAndSelect("select"); - core.refreshBox(); - }; + x = right - offset; + core.fillPolygon( + ctx, + [ + [x + pos, y], + [x - pos + 2, y - pos], + [x - pos + 2, y + pos], + ], + style + ); + core.strokeCircle(ctx, x, y, r, style, lineWidth); + var todo = function () { + core.addItemListboxPage(1); + }; + core.addUIEventListener(x - r - 2, y - r - 2, r * 2 + 4, r * 2 + 4, todo); + }; - this.addEquipboxType = function (num) { - var info = core.status.thisUIEventInfo; - var type = info.select.type; - if (type == null && num > 0) info.select.type = 0; - else info.select.type = type + num; - var max = core.status.globalAttribute.equipName.length; - if (info.select.type >= max) { - info.select = {}; - core.setIndexAndSelect("select"); - return core.addItemListboxPage(0); - } else { - var m = Math.abs(info.select.type); - if (info.select.type < 0) info.select.type = max - m; - core.setIndexAndSelect("select"); - core.refreshBox(); - return; - } - }; + this.clickItemFunc = function (id) { + var info = core.status.thisUIEventInfo; + if (!info) return; + if (info.select.id == id) return core.useSelectItemInBox(); + info.select = {}; + info.select.id = id; + core.setIndexAndSelect("index"); + core.refreshBox(); + }; - core.actions._keyDownToolbox = function (keycode) { - if (!core.status.thisEventClickArea) return; - if (keycode == 37) { - // left - core.addItemListboxPage(-1); - return; - } - if (keycode == 38) { - // up - core.addItemListboxIndex(-1); - return; - } - if (keycode == 39) { - // right - core.addItemListboxPage(1); - return; - } - if (keycode == 40) { - // down - core.addItemListboxIndex(1); - return; - } - }; + this.clickOneEquipbox = function (id, type) { + var info = core.status.thisUIEventInfo; + if (!info) return; + if (info.select.id == id && info.select.type == type) + core.useSelectItemInBox(); + else + core.status.thisUIEventInfo.select = { + id: id, + type: type, + action: "unload", + }; + return core.refreshBox(); + }; - ////// 工具栏界面时,放开某个键的操作 ////// - core.actions._keyUpToolbox = function (keycode) { - if (keycode == 81) { - core.ui.closePanel(); - if (core.isReplaying()) core.control._replay_equipbox(); - else core.openEquipbox(); - return; - } - if (keycode == 84 || keycode == 27 || keycode == 88) { - core.closePanel(); - return; - } - if (keycode == 13 || keycode == 32 || keycode == 67) { - var info = core.status.thisUIEventInfo; - if (info.select) { - core.useSelectItemInBox(); - } - return; - } - }; + core.ui.getToolboxItems = function (cls) { + var list = Object.keys(core.status.hero.items[cls] || {}); + if (cls == "all") { + for (var name in core.status.hero.items) { + if (name == "equips") continue; + list = list.concat(Object.keys(core.status.hero.items[name])); + } + return list + .filter(function (id) { + return !core.material.items[id].hideInToolbox; + }) + .sort(); + } - core.actions._keyDownEquipbox = function (keycode) { - if (!core.status.thisEventClickArea) return; - if (keycode == 37) { - // left - var info = core.status.thisUIEventInfo; - if (info.index != null) return core.addItemListboxPage(-1); - return core.addEquipboxType(-1); - } - if (keycode == 38) { - // up - var info = core.status.thisUIEventInfo; - if (info.index == 1) { - info.select.type = core.status.globalAttribute.equipName.length - 1; - core.setIndexAndSelect(); - return core.refreshBox(); - } - if (info.index) return core.addItemListboxIndex(-1); - return core.addEquipboxType(-1 * info.equips); - } - if (keycode == 39) { - // right - var info = core.status.thisUIEventInfo; - if (info.index != null) return core.addItemListboxPage(1); - return core.addEquipboxType(1); - } - if (keycode == 40) { - // down - var info = core.status.thisUIEventInfo; - if (info.index) return core.addItemListboxIndex(1); - return core.addEquipboxType(info.equips); - } - }; + if (this.uidata.getToolboxItems) { + return this.uidata.getToolboxItems(cls); + } + return list + .filter(function (id) { + return !core.material.items[id].hideInToolbox; + }) + .sort(); + }; - core.actions._keyUpEquipbox = function (keycode, altKey) { - if (altKey && keycode >= 48 && keycode <= 57) { - core.items.quickSaveEquip(keycode - 48); - return; - } - if (keycode == 84) { - core.ui.closePanel(); - if (core.isReplaying()) core.control._replay_toolbox(); - else core.openToolbox(); - return; - } - if (keycode == 81 || keycode == 27 || keycode == 88) { - core.closePanel(); - return; - } - if (keycode == 13 || keycode == 32 || keycode == 67) { - var info = core.status.thisUIEventInfo; - if (info.select) core.useSelectItemInBox(); - return; - } - }; + this.useSelectItemInBox = function () { + var info = core.status.thisUIEventInfo; + if (!info) return; + if (!info.select.id) return; + var id = info.select.id; + if (core.status.event.id == "toolbox") { + core.events.tryUseItem(id); + // core.closePanel(); + } else if (core.status.event.id == "equipbox") { + var action = info.select.action || "load"; + info.index = 1; + if (action == "load") { + var type = core.getEquipTypeById(id); + let equipClsid = core.material.items[id]?.equipCls; + let equipCls0 = core.material.items[core.getEquip(0)]?.equipCls; + let equipCls1 = core.material.items[core.getEquip(1)]?.equipCls; + if (equipClsid === "双手剑") { + core.unloadEquip(0, function () { + core.status.route.push("unEquip:" + 0); + }); + core.unloadEquip(1, function () { + core.status.route.push("unEquip:" + 1); + }); + } + if (equipClsid === "单手剑") { + if ( + equipCls1 !== "单手剑" && + equipCls1 !== "匕首" && + equipCls1 !== "盾牌" + ) { + core.unloadEquip(0, function () { + core.status.route.push("unEquip:" + 0); + }); + core.unloadEquip(1, function () { + core.status.route.push("unEquip:" + 1); + }); + } else if (equipCls0 !== "单手剑") { + core.unloadEquip(0, function () { + core.status.route.push("unEquip:" + 0); + }); + } + } + if (equipClsid === "法杖") { + if (equipCls1 !== "匕首" && equipCls1 !== "盾牌") { + core.unloadEquip(0, function () { + core.status.route.push("unEquip:" + 0); + }); + core.unloadEquip(1, function () { + core.status.route.push("unEquip:" + 1); + }); + } else { + core.unloadEquip(0, function () { + core.status.route.push("unEquip:" + 0); + }); + } + } + if (equipClsid === "双手剑") { + core.unloadEquip(0, function () { + core.status.route.push("unEquip:" + 0); + }); + core.unloadEquip(1, function () { + core.status.route.push("unEquip:" + 1); + }); + } + if (equipClsid === "匕首") { + if (equipCls0 !== "匕首") { + core.unloadEquip(0, function () { + core.status.route.push("unEquip:" + 0); + }); + core.unloadEquip(1, function () { + core.status.route.push("unEquip:" + 1); + }); + } else { + core.unloadEquip(1, function () { + core.status.route.push("unEquip:" + 1); + }); + } + } + if (equipClsid === "盾牌") { + if (equipCls0 !== "单手剑" && equipCls0 !== "法杖") { + core.unloadEquip(0, function () { + core.status.route.push("unEquip:" + 0); + }); + core.unloadEquip(1, function () { + core.status.route.push("unEquip:" + 1); + }); + } else { + core.unloadEquip(1, function () { + core.status.route.push("unEquip:" + 1); + }); + } + } + if (equipClsid === "护具") { + core.unloadEquip(2, function () { + core.status.route.push("unEquip:" + 2); + }); + } + if (equipClsid === "饰品" && core.getEquip(3) && core.getEquip(4)) { - core.registerAction( - "ondown", - "inEventClickAction", - function (x, y, px, py) { - if (!core.status.thisEventClickArea) return false; - // console.log(px + "," + py); - var info = core.status.thisEventClickArea; - for (var i = 0; i < info.length; i++) { - var obj = info[i]; - if ( - px >= obj.x && - px <= obj.x + obj.width && - py > obj.y && - py < obj.y + obj.height - ) { - if (obj.todo) obj.todo(); - break; - } - } - return true; - }, - 51 - ); - core.registerAction( - "onclick", - "stopClick", - function () { - if (core.status.thisEventClickArea) return true; - }, - 51 - ); + core.unloadEquip(4, function () { + core.status.route.push("unEquip:" + 4); + }); + } - this.addUIEventListener = function (x, y, width, height, todo) { - if (!core.status.thisEventClickArea) return; - var obj = { - x: x, - y: y, - width: width, - height: height, - todo: todo, - }; - core.status.thisEventClickArea.push(obj); - }; + const idneed = core.plugin.equipNeed[id] + let canload = true + if (core.plugin.equipNeed[id]) { + for (const a in idneed) { + if (core.status.hero[a] < idneed[a]) canload = false + } + } + if (canload) { + core.loadEquip(id, function () { + core.status.route.push("equip:" + id); + info.select.type = type; + core.setIndexAndSelect("select"); + core.drawEquipbox(); + }); + } else { + core.drawTip("未达装备需求") + } + } else { + var type = info.select.type; + core.unloadEquip(type, function () { + core.status.route.push("unEquip:" + type); + info.select.type = type; + //info.select.action = 'load' + core.setIndexAndSelect("select"); + core.drawEquipbox(); + }); + } + } + core.updateStatusBar(); + }; + this.setIndexAndSelect = function (toChange) { + var info = core.status.thisUIEventInfo; + if (!info) return; + core.setPageItems(info.page); + var index = info.index || 1; + var items = info.pageItems; + if (info.select.type != null) { + var type = info.select.type; + id = core.getEquip(type); + info.index = null; + info.select = { + id: id, + action: "unload", + type: type, + }; + return; + } else { + info.select.action = null; + info.select.type = null; + if (toChange == "index") info.index = items.indexOf(info.select.id) + 1; + info.select.id = items[info.index - 1]; + } + }; - this.initThisEventInfo = function () { - core.status.thisUIEventInfo = { - page: 1, - select: {}, - }; - core.status.thisEventClickArea = []; - }; + this.addItemListboxPage = function (num) { + var info = core.status.thisUIEventInfo; + if (!info) return; + var maxPage = info.maxPage || 1; + info.page = info.page || 1; + info.page += num; + if (info.page <= 0) info.page = maxPage; + if (info.page > maxPage) info.page = 1; + info.index = 1; + core.setPageItems(info.page); + core.setIndexAndSelect("select"); + core.refreshBox(); + }; - this.refreshBox = function () { - if (!core.status.event.id) return; - if (core.status.event.id == "toolbox") core.drawToolbox(); - else core.drawEquipbox(); - }; + this.addItemListboxIndex = function (num) { + var info = core.status.thisUIEventInfo; + if (!info) return; + var maxItem = info.maxItem || 0; + info.index = info.index || 0; + info.index += num; + if (info.index <= 0) info.index = 1; + if (info.index > maxItem) info.index = maxItem; + core.setIndexAndSelect("select"); + core.refreshBox(); + }; - core.ui.closePanel = function () { - if (core.status.hero && core.status.hero.flags) { - // 清除全部临时变量 - Object.keys(core.status.hero.flags).forEach(function (name) { - if (name.startsWith("@temp@") || /^arg\d+$/.test(name)) { - delete core.status.hero.flags[name]; - } - }); - } - this.clearUI(); - core.maps.generateGroundPattern(); - core.updateStatusBar(true); - core.unlockControl(); - core.status.event.data = null; - core.status.event.id = null; - core.status.event.selection = null; - core.status.event.ui = null; - core.status.event.interval = null; - core.status.thisUIEventInfo = null; - core.status.thisEventClickArea = null; - }; + this.addEquipboxType = function (num) { + var info = core.status.thisUIEventInfo; + var type = info.select.type; + if (type == null && num > 0) info.select.type = 0; + else info.select.type = type + num; + var max = core.status.globalAttribute.equipName.length; + if (info.select.type >= max) { + info.select = {}; + core.setIndexAndSelect("select"); + return core.addItemListboxPage(0); + } else { + var m = Math.abs(info.select.type); + if (info.select.type < 0) info.select.type = max - m; + core.setIndexAndSelect("select"); + core.refreshBox(); + return; + } + }; - this.getItemClsName = function (item) { - if (item == null) return itemClsName; - if (item.cls == "equips") { - if (typeof item.equip.type == "string") return item.equip.type; - var type = core.getEquipTypeById(item.id); - return core.status.globalAttribute.equipName[type]; - } else return itemClsName[item.cls] || item.cls; - }; + core.actions._keyDownToolbox = function (keycode) { + if (!core.status.thisEventClickArea) return; + if (keycode == 37) { + // left + core.addItemListboxPage(-1); + return; + } + if (keycode == 38) { + // up + core.addItemListboxIndex(-1); + return; + } + if (keycode == 39) { + // right + core.addItemListboxPage(1); + return; + } + if (keycode == 40) { + // down + core.addItemListboxIndex(1); + return; + } + }; - core.events.openToolbox = function (fromUserAction) { - if (core.isReplaying()) return; - if (!this._checkStatus("toolbox", fromUserAction)) return; - core.initThisEventInfo(); - let info = core.status.thisUIEventInfo; - info.index = 1; - core.setIndexAndSelect("select"); - core.drawToolbox(); - }; + ////// 工具栏界面时,放开某个键的操作 ////// + core.actions._keyUpToolbox = function (keycode) { + if (keycode == 81) { + core.ui.closePanel(); + if (core.isReplaying()) core.control._replay_equipbox(); + else core.openEquipbox(); + return; + } + if (keycode == 84 || keycode == 27 || keycode == 88) { + core.closePanel(); + return; + } + if (keycode == 13 || keycode == 32 || keycode == 67) { + var info = core.status.thisUIEventInfo; + if (info.select) { + core.useSelectItemInBox(); + } + return; + } + }; - core.events.openEquipbox = function (fromUserAction) { - if (core.isReplaying()) return; - if (!this._checkStatus("equipbox", fromUserAction)) return; - core.initThisEventInfo(); - let info = core.status.thisUIEventInfo; - info.select.type = 0; - core.setIndexAndSelect("select"); - core.drawEquipbox(); - }; + core.actions._keyDownEquipbox = function (keycode) { + if (!core.status.thisEventClickArea) return; + if (keycode == 37) { + // left + var info = core.status.thisUIEventInfo; + if (info.index != null) return core.addItemListboxPage(-1); + return core.addEquipboxType(-1); + } + if (keycode == 38) { + // up + var info = core.status.thisUIEventInfo; + if (info.index == 1) { + info.select.type = core.status.globalAttribute.equipName.length - 1; + core.setIndexAndSelect(); + return core.refreshBox(); + } + if (info.index) return core.addItemListboxIndex(-1); + return core.addEquipboxType(-1 * info.equips); + } + if (keycode == 39) { + // right + var info = core.status.thisUIEventInfo; + if (info.index != null) return core.addItemListboxPage(1); + return core.addEquipboxType(1); + } + if (keycode == 40) { + // down + var info = core.status.thisUIEventInfo; + if (info.index) return core.addItemListboxIndex(1); + return core.addEquipboxType(info.equips); + } + }; - core.control._replay_toolbox = function () { - if (!core.isPlaying() || !core.isReplaying()) return; - if (!core.status.replay.pausing) return core.drawTip("请先暂停录像"); - if (core.isMoving() || core.status.replay.animate || core.status.event.id) - return core.drawTip("请等待当前事件的处理结束"); + core.actions._keyUpEquipbox = function (keycode, altKey) { + if (altKey && keycode >= 48 && keycode <= 57) { + core.items.quickSaveEquip(keycode - 48); + return; + } + if (keycode == 84) { + core.ui.closePanel(); + if (core.isReplaying()) core.control._replay_toolbox(); + else core.openToolbox(); + return; + } + if (keycode == 81 || keycode == 27 || keycode == 88) { + core.closePanel(); + return; + } + if (keycode == 13 || keycode == 32 || keycode == 67) { + var info = core.status.thisUIEventInfo; + if (info.select) core.useSelectItemInBox(); + return; + } + }; - core.lockControl(); - core.status.event.id = "toolbox"; - core.drawToolbox(); - }; + core.registerAction( + "ondown", + "inEventClickAction", + function (x, y, px, py) { + if (!core.status.thisEventClickArea) return false; + // console.log(px + "," + py); + var info = core.status.thisEventClickArea; + for (var i = 0; i < info.length; i++) { + var obj = info[i]; + if ( + px >= obj.x && + px <= obj.x + obj.width && + py > obj.y && + py < obj.y + obj.height + ) { + if (obj.todo) obj.todo(); + break; + } + } + return true; + }, + 51 + ); + core.registerAction( + "onclick", + "stopClick", + function () { + if (core.status.thisEventClickArea) return true; + }, + 51 + ); - core.control._replay_equipbox = function () { - if (!core.isPlaying() || !core.isReplaying()) return; - if (!core.status.replay.pausing) return core.drawTip("请先暂停录像"); - if (core.isMoving() || core.status.replay.animate || core.status.event.id) - return core.drawTip("请等待当前事件的处理结束"); + this.addUIEventListener = function (x, y, width, height, todo) { + if (!core.status.thisEventClickArea) return; + var obj = { + x: x, + y: y, + width: width, + height: height, + todo: todo, + }; + core.status.thisEventClickArea.push(obj); + }; - core.lockControl(); - core.status.event.id = "equipbox"; - core.drawEquipbox(); - }; + this.initThisEventInfo = function () { + core.status.thisUIEventInfo = { + page: 1, + select: {}, + }; + core.status.thisEventClickArea = []; + }; - core.control._replayAction_item = function (action) { - if (action.indexOf("item:") != 0) return false; - var itemId = action.substring(5); - if (!core.canUseItem(itemId)) return false; - if ( - core.material.items[itemId].hideInReplay || - core.status.replay.speed == 24 - ) { - core.useItem(itemId, false, core.replay); - return true; - } - core.status.event.id = "toolbox"; - core.initThisEventInfo(); - var info = core.status.thisUIEventInfo; - var items = core.getToolboxItems("all"); - core.setPageItems(1); - var index = items.indexOf(itemId) + 1; - info.page = Math.ceil(index / info.maxItem); - info.index = index % info.maxItem || info.maxItem; - core.setIndexAndSelect("select"); - core.setPageItems(info.page); - core.drawToolbox(); - setTimeout(function () { - core.ui.closePanel(); - core.useItem(itemId, false, core.replay); - }, core.control.__replay_getTimeout()); - return true; - }; + this.refreshBox = function () { + if (!core.status.event.id) return; + if (core.status.event.id == "toolbox") core.drawToolbox(); + else core.drawEquipbox(); + }; - core.control._replayAction_equip = function (action) { - if (action.indexOf("equip:") != 0) return false; - var itemId = action.substring(6); - var items = core.getToolboxItems("equips"); - var index = items.indexOf(itemId) + 1; - if (index < 1) return false; - core.status.route.push(action); - if ( - core.material.items[itemId].hideInReplay || - core.status.replay.speed == 24 - ) { - core.loadEquip(itemId, core.replay); - return true; - } - core.status.event.id = "equipbox"; - core.initThisEventInfo(); - var info = core.status.thisUIEventInfo; - core.setPageItems(1); - info.page = Math.ceil(index / info.maxItem); - info.index = index % info.maxItem || info.maxItem; - core.setIndexAndSelect("select"); - core.setPageItems(info.page); - core.drawEquipbox(); - setTimeout(function () { - core.ui.closePanel(); - core.loadEquip(itemId, core.replay); - }, core.control.__replay_getTimeout()); - return true; - }; + core.ui.closePanel = function () { + if (core.status.hero && core.status.hero.flags) { + // 清除全部临时变量 + Object.keys(core.status.hero.flags).forEach(function (name) { + if (name.startsWith("@temp@") || /^arg\d+$/.test(name)) { + delete core.status.hero.flags[name]; + } + }); + } + this.clearUI(); + core.maps.generateGroundPattern(); + core.updateStatusBar(true); + core.unlockControl(); + core.status.event.data = null; + core.status.event.id = null; + core.status.event.selection = null; + core.status.event.ui = null; + core.status.event.interval = null; + core.status.thisUIEventInfo = null; + core.status.thisEventClickArea = null; + }; - core.control._replayAction_unEquip = function (action) { - if (action.indexOf("unEquip:") != 0) return false; - var equipType = parseInt(action.substring(8)); - if (!core.isset(equipType)) return false; - core.status.route.push(action); - if (core.status.replay.speed == 24) { - core.unloadEquip(equipType, core.replay); - return true; - } - core.status.event.id = "equipbox"; - core.initThisEventInfo(); - var info = core.status.thisUIEventInfo; - core.setPageItems(1); - info.select.type = equipType; - core.setIndexAndSelect(); - core.drawEquipbox(); - setTimeout(function () { - core.ui.closePanel(); - core.unloadEquip(equipType, core.replay); - }, core.control.__replay_getTimeout()); - return true; - }; + this.getItemClsName = function (item) { + if (item == null) return itemClsName; + if (item.cls == "equips") { + if (typeof item.equip.type == "string") return item.equip.type; + var type = core.getEquipTypeById(item.id); + return core.status.globalAttribute.equipName[type]; + } else return itemClsName[item.cls] || item.cls; + }; - core.registerReplayAction("item", core.control._replayAction_item); - core.registerReplayAction("equip", core.control._replayAction_equip); - core.registerReplayAction("unEquip", core.control._replayAction_unEquip); - }, + core.events.openToolbox = function (fromUserAction) { + if (core.isReplaying()) return; + if (!this._checkStatus("toolbox", fromUserAction)) return; + core.initThisEventInfo(); + let info = core.status.thisUIEventInfo; + info.index = 1; + core.setIndexAndSelect("select"); + core.drawToolbox(); + }; + + core.events.openEquipbox = function (fromUserAction) { + if (core.isReplaying()) return; + if (!this._checkStatus("equipbox", fromUserAction)) return; + core.initThisEventInfo(); + let info = core.status.thisUIEventInfo; + info.select.type = 0; + core.setIndexAndSelect("select"); + core.drawEquipbox(); + }; + + core.control._replay_toolbox = function () { + if (!core.isPlaying() || !core.isReplaying()) return; + if (!core.status.replay.pausing) return core.drawTip("请先暂停录像"); + if (core.isMoving() || core.status.replay.animate || core.status.event.id) + return core.drawTip("请等待当前事件的处理结束"); + + core.lockControl(); + core.status.event.id = "toolbox"; + core.drawToolbox(); + }; + + core.control._replay_equipbox = function () { + if (!core.isPlaying() || !core.isReplaying()) return; + if (!core.status.replay.pausing) return core.drawTip("请先暂停录像"); + if (core.isMoving() || core.status.replay.animate || core.status.event.id) + return core.drawTip("请等待当前事件的处理结束"); + + core.lockControl(); + core.status.event.id = "equipbox"; + core.drawEquipbox(); + }; + + core.control._replayAction_item = function (action) { + if (action.indexOf("item:") != 0) return false; + var itemId = action.substring(5); + if (!core.canUseItem(itemId)) return false; + if ( + core.material.items[itemId].hideInReplay || + core.status.replay.speed == 24 + ) { + core.useItem(itemId, false, core.replay); + return true; + } + core.status.event.id = "toolbox"; + core.initThisEventInfo(); + var info = core.status.thisUIEventInfo; + var items = core.getToolboxItems("all"); + core.setPageItems(1); + var index = items.indexOf(itemId) + 1; + info.page = Math.ceil(index / info.maxItem); + info.index = index % info.maxItem || info.maxItem; + core.setIndexAndSelect("select"); + core.setPageItems(info.page); + core.drawToolbox(); + setTimeout(function () { + core.ui.closePanel(); + core.useItem(itemId, false, core.replay); + }, core.control.__replay_getTimeout()); + return true; + }; + + core.control._replayAction_equip = function (action) { + if (action.indexOf("equip:") != 0) return false; + var itemId = action.substring(6); + var items = core.getToolboxItems("equips"); + var index = items.indexOf(itemId) + 1; + if (index < 1) return false; + core.status.route.push(action); + if ( + core.material.items[itemId].hideInReplay || + core.status.replay.speed == 24 + ) { + core.loadEquip(itemId, core.replay); + return true; + } + core.status.event.id = "equipbox"; + core.initThisEventInfo(); + var info = core.status.thisUIEventInfo; + core.setPageItems(1); + info.page = Math.ceil(index / info.maxItem); + info.index = index % info.maxItem || info.maxItem; + core.setIndexAndSelect("select"); + core.setPageItems(info.page); + core.drawEquipbox(); + setTimeout(function () { + core.ui.closePanel(); + core.loadEquip(itemId, core.replay); + }, core.control.__replay_getTimeout()); + return true; + }; + + core.control._replayAction_unEquip = function (action) { + if (action.indexOf("unEquip:") != 0) return false; + var equipType = parseInt(action.substring(8)); + if (!core.isset(equipType)) return false; + core.status.route.push(action); + if (core.status.replay.speed == 24) { + core.unloadEquip(equipType, core.replay); + return true; + } + core.status.event.id = "equipbox"; + core.initThisEventInfo(); + var info = core.status.thisUIEventInfo; + core.setPageItems(1); + info.select.type = equipType; + core.setIndexAndSelect(); + core.drawEquipbox(); + setTimeout(function () { + core.ui.closePanel(); + core.unloadEquip(equipType, core.replay); + }, core.control.__replay_getTimeout()); + return true; + }; + + core.registerReplayAction("item", core.control._replayAction_item); + core.registerReplayAction("equip", core.control._replayAction_equip); + core.registerReplayAction("unEquip", core.control._replayAction_unEquip); +}, "技能树": function () { // 在此增加新插件 // @@ -13894,6 +14034,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } } }; + this.equipNeed = { //装备需求(无需求装备不写,只写需求的属性,无要求属性不写) + "sword1": { str: 10 }, + "knife1": { str: 5, agi: 5 } + + } this.updateStatus = function () { const hero = core.status.hero; //默认映射关系 From cc76d50a919f8f908cda1d03007ae91e340e8a74 Mon Sep 17 00:00:00 2001 From: strawberry42271 <2806566736@qq.com> Date: Tue, 14 Jan 2025 22:51:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E5=92=8C=E8=A3=85=E5=A4=87=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/data.js | 6 ++-- project/items.js | 2 +- project/plugins.js | 80 ++++++++++++++++++++++++++++++---------------- 3 files changed, 57 insertions(+), 31 deletions(-) diff --git a/project/data.js b/project/data.js index f01d01b..95ad3ee 100644 --- a/project/data.js +++ b/project/data.js @@ -1053,9 +1053,9 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "matk": 0, "speed": 0, "str": 5, - "agi": 10, - "int": 10, - "con": 10, + "agi": 5, + "int": 5, + "con": 5, "magic": false }, "startCanvas": [ diff --git a/project/items.js b/project/items.js index 0ca9007..385932e 100644 --- a/project/items.js +++ b/project/items.js @@ -234,7 +234,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "agi": -5 }, "percentage": { - "speed": 10 + "str": 10 } }, "itemEffect": "core.status.hero.def += 0", diff --git a/project/plugins.js b/project/plugins.js index f09c2cf..cb4d4b2 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -5264,6 +5264,16 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = itemText = core.replaceText(itemText); if (itemText[0] == "," || itemText[0] == ",") itemText = itemText.substring(1); + if (itemCls === 'equips' && item.id) { + let text = "" + + switch (item.id) { //此处写道具效果描述\n表示换行 + case 'sword1': + text = "普通攻击属性:物理\n作为主手时:物理攻击=力量+敏捷(" + (core.getRealStatusOrDefault(hero, 'str') + core.getRealStatusOrDefault(hero, 'agi')) + ")\n作为副手时:物理攻击+敏捷(" + core.getRealStatusOrDefault(hero, 'agi') + ")" + break; + } + itemText = text ? '【装备效果】\n' + text : "" + } /* 一个根据道具id修改道具名字(右栏)的例子 * if (item.id == "xxx") itemNameColor = "red"; */ @@ -5291,6 +5301,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = ); core.setTextAlign(ctx, "left"); core.setTextBaseline(ctx, "middle"); + if (itemCls === 'equips' && item.id) { + itemName = "【" + item.equipCls + "】" + itemName + } core.fillText( ctx, itemName, @@ -5309,7 +5322,6 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = itemClsFont ); - var statusText = "【装备类型】" + item.equipCls + "\n\n"; /*if (core.status.event.id == "equipbox") { var type = item.equip.type; if (typeof type == "string") type = core.getEquipTypeByName(type); @@ -5329,7 +5341,6 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = statusText += core.getStatusLabel(name) + " " + nowValue + "->\r[" + color + "]" + newValue + "\r\n"; } }*/ - let shuxing = "【装备属性】\n" const equipValue = core.material.items[item.id]?.equip if (equipValue) { let value = "" @@ -5403,10 +5414,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } } - if (value !== '') itemText += "\n\n" + shuxing + value + if (value !== '') itemText += "\n\n【装备属性】\n" + value } - itemText = item.equipCls ? statusText + itemText : itemText let needText = '\n【装备需求】\n' @@ -13969,8 +13979,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }, "属性映射": function () { // 在此增加新插件 - this.statusEquip = function () { - const hero = core.status.hero; + this.statusEquip = function (hero = core.status.hero) { //装备具体效果在这里写,道具填写道具类型为equip并选择装备类型,道具的装备属性中装备类型遵循以下填写方式: //固定装备孔的填写0/1/2/3,分别对应主手、副手、防具、饰品 //主副手同时可使用的,填写 武器 @@ -13980,20 +13989,20 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = if (core.getEquip[0]) { switch (core.getEquip[0]) { case "sword1": - hero.atk = hero.str + hero.agi; + hero.atk = hero_str + hero_agi; hero.magic = false; break; case "twoHandedSword1": - hero.atk = Math.floor(hero.str * 2 + hero.con / 10); + hero.atk = Math.floor(hero_str * 2 + hero_con / 10); hero.magic = false; break; case "wand1": - hero.atk = hero.str + hero.int; + hero.atk = hero_str + hero_int; hero.magic = true; break; case "knife1": - hero.atk = Math.floor(hero.agi * 1.2); - hero.speed = hero.agi * 2 + hero.int; + hero.atk = Math.floor(hero_agi * 1.2); + hero.speed = hero_agi * 2 + hero_int; hero.magic = false; break; } @@ -14002,12 +14011,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = if (core.getEquip[1]) { switch (core.getEquip[1]) { case "sword1": - hero.atk += hero.agi; + hero.atk += hero_agi; break; case "knife1": - hero.speed += Math.floor(hero.agi * 0.6); + hero.speed += Math.floor(hero_agi * 0.6); if (core.getEquip[0] === "knife1") { - hero.atk += Math.floor(hero.agi * 0.6); + hero.atk += Math.floor(hero_agi * 0.6); } break; } @@ -14016,12 +14025,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = if (core.getEquip[2]) { switch (core.getEquip[2]) { case "armor1": - hero.def = hero.con + hero.agi; - hero.hpmax = Math.floor(2.5 * hero.con); + hero.def = hero_con + hero_agi; + hero.hpmax = Math.floor(2.5 * hero_con); break; case "armor2": - hero.mdef = hero.con + hero.int; - hero.hpmax = hero.con * 2 + hero.int; + hero.mdef = hero_con + hero_int; + hero.hpmax = hero_con * 2 + hero_int; break; } } @@ -14029,10 +14038,21 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = if (core.getEquip[3]) { switch (core.getEquip[3]) { case "jewel1": - hero.speed += Math.floor(0.4 * hero.int + 0.6 * hero.agi); + hero.speed += Math.floor(0.4 * hero_int + 0.6 * hero_agi); break; } } + const list = ['str', 'agi', 'int', 'con'] //四维 + //处理当前装备数值效果(四维数值已经处理过,无需再次处理) + for (let i = 0; i < 5; i++) { + const value = core.material.items[core.getEquip(i)]?.value + if (value) { + for (let item in value) { + if (!list.includes(item)) hero[item] += value[item] + } + } + } + return hero }; this.equipNeed = { //装备需求(无需求装备不写,只写需求的属性,无要求属性不写) "sword1": { str: 10 }, @@ -14040,16 +14060,22 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } this.updateStatus = function () { - const hero = core.status.hero; + let hero = core.status.hero; + //core.getRealStatusOrDefault计算增幅后属性 + const hero_str = core.getRealStatusOrDefault(hero, 'str') + const hero_agi = core.getRealStatusOrDefault(hero, 'agi') + const hero_int = core.getRealStatusOrDefault(hero, 'int') + const hero_con = core.getRealStatusOrDefault(hero, 'con') + //默认映射关系 - hero.hpmax = hero.str * 100 + hero.con * 100; - hero.atk = hero.str + hero.int; - hero.manamax = hero.agi + hero.int; - hero.def = hero.con + hero.agi; - hero.mdef = hero.con + hero.int; - hero.speed = hero.str + hero.agi; + hero.hpmax = hero_str * 100 + hero_con * 100; + hero.atk = hero_str + hero_int; + hero.manamax = hero_agi + hero_int; + hero.def = hero_con + hero_agi; + hero.mdef = hero_con + hero_int; + hero.speed = hero_str + hero_agi; hero.magic = false; - this.statusEquip(); //处理装备效果 + hero = this.statusEquip(hero); //处理装备效果 for (let v in hero) { //归整 if (typeof hero[v] === "number") {