技能优化

This commit is contained in:
hantao 2025-12-05 18:15:06 +08:00
parent c77620127d
commit ecee1606f4
5 changed files with 57 additions and 45 deletions

File diff suppressed because one or more lines are too long

View File

@ -95,48 +95,48 @@ return [
'min_level' => 1,
'desc' => '镜州边境的江湖门派,韩立修仙之路的起点。',
'monsters' => [
// [
// 'name' => '野狼帮帮众',
// 'level' => 1,
// 'hp' => 30,
// 'patk' => 5,
// 'matk' => 2,
// 'pdef' => 0,
// 'mdef' => 0,
// 'exp' => 10,
// 'spirit_stones' => 2,
// 'drops' => [
// ['type' => 'weapon', 'name' => '铁刀', 'rate' => 25] + $weaponTemplate,
// ['type' => 'consume', 'name' => '金疮药', 'rate' => 20, 'heal' => 30],
// ],
// 'spells' => [
// ['id' => 10, 'name' => '柔拳', 'rate' => 25],
// ],
// 'weight' => 60,
// ],
// [
// 'name' => '野狼帮精锐',
// 'level' => 3,
// 'hp' => 50,
// 'patk' => 10,
// 'matk' => 3,
// 'pdef' => 2,
// 'mdef' => 1,
// 'exp' => 20,
// 'spirit_stones' => 5,
// 'drops' => [
// ['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],
// ],
// 'weight' => 30,
// ],
[
'name' => '野狼帮帮众',
'level' => 1,
'hp' => 30,
'patk' => 5,
'matk' => 2,
'pdef' => 0,
'mdef' => 0,
'exp' => 10,
'spirit_stones' => 2,
'drops' => [
['type' => 'weapon', 'name' => '铁刀', 'rate' => 25] + $weaponTemplate,
['type' => 'consume', 'name' => '金疮药', 'rate' => 20, 'heal' => 30],
],
'spells' => [
['id' => 10, 'name' => '柔拳', 'rate' => 25],
],
'weight' => 60,
],
[
'name' => '野狼帮精锐',
'level' => 3,
'hp' => 50,
'patk' => 10,
'matk' => 3,
'pdef' => 2,
'mdef' => 1,
'exp' => 20,
'spirit_stones' => 5,
'drops' => [
['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],
],
'weight' => 30,
],
[
'name' => '墨大夫',
'level' => 5,

View File

@ -210,6 +210,8 @@ class Actor
'hp' => $this->hp,
'patk' => $this->patk ?? 0,
'matk' => $this->matk ?? 0,
'mana' => $this->mana ?? 0,
'maxMana' => $this->maxMana ?? 0,
'pdef' => $this->pdef ?? 0,
'mdef' => $this->mdef ?? 0,
'crit' => $this->crit ?? 0,

View File

@ -33,6 +33,7 @@ class Battle
private string $yellow;
private string $cyan;
private string $white;
private string $blue;
private string $magenta;
private string $bold;
private string $reset;
@ -54,6 +55,7 @@ class Battle
$this->magenta = Colors::MAGENTA;
$this->bold = Colors::BOLD;
$this->reset = Colors::RESET;
$this->blue = Colors::BLUE;
$this->qualityColors = [
'common' => Colors::WHITE,
@ -269,6 +271,7 @@ class Battle
$playerHpText = $this->player->hp . "/" . $stats['maxHp'];
$out->writeln("{$this->cyan}{$this->reset} {$this->green}🧙{$this->reset} {$this->bold}玩家{$this->reset} Lv.{$this->player->level}");
$out->writeln("{$this->cyan}{$this->reset} {$playerHpBar} {$this->white}{$playerHpText}{$this->reset}");
$out->writeln("{$this->cyan}{$this->reset} {$this->blue}🔮 {$stats['mana']}/{$stats['maxMana']}{$this->reset}");
$out->writeln("{$this->cyan}{$this->reset} {$this->yellow}⚔️{$this->reset} {$stats['patk']}/{$stats['matk']} {$this->green}🛡️{$this->reset} {$stats['pdef']}/{$stats['mdef']} {$this->red}💥{$this->reset} {$stats['crit']}/{$stats['critdmg']}%");
// 显示同伴信息
@ -283,6 +286,7 @@ class Battle
$status = $partnerHp > 0 ? "" : " {$this->red}[倒下]{$this->reset}";
$out->writeln("{$this->cyan}{$this->reset} {$this->magenta}👤{$this->reset} {$partner->name} Lv.{$partner->level}{$status}");
$out->writeln("{$this->cyan}{$this->reset} {$partnerHpBar} {$this->white}{$partnerHpText}{$this->reset}");
$out->writeln("{$this->cyan}{$this->reset} {$this->blue}🔮 {$partnerStats['mana']}/{$partnerStats['maxMana']}{$this->reset}");
$out->writeln("{$this->cyan}{$this->reset} {$this->yellow}⚔️{$this->reset} {$partnerStats['patk']}/{$partnerStats['matk']} {$this->green}🛡️{$this->reset} {$partnerStats['pdef']}/{$partnerStats['mdef']} {$this->red}💥{$this->reset} {$partnerStats['crit']}/{$partnerStats['critdmg']}%");
}
@ -837,6 +841,12 @@ class Battle
$target->hp -= $damage;
// 蓝量恢复机制
// 攻击者恢复 15 点
$actorRecovered = $actor->recoverMana(15);
// 受击者恢复 10 点
$targetRecovered = $target->recoverMana(10);
// 更新同伴血量显示
if ($target instanceof Partner && isset($this->partnerHp[$target->id])) {
$this->partnerHp[$target->id] = $target->hp;

View File

@ -101,7 +101,7 @@ class StatsPanel
$playerStats = $this->game->player->getStats();
$mark = $this->isPlayer && $this->currentActor === $this->game->player ? "{$this->green}{$this->reset} " : " ";
$out->writeln("{$mark}[1] {$this->yellow}玩家{$this->reset} Lv.{$this->game->player->level}");
$out->writeln(" HP:{$playerStats['maxHp']} 物攻:{$playerStats['patk']} 魔攻:{$playerStats['matk']} 暴击:{$playerStats['crit']}%");
$out->writeln(" HP:{$playerStats['maxHp']} 物攻:{$playerStats['patk']} 魔攻:{$playerStats['matk']} 暴击:{$playerStats['crit']}% 蓝量:{$playerStats['mana']}/{$playerStats['maxMana']}");
// 显示队友
$partners = $this->game->player->partners;
@ -113,7 +113,7 @@ class StatsPanel
$stats = $partner->getStats();
$mark = !$this->isPlayer && $this->currentActor === $partner ? "{$this->green}{$this->reset} " : " ";
$out->writeln("{$mark}[{$idx}] {$this->magenta}{$partner->name}{$this->reset} Lv.{$partner->level}");
$out->writeln(" HP:{$stats['maxHp']} 物攻:{$stats['patk']} 魔攻:{$stats['matk']} 暴击:{$stats['crit']}%");
$out->writeln(" HP:{$stats['maxHp']} 物攻:{$stats['patk']} 魔攻:{$stats['matk']} 暴击:{$stats['crit']}% 蓝量:{$stats['mana']}/{$stats['maxMana']}");
$idx++;
}
}