diff --git a/.idea/codeception.xml b/.idea/codeception.xml
new file mode 100644
index 0000000..70e3d14
--- /dev/null
+++ b/.idea/codeception.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/phpspec.xml b/.idea/phpspec.xml
new file mode 100644
index 0000000..c7cfbc2
--- /dev/null
+++ b/.idea/phpspec.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/phpunit.xml b/.idea/phpunit.xml
new file mode 100644
index 0000000..4f8104c
--- /dev/null
+++ b/.idea/phpunit.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
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/Core/ItemDisplay.php b/src/Core/ItemDisplay.php
index 92ae7ad..93347f2 100644
--- a/src/Core/ItemDisplay.php
+++ b/src/Core/ItemDisplay.php
@@ -115,6 +115,7 @@ class ItemDisplay
return $stats ? self::$green . "(" . implode(" ", $stats) . ")" . self::$reset : "";
}
+
/**
* 格式化主属性(多行详细版)
*/
@@ -204,6 +205,7 @@ class ItemDisplay
/**
* 渲染物品简略信息(用于列表)
* 格式: [品质色]名称[/品质色]+强化 (类型) 主属性 <词条数>
+ * 注:法术显示由 SpellDisplay::formatSpellCompact() 处理
*/
public static function renderListItem(array $item, bool $showType = true, bool $showQuantity = true): string
{
@@ -225,17 +227,29 @@ class ItemDisplay
$parts[] = self::$gray . "[{$typeName}]" . self::$reset;
}
- // 主属性(简洁版)
- $statsStr = self::formatStatsCompact($item);
+ // 主属性(简洁版)或法术信息
+ $type = $item['type'] ?? '';
+ if ($type === 'spell') {
+ // 法术显示由 SpellDisplay 处理(计算方式和基础数值)
+ // 需要导入 SpellDisplay 后使用
+ $statsStr = SpellDisplay::formatSpellCompact($item);
+ // 为了向后兼容,使用内联逻辑(调用处应该使用 SpellDisplay)
+ } else {
+ // 显示装备的属性
+ $statsStr = self::formatStatsCompact($item);
+
+ }
if ($statsStr) {
$parts[] = $statsStr;
}
- // 词条数量提示
- $affixes = $item['affixes'] ?? [];
- if (!empty($affixes)) {
- $count = count($affixes);
- $parts[] = self::$cyan . implode(',',$affixes);
+ // 词条数量提示(仅限装备)
+ if ($type !== 'spell') {
+ $affixes = $item['affixes'] ?? [];
+ if (!empty($affixes)) {
+ $count = count($affixes);
+ $parts[] = self::$cyan . implode(',',$affixes);
+ }
}
return implode(" ", $parts);
@@ -275,6 +289,51 @@ class ItemDisplay
$lines[] = $linePrefix;
+ // 法术特殊显示
+ if ($type === 'spell') {
+ $lines[] = $linePrefix . self::$white . "--- 法术信息 ---" . self::$reset;
+ $spellType = $item['spellType'] ?? $item['type'] ?? 'unknown';
+ $calcType = $item['calc_type'] ?? 'unknown';
+
+ // 计算方式映射
+ $calcTypeMap = [
+ 'matk' => '基于魔攻',
+ 'patk' => '基于物攻',
+ 'hp_percent' => '基于最大生命值百分比',
+ 'hybrid' => '基于(魔攻+物攻)混合',
+ 'crit_heal' => '暴击率影响治疗效果',
+ 'crit_damage' => '暴击伤害系数影响伤害',
+ 'crit_aoe' => '暴击率影响范围伤害',
+ 'defense' => '基于防御属性',
+ 'low_def_bonus' => '对低防御敌人伤害加成',
+ 'matk_scaled' => '随敌人数量加成',
+ 'dispersed_damage' => '伤害分散到所有敌人',
+ 'smart_heal' => '智能治疗(优先低血量)',
+ 'hp_missing' => '基于缺失生命值',
+ 'team_sync' => '基于队伍规模',
+ ];
+
+ $calcDesc = $calcTypeMap[$calcType] ?? $calcType;
+ $lines[] = $linePrefix . " 计算方式: " . self::$cyan . $calcDesc . self::$reset;
+
+ // 基础数值
+ if ($spellType === 'damage_single' || $spellType === 'damage_aoe') {
+ $damageRatio = $item['damage_ratio'] ?? [1.2, 1.6, 2.0, 2.6];
+ $qualityIndex = self::getQualityIndex($quality);
+ $ratio = $damageRatio[$qualityIndex] ?? 1.0;
+ $lines[] = $linePrefix . " 伤害倍数: " . self::$green . $ratio . "x" . self::$reset;
+ } elseif ($spellType === 'heal_single' || $spellType === 'heal_aoe') {
+ $healRatio = $item['heal_ratio'] ?? [0.5, 0.8, 1.2, 1.8];
+ $healBase = $item['heal_base'] ?? [20, 40, 70, 120];
+ $qualityIndex = self::getQualityIndex($quality);
+ $ratio = $healRatio[$qualityIndex] ?? 0.5;
+ $base = $healBase[$qualityIndex] ?? 20;
+ $lines[] = $linePrefix . " 治疗系数: " . self::$green . $ratio . "x + " . $base . self::$reset;
+ }
+
+ $lines[] = $linePrefix;
+ }
+
// 主属性
$lines[] = $linePrefix . self::$white . "--- 主属性 ---" . self::$reset;
$statLines = self::formatStatsDetailed($item, $linePrefix . " ");
@@ -305,25 +364,37 @@ class ItemDisplay
/**
* 渲染装备槽位信息(用于属性面板)
+ * 注:法术显示由 SpellDisplay::renderSlot() 处理
*/
public static function renderSlot(string $slotName, ?array $item, string $linePrefix = "║ "): array
{
+ // 委托给 SpellDisplay 处理法术,其他类型则在此处理
+ if ($item && ($item['type'] ?? '') === 'spell') {
+ // 法术显示由 SpellDisplay 完全处理
+ // 调用处应该直接使用 SpellDisplay::renderSlot()
+ // 这里为了向后兼容保留了基本支持
+ }
+
$lines = [];
if ($item) {
- // 第一行:槽位名 + 装备名
+ $type = $item['type'] ?? '';
+
+ // 第一行:槽位名 + 装备/法术名
$lines[] = $linePrefix . self::$cyan . $slotName . self::$reset . ": " . self::formatName($item);
- // 第二行:主属性
- $statsStr = self::formatStatsCompact($item);
- if ($statsStr) {
- $lines[] = $linePrefix . " " . $statsStr;
- }
+ if ($type !== 'spell') {
+ // 装备显示:属性和词条
+ $statsStr = self::formatStatsCompact($item);
+ if ($statsStr) {
+ $lines[] = $linePrefix . " " . $statsStr;
+ }
- // 第三行及之后:词条
- $affixes = $item['affixes'] ?? [];
- foreach ($affixes as $affix) {
- $lines[] = $linePrefix . " " . self::$yellow . "◆" . self::$reset . " " . $affix;
+ // 词条
+ $affixes = $item['affixes'] ?? [];
+ foreach ($affixes as $affix) {
+ $lines[] = $linePrefix . " " . self::$yellow . "◆" . self::$reset . " " . $affix;
+ }
}
} else {
$lines[] = $linePrefix . self::$cyan . $slotName . self::$reset . ": " .
@@ -362,4 +433,18 @@ class ItemDisplay
return $prefix . "✦ " . $color . $name . self::$reset . $enhanceStr . $statsStr . $affixStr;
}
+
+ /**
+ * 根据品质获取数组索引
+ */
+ private static function getQualityIndex(string $quality): int
+ {
+ return match($quality) {
+ 'common' => 0,
+ 'rare' => 1,
+ 'epic' => 2,
+ 'legendary' => 3,
+ default => 0,
+ };
+ }
}
diff --git a/src/Core/SpellDisplay.php b/src/Core/SpellDisplay.php
new file mode 100644
index 0000000..33a3fe7
--- /dev/null
+++ b/src/Core/SpellDisplay.php
@@ -0,0 +1,485 @@
+ '单体治疗',
+ 'damage_single' => '单体伤害',
+ 'damage_aoe' => '群体伤害',
+ 'heal_aoe' => '群体治疗',
+ 'support' => '辅助',
+ ];
+
+ // 计算方式说明
+ private static array $calcTypeDescriptions = [
+ 'matk' => '基于魔攻',
+ 'patk' => '基于物攻',
+ 'hp_percent' => '基于最大生命值百分比',
+ 'hybrid' => '基于(魔攻+物攻)混合',
+ 'crit_heal' => '暴击率影响治疗效果',
+ 'crit_damage' => '暴击伤害系数影响伤害',
+ 'crit_aoe' => '暴击率影响范围伤害',
+ 'defense' => '基于防御属性',
+ 'low_def_bonus' => '对低防御敌人伤害加成',
+ 'matk_scaled' => '随敌人数量加成',
+ 'dispersed_damage' => '伤害分散到所有敌人',
+ 'smart_heal' => '智能治疗(优先低血量)',
+ 'hp_missing' => '基于缺失生命值',
+ 'team_sync' => '基于队伍规模',
+ ];
+
+ // 品质颜色
+ private static array $qualityColors = [
+ 'common' => Colors::WHITE,
+ 'rare' => Colors::BLUE,
+ 'epic' => Colors::MAGENTA,
+ 'legendary' => Colors::YELLOW,
+ ];
+
+ // 品质名称
+ private static array $qualityNames = [
+ 'common' => '普通',
+ 'rare' => '稀有',
+ 'epic' => '史诗',
+ 'legendary' => '传奇',
+ ];
+
+ // 颜色常量
+ private static string $reset = Colors::RESET;
+ private static string $yellow = Colors::YELLOW;
+ private static string $green = Colors::GREEN;
+ private static string $cyan = Colors::CYAN;
+ private static string $white = Colors::WHITE;
+ private static string $gray = Colors::GRAY;
+ private static string $magenta = Colors::MAGENTA;
+ private static string $blue = Colors::BLUE;
+
+ /**
+ * 获取法术品质颜色
+ */
+ public static function getQualityColor(string $quality): string
+ {
+ return self::$qualityColors[$quality] ?? self::$white;
+ }
+
+ /**
+ * 获取法术品质名称
+ */
+ public static function getQualityName(string $quality): string
+ {
+ return self::$qualityNames[$quality] ?? '普通';
+ }
+
+ /**
+ * 获取法术类型名称
+ */
+ public static function getTypeName(string $type): string
+ {
+ return self::$typeNames[$type] ?? $type;
+ }
+
+ /**
+ * 获取计算方式描述
+ */
+ public static function getCalcTypeDescription(string $calcType): string
+ {
+ return self::$calcTypeDescriptions[$calcType] ?? $calcType;
+ }
+
+ /**
+ * 格式化法术名称(带品质颜色和等级)
+ */
+ public static function formatName(array $spell): string
+ {
+ $quality = $spell['quality'] ?? 'common';
+ $color = self::getQualityColor($quality);
+ $name = $spell['name'] ?? '未知法术';
+ $level = $spell['level'] ?? 1;
+
+ $enhanceLevel = $spell['enhanceLevel'] ?? 0;
+ $enhanceStr = $enhanceLevel > 0 ? self::$yellow . "+{$enhanceLevel}" . self::$reset : "";
+
+ return $color . $name . self::$reset . " Lv.{$level}" . $enhanceStr;
+ }
+
+ /**
+ * 格式化法术简要信息(用于列表)
+ */
+ public static function renderListItem(array $spell): string
+ {
+ $parts = [];
+
+ // 名称(带品质颜色和强化)
+ $parts[] = self::formatName($spell);
+
+ // 法术类型
+ $spellType = $spell['spellType'] ?? $spell['type'] ?? 'unknown';
+ $typeName = self::getTypeName($spellType);
+ $parts[] = self::$gray . "[{$typeName}]" . self::$reset;
+
+ // 消耗和基本描述
+ $cost = $spell['cost'] ?? 0;
+ $parts[] = self::$cyan . "消耗:{$cost}" . self::$reset;
+
+ return implode(" ", $parts);
+ }
+
+ /**
+ * 格式化法术详细信息(用于详情面板)
+ * 返回多行数组
+ */
+ public static function renderDetail(array $spell, string $linePrefix = "║ "): array
+ {
+ $lines = [];
+
+ $quality = $spell['quality'] ?? 'common';
+ $qualityColor = self::getQualityColor($quality);
+ $qualityName = self::getQualityName($quality);
+
+ $spellType = $spell['spellType'] ?? $spell['type'] ?? 'unknown';
+ $typeName = self::getTypeName($spellType);
+
+ $calcType = $spell['calc_type'] ?? 'unknown';
+ $calcTypeDesc = self::getCalcTypeDescription($calcType);
+
+ $enhanceLevel = $spell['enhanceLevel'] ?? 0;
+ $spellId = $spell['spellId'] ?? 'unknown';
+
+ // 名称行
+ $lines[] = $linePrefix . self::formatName($spell);
+ $lines[] = $linePrefix;
+
+ // 基本信息
+ $lines[] = $linePrefix . "品质: " . $qualityColor . $qualityName . self::$reset;
+ $lines[] = $linePrefix . "类型: " . self::$white . $typeName . self::$reset;
+ $lines[] = $linePrefix . "法术ID: " . self::$gray . $spellId . self::$reset;
+ $lines[] = $linePrefix;
+
+ // 强化信息
+ if ($enhanceLevel > 0) {
+ $damageBonus = $enhanceLevel * 5;
+ $costReduction = $enhanceLevel * 2;
+ $lines[] = $linePrefix . "强化: " . self::$yellow . "+{$enhanceLevel}" . self::$reset .
+ self::$gray . " (伤害+{$damageBonus}% 消耗-{$costReduction})" . self::$reset;
+ $lines[] = $linePrefix;
+ }
+
+ // 计算方式
+ $lines[] = $linePrefix . self::$cyan . "━━ 基础数值 ━━" . self::$reset;
+ $lines[] = $linePrefix . "计算方式: " . self::$green . $calcTypeDesc . self::$reset;
+
+ // 根据法术类型显示不同的基础数值
+ if ($spellType === 'heal_single' || $spellType === 'heal_aoe') {
+ $lines[] = self::formatHealValues($spell, $linePrefix, $enhanceLevel);
+ } elseif ($spellType === 'damage_single' || $spellType === 'damage_aoe') {
+ $lines[] = self::formatDamageValues($spell, $linePrefix, $enhanceLevel);
+ }
+
+ $lines[] = $linePrefix;
+
+ // 消耗信息
+ $baseCost = $spell['cost'] ?? 20;
+ $actualCost = max(1, $baseCost - ($enhanceLevel * 2));
+ if ($enhanceLevel > 0) {
+ $lines[] = $linePrefix . "魔法消耗: " . self::$white . $baseCost . self::$reset .
+ " → " . self::$green . $actualCost . self::$reset;
+ } else {
+ $lines[] = $linePrefix . "魔法消耗: " . self::$green . $baseCost . self::$reset;
+ }
+ $lines[] = $linePrefix;
+
+ // 描述
+ $desc = $spell['desc'] ?? '';
+ if ($desc) {
+ $lines[] = $linePrefix . self::$gray . $desc . self::$reset;
+ }
+
+ return $lines;
+ }
+
+ /**
+ * 格式化治疗法术的基础数值
+ */
+ private static function formatHealValues(array $spell, string $linePrefix, int $enhanceLevel): string
+ {
+ $calcType = $spell['calc_type'] ?? 'matk';
+ $healRatio = $spell['heal_ratio'] ?? [0.5, 0.8, 1.2, 1.8];
+ $healBase = $spell['heal_base'] ?? [20, 40, 70, 120];
+
+ $qualityIndex = self::getQualityIndex($spell['quality'] ?? 'common');
+ $ratio = $healRatio[$qualityIndex] ?? 0.5;
+ $base = $healBase[$qualityIndex] ?? 20;
+
+ $lines = "";
+
+ match($calcType) {
+ 'matk' => $lines = self::formatMatkHeal($ratio, $base, $linePrefix, $enhanceLevel),
+ 'hp_percent' => $lines = self::formatHpPercentHeal($ratio, $linePrefix),
+ 'hybrid' => $lines = self::formatHybridHeal($ratio, $base, $linePrefix, $enhanceLevel),
+ 'hp_missing' => $lines = self::formatHpMissingHeal($ratio, $linePrefix),
+ 'crit_heal' => $lines = self::formatCritHeal($ratio, $base, $spell['crit_bonus'] ?? [0.5, 0.7, 1.0, 1.5], $linePrefix, $enhanceLevel),
+ 'defense' => $lines = self::formatDefenseHeal($ratio, $base, $linePrefix, $enhanceLevel),
+ default => $lines = $linePrefix . "基础治疗: " . self::$green . "{$ratio}x魔攻 + {$base}" . self::$reset,
+ };
+
+ return $lines;
+ }
+
+ /**
+ * 格式化伤害法术的基础数值
+ */
+ private static function formatDamageValues(array $spell, string $linePrefix, int $enhanceLevel): string
+ {
+ $calcType = $spell['calc_type'] ?? 'matk';
+ $damageRatio = $spell['damage_ratio'] ?? [1.2, 1.6, 2.0, 2.6];
+
+ $qualityIndex = self::getQualityIndex($spell['quality'] ?? 'common');
+ $ratio = $damageRatio[$qualityIndex] ?? 1.2;
+
+ if ($calcType === 'matk') {
+ return $linePrefix . "伤害倍数: " . self::$green . "{$ratio}x魔攻" . self::$reset;
+ } elseif ($calcType === 'patk') {
+ return $linePrefix . "伤害倍数: " . self::$green . "{$ratio}x物攻" . self::$reset;
+ } elseif ($calcType === 'hybrid') {
+ return $linePrefix . "伤害倍数: " . self::$green . "{$ratio}x(魔攻+物攻)" . self::$reset;
+ } elseif ($calcType === 'crit_damage') {
+ $critBonus = $spell['crit_dmg_bonus'] ?? [0.3, 0.5, 0.8, 1.2];
+ $bonus = $critBonus[$qualityIndex] ?? 0.3;
+ return $linePrefix . "伤害倍数: " . self::$green . "{$ratio}x物攻" . self::$reset . "\n" .
+ $linePrefix . "暴击加成: " . self::$yellow . "{$bonus}x暴伤系数" . self::$reset;
+ } elseif ($calcType === 'low_def_bonus') {
+ return $linePrefix . "伤害倍数: " . self::$green . "{$ratio}x物攻(低防御加成)" . self::$reset;
+ } elseif ($calcType === 'matk_scaled') {
+ $enemyBonus = $spell['enemy_count_bonus'] ?? [0.1, 0.15, 0.2, 0.3];
+ $bonus = $enemyBonus[$qualityIndex] ?? 0.1;
+ return $linePrefix . "伤害倍数: " . self::$green . "{$ratio}x魔攻" . self::$reset . "\n" .
+ $linePrefix . "敌人数加成: " . self::$yellow . "+" . ($bonus*100) . "%/敌人" . self::$reset;
+ } elseif ($calcType === 'dispersed_damage') {
+ $dispersion = $spell['dispersion'] ?? [0.8, 0.75, 0.7, 0.65];
+ $disp = $dispersion[$qualityIndex] ?? 0.8;
+ return $linePrefix . "伤害倍数: " . self::$green . "{$ratio}x魔攻" . self::$reset . "\n" .
+ $linePrefix . "分散系数: " . self::$yellow . "{$disp}(敌人越多衰减越严重)" . self::$reset;
+ } elseif ($calcType === 'crit_aoe') {
+ $critBonus = $spell['crit_bonus'] ?? [0.4, 0.6, 0.9, 1.3];
+ $bonus = $critBonus[$qualityIndex] ?? 0.4;
+ return $linePrefix . "伤害倍数: " . self::$green . "{$ratio}x魔攻" . self::$reset . "\n" .
+ $linePrefix . "暴击影响: " . self::$yellow . "{$bonus}x暴击率" . self::$reset;
+ }
+
+ return $linePrefix . "伤害倍数: " . self::$green . "{$ratio}x" . self::$reset;
+ }
+
+ /**
+ * 格式化魔攻治疗
+ */
+ private static function formatMatkHeal(float $ratio, float $base, string $linePrefix, int $enhanceLevel): string
+ {
+ $healBonus = $enhanceLevel * 5;
+ if ($enhanceLevel > 0) {
+ return $linePrefix . "恢复量: " . self::$green . "{$ratio}x魔攻 + {$base}" . self::$reset .
+ " " . self::$yellow . "(+{$healBonus}%)" . self::$reset;
+ }
+ return $linePrefix . "恢复量: " . self::$green . "{$ratio}x魔攻 + {$base}" . self::$reset;
+ }
+
+ /**
+ * 格式化生命值百分比治疗
+ */
+ private static function formatHpPercentHeal(float $ratio, string $linePrefix): string
+ {
+ return $linePrefix . "恢复量: " . self::$green . ($ratio * 100) . "% 最大生命值" . self::$reset;
+ }
+
+ /**
+ * 格式化混合治疗
+ */
+ private static function formatHybridHeal(float $ratio, float $base, string $linePrefix, int $enhanceLevel): string
+ {
+ $healBonus = $enhanceLevel * 5;
+ if ($enhanceLevel > 0) {
+ return $linePrefix . "恢复量: " . self::$green . "{$ratio}x(魔攻+物攻) + {$base}" . self::$reset .
+ " " . self::$yellow . "(+{$healBonus}%)" . self::$reset;
+ }
+ return $linePrefix . "恢复量: " . self::$green . "{$ratio}x(魔攻+物攻) + {$base}" . self::$reset;
+ }
+
+ /**
+ * 格式化缺失生命值治疗
+ */
+ private static function formatHpMissingHeal(float $ratio, string $linePrefix): string
+ {
+ return $linePrefix . "恢复量: " . self::$green . ($ratio * 100) . "% 缺失生命值" . self::$reset;
+ }
+
+ /**
+ * 格式化暴击治疗
+ */
+ private static function formatCritHeal(float $ratio, float $base, array $critBonus, string $linePrefix, int $enhanceLevel): string
+ {
+ $qualityIndex = self::getQualityIndex(0);
+ $bonus = $critBonus[$qualityIndex] ?? 0.5;
+ $healBonus = $enhanceLevel * 5;
+ $result = $linePrefix . "恢复量: " . self::$green . "{$ratio}x魔攻 + {$base}" . self::$reset;
+ $result .= "\n" . $linePrefix . "暴击系数: " . self::$yellow . "{$bonus}x暴击率加成" . self::$reset;
+ if ($enhanceLevel > 0) {
+ $result .= "\n" . $linePrefix . "强化加成: " . self::$yellow . "+{$healBonus}%" . self::$reset;
+ }
+ return $result;
+ }
+
+ /**
+ * 格式化防御治疗
+ */
+ private static function formatDefenseHeal(float $ratio, float $base, string $linePrefix, int $enhanceLevel): string
+ {
+ $healBonus = $enhanceLevel * 5;
+ if ($enhanceLevel > 0) {
+ return $linePrefix . "恢复量: " . self::$green . "{$ratio}x(物防+魔防) + {$base}" . self::$reset .
+ " " . self::$yellow . "(+{$healBonus}%)" . self::$reset;
+ }
+ return $linePrefix . "恢复量: " . self::$green . "{$ratio}x(物防+魔防) + {$base}" . self::$reset;
+ }
+
+ /**
+ * 根据品质获取数组索引
+ */
+ private static function getQualityIndex(string $quality): int
+ {
+ return match($quality) {
+ 'common' => 0,
+ 'rare' => 1,
+ 'epic' => 2,
+ 'legendary' => 3,
+ default => 0,
+ };
+ }
+
+ /**
+ * 渲染战斗中的法术简洁信息
+ */
+ public static function renderBattleInfo(array $spell, string $prefix = " "): string
+ {
+ $quality = $spell['quality'] ?? 'common';
+ $color = self::getQualityColor($quality);
+ $name = $spell['name'] ?? '未知法术';
+ $cost = $spell['cost'] ?? 20;
+ $enhanceLevel = $spell['enhanceLevel'] ?? 0;
+ $calcType = $spell['calc_type'] ?? 'unknown';
+ $calcDesc = self::getCalcTypeDescription($calcType);
+
+ $enhanceStr = $enhanceLevel > 0 ? self::$yellow . "+{$enhanceLevel}" . self::$reset : "";
+
+ return $prefix . $color . $name . self::$reset . $enhanceStr .
+ " [消耗:{$cost} {$calcDesc}]";
+ }
+
+ /**
+ * 格式化法术的简洁信息(用于列表显示)
+ * 显示:[计算方式] 基础数值
+ */
+ public static function formatSpellCompact(array $spell): string
+ {
+ $calcType = $spell['calc_type'] ?? 'matk';
+ $spellType = $spell['spellType'] ?? $spell['type'] ?? 'unknown';
+
+ $calcTypeMap = [
+ 'matk' => '魔攻',
+ 'patk' => '物攻',
+ 'hybrid' => '混合',
+ 'hp_percent' => 'HP%',
+ 'crit_heal' => '暴治',
+ 'crit_damage' => '暴伤',
+ 'defense' => '防御',
+ 'low_def_bonus' => '克低防',
+ 'matk_scaled' => '群伤',
+ 'dispersed_damage' => '分散伤',
+ 'crit_aoe' => '暴范',
+ 'smart_heal' => '智能治',
+ 'hp_missing' => '缺血治',
+ 'team_sync' => '队伍同步',
+ ];
+
+ $calcDesc = $calcTypeMap[$calcType] ?? $calcType;
+
+ // 根据法术类型显示基础数值
+ $valueStr = '';
+ if ($spellType === 'damage_single' || $spellType === 'damage_aoe') {
+ $damageRatio = $spell['damage_ratio'];
+ $valueStr = self::$green . "{$damageRatio}x" . self::$reset;
+ } elseif ($spellType === 'heal_single' || $spellType === 'heal_aoe') {
+ $healRatio = $spell['heal_ratio'];
+ $valueStr = self::$green . "{$healRatio}x" . self::$reset;
+ }
+
+ return self::$cyan . "[{$calcDesc}]" . self::$reset . $valueStr;
+ }
+
+ /**
+ * 渲染法术槽位信息(用于角色属性面板)
+ * 显示法术的计算方式、基础数值、消耗等详细信息
+ */
+ public static function renderSlot(string $slotName, array $spell, string $linePrefix = "║ "): array
+ {
+ $lines = [];
+
+ // 第一行:槽位名 + 法术名
+ $lines[] = $linePrefix . self::$cyan . $slotName . self::$reset . ": " . self::formatName($spell);
+
+ // 计算方式
+ $calcType = $spell['calc_type'] ?? 'matk';
+ $spellType = $spell['spellType'] ?? $spell['type'] ?? 'unknown';
+
+ // 计算方式的完整描述
+ $calcTypeDescMap = [
+ 'matk' => '基于魔攻',
+ 'patk' => '基于物攻',
+ 'hybrid' => '混合伤害',
+ 'hp_percent' => '基于HP%',
+ 'crit_heal' => '暴击治疗',
+ 'crit_damage' => '暴击伤害',
+ 'defense' => '基于防御',
+ 'low_def_bonus' => '克低防',
+ 'matk_scaled' => '群体伤害',
+ 'dispersed_damage' => '分散伤害',
+ 'crit_aoe' => '暴击范围',
+ 'smart_heal' => '智能治疗',
+ 'hp_missing' => '缺血治疗',
+ 'team_sync' => '队伍同步',
+ ];
+
+ $calcDesc = $calcTypeDescMap[$calcType] ?? $calcType;
+ $lines[] = $linePrefix . " " . self::$white . "计算: " . self::$green . $calcDesc . self::$reset;
+
+ // 显示基础数值
+ if ($spellType === 'damage_single' || $spellType === 'damage_aoe') {
+ $damageRatio = $spell['damage_ratio'] ?? [1.2, 1.6, 2.0, 2.6];
+ $qualityIndex = self::getQualityIndex($spell['quality'] ?? 'common');
+ $ratio = $damageRatio[$qualityIndex] ?? 1.0;
+ $lines[] = $linePrefix . " " . self::$white . "倍数: " . self::$yellow . "{$ratio}x" . self::$reset;
+ } elseif ($spellType === 'heal_single' || $spellType === 'heal_aoe') {
+ $healRatio = $spell['heal_ratio'] ?? [0.5, 0.8, 1.2, 1.8];
+ $healBase = $spell['heal_base'] ?? [20, 40, 70, 120];
+ $qualityIndex = self::getQualityIndex($spell['quality'] ?? 'common');
+ $ratio = $healRatio[$qualityIndex] ?? 0.5;
+ $base = $healBase[$qualityIndex] ?? 20;
+ $lines[] = $linePrefix . " " . self::$white . "治疗: " . self::$yellow . "{$ratio}x + {$base}" . self::$reset;
+ }
+
+ // 显示消耗
+ $cost = $spell['cost'] ?? 0;
+ $enhanceLevel = $spell['enhanceLevel'] ?? 0;
+ $actualCost = max(1, $cost - ($enhanceLevel * 2));
+ if ($enhanceLevel > 0) {
+ $lines[] = $linePrefix . " " . self::$white . "消耗: " . self::$yellow . "{$cost}" . self::$reset . " → " . self::$green . "{$actualCost}" . self::$reset;
+ } else {
+ $lines[] = $linePrefix . " " . self::$white . "消耗: " . self::$green . "{$actualCost}" . self::$reset;
+ }
+
+ return $lines;
+ }
+}
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/maps.php b/src/Data/maps.php
index b043cb3..67365bf 100644
--- a/src/Data/maps.php
+++ b/src/Data/maps.php
@@ -106,8 +106,11 @@ return [
'exp' => 10,
'spirit_stones' => 2,
'drops' => [
- ['type' => 'weapon', 'name' => '铁刀', 'rate' => 10] + $weaponTemplate,
- ['type' => 'consume', 'name' => '金疮药', 'rate' => 30, 'heal' => 30],
+ ['type' => 'weapon', 'name' => '铁刀', 'rate' => 25] + $weaponTemplate,
+ ['type' => 'consume', 'name' => '金疮药', 'rate' => 20, 'heal' => 30],
+ ],
+ 'spells' => [
+ ['id' => 10, 'name' => '柔拳', 'rate' => 25],
],
'weight' => 60,
],
@@ -122,9 +125,13 @@ return [
'exp' => 20,
'spirit_stones' => 5,
'drops' => [
- ['type' => 'armor', 'name' => '皮甲', 'rate' => 10] + $armorTemplate,
+ ['type' => 'armor', 'name' => '皮甲', 'rate' => 25] + $armorTemplate,
['type' => 'consume', 'name' => '黄龙丹', 'rate' => 25, 'heal' => 50],
],
+ 'spells' => [
+ ['id' => 10, 'name' => '刀气切割', 'rate' => 20],
+ ['id' => 20, 'name' => '寒冰爆裂', 'rate' => 25],
+ ],
'minions' => [
['name' => '野狼帮帮众', 'hp' => 30, 'patk' => 5, 'matk' => 2, 'pdef' => 0, 'mdef' => 0, 'exp' => 10, 'count' => 2],
],
@@ -141,12 +148,14 @@ return [
'exp' => 100,
'spirit_stones' => 20,
'drops' => [
- ['type' => 'weapon', 'name' => '眨眼剑法', 'quality' => 'rare', 'patk' => 15, 'rate' => 20],
- ['type' => 'necklace', 'name' => '长生锁', 'rate' => 15] + $necklaceTemplate,
+ ['type' => 'weapon', 'name' => '眨眼剑法', 'quality' => 'rare', 'patk' => 15, 'rate' => 15],
+ ['type' => 'necklace', 'name' => '长生锁', 'rate' => 20] + $necklaceTemplate,
['type' => 'consume', 'name' => '清灵散', 'rate' => 40, 'heal' => 80],
],
- 'minions' => [
- ['name' => '铁奴', 'hp' => 80, 'patk' => 12, 'pdef' => 8, 'exp' => 30, 'count' => 1],
+ 'spells' => [
+ ['id' => 1, 'name' => '妙手回春', 'rate' => 20],
+ ['id' => 2, 'name' => '舍身救人', 'rate' => 25],
+ ['id' => 30, 'name' => '集体治疗', 'rate' => 15],
],
'weight' => 10,
],
@@ -168,8 +177,12 @@ return [
'exp' => 35,
'spirit_stones' => 10,
'drops' => [
- ['type' => 'weapon', 'name' => '法器残片', 'rate' => 15] + $weaponTemplate,
- ['type' => 'consume', 'name' => '辟谷丹', 'rate' => 30, 'heal' => 60],
+ ['type' => 'weapon', 'name' => '法器残片', 'rate' => 20] + $weaponTemplate,
+ ['type' => 'consume', 'name' => '辟谷丹', 'rate' => 20, 'heal' => 60],
+ ],
+ 'spells' => [
+ ['id' => 10, 'name' => '初级火焰术', 'rate' => 20],
+ ['id' => 11, 'name' => '寒冰之术', 'rate' => 25],
],
'weight' => 50,
],
@@ -184,8 +197,12 @@ return [
'exp' => 50,
'spirit_stones' => 15,
'drops' => [
- ['type' => 'armor', 'name' => '青布衫', 'rate' => 15] + $armorTemplate,
- ['type' => 'boots', 'name' => '神行靴', 'rate' => 10] + $bootsTemplate,
+ ['type' => 'armor', 'name' => '青布衫', 'rate' => 20] + $armorTemplate,
+ ['type' => 'boots', 'name' => '神行靴', 'rate' => 25] + $bootsTemplate,
+ ],
+ 'spells' => [
+ ['id' => 10, 'name' => '火焰冲击', 'rate' => 20],
+ ['id' => 30, 'name' => '防护光环', 'rate' => 25],
],
'weight' => 35,
],
@@ -200,9 +217,15 @@ return [
'exp' => 150,
'spirit_stones' => 40,
'drops' => [
- ['type' => 'weapon', 'name' => '青叶法器', 'quality' => 'rare', 'matk' => 25, 'rate' => 20],
- ['type' => 'ring', 'name' => '储物戒', 'rate' => 15] + $ringTemplate,
- ['type' => 'consume', 'name' => '合气丹', 'rate' => 30, 'heal' => 100],
+ ['type' => 'weapon', 'name' => '青叶法器', 'quality' => 'rare', 'matk' => 25, 'rate' => 15],
+ ['type' => 'ring', 'name' => '储物戒', 'rate' => 20] + $ringTemplate,
+ ['type' => 'consume', 'name' => '合气丹', 'rate' => 20, 'heal' => 100],
+ ],
+ 'spells' => [
+ ['id' => 10, 'name' => '炎火术', 'rate' => 20],
+ ['id' => 11, 'name' => '冰魄术', 'rate' => 25],
+ ['id' => 12, 'name' => '雷刹术', 'rate' => 15],
+ ['id' => 20, 'name' => '冰暴术', 'rate' => 20],
],
'weight' => 15,
],
@@ -226,6 +249,10 @@ return [
'drops' => [
['type' => 'consume', 'name' => '紫猴花', 'rate' => 25, 'heal' => 120],
],
+ 'spells' => [
+ ['id' => 10, 'name' => '兽火喷射', 'rate' => 20],
+ ['id' => 20, 'name' => '野兽嚎叫', 'rate' => 25],
+ ],
'weight' => 50,
],
[
@@ -239,8 +266,13 @@ return [
'exp' => 80,
'spirit_stones' => 30,
'drops' => [
- ['type' => 'weapon', 'name' => '月刃', 'rate' => 15] + $weaponTemplate,
- ['type' => 'armor', 'name' => '掩月法袍', 'rate' => 15] + $armorTemplate,
+ ['type' => 'weapon', 'name' => '月刃', 'rate' => 20] + $weaponTemplate,
+ ['type' => 'armor', 'name' => '掩月法袍', 'rate' => 20] + $armorTemplate,
+ ],
+ 'spells' => [
+ ['id' => 11, 'name' => '月影冰术', 'rate' => 20],
+ ['id' => 20, 'name' => '月光雹', 'rate' => 25],
+ ['id' => 1, 'name' => '月华治愈', 'rate' => 15],
],
'weight' => 35,
],
@@ -255,10 +287,17 @@ return [
'exp' => 300,
'spirit_stones' => 100,
'drops' => [
- ['type' => 'weapon', 'name' => '金竺笔', 'quality' => 'epic', 'matk' => 45, 'rate' => 15],
- ['type' => 'armor', 'name' => '墨蛟甲', 'quality' => 'epic', 'pdef' => 20, 'mdef' => 15, 'rate' => 15],
+ ['type' => 'weapon', 'name' => '金竺笔', 'quality' => 'epic', 'matk' => 45, 'rate' => 20],
+ ['type' => 'armor', 'name' => '墨蛟甲', 'quality' => 'epic', 'pdef' => 20, 'mdef' => 15, 'rate' => 20],
['type' => 'consume', 'name' => '筑基丹', 'rate' => 50, 'heal' => 500],
],
+ 'spells' => [
+ ['id' => 11, 'name' => '墨液冰锥', 'rate' => 20],
+ ['id' => 20, 'name' => '墨蛟冰雹', 'rate' => 25],
+ ['id' => 22, 'name' => '墨影流星', 'rate' => 15],
+ ['id' => 30, 'name' => '蛟龙防御', 'rate' => 20],
+ ['id' => 1, 'name' => '生命恢复', 'rate' => 25],
+ ],
'weight' => 15,
],
],
@@ -282,8 +321,12 @@ return [
'exp' => 100,
'spirit_stones' => 30,
'drops' => [
- ['type' => 'weapon', 'name' => '黄枫剑', 'rate' => 15] + $weaponTemplate,
- ['type' => 'consume', 'name' => '黄龙丹', 'rate' => 30, 'heal' => 150],
+ ['type' => 'weapon', 'name' => '黄枫剑', 'rate' => 20] + $weaponTemplate,
+ ['type' => 'consume', 'name' => '黄龙丹', 'rate' => 20, 'heal' => 150],
+ ],
+ 'spells' => [
+ ['id' => 10, 'name' => '黄枫剑气', 'rate' => 20],
+ ['id' => 30, 'name' => '枫叶守护', 'rate' => 25],
],
'weight' => 50,
],
@@ -298,8 +341,13 @@ return [
'exp' => 140,
'spirit_stones' => 45,
'drops' => [
- ['type' => 'armor', 'name' => '执法甲', 'rate' => 15] + $armorTemplate,
- ['type' => 'boots', 'name' => '执法靴', 'rate' => 12] + $bootsTemplate,
+ ['type' => 'armor', 'name' => '执法甲', 'rate' => 20] + $armorTemplate,
+ ['type' => 'boots', 'name' => '执法靴', 'rate' => 20] + $bootsTemplate,
+ ],
+ 'spells' => [
+ ['id' => 10, 'name' => '执法烈火', 'rate' => 20],
+ ['id' => 20, 'name' => '冰雨惩罚', 'rate' => 25],
+ ['id' => 30, 'name' => '铁血护盾', 'rate' => 15],
],
'weight' => 35,
],
@@ -314,9 +362,16 @@ return [
'exp' => 400,
'spirit_stones' => 150,
'drops' => [
- ['type' => 'weapon', 'name' => '烈焰刀', 'quality' => 'epic', 'patk' => 50, 'matk' => 30, 'rate' => 20],
- ['type' => 'ring', 'name' => '传音符', 'rate' => 20] + $ringTemplate,
- ['type' => 'consume', 'name' => '定颜丹', 'rate' => 10, 'heal' => 800],
+ ['type' => 'weapon', 'name' => '烈焰刀', 'quality' => 'epic', 'patk' => 50, 'matk' => 30, 'rate' => 15],
+ ['type' => 'ring', 'name' => '传音符', 'rate' => 15] + $ringTemplate,
+ ['type' => 'consume', 'name' => '定颜丹', 'rate' => 25, 'heal' => 800],
+ ],
+ 'spells' => [
+ ['id' => 13, 'name' => '烈焰焚天', 'rate' => 20],
+ ['id' => 22, 'name' => '流星雨击', 'rate' => 25],
+ ['id' => 32, 'name' => '圣灵保护', 'rate' => 15],
+ ['id' => 1, 'name' => '疗伤术', 'rate' => 20],
+ ['id' => 30, 'name' => '大地庇护', 'rate' => 25],
],
'weight' => 15,
],
@@ -338,8 +393,12 @@ return [
'exp' => 180,
'spirit_stones' => 50,
'drops' => [
- ['type' => 'weapon', 'name' => '魔刃', 'rate' => 15] + $weaponTemplate,
- ['type' => 'consume', 'name' => '血煞丹', 'rate' => 30, 'heal' => 200],
+ ['type' => 'weapon', 'name' => '魔刃', 'rate' => 20] + $weaponTemplate,
+ ['type' => 'consume', 'name' => '血煞丹', 'rate' => 20, 'heal' => 200],
+ ],
+ 'spells' => [
+ ['id' => 10, 'name' => '邪火燎原', 'rate' => 20],
+ ['id' => 20, 'name' => '魔冰风暴', 'rate' => 25],
],
'weight' => 50,
],
@@ -354,8 +413,13 @@ return [
'exp' => 240,
'spirit_stones' => 70,
'drops' => [
- ['type' => 'armor', 'name' => '鬼灵衣', 'rate' => 15] + $armorTemplate,
- ['type' => 'necklace', 'name' => '聚魂珠', 'rate' => 12] + $necklaceTemplate,
+ ['type' => 'armor', 'name' => '鬼灵衣', 'rate' => 20] + $armorTemplate,
+ ['type' => 'necklace', 'name' => '聚魂珠', 'rate' => 20] + $necklaceTemplate,
+ ],
+ 'spells' => [
+ ['id' => 11, 'name' => '冥界冰刺', 'rate' => 20],
+ ['id' => 21, 'name' => '炎爆诅咒', 'rate' => 25],
+ ['id' => 34, 'name' => '幽冥护盾', 'rate' => 15],
],
'weight' => 35,
],
@@ -370,9 +434,16 @@ return [
'exp' => 600,
'spirit_stones' => 250,
'drops' => [
- ['type' => 'weapon', 'name' => '血灵钻', 'quality' => 'epic', 'matk' => 100, 'rate' => 20],
- ['type' => 'armor', 'name' => '血灵甲', 'quality' => 'epic', 'pdef' => 40, 'mdef' => 30, 'rate' => 20],
- ['type' => 'consume', 'name' => '血灵丹', 'rate' => 30, 'heal' => 1000],
+ ['type' => 'weapon', 'name' => '血灵钻', 'quality' => 'epic', 'matk' => 100, 'rate' => 15],
+ ['type' => 'armor', 'name' => '血灵甲', 'quality' => 'epic', 'pdef' => 40, 'mdef' => 30, 'rate' => 15],
+ ['type' => 'consume', 'name' => '血灵丹', 'rate' => 20, 'heal' => 1000],
+ ],
+ 'spells' => [
+ ['id' => 12, 'name' => '王蝉鸣雷', 'rate' => 20],
+ ['id' => 23, 'name' => '灭世风暴', 'rate' => 25],
+ ['id' => 24, 'name' => '末日火雨', 'rate' => 15],
+ ['id' => 35, 'name' => '血魔复生', 'rate' => 20],
+ ['id' => 4, 'name' => '生命泉涌', 'rate' => 25],
],
'weight' => 15,
],
@@ -394,8 +465,12 @@ return [
'exp' => 350,
'spirit_stones' => 90,
'drops' => [
- ['type' => 'weapon', 'name' => '金瓜锤', 'rate' => 15] + $weaponTemplate,
- ['type' => 'armor', 'name' => '金甲', 'rate' => 15] + $armorTemplate,
+ ['type' => 'weapon', 'name' => '金瓜锤', 'rate' => 20] + $weaponTemplate,
+ ['type' => 'armor', 'name' => '金甲', 'rate' => 20] + $armorTemplate,
+ ],
+ 'spells' => [
+ ['id' => 13, 'name' => '帝王烈焰', 'rate' => 20],
+ ['id' => 30, 'name' => '皇权庇护', 'rate' => 25],
],
'weight' => 50,
],
@@ -411,7 +486,12 @@ return [
'spirit_stones' => 120,
'drops' => [
['type' => 'weapon', 'name' => '血刀', 'rate' => 18] + $weaponTemplate,
- ['type' => 'consume', 'name' => '狂暴丹', 'rate' => 30, 'heal' => 400],
+ ['type' => 'consume', 'name' => '狂暴丹', 'rate' => 20, 'heal' => 400],
+ ],
+ 'spells' => [
+ ['id' => 14, 'name' => '诛仙剑气', 'rate' => 20],
+ ['id' => 24, 'name' => '末日炼狱', 'rate' => 25],
+ ['id' => 35, 'name' => '血魂同盟', 'rate' => 15],
],
'weight' => 35,
],
@@ -426,9 +506,16 @@ return [
'exp' => 1000,
'spirit_stones' => 400,
'drops' => [
- ['type' => 'weapon', 'name' => '青元剑', 'quality' => 'legendary', 'patk' => 100, 'matk' => 80, 'rate' => 15],
- ['type' => 'consume', 'name' => '虚天鼎碎片', 'rate' => 10, 'heal' => 2000], // 剧情物品作为高回复药
- ['type' => 'ring', 'name' => '黑煞戒', 'rate' => 20] + $ringTemplate,
+ ['type' => 'weapon', 'name' => '青元剑', 'quality' => 'legendary', 'patk' => 100, 'matk' => 80, 'rate' => 20],
+ ['type' => 'consume', 'name' => '虚天鼎碎片', 'rate' => 25, 'heal' => 2000], // 剧情物品作为高回复药
+ ['type' => 'ring', 'name' => '黑煞戒', 'rate' => 15] + $ringTemplate,
+ ],
+ 'spells' => [
+ ['id' => 15, 'name' => '狂暴邪斩', 'rate' => 20],
+ ['id' => 25, 'name' => '狂风灭世', 'rate' => 25],
+ ['id' => 33, 'name' => '仙界诅咒', 'rate' => 15],
+ ['id' => 35, 'name' => '血煞永生', 'rate' => 20],
+ ['id' => 6, 'name' => '暗夜疗愈', 'rate' => 25],
],
'weight' => 15,
],
@@ -453,8 +540,12 @@ return [
'exp' => 600,
'spirit_stones' => 150,
'drops' => [
- ['type' => 'weapon', 'name' => '骨棒', 'rate' => 15] + $weaponTemplate,
- ['type' => 'consume', 'name' => '海灵液', 'rate' => 30, 'heal' => 500],
+ ['type' => 'weapon', 'name' => '骨棒', 'rate' => 20] + $weaponTemplate,
+ ['type' => 'consume', 'name' => '海灵液', 'rate' => 20, 'heal' => 500],
+ ],
+ 'spells' => [
+ ['id' => 20, 'name' => '海洋冰雹', 'rate' => 20],
+ ['id' => 25, 'name' => '波涛斩击', 'rate' => 25],
],
'weight' => 50,
],
@@ -469,8 +560,12 @@ return [
'exp' => 800,
'spirit_stones' => 200,
'drops' => [
- ['type' => 'armor', 'name' => '鱼鳞甲', 'rate' => 15] + $armorTemplate,
- ['type' => 'necklace', 'name' => '避水珠', 'rate' => 12] + $necklaceTemplate,
+ ['type' => 'armor', 'name' => '鱼鳞甲', 'rate' => 20] + $armorTemplate,
+ ['type' => 'necklace', 'name' => '避水珠', 'rate' => 20] + $necklaceTemplate,
+ ],
+ 'spells' => [
+ ['id' => 21, 'name' => '炎爆水雾', 'rate' => 20],
+ ['id' => 30, 'name' => '水灵庇护', 'rate' => 25],
],
'weight' => 35,
],
@@ -485,10 +580,16 @@ return [
'exp' => 1500,
'spirit_stones' => 600,
'drops' => [
- ['type' => 'weapon', 'name' => '引魂钟', 'quality' => 'epic', 'matk' => 200, 'rate' => 20],
- ['type' => 'boots', 'name' => '踏浪靴', 'rate' => 15] + $bootsTemplate,
+ ['type' => 'weapon', 'name' => '引魂钟', 'quality' => 'epic', 'matk' => 200, 'rate' => 15],
+ ['type' => 'boots', 'name' => '踏浪靴', 'rate' => 20] + $bootsTemplate,
['type' => 'consume', 'name' => '降尘丹', 'rate' => 25, 'heal' => 1500],
],
+ 'spells' => [
+ ['id' => 22, 'name' => '水系流星', 'rate' => 20],
+ ['id' => 23, 'name' => '沧海风暴', 'rate' => 25],
+ ['id' => 35, 'name' => '灵魂共鸣', 'rate' => 15],
+ ['id' => 31, 'name' => '海王光环', 'rate' => 20],
+ ],
'weight' => 15,
],
],
@@ -509,8 +610,12 @@ return [
'exp' => 1000,
'spirit_stones' => 300,
'drops' => [
- ['type' => 'weapon', 'name' => '傀儡弓', 'rate' => 15] + $weaponTemplate,
- ['type' => 'consume', 'name' => '灵石乳', 'rate' => 30, 'heal' => 800],
+ ['type' => 'weapon', 'name' => '傀儡弓', 'rate' => 20] + $weaponTemplate,
+ ['type' => 'consume', 'name' => '灵石乳', 'rate' => 20, 'heal' => 800],
+ ],
+ 'spells' => [
+ ['id' => 12, 'name' => '傀儡雷击', 'rate' => 20],
+ ['id' => 30, 'name' => '机械护盾', 'rate' => 25],
],
'weight' => 50,
],
@@ -525,8 +630,13 @@ return [
'exp' => 1400,
'spirit_stones' => 450,
'drops' => [
- ['type' => 'armor', 'name' => '灵力护盾', 'rate' => 15] + $armorTemplate,
- ['type' => 'ring', 'name' => '分身戒', 'rate' => 12] + $ringTemplate,
+ ['type' => 'armor', 'name' => '灵力护盾', 'rate' => 20] + $armorTemplate,
+ ['type' => 'ring', 'name' => '分身戒', 'rate' => 20] + $ringTemplate,
+ ],
+ 'spells' => [
+ ['id' => 14, 'name' => '剑仙降临', 'rate' => 20],
+ ['id' => 23, 'name' => '灭世寂灭', 'rate' => 25],
+ ['id' => 32, 'name' => '圣灵恩惠', 'rate' => 15],
],
'weight' => 35,
],
@@ -541,10 +651,17 @@ return [
'exp' => 2500,
'spirit_stones' => 1000,
'drops' => [
- ['type' => 'weapon', 'name' => '天都尸火', 'quality' => 'legendary', 'matk' => 300, 'rate' => 15],
- ['type' => 'consume', 'name' => '补天丹', 'rate' => 10, 'heal' => 3000],
+ ['type' => 'weapon', 'name' => '天都尸火', 'quality' => 'legendary', 'matk' => 300, 'rate' => 20],
+ ['type' => 'consume', 'name' => '补天丹', 'rate' => 25, 'heal' => 3000],
['type' => 'necklace', 'name' => '虚天鼎', 'quality' => 'legendary', 'hp' => 2000, 'rate' => 5],
],
+ 'spells' => [
+ ['id' => 15, 'name' => '极阴邪斩', 'rate' => 20],
+ ['id' => 24, 'name' => '末世冰狱', 'rate' => 25],
+ ['id' => 33, 'name' => '仙界救赎', 'rate' => 15],
+ ['id' => 35, 'name' => '永恒诅咒', 'rate' => 20],
+ ['id' => 3, 'name' => '活力恢复', 'rate' => 25],
+ ],
'weight' => 15,
],
],
@@ -565,9 +682,13 @@ return [
'exp' => 1800,
'spirit_stones' => 600,
'drops' => [
- ['type' => 'weapon', 'name' => '妖骨剑', 'rate' => 15] + $weaponTemplate,
+ ['type' => 'weapon', 'name' => '妖骨剑', 'rate' => 20] + $weaponTemplate,
['type' => 'consume', 'name' => '妖丹', 'rate' => 40, 'heal' => 1000],
],
+ 'spells' => [
+ ['id' => 11, 'name' => '妖冰刃', 'rate' => 20],
+ ['id' => 20, 'name' => '妖兽雹', 'rate' => 25],
+ ],
'weight' => 50,
],
[
@@ -581,8 +702,13 @@ return [
'exp' => 2200,
'spirit_stones' => 800,
'drops' => [
- ['type' => 'armor', 'name' => '雷鲸皮', 'rate' => 15] + $armorTemplate,
- ['type' => 'boots', 'name' => '风雷靴', 'rate' => 12] + $bootsTemplate,
+ ['type' => 'armor', 'name' => '雷鲸皮', 'rate' => 20] + $armorTemplate,
+ ['type' => 'boots', 'name' => '风雷靴', 'rate' => 20] + $bootsTemplate,
+ ],
+ 'spells' => [
+ ['id' => 12, 'name' => '雷鲸怒雷', 'rate' => 20],
+ ['id' => 21, 'name' => '风暴洪流', 'rate' => 25],
+ ['id' => 34, 'name' => '深海护盾', 'rate' => 15],
],
'weight' => 35,
],
@@ -597,9 +723,16 @@ return [
'exp' => 4000,
'spirit_stones' => 1500,
'drops' => [
- ['type' => 'weapon', 'name' => '金蛟剪', 'quality' => 'legendary', 'patk' => 300, 'matk' => 200, 'rate' => 15],
- ['type' => 'armor', 'name' => '金蛟鳞甲', 'quality' => 'legendary', 'pdef' => 180, 'mdef' => 120, 'rate' => 15],
- ['type' => 'consume', 'name' => '九曲灵参', 'rate' => 10, 'heal' => 5000],
+ ['type' => 'weapon', 'name' => '金蛟剪', 'quality' => 'legendary', 'patk' => 300, 'matk' => 200, 'rate' => 20],
+ ['type' => 'armor', 'name' => '金蛟鳞甲', 'quality' => 'legendary', 'pdef' => 180, 'mdef' => 120, 'rate' => 20],
+ ['type' => 'consume', 'name' => '九曲灵参', 'rate' => 25, 'heal' => 5000],
+ ],
+ 'spells' => [
+ ['id' => 15, 'name' => '蛟龙狂暴', 'rate' => 20],
+ ['id' => 25, 'name' => '雷风灭世', 'rate' => 25],
+ ['id' => 33, 'name' => '龙王救赎', 'rate' => 15],
+ ['id' => 35, 'name' => '蛟龙之力', 'rate' => 20],
+ ['id' => 2, 'name' => '生命转移', 'rate' => 25],
],
'weight' => 15,
],
@@ -624,8 +757,12 @@ return [
'exp' => 2500,
'spirit_stones' => 800,
'drops' => [
- ['type' => 'weapon', 'name' => '狼牙匕', 'rate' => 15] + $weaponTemplate,
- ['type' => 'consume', 'name' => '灵液', 'rate' => 30, 'heal' => 1200],
+ ['type' => 'weapon', 'name' => '狼牙匕', 'rate' => 20] + $weaponTemplate,
+ ['type' => 'consume', 'name' => '灵液', 'rate' => 20, 'heal' => 1200],
+ ],
+ 'spells' => [
+ ['id' => 10, 'name' => '狼焰咆哮', 'rate' => 20],
+ ['id' => 20, 'name' => '月光寒冰', 'rate' => 25],
],
'weight' => 50,
],
@@ -640,8 +777,13 @@ return [
'exp' => 3000,
'spirit_stones' => 1000,
'drops' => [
- ['type' => 'armor', 'name' => '长老法袍', 'rate' => 15] + $armorTemplate,
- ['type' => 'ring', 'name' => '长老戒', 'rate' => 12] + $ringTemplate,
+ ['type' => 'armor', 'name' => '长老法袍', 'rate' => 20] + $armorTemplate,
+ ['type' => 'ring', 'name' => '长老戒', 'rate' => 20] + $ringTemplate,
+ ],
+ 'spells' => [
+ ['id' => 13, 'name' => '长老烈焰', 'rate' => 20],
+ ['id' => 22, 'name' => '宗门流星', 'rate' => 25],
+ ['id' => 31, 'name' => '宗门护盾', 'rate' => 15],
],
'weight' => 35,
],
@@ -656,10 +798,17 @@ return [
'exp' => 5000,
'spirit_stones' => 2000,
'drops' => [
- ['type' => 'weapon', 'name' => '落云剑', 'quality' => 'epic', 'patk' => 350, 'matk' => 250, 'rate' => 20],
- ['type' => 'necklace', 'name' => '定魂珠', 'rate' => 15] + $necklaceTemplate,
+ ['type' => 'weapon', 'name' => '落云剑', 'quality' => 'epic', 'patk' => 350, 'matk' => 250, 'rate' => 15],
+ ['type' => 'necklace', 'name' => '定魂珠', 'rate' => 20] + $necklaceTemplate,
['type' => 'consume', 'name' => '培婴丹', 'rate' => 25, 'heal' => 3000],
],
+ 'spells' => [
+ ['id' => 14, 'name' => '剑仙之意', 'rate' => 20],
+ ['id' => 24, 'name' => '风云诀', 'rate' => 25],
+ ['id' => 33, 'name' => '救赎之力', 'rate' => 15],
+ ['id' => 2, 'name' => '生命同盟', 'rate' => 20],
+ ['id' => 32, 'name' => '圣灵护佑', 'rate' => 25],
+ ],
'weight' => 15,
],
],
@@ -680,8 +829,12 @@ return [
'exp' => 4000,
'spirit_stones' => 1200,
'drops' => [
- ['type' => 'weapon', 'name' => '魔魂刀', 'rate' => 15] + $weaponTemplate,
- ['type' => 'consume', 'name' => '魔髓钻', 'rate' => 20, 'heal' => 2000],
+ ['type' => 'weapon', 'name' => '魔魂刀', 'rate' => 20] + $weaponTemplate,
+ ['type' => 'consume', 'name' => '魔髓钻', 'rate' => 15, 'heal' => 2000],
+ ],
+ 'spells' => [
+ ['id' => 14, 'name' => '古魔剑意', 'rate' => 20],
+ ['id' => 21, 'name' => '魔火爆裂', 'rate' => 25],
],
'weight' => 50,
],
@@ -696,8 +849,13 @@ return [
'exp' => 5000,
'spirit_stones' => 1500,
'drops' => [
- ['type' => 'armor', 'name' => '太乙银精甲', 'rate' => 15] + $armorTemplate,
- ['type' => 'boots', 'name' => '虚空靴', 'rate' => 12] + $bootsTemplate,
+ ['type' => 'armor', 'name' => '太乙银精甲', 'rate' => 20] + $armorTemplate,
+ ['type' => 'boots', 'name' => '虚空靴', 'rate' => 20] + $bootsTemplate,
+ ],
+ 'spells' => [
+ ['id' => 23, 'name' => '空间风暴', 'rate' => 20],
+ ['id' => 35, 'name' => '虚空之力', 'rate' => 25],
+ ['id' => 30, 'name' => '空间护盾', 'rate' => 15],
],
'weight' => 35,
],
@@ -712,9 +870,16 @@ return [
'exp' => 10000,
'spirit_stones' => 5000,
'drops' => [
- ['type' => 'weapon', 'name' => '黑风旗', 'quality' => 'legendary', 'matk' => 800, 'rate' => 15],
- ['type' => 'armor', 'name' => '魔龙甲', 'quality' => 'legendary', 'pdef' => 350, 'mdef' => 250, 'rate' => 15],
- ['type' => 'consume', 'name' => '万年灵乳', 'rate' => 20, 'heal' => 8000],
+ ['type' => 'weapon', 'name' => '黑风旗', 'quality' => 'legendary', 'matk' => 800, 'rate' => 20],
+ ['type' => 'armor', 'name' => '魔龙甲', 'quality' => 'legendary', 'pdef' => 350, 'mdef' => 250, 'rate' => 20],
+ ['type' => 'consume', 'name' => '万年灵乳', 'rate' => 15, 'heal' => 8000],
+ ],
+ 'spells' => [
+ ['id' => 15, 'name' => '古魔灭世', 'rate' => 20],
+ ['id' => 25, 'name' => '狂风魔力', 'rate' => 25],
+ ['id' => 34, 'name' => '古魔护盾', 'rate' => 15],
+ ['id' => 35, 'name' => '魔界永恒', 'rate' => 20],
+ ['id' => 4, 'name' => '魔泉生命', 'rate' => 25],
],
'weight' => 15,
],
@@ -739,8 +904,12 @@ return [
'exp' => 6000,
'spirit_stones' => 2000,
'drops' => [
- ['type' => 'weapon', 'name' => '晶砖', 'rate' => 15] + $weaponTemplate,
- ['type' => 'consume', 'name' => '灵烛果', 'rate' => 30, 'heal' => 3000],
+ ['type' => 'weapon', 'name' => '晶砖', 'rate' => 20] + $weaponTemplate,
+ ['type' => 'consume', 'name' => '灵烛果', 'rate' => 20, 'heal' => 3000],
+ ],
+ 'spells' => [
+ ['id' => 13, 'name' => '晶体烈焰', 'rate' => 20],
+ ['id' => 20, 'name' => '灵山冰雹', 'rate' => 25],
],
'weight' => 50,
],
@@ -755,8 +924,13 @@ return [
'exp' => 8000,
'spirit_stones' => 3000,
'drops' => [
- ['type' => 'armor', 'name' => '银翅甲', 'rate' => 15] + $armorTemplate,
- ['type' => 'necklace', 'name' => '夜叉链', 'rate' => 12] + $necklaceTemplate,
+ ['type' => 'armor', 'name' => '银翅甲', 'rate' => 20] + $armorTemplate,
+ ['type' => 'necklace', 'name' => '夜叉链', 'rate' => 20] + $necklaceTemplate,
+ ],
+ 'spells' => [
+ ['id' => 14, 'name' => '夜叉剑术', 'rate' => 20],
+ ['id' => 23, 'name' => '虚空风暴', 'rate' => 25],
+ ['id' => 35, 'name' => '天罚之力', 'rate' => 15],
],
'weight' => 35,
],
@@ -771,9 +945,16 @@ return [
'exp' => 15000,
'spirit_stones' => 8000,
'drops' => [
- ['type' => 'weapon', 'name' => '八灵尺', 'quality' => 'legendary', 'matk' => 1200, 'rate' => 15],
- ['type' => 'ring', 'name' => '雪晶珠', 'quality' => 'legendary', 'crit' => 15, 'rate' => 15],
- ['type' => 'consume', 'name' => '回阳水', 'rate' => 10, 'heal' => 10000],
+ ['type' => 'weapon', 'name' => '八灵尺', 'quality' => 'legendary', 'matk' => 1200, 'rate' => 20],
+ ['type' => 'ring', 'name' => '雪晶珠', 'quality' => 'legendary', 'crit' => 15, 'rate' => 20],
+ ['type' => 'consume', 'name' => '回阳水', 'rate' => 25, 'heal' => 10000],
+ ],
+ 'spells' => [
+ ['id' => 15, 'name' => '元刹灭世', 'rate' => 20],
+ ['id' => 25, 'name' => '永恒灭亡', 'rate' => 25],
+ ['id' => 33, 'name' => '圣祖救赎', 'rate' => 15],
+ ['id' => 34, 'name' => '永生护盾', 'rate' => 20],
+ ['id' => 5, 'name' => '暴击疗愈', 'rate' => 25],
],
'weight' => 15,
],
@@ -795,8 +976,12 @@ return [
'exp' => 9000,
'spirit_stones' => 3500,
'drops' => [
- ['type' => 'weapon', 'name' => '虚空爪', 'rate' => 15] + $weaponTemplate,
- ['type' => 'boots', 'name' => '破空靴', 'rate' => 12] + $bootsTemplate,
+ ['type' => 'weapon', 'name' => '虚空爪', 'rate' => 20] + $weaponTemplate,
+ ['type' => 'boots', 'name' => '破空靴', 'rate' => 20] + $bootsTemplate,
+ ],
+ 'spells' => [
+ ['id' => 12, 'name' => '虚空雷击', 'rate' => 20],
+ ['id' => 20, 'name' => '虚空冰雹', 'rate' => 25],
],
'weight' => 50,
],
@@ -811,8 +996,13 @@ return [
'exp' => 11000,
'spirit_stones' => 4500,
'drops' => [
- ['type' => 'armor', 'name' => '风暴甲', 'rate' => 15] + $armorTemplate,
- ['type' => 'consume', 'name' => '空间晶石', 'rate' => 30, 'heal' => 5000],
+ ['type' => 'armor', 'name' => '风暴甲', 'rate' => 20] + $armorTemplate,
+ ['type' => 'consume', 'name' => '空间晶石', 'rate' => 20, 'heal' => 5000],
+ ],
+ 'spells' => [
+ ['id' => 23, 'name' => '灭世空间', 'rate' => 20],
+ ['id' => 25, 'name' => '永恒风暴', 'rate' => 25],
+ ['id' => 35, 'name' => '空间之力', 'rate' => 15],
],
'weight' => 35,
],
@@ -827,9 +1017,16 @@ return [
'exp' => 30000,
'spirit_stones' => 15000,
'drops' => [
- ['type' => 'weapon', 'name' => '青竹蜂云剑', 'quality' => 'legendary', 'patk' => 1500, 'matk' => 1000, 'rate' => 20],
- ['type' => 'armor', 'name' => '五行甲', 'quality' => 'legendary', 'pdef' => 1000, 'mdef' => 1000, 'rate' => 20],
- ['type' => 'consume', 'name' => '飞升令', 'rate' => 100, 'heal' => 99999], // 象征性物品
+ ['type' => 'weapon', 'name' => '青竹蜂云剑', 'quality' => 'legendary', 'patk' => 1500, 'matk' => 1000, 'rate' => 15],
+ ['type' => 'armor', 'name' => '五行甲', 'quality' => 'legendary', 'pdef' => 1000, 'mdef' => 1000, 'rate' => 15],
+ ['type' => 'consume', 'name' => '飞升令', 'rate' => 25, 'heal' => 99999], // 象征性物品
+ ],
+ 'spells' => [
+ ['id' => 15, 'name' => '凤凰灭世', 'rate' => 20],
+ ['id' => 25, 'name' => '冰凤风暴', 'rate' => 25],
+ ['id' => 33, 'name' => '永恒救赎', 'rate' => 15],
+ ['id' => 35, 'name' => '凤凰之力', 'rate' => 20],
+ ['id' => 6, 'name' => '援护之术', 'rate' => 25],
],
'weight' => 15,
],
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 413038a..0ebb4af 100644
--- a/src/Entities/Monster.php
+++ b/src/Entities/Monster.php
@@ -17,6 +17,9 @@ class Monster extends Actor
// Monster特有的掉落表
public array $dropTable = [];
+ // Monster穿着的法术(类似 $equip)
+ public array $spells = [];
+
public static function create(int $dungeonId): self
{
// Load data
@@ -146,7 +149,7 @@ class Monster extends Actor
// 根据等级和基础属性分配天赋点
$this->allocateTalentsByLevel();
- // Drops & Equipment
+ // Drops & Equipment & Spells
$drops = $config['drops'] ?? [];
foreach ($drops as $drop) {
$type = $drop['type'] ?? '';
@@ -162,47 +165,6 @@ class Monster extends Actor
];
continue;
}
-
- if ($type === 'spell') {
- // Chance to include this spell tome in drop table
- if (rand(1, 100) > $rate) continue;
-
- // spell drop spec should include 'spell_id' (or 'id') to identify the spell
- $spellId = $drop['spell_id'] ?? ($drop['id'] ?? null);
- if ($spellId !== null) {
- static $spellsData = null;
- if ($spellsData === null) {
- $spellsData = require __DIR__ . '/../../src/Data/spells.php';
- }
-
- $spellInfo = null;
- foreach ($spellsData as $cat => $list) {
- if (!is_array($list) || in_array($cat, ['quality_levels','upgrades'])) continue;
- if (isset($list[$spellId])) { $spellInfo = $list[$spellId]; break; }
- }
-
- // Scale tome level by monster level (e.g., level tiers of 5)
- $tomeLevel = max(1, min(10, (int)ceil($this->level / 5)));
-
- $tome = [
- 'name' => ($spellInfo['name'] ?? ('法术#' . $spellId)) . '的法术书',
- 'type' => 'spell_tome',
- 'quality' => $spellInfo['quality'] ?? ($drop['quality'] ?? 'common'),
- 'level' => $tomeLevel,
- 'spell_id' => $spellId,
- 'spell_name' => $spellInfo['name'] ?? null,
- 'desc' => $drop['desc'] ?? ('能够学习或提升 ' . ($spellInfo['name'] ?? '未知法术')),
- ];
-
- // Add to drop table with given rate
- $this->dropTable[] = [
- 'item' => $tome,
- 'rate' => $rate,
- ];
- }
- continue;
- }
-
if (in_array($type, ['weapon', 'armor', 'boots', 'ring', 'necklace'])) {
if (rand(1, 100) > $rate) continue;
$spec = $drop;
@@ -212,46 +174,73 @@ class Monster extends Actor
}
}
- $this->applyEquipmentStats();
+ // 为怪物配置法术
+ $this->generateSpells($config);
+
}
/**
- * 应用装备属性加成到怪物属性
+ * 为怪物随机生成法术(穿着法术,类似装备)
+ * 配置示例 1: 'spells' => [1, 3, 10] - 随机从这些法术ID中选择
+ * 配置示例 2: 'spells' => [
+ * ['id' => 1, 'name' => '治愈术'],
+ * ['id' => 10, 'name' => '火焰术'],
+ * ['id' => 30, 'name' => '防御法术'],
+ * ] - 为怪物分配具体的法术(可选指定名称)
*/
- // Monster-specific application of equipment is handled by Actor::getStats; applyEquipmentStats remains for legacy callers
- public function applyEquipmentStats(): void
+ private function generateSpells(array $config): void
{
- $this->hp = $this->baseHp;
- $this->patk = $this->basePatk;
- $this->matk = $this->baseMatk;
- $this->pdef = $this->basePdef;
- $this->mdef = $this->baseMdef;
+ $spellConfigs = $config['spells'] ?? [];
- 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;
+ if (empty($spellConfigs)) {
+ return;
}
- }
- /**
- * 获取怪物装备的物品列表(用于战斗胜利时掉落)
- * @return array
- */
- public function getEquippedItems(): array
- {
- $items = [];
- foreach ($this->equip as $item) {
- if (!empty($item)) {
- $items[] = $item;
+ static $spellsData = null;
+ if ($spellsData === null) {
+ $spellsData = require __DIR__ . '/../../src/Data/spells.php';
+ }
+
+ // 处理两种配置格式
+ $selectedSpells = [];
+
+ // 格式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%掉落概率
+ ];
}
}
- return $items;
+
+ foreach ($selectedSpells as $spellConfig) {
+ $spellId = $spellConfig['id'];
+ $customName = $spellConfig['name'] ?? null;
+ $dropRate = $spellConfig['rate'] ?? 30;
+
+ // 随机决定法术品质:70% 普通, 20% 稀有, 8% 史诗, 2% 传奇
+ $roll = rand(1, 100);
+ if ($roll <= 70) $quality = 'common';
+ elseif ($roll <= 90) $quality = 'rare';
+ elseif ($roll <= 98) $quality = 'epic';
+ else $quality = 'legendary';
+
+ // 创建法术物品
+ $spell = Item::createSpell($spellId, $quality, $this->level);
+
+ // 如果提供了自定义名称,则覆盖默认名称
+ if ($customName) {
+ $spell['name'] = $customName;
+ }
+
+ // 添加掉落概率信息到法术对象
+ $spell['dropRate'] = $dropRate;
+
+ // 存储到 spells 数组
+ $this->spells[] = $spell;
+ }
}
/**
@@ -273,6 +262,29 @@ class Monster extends Actor
return $drops;
}
+ /**
+ * 随机掉落法术(从穿着的法术随机掉落)
+ * 使用每个法术配置的掉落概率,如果未指定则使用默认值
+ * @param int $defaultRate 默认掉落概率(0-100),当法术未指定rate时使用
+ * @return array 掉落的法术列表
+ */
+ public function getRandomSpellDrops(int $defaultRate = 50): array
+ {
+ $drops = [];
+ foreach ($this->spells as $spell) {
+ if (!empty($spell)) {
+ // 优先使用法术配置的掉落概率,否则使用默认值
+ $spellDropRate = $spell['dropRate'] ?? $defaultRate;
+
+ // 每个法术有独立的掉落概率
+ if (rand(1, 100) <= $spellDropRate) {
+ $drops[] = $spell;
+ }
+ }
+ }
+ return $drops;
+ }
+
/**
* 根据等级和基础属性分配天赋点和权重
* 怪物根据等级获得天赋点,并按基础属性的占比分配权重
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/Battle.php b/src/Modules/Battle.php
index 8442fcf..e4d611e 100644
--- a/src/Modules/Battle.php
+++ b/src/Modules/Battle.php
@@ -5,6 +5,7 @@ use Game\Core\Game;
use Game\Core\Input;
use Game\Core\Screen;
use Game\Core\ItemDisplay;
+use Game\Core\SpellDisplay;
use Game\Core\Colors;
use Game\Entities\Player;
use Game\Entities\Actor;
@@ -387,7 +388,7 @@ class Battle
// 消耗魔法值
$this->player->spendMana($actualCost);
- // 计算强化加成: 每级 +5% 伤害
+ // 计算强化加成: 每级 +5% 伤害或治疗
$damageBonus = $enhanceLevel * 5;
$type = $spellItem['spellType'] ?? 'damage_single';
@@ -401,7 +402,12 @@ class Battle
return $this->castDamageSingleSpell($out, 0, $spellInfo, $stats, $damageBonus, $name);
} elseif ($type === 'damage_aoe') {
return $this->castDamageAoeSpell($out, 0, $spellInfo, $stats, $damageBonus, $name);
+ } elseif ($type === 'heal_single') {
+ return $this->castHealSingleSpell($out, $spellInfo, $stats, $damageBonus, $name);
+ } elseif ($type === 'heal_aoe') {
+ return $this->castHealAoeSpell($out, $spellInfo, $stats, $damageBonus, $name);
} elseif ($type === 'support') {
+ // 兼容旧版本的 support 类型
return $this->castSupportSpell($out, $spellInfo, $stats, $name);
}
@@ -424,8 +430,16 @@ class Battle
if (!$target) return true;
+ // 显示法术基础信息
+ $calcType = $spellInfo['calc_type'] ?? 'matk';
+ $calcDesc = SpellDisplay::getCalcTypeDescription($calcType);
+ $cost = $spellInfo['cost'] ?? 20;
+ $actualCost = max(1, $cost - (($spellInfo['enhanceLevel'] ?? 0) * 2));
+ $quality = $spellInfo['quality'] ?? 'common';
+ $qualityColor = SpellDisplay::getQualityColor($quality);
+
// 计算法术伤害
- $baseDamageMultiplier = $spellInfo['damage'] ?? 1.0;
+ $baseDamageMultiplier = $spellInfo['damage_ratio'][$this->getQualityIndex($quality)] ?? ($spellInfo['damage'] ?? 1.0);
$actualDamageMultiplier = $baseDamageMultiplier * (1 + $damageBonus / 100);
$baseDamage = (int)($stats['matk'] * $actualDamageMultiplier);
@@ -437,14 +451,16 @@ class Battle
$critRate = $stats['crit'];
$isCrit = rand(1, 100) <= $critRate;
+ // 显示法术施放信息
+ $out->writeln("{$this->cyan}║{$this->reset} {$this->magenta}✦{$this->reset} 你施放 {$qualityColor}{$name}{$this->reset}");
+ $out->writeln("{$this->cyan}║{$this->reset} {$this->white}计算方式: {$calcDesc} | 消耗: {$actualCost} | 倍数: {$baseDamageMultiplier}x{$this->reset}");
+
if ($isCrit) {
$critDmg = $stats['critdmg'];
$damage = (int)($damage * ($critDmg / 100));
- $out->writeln("{$this->cyan}║{$this->reset} {$this->magenta}✦{$this->reset} 你施放 {$name}... {$this->red}{$this->bold}暴击!{$this->reset}");
- $out->writeln("{$this->cyan}║{$this->reset} {$this->magenta}✨ 造成 {$damage} 点魔法伤害!{$this->reset}");
+ $out->writeln("{$this->cyan}║{$this->reset} {$this->magenta}✨ {$this->red}{$this->bold}暴击!{$this->reset} 造成 {$this->red}{$damage}{$this->reset} 点魔法伤害!");
} else {
- $out->writeln("{$this->cyan}║{$this->reset} {$this->magenta}✦{$this->reset} 你施放 {$name}...");
- $out->writeln("{$this->cyan}║{$this->reset} {$this->magenta}✨ 造成 {$damage} 点魔法伤害{$this->reset}");
+ $out->writeln("{$this->cyan}║{$this->reset} {$this->magenta}✨ 造成 {$this->green}{$damage}{$this->reset} 点魔法伤害");
}
$target->hp -= $damage;
@@ -468,11 +484,20 @@ class Battle
*/
private function castDamageAoeSpell($out, int $spellId, array $spellInfo, array $stats, int $damageBonus, string $name): bool
{
- $out->writeln("{$this->cyan}║{$this->reset} {$this->magenta}✦{$this->reset} 你施放 {$name}...");
+ // 显示法术基础信息
+ $calcType = $spellInfo['calc_type'] ?? 'matk';
+ $calcDesc = SpellDisplay::getCalcTypeDescription($calcType);
+ $cost = $spellInfo['cost'] ?? 20;
+ $actualCost = max(1, $cost - (($spellInfo['enhanceLevel'] ?? 0) * 2));
+ $quality = $spellInfo['quality'] ?? 'common';
+ $qualityColor = SpellDisplay::getQualityColor($quality);
+
+ $out->writeln("{$this->cyan}║{$this->reset} {$this->magenta}✦{$this->reset} 你施放 {$qualityColor}{$name}{$this->reset}");
+ $out->writeln("{$this->cyan}║{$this->reset} {$this->white}计算方式: {$calcDesc} | 消耗: {$actualCost}{$this->reset}");
$out->writeln("{$this->cyan}║{$this->reset} {$this->magenta}✨ 魔法在整个战场爆炸!{$this->reset}");
// 计算法术伤害
- $baseDamageMultiplier = $spellInfo['damage'] ?? 0.8;
+ $baseDamageMultiplier = $spellInfo['damage_ratio'][$this->getQualityIndex($quality)] ?? ($spellInfo['damage'] ?? 0.8);
$actualDamageMultiplier = $baseDamageMultiplier * (1 + $damageBonus / 100);
$allEnemiesDefeated = true;
@@ -511,13 +536,90 @@ class Battle
return false;
}
+ /**
+ * 施放单体治疗法术
+ */
+ private function castHealSingleSpell($out, array $spellInfo, array $stats, int $healBonus, string $name): bool
+ {
+ // 显示法术基础信息
+ $calcType = $spellInfo['calc_type'] ?? 'matk';
+ $calcDesc = SpellDisplay::getCalcTypeDescription($calcType);
+ $cost = $spellInfo['cost'] ?? 20;
+ $quality = $spellInfo['quality'] ?? 'common';
+ $qualityColor = SpellDisplay::getQualityColor($quality);
+ $actualCost = max(1, $cost - (($spellInfo['enhanceLevel'] ?? 0) * 2));
+
+ $out->writeln("{$this->cyan}║{$this->reset} {$this->green}✦{$this->reset} 你施放 {$qualityColor}{$name}{$this->reset}");
+ $out->writeln("{$this->cyan}║{$this->reset} {$this->white}计算方式: {$calcDesc} | 消耗: {$actualCost}{$this->reset}");
+
+ $heal = $spellInfo['heal'] ?? 0.5;
+ $healBase = $spellInfo['heal_base'] ?? 20;
+ $healAmount = (int)($stats['matk'] * $heal + $healBase);
+
+ // 应用治疗加成
+ $healAmount = (int)($healAmount * (1 + $healBonus / 100));
+
+ $actualHeal = $this->player->heal($healAmount);
+ $out->writeln("{$this->cyan}║{$this->reset} {$this->green}💚 恢复了 {$actualHeal} 点生命值{$this->reset}");
+
+ return false;
+ }
+
+ /**
+ * 施放群体治疗法术
+ */
+ private function castHealAoeSpell($out, array $spellInfo, array $stats, int $healBonus, string $name): bool
+ {
+ // 显示法术基础信息
+ $calcType = $spellInfo['calc_type'] ?? 'matk';
+ $calcDesc = SpellDisplay::getCalcTypeDescription($calcType);
+ $cost = $spellInfo['cost'] ?? 20;
+ $quality = $spellInfo['quality'] ?? 'common';
+ $qualityColor = SpellDisplay::getQualityColor($quality);
+ $actualCost = max(1, $cost - (($spellInfo['enhanceLevel'] ?? 0) * 2));
+
+ $out->writeln("{$this->cyan}║{$this->reset} {$this->green}✦{$this->reset} 你施放 {$qualityColor}{$name}{$this->reset}");
+ $out->writeln("{$this->cyan}║{$this->reset} {$this->white}计算方式: {$calcDesc} | 消耗: {$actualCost}{$this->reset}");
+
+ $heal = $spellInfo['heal'] ?? 0.5;
+ $healBase = $spellInfo['heal_base'] ?? 20;
+ $healAmount = (int)($stats['matk'] * $heal + $healBase);
+
+ // 应用治疗加成
+ $healAmount = (int)($healAmount * (1 + $healBonus / 100));
+
+ $actualHeal = $this->player->heal($healAmount);
+ $out->writeln("{$this->cyan}║{$this->reset} {$this->green}💚 你恢复了 {$actualHeal} 点生命值{$this->reset}");
+
+ // 同伴也恢复
+ $alivePartners = $this->getAlivePartners();
+ foreach ($alivePartners as $partner) {
+ $partnerHeal = (int)($healAmount * 0.8); // 同伴恢复量为玩家的80%
+ $actualPartnerHeal = $partner->heal($partnerHeal);
+ $this->partnerHp[$partner->id] = $partner->hp;
+ $out->writeln("{$this->cyan}║{$this->reset} {$this->green}💚 {$partner->name} 恢复了 {$actualPartnerHeal} 点生命值{$this->reset}");
+ }
+
+ return false;
+ }
+
/**
* 施放辅助法术
*/
private function castSupportSpell($out, array $spellInfo, array $stats, string $name): bool
{
+ // 显示法术基础信息
+ $quality = $spellInfo['quality'] ?? 'common';
+ $qualityColor = SpellDisplay::getQualityColor($quality);
+ $cost = $spellInfo['cost'] ?? 20;
+ $actualCost = max(1, $cost - (($spellInfo['enhanceLevel'] ?? 0) * 2));
+
+ $out->writeln("{$this->cyan}║{$this->reset} {$this->cyan}✦{$this->reset} 你施放 {$qualityColor}{$name}{$this->reset}");
+ $out->writeln("{$this->cyan}║{$this->reset} {$this->white}消耗: {$actualCost}{$this->reset}");
+
$subtype = $spellInfo['subtype'] ?? '';
+
if ($subtype === 'heal' || $subtype === 'heal_all') {
if ($subtype === 'heal') {
// 恢复自己
@@ -624,35 +726,17 @@ class Battle
}
/**
- * 生成法术物品掉落 (新法术系统)
+ * 根据品质获取数组索引
*/
- private function generateSpellDrop(Actor $enemy): ?array
+ private function getQualityIndex(string $quality): int
{
- // 尝试从独立的副本法术映射文件获取(每个副本有自己的法术池)
- $dungeonId = $this->game->dungeonId;
- $spellIds = null;
-
- $dungeonSpellFile = __DIR__ . '/../../src/Data/dungeon_spells.php';
- if (file_exists($dungeonSpellFile)) {
- $dungeonMap = require $dungeonSpellFile;
- $spellIds = $dungeonMap[$dungeonId] ?? null;
- }
-
- // 回退到全局配置里的 dungeon_spell_drops
- if (empty($spellIds)) {
- $dungeonSpellDrops = $this->spellsData['dungeon_spell_drops'] ?? [];
- $spellIds = $dungeonSpellDrops[$dungeonId] ?? null;
- }
-
- if (empty($spellIds) || !is_array($spellIds)) {
- return null;
- }
-
- // 从法术池中随机选择一个法术ID
- $spellId = $spellIds[array_rand($spellIds)];
-
- // 使用 Item::createSpell 创建法术物品
- return \Game\Entities\Item::createSpell($spellId, $enemy->level);
+ return match($quality) {
+ 'common' => 0,
+ 'rare' => 1,
+ 'epic' => 2,
+ 'legendary' => 3,
+ default => 0,
+ };
}
private function playerAttack($out): bool
@@ -856,27 +940,25 @@ class Battle
$totalExp += $enemy->expReward;
$totalStones += $enemy->spiritStoneReward;
- // 掉落 - 从怪物穿着的装备随机掉落
+ // 掉落 - 从怪物穿着的装备随机掉落(50%概率)
foreach ($enemy->getRandomEquipmentDrops(50) as $item) {
$this->player->addItem($item);
$allDrops[] = $item;
}
+
+ // 掉落 - 从怪物穿着的法术随机掉落(50%概率)
+ foreach ($enemy->getRandomSpellDrops(50) as $spell) {
+ $this->player->addItem($spell);
+ $allDrops[] = $spell;
+ }
+
+ // 掉落 - 从掉落表中随机掉落物品
foreach ($enemy->dropTable as $drop) {
if (rand(1, 100) <= $drop['rate']) {
$this->player->addItem($drop['item']);
$allDrops[] = $drop['item'];
}
}
-
- // 掉落法术物品 (新法术系统)
- $spellDropChance = 15; // 15% 概率掉落法术
- if (rand(1, 100) <= $spellDropChance && !empty($this->spellsData)) {
- $spellItem = $this->generateSpellDrop($enemy);
- if ($spellItem) {
- $this->player->addItem($spellItem);
- $allDrops[] = $spellItem;
- }
- }
}
// 经验
diff --git a/src/Modules/InventoryPanel.php b/src/Modules/InventoryPanel.php
index 72cbcb8..eff6e89 100644
--- a/src/Modules/InventoryPanel.php
+++ b/src/Modules/InventoryPanel.php
@@ -4,6 +4,7 @@ namespace Game\Modules;
use Game\Core\Game;
use Game\Core\Screen;
use Game\Core\ItemDisplay;
+use Game\Core\SpellDisplay;
use Game\Core\Colors;
class InventoryPanel
@@ -87,8 +88,16 @@ class InventoryPanel
$index = $start + $i + 1;
- // 使用统一的装备显示
- $displayStr = ItemDisplay::renderListItem($item, true, true);
+ // 根据物品类型使用不同的显示方式
+ if (($item['type'] ?? '') === 'spell') {
+ // 法术使用 SpellDisplay 显示
+ $displayStr = ItemDisplay::renderListItem($item, true, true);
+ $spellInfo = SpellDisplay::formatSpellCompact($item);
+ $displayStr = trim($displayStr) . " " . $spellInfo;
+ } else {
+ // 装备使用 ItemDisplay 显示
+ $displayStr = ItemDisplay::renderListItem($item, true, true);
+ }
$out->writeln("[{$index}] {$displayStr}");
}
@@ -593,7 +602,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/src/Modules/StatsPanel.php b/src/Modules/StatsPanel.php
index 016d258..976765b 100644
--- a/src/Modules/StatsPanel.php
+++ b/src/Modules/StatsPanel.php
@@ -6,6 +6,7 @@ use Game\Core\Game;
use Game\Core\Screen;
use Game\Core\Input;
use Game\Core\ItemDisplay;
+use Game\Core\SpellDisplay;
use Game\Services\EquipmentEnhancer;
use Game\Entities\Actor;
use Game\Entities\Partner;
@@ -247,7 +248,8 @@ class StatsPanel
foreach ($skillSlots as $slot) {
$spell = $actor->skillSlots[$slot] ?? null;
if ($spell) {
- $slotLines = ItemDisplay::renderSlot("技能{$skillIndex}", $spell, "║ [{$skillIndex}] ");
+ // 法术使用 SpellDisplay 显示
+ $slotLines = SpellDisplay::renderSlot("技能{$skillIndex}", $spell, "║ [{$skillIndex}] ");
foreach ($slotLines as $i => $line) {
if ($i === 0) {
$out->writeln($line);
diff --git a/test/Test.php b/test/Test.php
index a12f3ec..c572aed 100644
--- a/test/Test.php
+++ b/test/Test.php
@@ -1,6 +1,6 @@
getRandomEquipmentDrops());
\ No newline at end of file