From c2a2e93ff38b619a8782fbe9924f3b79bbc68c99 Mon Sep 17 00:00:00 2001 From: hant Date: Thu, 4 Dec 2025 23:52:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- save.json | 556 ++++++++++++++++++++++++++++++++- src/Data/dungeon_spells.php | 33 +- src/Data/spells.php | 422 ++++++++++++++++++------- src/Entities/Actor.php | 16 +- src/Entities/Item.php | 55 +++- src/Entities/Monster.php | 69 +--- src/Entities/Player.php | 3 +- src/Modules/InventoryPanel.php | 2 +- src/Modules/SpellPanel.php | 26 +- test/Test.php | 4 +- 10 files changed, 959 insertions(+), 227 deletions(-) diff --git a/save.json b/save.json index ef0a1f1..f423a06 100644 --- a/save.json +++ b/save.json @@ -1 +1,555 @@ -{"player":{"hp":0,"maxHp":0,"patk":10,"matk":5,"pdef":5,"mdef":3,"crit":5,"critdmg":130,"level":16,"exp":14282,"maxExp":43606,"inventory":[{"name":"金疮药","type":"consume","quality":"legendary","level":1,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":132,"affixes":[],"desc":"Lv.1 legendary品质的药剂","id":"69305a7c8d8e4","quantity":2},{"name":"金疮药","type":"consume","quality":"legendary","level":1,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":129,"affixes":[],"desc":"Lv.1 legendary品质的药剂","id":"693102c5300fa","quantity":1},{"name":"补气丹","type":"consume","quality":"epic","level":5,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":112,"affixes":[],"desc":"Lv.5 epic品质的药剂","id":"693102f87b75d","quantity":1},{"name":"补气丹","type":"consume","quality":"epic","level":5,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":111,"affixes":[],"desc":"Lv.5 epic品质的药剂","id":"69310388b1ee6","quantity":1},{"name":"筑基丹","type":"consume","quality":"epic","level":10,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":136,"affixes":[],"desc":"Lv.10 epic品质的药剂","id":"69310a735a1a6","quantity":1},{"name":"补气丹","type":"consume","quality":"epic","level":6,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":117,"affixes":[],"desc":"Lv.6 epic品质的药剂","id":"6931103411a86","quantity":1},{"name":"金疮药","type":"consume","quality":"epic","level":6,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":113,"affixes":[],"desc":"Lv.6 epic品质的药剂","id":"693116d542665","quantity":1},{"name":"筑基丹","type":"consume","quality":"legendary","level":6,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":155,"affixes":[],"desc":"Lv.6 legendary品质的药剂","id":"6931172e5d795","quantity":1},{"name":"补气丹","type":"consume","quality":"epic","level":6,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":111,"affixes":[],"desc":"Lv.6 epic品质的药剂","id":"693117f8bb7d1","quantity":2},{"name":"补气丹","type":"consume","quality":"epic","level":6,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":112,"affixes":[],"desc":"Lv.6 epic品质的药剂","id":"6931184c07341","quantity":1},{"name":"回灵丹","type":"consume","quality":"legendary","level":10,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":170,"affixes":[],"desc":"Lv.10 legendary品质的药剂","id":"6931227d7b7f3","quantity":1},{"name":"金疮药","type":"consume","quality":"epic","level":6,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":111,"affixes":[],"desc":"Lv.6 epic品质的药剂","id":"693125ecb54a7","quantity":1},{"name":"回灵丹","type":"consume","quality":"epic","level":10,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":131,"affixes":[],"desc":"Lv.10 epic品质的药剂","id":"693125ecb54e7","quantity":2},{"name":"补气丹","type":"consume","quality":"epic","level":10,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":139,"affixes":[],"desc":"Lv.10 epic品质的药剂","id":"693129f6a8551","quantity":1},{"name":"培元丹","type":"consume","quality":"epic","level":6,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":113,"affixes":[],"desc":"Lv.6 epic品质的药剂","id":"69312ae28d4d6","quantity":1},{"name":"金疮药","type":"consume","quality":"epic","level":11,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":143,"affixes":[],"desc":"Lv.11 epic品质的药剂","id":"69312cd2d281d","quantity":1},{"name":"筑基丹","type":"consume","quality":"legendary","level":15,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":197,"affixes":[],"desc":"Lv.15 legendary品质的药剂","id":"69312d2a34d46","quantity":1},{"name":"金疮药","type":"consume","quality":"rare","level":11,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":114,"affixes":[],"desc":"Lv.11 rare品质的药剂","id":"69312dfd55678","quantity":2},{"name":"筑基丹","type":"consume","quality":"epic","level":15,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":165,"affixes":[],"desc":"Lv.15 epic品质的药剂","id":"69312ec3f285d","quantity":1},{"name":"龙鳞甲","type":"armor","quality":"epic","level":15,"patk":0,"matk":0,"pdef":20,"mdef":15,"hp":0,"crit":0,"critdmg":0,"heal":0,"affixes":[],"desc":"Lv.15 common品质的防具","id":"69312f13848b4","quantity":1},{"name":"筑基丹","type":"consume","quality":"common","level":15,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":113,"affixes":[],"desc":"Lv.15 common品质的药剂","id":"69312f13848f1","quantity":2},{"name":"筑基丹","type":"consume","quality":"rare","level":11,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":112,"affixes":[],"desc":"Lv.11 rare品质的药剂","id":"69312f4a0fc80","quantity":1},{"name":"精钢甲","type":"armor","quality":"epic","level":8,"patk":0,"matk":0,"pdef":37,"mdef":9,"hp":77,"crit":0,"critdmg":0,"heal":0,"affixes":["物防 +7%","魔防 +10%"],"desc":"Lv.8 epic品质的防具","id":"693134abb5060","quantity":1},{"name":"筑基丹","type":"consume","quality":"rare","level":15,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":131,"affixes":[],"desc":"Lv.15 rare品质的药剂","id":"693136a68a0cf","quantity":1},{"name":"筑基丹","type":"consume","quality":"epic","level":15,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":159,"affixes":[],"desc":"Lv.15 epic品质的药剂","id":"693136f3c0cb9","quantity":2},{"name":"筑基丹","type":"consume","quality":"rare","level":15,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":126,"affixes":[],"desc":"Lv.15 rare品质的药剂","id":"693137235becf","quantity":1},{"name":"金疮药","type":"consume","quality":"legendary","level":11,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":180,"affixes":[],"desc":"Lv.11 legendary品质的药剂","id":"69313729491c6","quantity":1},{"name":"筑基丹","type":"consume","quality":"common","level":15,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":112,"affixes":[],"desc":"Lv.15 common品质的药剂","id":"6931384c826e1","quantity":4},{"name":"补气丹","type":"consume","quality":"legendary","level":11,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":183,"affixes":[],"desc":"Lv.11 legendary品质的药剂","id":"69313f9a7e688","quantity":1},{"name":"筑基丹","type":"consume","quality":"rare","level":15,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":128,"affixes":[],"desc":"Lv.15 rare品质的药剂","id":"6931409199364","quantity":2},{"name":"筑基丹","type":"consume","quality":"epic","level":11,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":138,"affixes":[],"desc":"Lv.11 epic品质的药剂","id":"6931410c51c8c","quantity":1},{"name":"培元丹","type":"consume","quality":"rare","level":11,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":111,"affixes":[],"desc":"Lv.11 rare品质的药剂","id":"693141f62e921","quantity":1},{"name":"筑基丹","type":"consume","quality":"rare","level":11,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":110,"affixes":[],"desc":"Lv.11 rare品质的药剂","id":"693142137163b","quantity":1},{"name":"筑基丹","type":"consume","quality":"rare","level":15,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":127,"affixes":[],"desc":"Lv.15 rare品质的药剂","id":"69314250e92fd","quantity":1},{"name":"筑基丹","type":"consume","quality":"common","level":15,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":114,"affixes":[],"desc":"Lv.15 common品质的药剂","id":"693143614614b","quantity":1},{"name":"青钢剑","type":"weapon","quality":"epic","level":15,"patk":29,"matk":45,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":0,"affixes":[],"desc":"Lv.15 common品质的武器","id":"693143c5eda96","quantity":1},{"name":"皮甲","type":"armor","quality":"epic","level":15,"patk":0,"matk":0,"pdef":20,"mdef":15,"hp":0,"crit":0,"critdmg":0,"heal":0,"affixes":["魔防 +21"],"desc":"Lv.15 rare品质的防具","id":"693144565899d","quantity":1},{"name":"铁甲","type":"armor","quality":"epic","level":15,"patk":0,"matk":0,"pdef":20,"mdef":15,"hp":0,"crit":0,"critdmg":0,"heal":0,"affixes":[],"desc":"Lv.15 common品质的防具","id":"69314486acc4a","quantity":1},{"name":"筑基丹","type":"consume","quality":"rare","level":15,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":132,"affixes":[],"desc":"Lv.15 rare品质的药剂","id":"69314486accc8","quantity":1},{"name":"筑基丹","type":"consume","quality":"epic","level":15,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":163,"affixes":[],"desc":"Lv.15 epic品质的药剂","id":"693144e5cf565","quantity":1},{"name":"铁剑","type":"weapon","quality":"epic","level":16,"patk":54,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":25,"heal":0,"affixes":["生命值 +9%","物攻 +8%"],"desc":"Lv.16 epic品质的武器","id":"693147b07e22d","quantity":1},{"name":"筑基丹","type":"consume","quality":"common","level":16,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":118,"affixes":[],"desc":"Lv.16 common品质的药剂","id":"693147b80ef7a","quantity":1},{"name":"回灵丹","type":"consume","quality":"rare","level":16,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":139,"affixes":[],"desc":"Lv.16 rare品质的药剂","id":"69314e4ba835b","quantity":1},{"name":"回灵丹","type":"consume","quality":"epic","level":16,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":163,"affixes":[],"desc":"Lv.16 epic品质的药剂","id":"69314e68282ec","quantity":1},{"name":"雷霆锤","type":"weapon","quality":"epic","level":16,"patk":58,"matk":23,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":27,"heal":0,"affixes":["暴击率 +9%","暴击伤害 +22"],"desc":"Lv.16 epic品质的武器","id":"69314e7aec20e","quantity":1},{"name":"培元丹","type":"consume","quality":"common","level":16,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":110,"affixes":[],"desc":"Lv.16 common品质的药剂","id":"69314e9d57f9c","quantity":1},{"name":"金疮药","type":"consume","quality":"common","level":16,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":111,"affixes":[],"desc":"Lv.16 common品质的药剂","id":"69314ebb6f8c2","quantity":2},{"name":"烈焰刀","type":"weapon","quality":"epic","level":20,"patk":50,"matk":30,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":0,"affixes":[],"desc":"Lv.20 common品质的武器","id":"69315084c9bbd","quantity":1},{"name":"培元丹","type":"consume","quality":"rare","level":16,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":133,"affixes":[],"desc":"Lv.16 rare品质的药剂","id":"693150a4e185f","quantity":1},{"name":"补气丹","type":"consume","quality":"rare","level":16,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":138,"affixes":[],"desc":"Lv.16 rare品质的药剂","id":"693150c506174","quantity":1},{"name":"补气丹","type":"consume","quality":"epic","level":16,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":168,"affixes":[],"desc":"Lv.16 epic品质的药剂","id":"6931510aa6798","quantity":1},{"name":"回灵丹","type":"consume","quality":"rare","level":16,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":137,"affixes":[],"desc":"Lv.16 rare品质的药剂","id":"69315126e25f0","quantity":1},{"name":"筑基丹","type":"consume","quality":"rare","level":30,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":203,"affixes":[],"desc":"Lv.30 rare品质的药剂","id":"6931516d3e2f3","quantity":1},{"name":"布衣","type":"armor","quality":"epic","level":13,"patk":0,"matk":0,"pdef":12,"mdef":12,"hp":92,"crit":0,"critdmg":0,"heal":0,"affixes":["生命值 +162","魔攻 +32"],"desc":"Lv.13 epic品质的防具","id":"693152241d32c","quantity":1},{"name":"补气丹","type":"consume","quality":"common","level":16,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":116,"affixes":[],"desc":"Lv.16 common品质的药剂","id":"69315704db372","quantity":1},{"name":"筑基丹","type":"consume","quality":"common","level":16,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":120,"affixes":[],"desc":"Lv.16 common品质的药剂","id":"6931573a7d21c","quantity":1},{"name":"烈焰刀","type":"weapon","quality":"epic","level":20,"patk":50,"matk":30,"pdef":0,"mdef":0,"hp":0,"crit":10,"critdmg":0,"heal":0,"affixes":["物攻 +10%"],"desc":"Lv.20 rare品质的武器","id":"6931575d1ce4a","quantity":1}],"equip":{"weapon":{"name":"烈焰刀","type":"weapon","quality":"legendary","level":13,"patk":49,"matk":49,"pdef":0,"mdef":0,"hp":0,"crit":13,"critdmg":0,"heal":0,"affixes":["物攻 +8%","暴击伤害 +9%","生命值 +7%"],"desc":"Lv.13 legendary品质的武器","id":"693136a689b5b","quantity":1,"enhanceLevel":8},"armor":{"name":"皮甲","type":"armor","quality":"legendary","level":3,"patk":0,"matk":0,"pdef":26,"mdef":8,"hp":92,"crit":0,"critdmg":0,"heal":0,"affixes":["物攻 +3%","魔攻 +8%","物防 +16"],"desc":"Lv.3 legendary品质的防具","id":"693044ffc1381","quantity":1,"enhanceLevel":7},"necklace":{"name":"金链","type":"necklace","quality":"rare","level":5,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":57,"crit":0,"critdmg":0,"heal":0,"affixes":["物防 +9"],"desc":"Lv.5 rare品质的项链","id":"693046bc441b6","quantity":1,"enhanceLevel":7},"boots":{"name":"幽步靴","type":"boots","quality":"rare","level":8,"patk":0,"matk":0,"pdef":8,"mdef":5,"hp":0,"crit":0,"critdmg":0,"heal":0,"affixes":["物防 +16"],"desc":"Lv.8 rare品质的鞋子","id":"693106c639f68","quantity":1,"enhanceLevel":7},"ring":{"name":"金戒","type":"ring","quality":"rare","level":10,"patk":0,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":10,"critdmg":0,"heal":0,"affixes":["魔攻 +7%"],"desc":"Lv.10 rare品质的戒指","id":"6931168bb01d0","quantity":1,"enhanceLevel":7}},"spiritStones":12220,"npcFlags":[],"talentPoints":0,"talents":{"hp":22,"patk":5,"matk":0,"pdef":0,"mdef":0,"crit":0,"critdmg":0},"mana":43,"maxMana":100,"skillSlots":{"skill1":null,"skill2":null,"skill3":null,"skill4":null},"partners":[{"id":"li_feiyu","name":"厉飞雨","level":24,"exp":7328,"maxExp":29071,"equip":{"weapon":{"name":"烈焰刀","type":"weapon","quality":"legendary","level":1,"patk":35,"matk":50,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":27,"heal":0,"affixes":["暴击率 +7","物攻 +15","魔攻 +8%"],"desc":"Lv.1 legendary品质的武器","id":"69313796a3735","quantity":1,"enhanceLevel":7},"necklace":{"name":"铜链","type":"necklace","quality":"rare","level":5,"patk":0,"matk":0,"pdef":8,"mdef":0,"hp":60,"crit":0,"critdmg":0,"heal":0,"affixes":["暴击率 +6"],"desc":"Lv.5 rare品质的项链","id":"69305ac73cf42","quantity":1},"armor":{"name":"皮甲","type":"armor","quality":"epic","level":13,"patk":0,"matk":0,"pdef":23,"mdef":7,"hp":95,"crit":0,"critdmg":0,"heal":0,"affixes":["物防 +12%","生命值 +12%"],"desc":"Lv.13 epic品质的防具","id":"69312ee919ef6","quantity":1,"enhanceLevel":7},"boots":{"name":"铁靴","type":"boots","quality":"common","level":8,"patk":0,"matk":0,"pdef":4,"mdef":4,"hp":0,"crit":0,"critdmg":0,"heal":0,"affixes":[],"desc":"Lv.8 common品质的鞋子","id":"69310787c6cb5","quantity":1},"ring":{"name":"仙戒","type":"ring","quality":"rare","level":10,"patk":14,"matk":0,"pdef":0,"mdef":0,"hp":0,"crit":9,"critdmg":0,"heal":0,"affixes":["暴击伤害 +13"],"desc":"Lv.10 rare品质的戒指","id":"69312a683bc39","quantity":1}},"talents":{"hp":58,"patk":14,"matk":0,"pdef":0,"mdef":0,"crit":0,"critdmg":0},"talentWeights":{"hp":1,"patk":1,"matk":1,"pdef":1,"mdef":1,"crit":1,"critdmg":1},"mana":100,"maxMana":100,"skillSlots":{"skill1":null,"skill2":null,"skill3":null,"skill4":null},"hp":422,"maxHp":0,"patk":15,"matk":5,"pdef":5,"mdef":3,"crit":10,"critdmg":130},{"id":"chen_qiaoqian","name":"陈巧倩","level":12,"exp":2164,"maxExp":8614,"equip":{"armor":{"name":"龙鳞甲","type":"armor","quality":"epic","level":30,"patk":0,"matk":0,"pdef":40,"mdef":30,"hp":0,"crit":0,"critdmg":0,"heal":0,"affixes":[],"desc":"Lv.30 common品质的防具","id":"6931516d3e290","quantity":1},"weapon":{"name":"寒冰剑","type":"weapon","quality":"epic","level":15,"patk":14,"matk":45,"pdef":0,"mdef":0,"hp":0,"crit":0,"critdmg":0,"heal":0,"affixes":[],"desc":"Lv.15 common品质的武器","id":"6931384c826ed","quantity":1,"enhanceLevel":1}},"talents":{"hp":22,"patk":11,"matk":0,"pdef":0,"mdef":0,"crit":0,"critdmg":0},"talentWeights":{"hp":1,"patk":1,"matk":1,"pdef":1,"mdef":1,"crit":1,"critdmg":1},"mana":100,"maxMana":100,"skillSlots":{"skill1":null,"skill2":null,"skill3":null,"skill4":null},"hp":899,"maxHp":500,"patk":40,"matk":60,"pdef":30,"mdef":45,"crit":15,"critdmg":150}]},"dungeonId":4,"state":7} \ No newline at end of file +{ + "player": { + "hp": 100, + "maxHp": 100, + "patk": 10, + "matk": 10, + "pdef": 10, + "mdef": 10, + "crit": 0, + "critdmg": 110, + "level": 5, + "exp": 378, + "maxExp": 505, + "inventory": [ + { + "id": "6931aad284144", + "type": "spell", + "name": "柔拳", + "quality": "common", + "level": 1, + "spellId": 10, + "enhanceLevel": 0, + "calc_type": "matk", + "cost": 20, + "spellType": "damage_single", + "desc": "发出一团火球,对单个敌人造成伤害", + "heal_ratio": 0, + "damage_ratio": 1.2, + "heal_base": 0, + "crit_bonus": 0, + "crit_dmg_bonus": 0, + "enemy_count_bonus": 0, + "dispersion": 1, + "team_bonus": 0, + "priority_bonus": 0, + "dropRate": 25, + "quantity": 1 + }, + { + "id": "6931aad28414a", + "type": "spell", + "name": "柔拳", + "quality": "common", + "level": 1, + "spellId": 10, + "enhanceLevel": 0, + "calc_type": "matk", + "cost": 20, + "spellType": "damage_single", + "desc": "发出一团火球,对单个敌人造成伤害", + "heal_ratio": 0, + "damage_ratio": 1.2, + "heal_base": 0, + "crit_bonus": 0, + "crit_dmg_bonus": 0, + "enemy_count_bonus": 0, + "dispersion": 1, + "team_bonus": 0, + "priority_bonus": 0, + "dropRate": 25, + "quantity": 1 + }, + { + "name": "金疮药", + "type": "consume", + "quality": "common", + "level": 1, + "patk": 0, + "matk": 0, + "pdef": 0, + "mdef": 0, + "hp": 0, + "crit": 0, + "critdmg": 0, + "heal": 45, + "affixes": [], + "desc": "Lv.1 common品质的药剂", + "id": "6931aad284152", + "quantity": 1 + }, + { + "name": "金疮药", + "type": "consume", + "quality": "common", + "level": 1, + "patk": 0, + "matk": 0, + "pdef": 0, + "mdef": 0, + "hp": 0, + "crit": 0, + "critdmg": 0, + "heal": 42, + "affixes": [], + "desc": "Lv.1 common品质的药剂", + "id": "6931aaebc3dfa", + "quantity": 1 + }, + { + "id": "6931ab173bb23", + "type": "spell", + "name": "刀气切割", + "quality": "common", + "level": 3, + "spellId": 10, + "enhanceLevel": 0, + "calc_type": "matk", + "cost": 20, + "spellType": "damage_single", + "desc": "发出一团火球,对单个敌人造成伤害", + "heal_ratio": 0, + "damage_ratio": 1.2, + "heal_base": 0, + "crit_bonus": 0, + "crit_dmg_bonus": 0, + "enemy_count_bonus": 0, + "dispersion": 1, + "team_bonus": 0, + "priority_bonus": 0, + "dropRate": 30, + "quantity": 1 + }, + { + "id": "6931ab173bb26", + "type": "spell", + "name": "寒冰爆裂", + "quality": "common", + "level": 3, + "spellId": 20, + "enhanceLevel": 0, + "calc_type": "matk", + "cost": 35, + "spellType": "damage_aoe", + "desc": "召唤冰雹,攻击所有敌人", + "heal_ratio": 0, + "damage_ratio": 0.7, + "heal_base": 0, + "crit_bonus": 0, + "crit_dmg_bonus": 0, + "enemy_count_bonus": 0, + "dispersion": 1, + "team_bonus": 0, + "priority_bonus": 0, + "dropRate": 25, + "quantity": 1 + }, + { + "name": "金疮药", + "type": "consume", + "quality": "common", + "level": 3, + "patk": 0, + "matk": 0, + "pdef": 0, + "mdef": 0, + "hp": 0, + "crit": 0, + "critdmg": 0, + "heal": 46, + "affixes": [], + "desc": "Lv.3 common品质的药剂", + "id": "6931ab173bb2a", + "quantity": 1 + }, + { + "name": "雷霆锤", + "type": "weapon", + "quality": "rare", + "level": 1, + "patk": 17, + "matk": 5, + "pdef": 0, + "mdef": 0, + "hp": 0, + "crit": 0, + "critdmg": 0, + "heal": 0, + "affixes": [ + "物攻 +5" + ], + "desc": "Lv.1 rare品质的武器", + "id": "6931ab54ee18e", + "quantity": 1 + }, + { + "id": "6931ab54ee193", + "type": "spell", + "name": "寒冰爆裂", + "quality": "common", + "level": 3, + "spellId": 20, + "enhanceLevel": 0, + "calc_type": "matk", + "cost": 35, + "spellType": "damage_aoe", + "desc": "召唤冰雹,攻击所有敌人", + "heal_ratio": 0, + "damage_ratio": 0.7, + "heal_base": 0, + "crit_bonus": 0, + "crit_dmg_bonus": 0, + "enemy_count_bonus": 0, + "dispersion": 1, + "team_bonus": 0, + "priority_bonus": 0, + "dropRate": 25, + "quantity": 1 + }, + { + "name": "金疮药", + "type": "consume", + "quality": "rare", + "level": 1, + "patk": 0, + "matk": 0, + "pdef": 0, + "mdef": 0, + "hp": 0, + "crit": 0, + "critdmg": 0, + "heal": 58, + "affixes": [], + "desc": "Lv.1 rare品质的药剂", + "id": "6931ab54ee199", + "quantity": 1 + }, + { + "id": "6931ab5b497ab", + "type": "spell", + "name": "柔拳", + "quality": "epic", + "level": 1, + "spellId": 10, + "enhanceLevel": 0, + "calc_type": "matk", + "cost": 20, + "spellType": "damage_single", + "desc": "发出一团火球,对单个敌人造成伤害", + "heal_ratio": 0, + "damage_ratio": 2, + "heal_base": 0, + "crit_bonus": 0, + "crit_dmg_bonus": 0, + "enemy_count_bonus": 0, + "dispersion": 1, + "team_bonus": 0, + "priority_bonus": 0, + "dropRate": 25, + "quantity": 1 + }, + { + "name": "金疮药", + "type": "consume", + "quality": "rare", + "level": 1, + "patk": 0, + "matk": 0, + "pdef": 0, + "mdef": 0, + "hp": 0, + "crit": 0, + "critdmg": 0, + "heal": 60, + "affixes": [], + "desc": "Lv.1 rare品质的药剂", + "id": "6931ab6f31d10", + "quantity": 1 + }, + { + "id": "6931ab91181f3", + "type": "spell", + "name": "柔拳", + "quality": "rare", + "level": 1, + "spellId": 10, + "enhanceLevel": 0, + "calc_type": "matk", + "cost": 20, + "spellType": "damage_single", + "desc": "发出一团火球,对单个敌人造成伤害", + "heal_ratio": 0, + "damage_ratio": 1.6, + "heal_base": 0, + "crit_bonus": 0, + "crit_dmg_bonus": 0, + "enemy_count_bonus": 0, + "dispersion": 1, + "team_bonus": 0, + "priority_bonus": 0, + "dropRate": 25, + "quantity": 1 + }, + { + "name": "金疮药", + "type": "consume", + "quality": "rare", + "level": 1, + "patk": 0, + "matk": 0, + "pdef": 0, + "mdef": 0, + "hp": 0, + "crit": 0, + "critdmg": 0, + "heal": 59, + "affixes": [], + "desc": "Lv.1 rare品质的药剂", + "id": "6931ab91181f6", + "quantity": 1 + }, + { + "id": "6931abc63bfdd", + "type": "spell", + "name": "刀气切割", + "quality": "common", + "level": 3, + "spellId": 10, + "enhanceLevel": 0, + "calc_type": "matk", + "cost": 20, + "spellType": "damage_single", + "desc": "发出一团火球,对单个敌人造成伤害", + "heal_ratio": 0, + "damage_ratio": 1.2, + "heal_base": 0, + "crit_bonus": 0, + "crit_dmg_bonus": 0, + "enemy_count_bonus": 0, + "dispersion": 1, + "team_bonus": 0, + "priority_bonus": 0, + "dropRate": 30, + "quantity": 1 + }, + { + "id": "6931abc63bfe2", + "type": "spell", + "name": "柔拳", + "quality": "rare", + "level": 1, + "spellId": 10, + "enhanceLevel": 0, + "calc_type": "matk", + "cost": 20, + "spellType": "damage_single", + "desc": "发出一团火球,对单个敌人造成伤害", + "heal_ratio": 0, + "damage_ratio": 1.6, + "heal_base": 0, + "crit_bonus": 0, + "crit_dmg_bonus": 0, + "enemy_count_bonus": 0, + "dispersion": 1, + "team_bonus": 0, + "priority_bonus": 0, + "dropRate": 25, + "quantity": 1 + }, + { + "name": "金疮药", + "type": "consume", + "quality": "epic", + "level": 1, + "patk": 0, + "matk": 0, + "pdef": 0, + "mdef": 0, + "hp": 0, + "crit": 0, + "critdmg": 0, + "heal": 88, + "affixes": [], + "desc": "Lv.1 epic品质的药剂", + "id": "6931abc63bfe5", + "quantity": 1 + } + ], + "equip": { + "weapon": { + "name": "寒冰剑", + "type": "weapon", + "quality": "common", + "level": 1, + "patk": 2, + "matk": 8, + "pdef": 0, + "mdef": 0, + "hp": 0, + "crit": 0, + "critdmg": 0, + "heal": 0, + "affixes": [], + "desc": "Lv.1 common品质的武器", + "id": "69319d7e966eb", + "quantity": 1 + } + }, + "spiritStones": 399, + "npcFlags": { + "gift_li_feiyu": true + }, + "talentPoints": 3, + "talents": { + "hp": 0, + "patk": 0, + "matk": 0, + "pdef": 0, + "mdef": 0, + "crit": 0, + "critdmg": 0 + }, + "mana": 39, + "maxMana": 100, + "skillSlots": { + "skill1": { + "id": "69319e185013f", + "type": "spell", + "name": "刀气切割", + "quality": "rare", + "level": 3, + "spellId": 10, + "enhanceLevel": 0, + "calc_type": "matk", + "cost": 20, + "spellType": "damage_single", + "desc": "发出一团火球,对单个敌人造成伤害", + "heal_ratio": 0, + "damage_ratio": 1.6, + "heal_base": 0, + "crit_bonus": 0, + "crit_dmg_bonus": 0, + "enemy_count_bonus": 0, + "dispersion": 1, + "team_bonus": 0, + "priority_bonus": 0, + "quantity": 1 + }, + "skill2": { + "id": "69319e1850143", + "type": "spell", + "name": "妙手回春", + "quality": "common", + "level": 5, + "spellId": 1, + "enhanceLevel": 0, + "calc_type": "matk", + "cost": 15, + "spellType": "heal_single", + "desc": "恢复自己或队友的生命值,效果与魔攻相关", + "heal_ratio": 0.5, + "damage_ratio": 1, + "heal_base": 20, + "crit_bonus": 0, + "crit_dmg_bonus": 0, + "enemy_count_bonus": 0, + "dispersion": 1, + "team_bonus": 0, + "priority_bonus": 0, + "quantity": 1 + }, + "skill3": { + "id": "69319e6144cf6", + "type": "spell", + "name": "柔拳", + "quality": "legendary", + "level": 1, + "spellId": 10, + "enhanceLevel": 1, + "calc_type": "matk", + "cost": 20, + "spellType": "damage_single", + "desc": "发出一团火球,对单个敌人造成伤害", + "heal_ratio": 0, + "damage_ratio": 2.6, + "heal_base": 0, + "crit_bonus": 0, + "crit_dmg_bonus": 0, + "enemy_count_bonus": 0, + "dispersion": 1, + "team_bonus": 0, + "priority_bonus": 0, + "quantity": 1 + }, + "skill4": null + }, + "partners": [ + { + "id": "li_feiyu", + "name": "厉飞雨", + "level": 2, + "exp": 148, + "maxExp": 150, + "equip": [], + "talents": { + "hp": 2, + "patk": 1, + "matk": 0, + "pdef": 0, + "mdef": 0, + "crit": 0, + "critdmg": 0 + }, + "talentWeights": { + "hp": 1, + "patk": 1, + "matk": 1, + "pdef": 1, + "mdef": 1, + "crit": 1, + "critdmg": 1 + }, + "mana": 100, + "maxMana": 100, + "skillSlots": { + "skill1": { + "id": "69319cc96e00b", + "type": "spell", + "name": "寒冰爆裂", + "quality": "common", + "level": 3, + "spellId": 20, + "enhanceLevel": 0, + "calc_type": "matk", + "cost": 35, + "spellType": "damage_aoe", + "desc": "召唤冰雹,攻击所有敌人", + "heal_ratio": 0, + "damage_ratio": 0.7, + "heal_base": 0, + "crit_bonus": 0, + "crit_dmg_bonus": 0, + "enemy_count_bonus": 0, + "dispersion": 1, + "team_bonus": 0, + "priority_bonus": 0, + "quantity": 1 + }, + "skill2": null, + "skill3": null, + "skill4": null + }, + "hp": 120, + "maxHp": 100, + "patk": 15, + "matk": 5, + "pdef": 5, + "mdef": 3, + "crit": 10, + "critdmg": 130 + } + ] + }, + "dungeonId": 1, + "state": 4 +} \ No newline at end of file diff --git a/src/Data/dungeon_spells.php b/src/Data/dungeon_spells.php index eca24d2..839fc7b 100644 --- a/src/Data/dungeon_spells.php +++ b/src/Data/dungeon_spells.php @@ -1,14 +1,25 @@ [1, 10], - 2 => [2, 3, 11], - 3 => [20, 21], - 4 => [12], - 5 => [4], - 6 => [5, 22], - 7 => [13], - 8 => [13, 22], - 9 => [5, 13], - // others can be added later + 1 => ['heal_single', 'damage_single', 'damage_aoe'], // 七玄门 (Lv.1-5) + 2 => ['damage_single', 'damage_aoe', 'heal_aoe'], // 太南谷 (Lv.5-10) + 3 => ['heal_single', 'heal_aoe'], // 血色禁地 (Lv.10-15) + 4 => ['damage_single', 'damage_aoe'], // 黄枫谷 (Lv.15-20) + 5 => ['damage_single', 'heal_aoe'], // 燕翎堡 (Lv.20-30) + 6 => ['damage_single', 'heal_aoe'], // 越京皇宫 (Lv.30-40) + 7 => ['damage_aoe'], // 乱星海-魁星岛 (Lv.40-50) + 8 => ['damage_aoe', 'heal_single', 'heal_aoe'], // 虚天殿 (Lv.50-60) + 9 => ['damage_single', 'damage_aoe', 'heal_single'], // 外星海 (Lv.60+) ]; diff --git a/src/Data/spells.php b/src/Data/spells.php index 13c6713..f7a1dc2 100644 --- a/src/Data/spells.php +++ b/src/Data/spells.php @@ -1,138 +1,313 @@ [ + // ============ 单体治疗法术 (heal_single) ============ + 'heal_single' => [ + // 1. 治愈术 - 魔攻型 (恢复 = 魔攻 × 倍数 + 基础值) 1 => [ + 'name' => '治愈术', + 'type' => 'heal_single', + 'calc_type' => 'matk', // 计算方式:纯魔攻 + 'cost' => 15, + 'level_req' => 1, + 'desc' => '恢复自己或队友的生命值,效果与魔攻相关', + // 品质参数:[common, rare, epic, legendary] + 'heal_ratio' => [0.5, 0.8, 1.2, 1.8], // 魔攻倍数 + 'heal_base' => [20, 40, 70, 120], // 基础治疗值 + ], + + // 2. 及时救难 - 生命值百分比型 (恢复 = 自己最大生命值 × 百分比) + 2 => [ + 'name' => '及时救难', + 'type' => 'heal_single', + 'calc_type' => 'hp_percent', // 计算方式:最大生命值百分比 + 'cost' => 20, + 'level_req' => 5, + 'desc' => '将自己的部分生命值转移给队友', + 'heal_ratio' => [0.3, 0.4, 0.5, 0.6], // 最大生命值百分比 + ], + + // 3. 活力术 - 混合型 (恢复 = (魔攻 + 物攻) × 倍数 + 基础值) + 3 => [ + 'name' => '活力术', + 'type' => 'heal_single', + 'calc_type' => 'hybrid', // 计算方式:魔攻 + 物攻混合 + 'cost' => 25, + 'level_req' => 12, + 'desc' => '结合物理和魔法的治疗法术', + 'heal_ratio' => [0.3, 0.5, 0.7, 1.0], // (魔攻+物攻) 倍数 + 'heal_base' => [15, 30, 50, 80], + ], + + // 4. 生命之泉 - 基于当前生命值缺口 (恢复 = 缺失血量 × 百分比) + 4 => [ + 'name' => '生命之泉', + 'type' => 'heal_single', + 'calc_type' => 'hp_missing', // 计算方式:缺失生命值百分比 + 'cost' => 30, + 'level_req' => 18, + 'desc' => '根据队友缺失的生命值比例进行治疗', + 'heal_ratio' => [0.4, 0.55, 0.7, 0.85], // 缺失生命值百分比 + ], + + // 5. 暴击治疗 - 与暴击率相关 (恢复 = 魔攻 × 倍数 × (1 + 暴击率×特殊系数)) + 5 => [ + 'name' => '暴击治疗', + 'type' => 'heal_single', + 'calc_type' => 'crit_heal', // 计算方式:与暴击率相关 + 'cost' => 28, + 'level_req' => 22, + 'desc' => '暴击率越高,治疗效果越强', + 'heal_ratio' => [0.4, 0.65, 0.95, 1.4], // 基础魔攻倍数 + 'crit_bonus' => [0.5, 0.7, 1.0, 1.5], // 暴击率加成系数 + ], + + // 6. 援护术 - 基于防御属性 (恢复 = (物防+魔防) × 倍数 + 固定值) + 6 => [ + 'name' => '援护术', + 'type' => 'heal_single', + 'calc_type' => 'defense', // 计算方式:基于防御属性 + 'cost' => 22, + 'level_req' => 15, + 'desc' => '根据防御力进行治疗,防御越高效果越好', + 'heal_ratio' => [0.8, 1.2, 1.8, 2.5], // (物防+魔防) 倍数 + 'heal_base' => [10, 20, 35, 60], + ], + ], + + // ============ 单体伤害法术 (damage_single) ============ + 'damage_single' => [ + // 10. 火球术 - 魔攻型 (伤害 = 魔攻 × 倍数) + 10 => [ 'name' => '火球术', 'type' => 'damage_single', - 'quality' => 'common', + 'calc_type' => 'matk', 'cost' => 20, - 'damage' => 1.2, // 伤害倍数 = 魔攻 * damage 'level_req' => 1, - 'desc' => '发出一团火球,攻击单个敌人', + 'desc' => '发出一团火球,对单个敌人造成伤害', + 'damage_ratio' => [1.2, 1.6, 2.0, 2.6], ], - 2 => [ + + // 11. 冰锥术 - 魔攻型 + 11 => [ 'name' => '冰锥术', 'type' => 'damage_single', - 'quality' => 'rare', - 'cost' => 25, - 'damage' => 1.3, - 'level_req' => 5, + 'calc_type' => 'matk', + 'cost' => 22, + 'level_req' => 6, 'desc' => '凝聚寒冰之力,发出锐利冰锥', + 'damage_ratio' => [1.3, 1.8, 2.2, 3.0], ], - 3 => [ + + // 12. 雷击术 - 物攻型 (伤害 = 物攻 × 倍数) + 12 => [ 'name' => '雷击术', 'type' => 'damage_single', - 'quality' => 'rare', - 'cost' => 30, - 'damage' => 1.5, + 'calc_type' => 'patk', + 'cost' => 24, 'level_req' => 10, - 'desc' => '召唤雷电直击单个敌人', + 'desc' => '召唤雷电直击单个敌人,与物攻相关', + 'damage_ratio' => [1.4, 1.9, 2.3, 3.2], ], - 4 => [ + + // 13. 烈焰焚天 - 混合型 (伤害 = (魔攻 + 物攻) × 倍数) + 13 => [ 'name' => '烈焰焚天', 'type' => 'damage_single', - 'quality' => 'epic', - 'cost' => 45, - 'damage' => 1.8, - 'level_req' => 20, - 'desc' => '释放强大的火焰,对单个敌人造成巨大伤害', + 'calc_type' => 'hybrid', + 'cost' => 35, + 'level_req' => 18, + 'desc' => '释放强大的火焰,伤害与双攻相关', + 'damage_ratio' => [0.8, 1.1, 1.5, 2.0], ], - 5 => [ + + // 14. 诛仙剑气 - 物攻 + 暴击型 (伤害 = 物攻 × 倍数 × (1 + 暴击伤害系数)) + 14 => [ 'name' => '诛仙剑气', 'type' => 'damage_single', - 'quality' => 'legendary', - 'cost' => 60, - 'damage' => 2.2, - 'level_req' => 35, - 'desc' => '凝聚剑意,发出致命一击', + 'calc_type' => 'crit_damage', + 'cost' => 40, + 'level_req' => 28, + 'desc' => '凝聚剑意,暴击伤害系数越高效果越强', + 'damage_ratio' => [1.5, 2.0, 2.6, 3.5], + 'crit_dmg_bonus' => [0.3, 0.5, 0.8, 1.2], // 暴击伤害加成系数 + ], + + // 15. 狂暴斩 - 低防御有加成 (伤害 = 物攻 × 倍数 × (1 + (100-敌人防御百分比)×系数)) + 15 => [ + 'name' => '狂暴斩', + 'type' => 'damage_single', + 'calc_type' => 'low_def_bonus', + 'cost' => 32, + 'level_req' => 20, + 'desc' => '攻击防御低的敌人伤害更高', + 'damage_ratio' => [1.1, 1.5, 2.0, 2.7], ], ], - // AOE伤害法术 + // ============ 群体伤害法术 (damage_aoe) ============ 'damage_aoe' => [ - 10 => [ + // 20. 冰雹术 - 魔攻型 (每敌伤害 = 魔攻 × 倍数) + 20 => [ 'name' => '冰雹术', 'type' => 'damage_aoe', - 'quality' => 'common', + 'calc_type' => 'matk', 'cost' => 35, - 'damage' => 0.8, // 对每个敌人的伤害倍数较低,但打全体 - 'level_req' => 8, + 'level_req' => 5, 'desc' => '召唤冰雹,攻击所有敌人', + 'damage_ratio' => [0.7, 1.0, 1.3, 1.7], ], - 11 => [ + + // 21. 炎爆术 - 魔攻型,随敌人数量加成 + 21 => [ 'name' => '炎爆术', 'type' => 'damage_aoe', - 'quality' => 'rare', - 'cost' => 45, - 'damage' => 0.95, - 'level_req' => 15, - 'desc' => '引发连锁爆炸,对所有敌人造成伤害', + 'calc_type' => 'matk_scaled', + 'cost' => 40, + 'level_req' => 12, + 'desc' => '引发连锁爆炸,敌人越多伤害加成越高', + 'damage_ratio' => [0.8, 1.1, 1.4, 1.9], + 'enemy_count_bonus' => [0.1, 0.15, 0.2, 0.3], // 每增加一个敌人增加的伤害百分比 ], - 12 => [ + + // 22. 流星雨 - 混合型 (每敌伤害 = (魔攻 + 物攻) × 倍数) + 22 => [ 'name' => '流星雨', 'type' => 'damage_aoe', - 'quality' => 'epic', - 'cost' => 60, - 'damage' => 1.1, - 'level_req' => 25, + 'calc_type' => 'hybrid', + 'cost' => 50, + 'level_req' => 20, 'desc' => '召唤流星坠落,轰击全体敌人', + 'damage_ratio' => [0.6, 0.85, 1.15, 1.55], ], - 13 => [ + + // 23. 灭世风暴 - 基于暴击率 (每敌伤害 = 魔攻 × 倍数 × (1 + 暴击率×系数)) + 23 => [ 'name' => '灭世风暴', 'type' => 'damage_aoe', - 'quality' => 'legendary', - 'cost' => 80, - 'damage' => 1.3, - 'level_req' => 40, - 'desc' => '引发天地异变,对所有敌人造成毁灭性伤害', - ], - ], - - // 辅助法术(恢复、增益) - 'support' => [ - 20 => [ - 'name' => '治愈术', - 'type' => 'support', - 'subtype' => 'heal', - 'quality' => 'common', - 'cost' => 15, - 'heal' => 0.5, // 恢复量倍数 = 魔攻 * heal + 基础值 - 'heal_base' => 20, - 'level_req' => 3, - 'desc' => '恢复自己或队友的生命值', - ], - 21 => [ - 'name' => '神圣庇护', - 'type' => 'support', - 'subtype' => 'defend', - 'quality' => 'rare', - 'cost' => 25, - 'defense_boost' => 30, // 增加固定防御值 - 'duration' => 3, // 持续回合数(如果支持的话) - 'level_req' => 12, - 'desc' => '增加自己或队友的防御力', - ], - 22 => [ - 'name' => '恢复光环', - 'type' => 'support', - 'subtype' => 'heal_all', - 'quality' => 'epic', - 'cost' => 50, - 'heal' => 0.6, - 'heal_base' => 40, + 'calc_type' => 'crit_aoe', + 'cost' => 60, 'level_req' => 30, - 'desc' => '为所有队员恢复生命值', + 'desc' => '引发天地异变,暴击率影响范围伤害', + 'damage_ratio' => [0.9, 1.2, 1.6, 2.2], + 'crit_bonus' => [0.4, 0.6, 0.9, 1.3], + ], + + // 24. 末日火雨 - 敌人越多伤害越低,但每个敌人都会受伤 + 24 => [ + 'name' => '末日火雨', + 'type' => 'damage_aoe', + 'calc_type' => 'dispersed_damage', + 'cost' => 55, + 'level_req' => 25, + 'desc' => '魔法能量分散到所有敌人,敌人越多分散越严重', + 'damage_ratio' => [1.8, 2.5, 3.2, 4.0], + 'dispersion' => [0.8, 0.75, 0.7, 0.65], // 随敌人数量衰减系数 + ], + + // 25. 狂风斩 - 基于物攻 (每敌伤害 = 物攻 × 倍数) + 25 => [ + 'name' => '狂风斩', + 'type' => 'damage_aoe', + 'calc_type' => 'patk', + 'cost' => 45, + 'level_req' => 16, + 'desc' => '挥出狂暴的风刃,基于物攻伤害', + 'damage_ratio' => [0.9, 1.2, 1.6, 2.1], ], ], - // 法术品质对应的学习资源书数量 + // ============ 群体治疗法术 (heal_aoe) ============ + 'heal_aoe' => [ + // 30. 神圣庇护 - 魔攻型 (每人恢复 = 魔攻 × 倍数 + 基础值) + 30 => [ + 'name' => '神圣庇护', + 'type' => 'heal_aoe', + 'calc_type' => 'matk', + 'cost' => 30, + 'level_req' => 8, + 'desc' => '为所有队员增加防护,恢复生命值', + 'heal_ratio' => [0.3, 0.5, 0.75, 1.0], + 'heal_base' => [15, 30, 50, 75], + ], + + // 31. 恢复光环 - 生命值百分比型 (每人恢复 = 自己最大生命值 × 百分比) + 31 => [ + 'name' => '恢复光环', + 'type' => 'heal_aoe', + 'calc_type' => 'hp_percent', + 'cost' => 35, + 'level_req' => 14, + 'desc' => '释放温暖的光芒,基于自己的最大生命值恢复队员', + 'heal_ratio' => [0.2, 0.3, 0.4, 0.5], + ], + + // 32. 圣灵之力 - 混合型 (每人恢复 = (魔攻 + 物攻) × 倍数) + 32 => [ + 'name' => '圣灵之力', + 'type' => 'heal_aoe', + 'calc_type' => 'hybrid', + 'cost' => 45, + 'level_req' => 22, + 'desc' => '强大的群体治疗,恢复所有队员', + 'heal_ratio' => [0.25, 0.4, 0.6, 0.85], + 'heal_base' => [10, 20, 35, 55], + ], + + // 33. 仙界救赎 - 智能治疗(优先治疗血量少的队员) + 33 => [ + 'name' => '仙界救赎', + 'type' => 'heal_aoe', + 'calc_type' => 'smart_heal', + 'cost' => 55, + 'level_req' => 32, + 'desc' => '至高的救赎之力,优先治疗血量较低的队员', + 'heal_ratio' => [0.4, 0.6, 0.9, 1.3], + 'heal_base' => [25, 45, 70, 110], + 'priority_bonus' => [0.2, 0.3, 0.4, 0.5], // 血量越少加成越多 + ], + + // 34. 护盾术 - 基于防御属性 (每人恢复 = (物防+魔防) × 倍数) + 34 => [ + 'name' => '护盾术', + 'type' => 'heal_aoe', + 'calc_type' => 'defense', + 'cost' => 40, + 'level_req' => 18, + 'desc' => '根据防御力为队员恢复生命值', + 'heal_ratio' => [0.5, 0.75, 1.1, 1.5], + 'heal_base' => [8, 16, 28, 45], + ], + + // 35. 团队共鸣 - 基于队伍状态 (每人恢复 = 魔攻 × 倍数 × (队员数量系数)) + 35 => [ + 'name' => '团队共鸣', + 'type' => 'heal_aoe', + 'calc_type' => 'team_sync', + 'cost' => 38, + 'level_req' => 20, + 'desc' => '队员越多,治疗效果越强', + 'heal_ratio' => [0.35, 0.55, 0.8, 1.1], + 'team_bonus' => [0.2, 0.3, 0.45, 0.6], // 每增加一个队员增加的治疗百分比 + ], + ], + + // ============ 品质掉落概率 ============ + 'quality_drop_rates' => [ + 'common' => 70, // 普通法术 70% 掉落概率 + 'rare' => 20, // 稀有法术 20% 掉落概率 + 'epic' => 8, // 史诗法术 8% 掉落概率 + 'legendary' => 2, // 传奇法术 2% 掉落概率 + ], + + // ============ 法术品质对应的学习资源书数量 ============ 'quality_levels' => [ 'common' => 1, // 普通资源书可学习普通法术 'rare' => 2, // 稀有资源书可学习稀有法术 @@ -140,32 +315,59 @@ return [ 'legendary' => 4, // 传奇资源书可学习传奇法术 ], - // 法术升级系统 + // ============ 法术升级系统 ============ 'upgrades' => [ // 每个等级需要的资源书数量和属性提升 - // level => ['cost' => 资源书数量, 'damage_bonus' => 伤害加成%, 'cost_reduction' => 消耗减少] - 1 => ['cost' => 0, 'damage_bonus' => 0, 'cost_reduction' => 0], - 2 => ['cost' => 2, 'damage_bonus' => 10, 'cost_reduction' => 2], - 3 => ['cost' => 3, 'damage_bonus' => 20, 'cost_reduction' => 4], - 4 => ['cost' => 4, 'damage_bonus' => 30, 'cost_reduction' => 6], - 5 => ['cost' => 5, 'damage_bonus' => 40, 'cost_reduction' => 8], - 6 => ['cost' => 6, 'damage_bonus' => 50, 'cost_reduction' => 10], - 7 => ['cost' => 8, 'damage_bonus' => 60, 'cost_reduction' => 12], - 8 => ['cost' => 10, 'damage_bonus' => 70, 'cost_reduction' => 14], - 9 => ['cost' => 12, 'damage_bonus' => 80, 'cost_reduction' => 16], - 10 => ['cost' => 15, 'damage_bonus' => 100, 'cost_reduction' => 20], + 1 => ['cost' => 0, 'bonus' => 0, 'cost_reduction' => 0], + 2 => ['cost' => 2, 'bonus' => 10, 'cost_reduction' => 2], + 3 => ['cost' => 3, 'bonus' => 20, 'cost_reduction' => 4], + 4 => ['cost' => 4, 'bonus' => 30, 'cost_reduction' => 6], + 5 => ['cost' => 5, 'bonus' => 40, 'cost_reduction' => 8], + 6 => ['cost' => 6, 'bonus' => 50, 'cost_reduction' => 10], + 7 => ['cost' => 8, 'bonus' => 60, 'cost_reduction' => 12], + 8 => ['cost' => 10, 'bonus' => 70, 'cost_reduction' => 14], + 9 => ['cost' => 12, 'bonus' => 80, 'cost_reduction' => 16], + 10 => ['cost' => 15, 'bonus' => 100, 'cost_reduction' => 20], ], - // 地牢法术掉落映射 - 定义各地牢的法术资源书掉落池 + // ============ 地牢法术掉落映射 ============ 'dungeon_spell_drops' => [ - 1 => [1, 10], // 七玄门 (Lv.1-5): 火球术、冰雹术 - 2 => [2, 3, 11], // 太南谷 (Lv.5-10): 冰锥术、雷击术、炎爆术 - 3 => [20, 21], // 血色禁地 (Lv.10-15): 治愈术、神圣庇护 - 4 => [12], // 黄枫谷 (Lv.15-20): 流星雨 - 5 => [4], // 燕翎堡 (Lv.20-30): 烈焰焚天 - 6 => [5, 22], // 越京皇宫 (Lv.30-40): 诛仙剑气、恢复光环 - 7 => [13], // 乱星海-魁星岛 (Lv.40-50): 灭世风暴 - 8 => [13, 22], // 虚天殿 (Lv.50-60): 灭世风暴、恢复光环 - 9 => [5, 13], // 外星海 (Lv.60+): 诛仙剑气、灭世风暴 + 1 => ['heal_single', 'damage_single', 'damage_aoe'], // 七玄门 (Lv.1-5) + 2 => ['damage_single', 'damage_aoe', 'heal_aoe'], // 太南谷 (Lv.5-10) + 3 => ['heal_single', 'heal_aoe'], // 血色禁地 (Lv.10-15) + 4 => ['damage_single', 'damage_aoe'], // 黄枫谷 (Lv.15-20) + 5 => ['damage_single', 'heal_aoe'], // 燕翎堡 (Lv.20-30) + 6 => ['damage_single', 'heal_aoe'], // 越京皇宫 (Lv.30-40) + 7 => ['damage_aoe'], // 乱星海-魁星岛 (Lv.40-50) + 8 => ['damage_aoe', 'heal_single', 'heal_aoe'], // 虚天殿 (Lv.50-60) + 9 => ['damage_single', 'damage_aoe', 'heal_single'], // 外星海 (Lv.60+) + ], + + // ============ 按法术类型和品质分类 ============ + 'spells_by_quality' => [ + 'common' => [ + 'heal_single' => [1], + 'damage_single' => [10], + 'damage_aoe' => [20], + 'heal_aoe' => [30], + ], + 'rare' => [ + 'heal_single' => [2, 3], + 'damage_single' => [11, 12], + 'damage_aoe' => [21, 22], + 'heal_aoe' => [31, 32], + ], + 'epic' => [ + 'heal_single' => [4, 5], + 'damage_single' => [13, 14], + 'damage_aoe' => [23, 24], + 'heal_aoe' => [33, 34], + ], + 'legendary' => [ + 'heal_single' => [6], + 'damage_single' => [15], + 'damage_aoe' => [25], + 'heal_aoe' => [35], + ], ], ]; diff --git a/src/Entities/Actor.php b/src/Entities/Actor.php index bb506bf..1e8ec12 100644 --- a/src/Entities/Actor.php +++ b/src/Entities/Actor.php @@ -9,17 +9,17 @@ class Actor public int $exp = 0; public int $maxExp = 100; - public int $hp = 0; - public int $maxHp = 0; - public int $patk = 0; - public int $matk = 0; - public int $pdef = 0; - public int $mdef = 0; + public int $hp = 100; + public int $maxHp = 100; + public int $patk = 10; + public int $matk = 10; + public int $pdef = 10; + public int $mdef = 10; public int $crit = 0; public float $critdmg = 110.0; - public int $mana = 0; - public int $maxMana = 0; + public int $mana = 100; + public int $maxMana = 100; // 技能槽位系统 (新法术系统) public array $skillSlots = [ diff --git a/src/Entities/Item.php b/src/Entities/Item.php index 7a24aa6..adda754 100644 --- a/src/Entities/Item.php +++ b/src/Entities/Item.php @@ -87,9 +87,6 @@ class Item $growth = $typeConfig['growth'] ?? 0; $item->heal = $baseStats[$qualityIndex] + ($level * $growth) + rand(0, 10); $item->desc = "Lv.{$level} {$quality}品质的药剂"; - } elseif ($type === 'spell_tome') { - // 法术资源书特殊处理 - $item->desc = "Lv.{$level} {$quality}品质的法术资源书"; } else { // 检查是否有特定物品配置 $specificConfig = $typeConfig['specific_config'][$item->name] ?? []; @@ -237,12 +234,13 @@ class Item } /** - * 创建法术物品 - * @param int $spellId 法术ID (来自 spells.php) + * 创建法术物品 - 支持新的丰富法术系统 + * @param int $spellId 法术ID + * @param string $quality 品质 (common, rare, epic, legendary) * @param int $level 物品等级 * @return array 法术物品数组 */ - public static function createSpell(int $spellId, int $level = 1): array + public static function createSpell(int $spellId, string $quality = 'common', int $level = 1): array { static $spellsData = null; if ($spellsData === null) { @@ -252,7 +250,7 @@ class Item // 查找法术信息 $spellInfo = null; foreach ($spellsData as $category => $spells) { - if (is_array($spells) && $category !== 'quality_levels' && $category !== 'upgrades' && $category !== 'dungeon_spell_drops') { + if (is_array($spells) && !in_array($category, ['quality_levels', 'upgrades', 'dungeon_spell_drops', 'quality_drop_rates', 'spells_by_quality'])) { if (isset($spells[$spellId])) { $spellInfo = $spells[$spellId]; break; @@ -266,33 +264,60 @@ class Item 'id' => uniqid('spell_'), 'type' => 'spell', 'name' => '未知法术', - 'quality' => 'common', + 'quality' => $quality, 'level' => $level, 'spellId' => $spellId, 'enhanceLevel' => 0, - 'damage' => 1.0, + 'calc_type' => 'matk', 'cost' => 20, 'spellType' => 'damage_single', 'desc' => '未知的法术', ]; } + // 品质映射到数组索引 (common=0, rare=1, epic=2, legendary=3) + $qualityIndex = match($quality) { + 'common' => 0, + 'rare' => 1, + 'epic' => 2, + 'legendary' => 3, + default => 0, + }; + + // 提取品质相关的参数 + $healRatio = $spellInfo['heal_ratio'][$qualityIndex] ?? ($spellInfo['heal_ratio'][0] ?? 0); + $damageRatio = $spellInfo['damage_ratio'][$qualityIndex] ?? ($spellInfo['damage_ratio'][0] ?? 1.0); + $healBase = $spellInfo['heal_base'][$qualityIndex] ?? ($spellInfo['heal_base'][0] ?? 0); + $critBonus = $spellInfo['crit_bonus'][$qualityIndex] ?? ($spellInfo['crit_bonus'][0] ?? 0); + $critDmgBonus = $spellInfo['crit_dmg_bonus'][$qualityIndex] ?? ($spellInfo['crit_dmg_bonus'][0] ?? 0); + $enemyCountBonus = $spellInfo['enemy_count_bonus'][$qualityIndex] ?? ($spellInfo['enemy_count_bonus'][0] ?? 0); + $dispersion = $spellInfo['dispersion'][$qualityIndex] ?? ($spellInfo['dispersion'][0] ?? 1.0); + $teamBonus = $spellInfo['team_bonus'][$qualityIndex] ?? ($spellInfo['team_bonus'][0] ?? 0); + $priorityBonus = $spellInfo['priority_bonus'][$qualityIndex] ?? ($spellInfo['priority_bonus'][0] ?? 0); + return [ 'id' => uniqid('spell_'), 'type' => 'spell', 'name' => $spellInfo['name'], - 'quality' => $spellInfo['quality'] ?? 'common', + 'quality' => $quality, 'level' => $level, 'spellId' => $spellId, 'enhanceLevel' => 0, - 'damage' => $spellInfo['damage'] ?? 1.0, + 'calc_type' => $spellInfo['calc_type'] ?? 'matk', 'cost' => $spellInfo['cost'] ?? 20, 'spellType' => $spellInfo['type'] ?? 'damage_single', - 'subtype' => $spellInfo['subtype'] ?? null, - 'heal' => $spellInfo['heal'] ?? 0, - 'heal_base' => $spellInfo['heal_base'] ?? 0, - 'defense_boost' => $spellInfo['defense_boost'] ?? 0, 'desc' => $spellInfo['desc'] ?? '', + + // 品质参数 + 'heal_ratio' => $healRatio, + 'damage_ratio' => $damageRatio, + 'heal_base' => $healBase, + 'crit_bonus' => $critBonus, + 'crit_dmg_bonus' => $critDmgBonus, + 'enemy_count_bonus' => $enemyCountBonus, + 'dispersion' => $dispersion, + 'team_bonus' => $teamBonus, + 'priority_bonus' => $priorityBonus, ]; } diff --git a/src/Entities/Monster.php b/src/Entities/Monster.php index c23611b..0ebb4af 100644 --- a/src/Entities/Monster.php +++ b/src/Entities/Monster.php @@ -204,33 +204,15 @@ class Monster extends Actor // 处理两种配置格式 $selectedSpells = []; - if (is_numeric($spellConfigs[0] ?? null)) { - // 格式1: 简单数组 [1, 3, 10] - 随机选择 - $spellCount = rand(1, min(3, count($spellConfigs))); - $selectedIds = array_rand($spellConfigs, $spellCount); - - if (!is_array($selectedIds)) { - $selectedIds = [$selectedIds]; - } - - foreach ($selectedIds as $key) { + // 格式2: 配置数组 [['id' => 1, 'name' => '治愈术', 'rate' => 30]] + foreach ($spellConfigs as $spellConfig) { + if (is_array($spellConfig) && isset($spellConfig['id'])) { $selectedSpells[] = [ - 'id' => $spellConfigs[$key], - 'name' => null, - 'rate' => 30, // 格式1不指定rate时默认30% + 'id' => $spellConfig['id'], + 'name' => $spellConfig['name'] ?? null, + 'rate' => $spellConfig['rate'] ?? 30, // 默认30%掉落概率 ]; } - } else { - // 格式2: 配置数组 [['id' => 1, 'name' => '治愈术', 'rate' => 30]] - foreach ($spellConfigs as $spellConfig) { - if (is_array($spellConfig) && isset($spellConfig['id'])) { - $selectedSpells[] = [ - 'id' => $spellConfig['id'], - 'name' => $spellConfig['name'] ?? null, - 'rate' => $spellConfig['rate'] ?? 30, // 默认30%掉落概率 - ]; - } - } } foreach ($selectedSpells as $spellConfig) { @@ -261,45 +243,6 @@ class Monster extends Actor } } - /** - * 应用装备属性加成到怪物属性 - */ - // Monster-specific application of equipment is handled by Actor::getStats; applyEquipmentStats remains for legacy callers - public function applyEquipmentStats(): void - { - $this->hp = $this->baseHp; - $this->patk = $this->basePatk; - $this->matk = $this->baseMatk; - $this->pdef = $this->basePdef; - $this->mdef = $this->baseMdef; - - foreach ($this->equip as $item) { - if (empty($item)) continue; - $this->hp += $item['hp'] ?? 0; - $this->patk += $item['patk'] ?? $item['atk'] ?? 0; - $this->matk += $item['matk'] ?? 0; - $this->pdef += $item['pdef'] ?? $item['def'] ?? 0; - $this->mdef += $item['mdef'] ?? 0; - $this->crit += $item['crit'] ?? 0; - $this->critdmg += $item['critdmg'] ?? 0; - } - } - - /** - * 获取怪物装备的物品列表(用于战斗胜利时掉落) - * @return array - */ - public function getEquippedItems(): array - { - $items = []; - foreach ($this->equip as $item) { - if (!empty($item)) { - $items[] = $item; - } - } - return $items; - } - /** * 随机掉落装备物品(从穿着的装备随机掉落) * @param int $dropRate 掉落概率(0-100) diff --git a/src/Entities/Player.php b/src/Entities/Player.php index aaa9710..04b0f91 100644 --- a/src/Entities/Player.php +++ b/src/Entities/Player.php @@ -56,8 +56,7 @@ class Player extends Actor $this->exp -= $this->maxExp; $this->maxExp = (int)($this->maxExp * 1.5); - // 升级获得天赋点(每级3点)并通过 autoAllocateTalents 自动分配 - $this->autoAllocateTalents(3); + $this->talentPoints += 3; // 升级时恢复全部生命值 $this->fullHeal(); diff --git a/src/Modules/InventoryPanel.php b/src/Modules/InventoryPanel.php index cc68ddc..e8ba2f7 100644 --- a/src/Modules/InventoryPanel.php +++ b/src/Modules/InventoryPanel.php @@ -594,7 +594,7 @@ class InventoryPanel foreach ($player->inventory as $index => $item) { $quality = $item['quality'] ?? $item['rarity'] ?? 'common'; - $isEquipment = in_array($item['type'], ['weapon', 'armor', 'ring', 'necklace', 'boots']); + $isEquipment = in_array($item['type'], ['weapon', 'armor', 'ring', 'necklace', 'boots','spell']); if ($isEquipment && in_array($quality, $qualitiesToSell)) { $price = \Game\Entities\Item::calculateSellPrice($item); diff --git a/src/Modules/SpellPanel.php b/src/Modules/SpellPanel.php index e99a4b2..a45e742 100644 --- a/src/Modules/SpellPanel.php +++ b/src/Modules/SpellPanel.php @@ -212,18 +212,16 @@ class SpellPanel $actualDamage = $damage * (1 + $damageBonus / 100); $out->writeln("伤害倍数: {$this->yellow}" . number_format($damage, 2) . "{$this->reset} → {$this->green}" . number_format($actualDamage, 2) . "x{$this->reset}"); $out->writeln("效果: {$this->magenta}对所有敌人造成魔法伤害{$this->reset}"); - } elseif ($type === 'support') { - $subtype = $spellInfo['subtype'] ?? ''; - if ($subtype === 'heal' || $subtype === 'heal_all') { - $heal = $spellInfo['heal'] ?? 0.5; - $healBase = $spellInfo['heal_base'] ?? 20; - $out->writeln("恢复效果: {$this->green}魔攻 x {$heal} + {$healBase}{$this->reset}"); - $out->writeln("效果: {$this->magenta}恢复生命值{$this->reset}"); - } elseif ($subtype === 'defend') { - $defenseBoos = $spellInfo['defense_boost'] ?? 0; - $out->writeln("防御增加: {$this->green}+{$defenseBoos}{$this->reset}"); - $out->writeln("效果: {$this->magenta}增加防御力{$this->reset}"); - } + } elseif ($type === 'heal_single') { + $heal = $spellInfo['heal'] ?? 0.5; + $healBase = $spellInfo['heal_base'] ?? 20; + $out->writeln("恢复效果: {$this->green}魔攻 x {$heal} + {$healBase}{$this->reset}"); + $out->writeln("效果: {$this->magenta}恢复单个目标的生命值{$this->reset}"); + } elseif ($type === 'heal_aoe') { + $heal = $spellInfo['heal'] ?? 0.5; + $healBase = $spellInfo['heal_base'] ?? 20; + $out->writeln("恢复效果: {$this->green}魔攻 x {$heal} + {$healBase}{$this->reset}"); + $out->writeln("效果: {$this->magenta}恢复所有队员的生命值{$this->reset}"); } $out->writeln(""); @@ -245,7 +243,7 @@ class SpellPanel // 获取所有可学习的法术(按品质分类) $allSpells = []; foreach ($spellsData as $category => $spells) { - if (is_array($spells) && $category !== 'quality_levels' && $category !== 'upgrades') { + if (is_array($spells) && !in_array($category, ['quality_levels', 'upgrades', 'dungeon_spell_drops', 'quality_drop_rates', 'spells_by_quality'])) { foreach ($spells as $spellId => $spellInfo) { if (is_numeric($spellId)) { $allSpells[$spellId] = $spellInfo; @@ -459,7 +457,7 @@ class SpellPanel private function getSpellInfo(int $spellId, array $spellsData): ?array { foreach ($spellsData as $category => $spells) { - if (is_array($spells) && $category !== 'quality_levels' && $category !== 'upgrades') { + if (is_array($spells) && !in_array($category, ['quality_levels', 'upgrades', 'dungeon_spell_drops', 'quality_drop_rates', 'spells_by_quality'])) { if (isset($spells[$spellId])) { return $spells[$spellId]; } diff --git a/test/Test.php b/test/Test.php index a12f3ec..832f7bf 100644 --- a/test/Test.php +++ b/test/Test.php @@ -1,6 +1,6 @@ getRandomSpellDrops()); \ No newline at end of file