更新角色佩恩(六道轮回)
添加替身、奥义点、击飞机制
修改了血量上限,增加游戏公平性
优化了AI判定,可接技能、自动攻击、击飞可解
代码一共4400行
代码如下:
#include <iostream>
#include <conio.h>
#include <windows.h>
#include <string>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <thread>
#include <chrono>
#include <cmath>
using namespace std;
// ==================== 辅助函数 ====================
void setColor(int color) {
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hConsole, color);
}
void gotoxy(int x, int y) {
if (x < 0) x = 0; if (y < 0) y = 0;
COORD coord; coord.X = (SHORT)x; coord.Y = (SHORT)y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}
void hideCursor() {
HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO info; info.dwSize = 100; info.bVisible = FALSE;
SetConsoleCursorInfo(consoleHandle, &info);
}
void clearScreen() { system("cls"); }
// ==================== 结构体 ====================
struct Skill {
string name; int cooldown; int currentCD; int damageMin; int damageMax;
string displayChar; int duration;
};
struct Character {
string name; int hp; int maxHp; int x, y; bool available;
vector<Skill> skills; int characterType;
};
// ==================== 地图常量 ====================
const int MAP_WIDTH = 100, MAP_HEIGHT = 24, MAP_START_X = 2, MAP_START_Y = 3, CHARACTER_ROW = MAP_HEIGHT – 1;
// ==================== 全局角色 ====================
Character player, enemy;
bool gameRunning = false, skillInProgress = false, enemySkillInProgress = false;
int playerCharacterType = 0, enemyCharacterType = 0;
// ==================== 黑绝机制变量 ====================
bool playerBlackZetsuMode = false, playerBlackZetsuCarrier = false;
chrono::steady_clock::time_point playerBlackZetsuNormalCDEnd;
int increasePlayerDamage(int dmg) {
if (playerBlackZetsuCarrier) return (int)(dmg * 1.1);
return dmg;
}
int reducePlayerDamage(int dmg) {
if (playerBlackZetsuCarrier) return (int)(dmg * 0.7);
return dmg;
}
// ==================== 技能冷却时间点 ====================
chrono::steady_clock::time_point playerSkill1CDEnd, playerSkill2CDEnd, playerSkill3CDEnd;
chrono::steady_clock::time_point enemySkill1CDEnd, enemySkill2CDEnd, enemySkill3CDEnd;
// ==================== 佩恩天道变量 ====================
int playerShinraTenseiStack = 0, playerShinraTenseiRadius = 1, playerShinraTenseiCurrentCD = 15;
chrono::steady_clock::time_point playerShinraTenseiStart; bool playerShinraTenseiActive = false;
int enemyShinraTenseiStack = 0, enemyShinraTenseiRadius = 1, enemyShinraTenseiCurrentCD = 15;
chrono::steady_clock::time_point enemyShinraTenseiStart; bool enemyShinraTenseiActive = false;
bool playerBanshoTeninActive = false, enemyBanshoTeninActive = false;
chrono::steady_clock::time_point playerBanshoTeninEnd, enemyBanshoTeninEnd;
int playerBlackRodLeftX = 0, playerBlackRodRightX = 0, enemyBlackRodLeftX = 0, enemyBlackRodRightX = 0;
chrono::steady_clock::time_point lastEnemyAction;
// ==================== 鸣人变量 ====================
bool playerNarutoTailActive = false, enemyNarutoTailActive = false;
chrono::steady_clock::time_point playerNarutoTailEnd, enemyNarutoTailEnd;
int playerNarutoTailX[3] = { 0 }, enemyNarutoTailX[3] = { 0 };
// ==================== 黑棒变量 ====================
bool playerPainRodActive = false, enemyPainRodActive = false;
int playerPainRodX = 0, enemyPainRodX = 0;
chrono::steady_clock::time_point playerPainRodEnd, enemyPainRodEnd;
bool playerRodHitting = false, enemyRodHitting = false;
chrono::steady_clock::time_point playerRodHitEnd, enemyRodHitEnd;
// ==================== 带土变量 ====================
bool playerObitoKickActive = false, playerObitoWoodSpikeActive = false, playerObitoEnemyTrapped = false;
chrono::steady_clock::time_point playerObitoKickEnd, playerObitoWoodSpikeEnd, playerObitoEnemyTrappedEnd;
int playerObitoKickX = 0, playerObitoWoodSpikeX = 0;
bool playerObitoKamuiActive = false, playerObitoKamuiSpaceActive = false, playerObitoEnemyInSpace = false;
chrono::steady_clock::time_point playerObitoKamuiEnd, playerObitoKamuiSpaceEnd; int playerObitoSavedX = 0;
bool playerObitoFireActive = false, playerObitoWoodStormActive = false, playerObitoUltimateActive = false;
bool enemyObitoKickActive = false, enemyObitoWoodSpikeActive = false, enemyObitoEnemyTrapped = false;
chrono::steady_clock::time_point enemyObitoKickEnd, enemyObitoWoodSpikeEnd, enemyObitoEnemyTrappedEnd;
int enemyObitoKickX = 0, enemyObitoWoodSpikeX = 0;
bool enemyObitoKamuiActive = false, enemyObitoKamuiSpaceActive = false, enemyObitoPlayerInSpace = false;
chrono::steady_clock::time_point enemyObitoKamuiEnd, enemyObitoKamuiSpaceEnd; int enemyObitoSavedX = 0;
bool enemyObitoFireActive = false, enemyObitoWoodStormActive = false, enemyObitoUltimateActive = false;
// ==================== 博人变量 ====================
bool playerBorutoSwordActive = false; chrono::steady_clock::time_point playerBorutoSwordEnd;
int playerBorutoSwordX = 0; bool playerBorutoSwordSlashing = false;
bool playerBorutoRasenganActive = false; chrono::steady_clock::time_point playerBorutoRasenganEnd; bool playerBorutoRasenganHit = false;
bool playerBorutoMarkActive = false; chrono::steady_clock::time_point playerBorutoMarkEnd; int playerBorutoMarkX = 0;
bool playerBorutoTeleported = false; int playerBorutoTeleportSavedX = 0; bool playerBorutoTeleportBack = false;
chrono::steady_clock::time_point playerBorutoTeleportTime;
bool playerBorutoKarmaActive = false; chrono::steady_clock::time_point playerBorutoKarmaEnd;
bool playerBorutoFlying = false; chrono::steady_clock::time_point playerBorutoFlyingEnd;
int playerBorutoEnhancedAttackCount = 0; chrono::steady_clock::time_point playerBorutoEnhancedAttackCD;
bool playerBorutoBigRasenganActive = false; chrono::steady_clock::time_point playerBorutoBigRasenganDotEnd; bool playerBorutoBigRasenganHit = false;
bool playerBorutoEnhancedAttackActive = false; int playerBorutoEnhancedAttackX = 0;
bool enemyBorutoSwordActive = false; chrono::steady_clock::time_point enemyBorutoSwordEnd;
int enemyBorutoSwordX = 0; bool enemyBorutoSwordSlashing = false;
bool enemyBorutoRasenganActive = false; chrono::steady_clock::time_point enemyBorutoRasenganEnd; bool enemyBorutoRasenganHit = false;
bool enemyBorutoMarkActive = false; chrono::steady_clock::time_point enemyBorutoMarkEnd; int enemyBorutoMarkX = 0;
bool enemyBorutoTeleported = false; int enemyBorutoTeleportSavedX = 0; bool enemyBorutoTeleportBack = false;
chrono::steady_clock::time_point enemyBorutoTeleportTime;
bool enemyBorutoKarmaActive = false; chrono::steady_clock::time_point enemyBorutoKarmaEnd;
bool enemyBorutoFlying = false; chrono::steady_clock::time_point enemyBorutoFlyingEnd;
int enemyBorutoEnhancedAttackCount = 0; chrono::steady_clock::time_point enemyBorutoEnhancedAttackCD;
// ==================== 柱间变量 ====================
bool playerHashiramaStompActive = false; chrono::steady_clock::time_point playerHashiramaStompEnd; int playerHashiramaStompX = 0;
bool playerHashiramaWoodDragonActive = false; chrono::steady_clock::time_point playerHashiramaWoodDragonEnd;
bool playerHashiramaEnemyTrapped = false; chrono::steady_clock::time_point playerHashiramaWoodDragonTrapEnd;
bool playerHashiramaMyojinmonActive = false; bool playerHashiramaMyojinmonUsed = false;
bool playerHashiramaWoodGolemActive = false; chrono::steady_clock::time_point playerHashiramaWoodGolemEnd;
int playerHashiramaWoodGolemAttackCount = 0; chrono::steady_clock::time_point playerHashiramaWoodGolemAttackCD;
bool playerHashiramaUltimateActive = false;
bool enemyHashiramaStompActive = false; chrono::steady_clock::time_point enemyHashiramaStompEnd; int enemyHashiramaStompX = 0;
bool enemyHashiramaWoodDragonActive = false; chrono::steady_clock::time_point enemyHashiramaWoodDragonEnd;
bool enemyHashiramaEnemyTrapped = false; chrono::steady_clock::time_point enemyHashiramaWoodDragonTrapEnd;
bool enemyHashiramaMyojinmonActive = false; bool enemyHashiramaMyojinmonUsed = false;
bool enemyHashiramaWoodGolemActive = false; chrono::steady_clock::time_point enemyHashiramaWoodGolemEnd;
int enemyHashiramaWoodGolemAttackCount = 0; chrono::steady_clock::time_point enemyHashiramaWoodGolemAttackCD;
bool enemyHashiramaUltimateActive = false;
// ==================== 佐助变量 ====================
bool playerSasukeSlashActive = false; chrono::steady_clock::time_point playerSasukeSlashEnd, playerSasukeSlashCD;
bool playerSasukeAmaterasuActive = false; chrono::steady_clock::time_point playerSasukeAmaterasuEnd, playerSasukeAmaterasuTick;
bool playerSasukeAmaterasuHit = false;
bool playerSasukeSusanooActive = false; chrono::steady_clock::time_point playerSasukeSusanooEnd;
int playerSasukeSusanooSlashCount = 0; chrono::steady_clock::time_point playerSasukeSusanooSlashCD;
bool playerSasukeSusanooSlashActive = false; chrono::steady_clock::time_point playerSasukeSusanooSlashEnd;
bool playerSasukeUltimateActive = false; chrono::steady_clock::time_point playerSasukeSubSkillCD;
bool enemySasukeSlashActive = false; chrono::steady_clock::time_point enemySasukeSlashEnd, enemySasukeSlashCD;
bool enemySasukeAmaterasuActive = false; chrono::steady_clock::time_point enemySasukeAmaterasuEnd, enemySasukeAmaterasuTick;
bool enemySasukeAmaterasuHit = false;
bool enemySasukeSusanooActive = false; chrono::steady_clock::time_point enemySasukeSusanooEnd;
int enemySasukeSusanooSlashCount = 0; chrono::steady_clock::time_point enemySasukeSusanooSlashCD;
bool enemySasukeSusanooSlashActive = false; chrono::steady_clock::time_point enemySasukeSusanooSlashEnd;
bool enemySasukeUltimateActive = false; chrono::steady_clock::time_point enemySasukeSubSkillCD;
// ==================== 泉奈变量 ====================
bool playerIzunaSlashActive = false; chrono::steady_clock::time_point playerIzunaSlashEnd, playerIzunaSlashCD;
bool playerIzunaFireballActive = false; chrono::steady_clock::time_point playerIzunaFireballEnd;
bool playerIzunaCounterActive = false; chrono::steady_clock::time_point playerIzunaCounterEnd;
bool playerIzunaCounterTriggered = false;
bool playerIzunaSwordActive = false; chrono::steady_clock::time_point playerIzunaSwordEnd;
chrono::steady_clock::time_point playerIzunaSword2ndWindow; bool playerIzunaSword2ndUsed = false;
bool playerIzunaUltimateActive = false;
bool enemyIzunaSlashActive = false; chrono::steady_clock::time_point enemyIzunaSlashEnd, enemyIzunaSlashCD;
bool enemyIzunaFireballActive = false; chrono::steady_clock::time_point enemyIzunaFireballEnd;
bool enemyIzunaCounterActive = false; chrono::steady_clock::time_point enemyIzunaCounterEnd;
bool enemyIzunaCounterTriggered = false;
bool enemyIzunaSwordActive = false; chrono::steady_clock::time_point enemyIzunaSwordEnd;
bool enemyIzunaUltimateActive = false;
// ==================== 漂泊浪客变量 ====================
int playerWandererState = 0;
chrono::steady_clock::time_point playerWandererStateSwitchWindow;
bool playerWandererShortSkill2Used = false;
int playerWandererLongSkill2Count = 2;
bool playerWandererSpinActive = false;
chrono::steady_clock::time_point playerWandererSpinEnd;
bool playerWandererSpinEnemyTransferred = false;
int playerWandererSpinEnemySavedX = 0;
bool playerWandererShockActive = false;
int playerWandererShockEnemyY = 0;
chrono::steady_clock::time_point playerWandererShockDropTime;
chrono::steady_clock::time_point playerWandererNormalCDEnd, playerWandererSkill1CDEnd;
chrono::steady_clock::time_point playerWandererShortSubSkillCDEnd, playerWandererLongSkill2CDEnd, playerWandererLongSubSkillCDEnd;
int enemyWandererState = 0;
chrono::steady_clock::time_point enemyWandererStateSwitchWindow;
bool enemyWandererShortSkill2Used = false;
int enemyWandererLongSkill2Count = 2;
bool enemyWandererSpinActive = false;
chrono::steady_clock::time_point enemyWandererSpinEnd;
bool enemyWandererSpinEnemyTransferred = false;
int enemyWandererSpinEnemySavedX = 0;
bool enemyWandererShockActive = false;
int enemyWandererShockEnemyY = 0;
chrono::steady_clock::time_point enemyWandererShockDropTime;
chrono::steady_clock::time_point enemyWandererNormalCDEnd, enemyWandererSkill1CDEnd;
chrono::steady_clock::time_point enemyWandererShortSubSkillCDEnd, enemyWandererLongSkill2CDEnd, enemyWandererLongSubSkillCDEnd;
// ==================== 水门变量 ====================
bool playerMinatoKunaiActive = false; int playerMinatoKunaiX = 0;
chrono::steady_clock::time_point playerMinatoNormalCDEnd;
bool playerMinatoMarkActive = false; int playerMinatoMarkX = 0;
chrono::steady_clock::time_point playerMinatoMarkEnd;
bool playerMinatoCounterReady = false;
chrono::steady_clock::time_point playerMinatoSkill1CDEnd, playerMinatoSkill2CDEnd, playerMinatoUltimateCDEnd;
bool enemyMinatoKunaiActive = false; int enemyMinatoKunaiX = 0;
chrono::steady_clock::time_point enemyMinatoNormalCDEnd;
bool enemyMinatoMarkActive = false; int enemyMinatoMarkX = 0;
chrono::steady_clock::time_point enemyMinatoMarkEnd;
bool enemyMinatoCounterReady = false;
chrono::steady_clock::time_point enemyMinatoSkill1CDEnd, enemyMinatoSkill2CDEnd, enemyMinatoUltimateCDEnd;
// ==================== 佩恩六道变量 ====================
int playerPainSixPathState = 0; // 0:天道, 1:畜生道-男, 2:畜生道-女, 3:修罗道, 4:饿鬼道, 5:人间道, 6:地狱道
int enemyPainSixPathState = 0;
bool playerPainSixPathSkill1Used = false, playerPainSixPathSkill2Used = false;
bool enemyPainSixPathSkill1Used = false, enemyPainSixPathSkill2Used = false;
int playerPainSixPathSkill1Count = 0, playerPainSixPathSkill2Count = 0;
int enemyPainSixPathSkill1Count = 0, enemyPainSixPathSkill2Count = 0;
int playerPainSixPathCycleCount = 0, enemyPainSixPathCycleCount = 0; // 轮换计数
chrono::steady_clock::time_point playerPainSixPathSkill1CD, playerPainSixPathSkill2CD;
chrono::steady_clock::time_point enemyPainSixPathSkill1CD, enemyPainSixPathSkill2CD;
bool playerPainSixPathShieldActive = false;
chrono::steady_clock::time_point playerPainSixPathShieldEnd;
bool enemyPainSixPathShieldActive = false;
chrono::steady_clock::time_point enemyPainSixPathShieldEnd;
bool playerPainSixPathEnemySealed = false;
chrono::steady_clock::time_point playerPainSixPathEnemySealedEnd;
bool enemyPainSixPathPlayerSealed = false;
chrono::steady_clock::time_point enemyPainSixPathPlayerSealedEnd;
bool playerPainSixPathInvincible = false;
chrono::steady_clock::time_point playerPainSixPathInvincibleEnd;
bool enemyPainSixPathInvincible = false;
chrono::steady_clock::time_point enemyPainSixPathInvincibleEnd;
bool playerPainSixPathSummonActive = false;
int playerPainSixPathSummonX = 0, playerPainSixPathSummonY = 0;
chrono::steady_clock::time_point playerPainSixPathSummonEnd;
bool enemyPainSixPathSummonActive = false;
int enemyPainSixPathSummonX = 0, enemyPainSixPathSummonY = 0;
chrono::steady_clock::time_point enemyPainSixPathSummonEnd;
bool playerPainSixPathSoulActive = false;
int playerPainSixPathSoulX = 0, playerPainSixPathSoulY = 0;
chrono::steady_clock::time_point playerPainSixPathSoulEnd;
bool enemyPainSixPathSoulActive = false;
int enemyPainSixPathSoulX = 0, enemyPainSixPathSoulY = 0;
chrono::steady_clock::time_point enemyPainSixPathSoulEnd;
bool playerPainSixPathUltimateActive = false;
bool enemyPainSixPathUltimateActive = false;
// ==================== 技能点/击飞/替身机制 ====================
int playerSkillPoints = 2;
int enemySkillPoints = 2;
const int MAX_SKILL_POINTS = 4;
const int INITIAL_SKILL_POINTS = 2;
bool playerLaunched = false;
chrono::steady_clock::time_point playerLaunchTime;
bool enemyLaunched = false;
chrono::steady_clock::time_point enemyLaunchTime;
bool playerSubstitutionReady = true;
bool enemySubstitutionReady = true;
chrono::steady_clock::time_point playerSubstitutionCD;
chrono::steady_clock::time_point enemySubstitutionCD;
const int SUBSTITUTION_COOLDOWN = 12;
bool playerPinned = false;
bool enemyPinned = false;
// ==================== AI变量 ====================
int enemyPhase = 0, enemyNormalAttackCount = 0; bool enemyUltimateReady = false;
int enemyAIMood = 0, enemyConsecutiveSkills = 0, enemyStuckCounter = 0, enemyLastActionType = -1;
chrono::steady_clock::time_point enemyLastSkillTime; bool enemyJustMoved = false;
// ==================== 工具函数 ====================
int getRemainingCD(chrono::steady_clock::time_point cdEnd) {
auto now = chrono::steady_clock::now();
if (now >= cdEnd) return 0;
return chrono::duration_cast<chrono::seconds>(cdEnd – now).count() + 1;
}
vector<Character> getAllCharacters() {
vector<Character> chars;
chars.push_back({ "漩涡鸣人(九尾查克拉)",600,600,0,0,true,{{"螺旋丸",8,0,8,15,"O",1},{"九尾抓取",15,0,20,25,"——",0},{"尾兽玉",0,0,35,35,"0",3}},0 });
chars.push_back({ "佐助(鹰小队)",600,600,0,0,false,{},0 });
chars.push_back({ "旗木卡卡西(万花筒写轮眼)",600,600,0,0,false,{},0 });
chars.push_back({ "波风水门(四代目火影)",600,600,0,0,true,{},9 });
chars.push_back({ "春野樱(百豪怪力)",600,600,0,0,false,{},0 });
chars.push_back({ "自来也(仙人模式)",600,600,0,0,false,{},0 });
chars.push_back({ "纲手(百豪)",600,600,0,0,false,{},0 });
chars.push_back({ "大蛇丸(八岐之术)",600,600,0,0,false,{},0 });
chars.push_back({ "漩涡长门(轮回之力)",600,600,0,0,false,{},0 });
chars.push_back({ "佩恩(天道)",600,600,0,0,true,{{"万象天引",12,0,10,13,"\\\\/",5},{"神罗天征",15,0,8,15,"()",3},{"超神罗天征",0,0,50,50,"{}",5}},1 });
chars.push_back({ "佩恩(修罗道)",600,600,0,0,false,{},0 });
chars.push_back({ "宇智波斑(虎皮面具男)",600,600,0,0,false,{},0 });
chars.push_back({ "宇智波带土(忍界大战)",600,600,0,0,true,{{"木遁-扦插/火遁-火龙卷",20,0,12,16,"-",15},{"神威/神威-空间",10,0,0,0,"()",5},{"十尾入侵",0,0,50,50,"*",5}},2 });
chars.push_back({ "大筒木博人",600,600,0,0,true,{{"螺旋丸-涡彦/大筒木-飞行",18,0,8,12,"O",3},{"亚-飞雷神/超大玉螺旋丸",8,0,10,18,"-—",5},{"楔",45,0,0,0,"*",60}},3 });
chars.push_back({ "千手柱间",600,600,0,0,true,{{"木龙扦插之术/明神门",15,0,15,20,"~",8},{"木人之术",18,0,22,35,"¥",5},{"千手观音",0,0,80,80,"\\\\",3}},4 });
chars.push_back({ "宇智波佐助(六道-阴)",600,600,0,0,true,{{"天照",10,0,5,5,"-",5},{"天手力",8,0,12,18,")",2},{"地爆天星-斩",0,0,20,35,"*",5}},5 });
chars.push_back({ "宇智波泉奈",600,600,0,0,true,{{"火遁-豪火球",18,0,18,21,"-",3},{"宇智波流剑术",20,0,20,24,"-",3},{"宇智波的荣耀",0,0,40,40,"|",5}},6 });
chars.push_back({ "黑绝",350,350,0,0,true,{},7 });
chars.push_back({ "宇智波带土(漂泊浪客)",600,600,0,0,true,{},8 });
chars.push_back({ "佩恩(六道轮回)",600,600,0,0,true,{},10 });
chars.push_back({ "佩恩(畜生道-男)",600,600,0,0,false,{},0 });
chars.push_back({ "佩恩(畜生道-女)",600,600,0,0,false,{},0 });
chars.push_back({ "佩恩(人间道)",600,600,0,0,false,{},0 });
chars.push_back({ "佩恩(地狱道)",600,600,0,0,false,{},0 });
chars.push_back({ "佩恩(饿鬼道)",600,600,0,0,false,{},0 });
chars.push_back({ "宇智波斑",600,600,0,0,false,{},0 });
chars.push_back({ "千手扉间",600,600,0,0,false,{},0 });
chars.push_back({ "宇智波斑(秽土转生)",600,600,0,0,false,{},0 });
chars.push_back({ "千手柱间(秽土转生)",600,600,0,0,false,{},0 });
chars.push_back({ "千手扉间(秽土转生)",600,600,0,0,false,{},0 });
chars.push_back({ "宇智波鼬(灭族之夜)",600,600,0,0,false,{},0 });
chars.push_back({ "宇智波鼬(晓)",600,600,0,0,false,{},0 });
chars.push_back({ "宇智波鼬(秽土转生)",600,600,0,0,false,{},0 });
chars.push_back({ "面具男(灭族之夜)",600,600,0,0,false,{},0 });
chars.push_back({ "旗木卡卡西(须佐能乎)",600,600,0,0,false,{},0 });
chars.push_back({ "绝(晓)",600,600,0,0,false,{},0 });
chars.push_back({ "鬼鲛(晓)",600,600,0,0,false,{},0 });
chars.push_back({ "鬼鲛(鲛肌)",600,600,0,0,false,{},0 });
chars.push_back({ "迪达拉(晓)",600,600,0,0,false,{},0 });
chars.push_back({ "迪达拉(秽土转生)",600,600,0,0,false,{},0 });
chars.push_back({ "蝎(晓)",600,600,0,0,false,{},0 });
chars.push_back({ "蝎(秽土转生)",600,600,0,0,false,{},0 });
chars.push_back({ "宇智波止水(万花筒写轮眼)",600,600,0,0,false,{},0 });
chars.push_back({ "宇智波止水(须佐能乎)",600,600,0,0,false,{},0 });
chars.push_back({ "宇智波佐助(须佐能乎)",600,600,0,0,false,{},0 });
chars.push_back({ "漩涡鸣人(六道-阳)",600,600,0,0,false,{},0 });
chars.push_back({ "神农",600,600,0,0,false,{},0 });
chars.push_back({ "我爱罗(青年)",600,600,0,0,false,{},0 });
chars.push_back({ "宇智波带土(十尾人柱力)",600,600,0,0,false,{},0 });
chars.push_back({ "宇智波斑(十尾人柱力)",600,600,0,0,false,{},0 });
chars.push_back({ "宇智波斑(六道)",600,600,0,0,false,{},0 });
chars.push_back({ "宇智波带土(双神威)",600,600,0,0,false,{},0 });
chars.push_back({ "宇智波带土(百战成灰)",600,600,0,0,false,{},0 });
chars.push_back({ "春野樱(忍战)",600,600,0,0,false,{},0 });
chars.push_back({ "我爱罗(忍战)",600,600,0,0,false,{},0 });
chars.push_back({ "大筒木辉夜",600,600,0,0,false,{},0 });
chars.push_back({ "角都(晓)",600,600,0,0,false,{},0 });
chars.push_back({ "角都(秽土转生)",600,600,0,0,false,{},0 });
chars.push_back({ "宇智波佐良娜",600,600,0,0,false,{},0 });
chars.push_back({ "漩涡博人",600,600,0,0,false,{},0 });
chars.push_back({ "漩涡向日葵",600,600,0,0,false,{},0 });
chars.push_back({ "宇智波佐良娜(万花筒写轮眼)",600,600,0,0,false,{},0 });
chars.push_back({ "川木(楔)",600,600,0,0,false,{},0 });
chars.push_back({ "漩涡博人(桃式)",600,600,0,0,false,{},0 });
chars.push_back({ "漩涡向日葵(九尾查克拉)",600,600,0,0,false,{},0 });
chars.push_back({ "漩涡川木(青年)",600,600,0,0,false,{},0 });
chars.push_back({ "漩涡鸣人(重粒子模式)",600,600,0,0,false,{},0 });
chars.push_back({ "宇智波佐助(轮回眼)",600,600,0,0,false,{},0 });
chars.push_back({ "大筒木桃式",600,600,0,0,false,{},0 });
chars.push_back({ "大筒木金式",600,600,0,0,false,{},0 });
chars.push_back({ "大筒木壹式",600,600,0,0,false,{},0 });
return chars;
}
// ==================== 界面绘制 ====================
void drawStartScreen() {
clearScreen(); hideCursor(); setColor(6);
gotoxy(35, 10); cout << "=========================";
gotoxy(35, 11); cout << "|| ||";
gotoxy(35, 12); cout << "|| 火影忍者 ||";
gotoxy(35, 13); cout << "|| ||";
gotoxy(35, 14); cout << "=========================";
setColor(7); gotoxy(35, 17); cout << "按 ENTER 进入游戏";
}
void drawLaunchScreen(int selectedIndex) {
clearScreen(); hideCursor(); setColor(6);
gotoxy(40, 5); cout << "火 影 忍 者"; setColor(7);
vector<string> options = { "对决模式","剧情模式","打开官网","退出游戏" };
for (int i = 0; i < options.size(); i++) {
gotoxy(35, 10 + i * 3);
if (i == selectedIndex) { setColor(10); cout << "> "; }
else { cout << " "; }
setColor(7); cout << options[i];
}
setColor(8); gotoxy(30, 25); cout << "W/S – 选择 | ENTER – 确认";
}
void drawSelectScreen(int selectedIndex) {
clearScreen(); hideCursor(); setColor(6);
gotoxy(35, 2); cout << "=== 选择你的忍者 ===";
vector<Character> chars = getAllCharacters();
int row = 0, col = 0;
for (int i = 0; i < chars.size(); i++) {
int x = 2 + col * 24; int y = 5 + row * 3;
gotoxy(x, y);
if (i == selectedIndex) { setColor(10); cout << "> "; }
else { cout << " "; }
if (chars[i].available) { setColor(10); }
else { setColor(12); }
cout << chars[i].name;
col++; if (col >= 5) { col = 0; row++; }
}
}
void drawBattleMap() {
clearScreen(); hideCursor();
gotoxy(2, 0); setColor(10); cout << player.name;
if (playerBlackZetsuCarrier) cout << "(黑绝载体)";
gotoxy(2, 1); cout << "HP: [";
int hpBars = player.hp * 50 / player.maxHp; if (hpBars < 0) hpBars = 0;
for (int i = 0; i < 50; i++) {
if (i < hpBars) { setColor(10); cout << "#"; }
else { setColor(8); cout << "-"; }
}
setColor(7); cout << "] " << player.hp << "/" << player.maxHp;
gotoxy(2, 2); cout << "技能点: ";
for (int i = 0; i < MAX_SKILL_POINTS; i++) {
if (i < playerSkillPoints) { setColor(14); cout << "●"; }
else { setColor(8); cout << "○"; }
}
setColor(7); cout << " 替身: " << (playerSubstitutionReady ? "可用" : "CD中");
gotoxy(MAP_WIDTH + MAP_START_X – 20, 0); setColor(12); cout << enemy.name;
gotoxy(MAP_WIDTH + MAP_START_X – 20, 1); cout << "HP: [";
hpBars = enemy.hp * 50 / enemy.maxHp; if (hpBars < 0) hpBars = 0;
for (int i = 0; i < 50; i++) {
if (i < hpBars) { setColor(12); cout << "#"; }
else { setColor(8); cout << "-"; }
}
setColor(7); cout << "] " << enemy.hp << "/" << enemy.maxHp;
gotoxy(MAP_WIDTH + MAP_START_X – 20, 2); cout << "技能点: ";
for (int i = 0; i < MAX_SKILL_POINTS; i++) {
if (i < enemySkillPoints) { setColor(14); cout << "●"; }
else { setColor(8); cout << "○"; }
}
setColor(7); cout << " 替身: " << (enemySubstitutionReady ? "可用" : "CD中");
gotoxy(MAP_START_X, MAP_START_Y); for (int i = 0; i < MAP_WIDTH; i++) cout << "-";
gotoxy(MAP_START_X, MAP_START_Y + MAP_HEIGHT); for (int i = 0; i < MAP_WIDTH; i++) cout << "-";
for (int i = 0; i < MAP_HEIGHT; i++) {
gotoxy(MAP_START_X, MAP_START_Y + i); cout << "|";
gotoxy(MAP_START_X + MAP_WIDTH, MAP_START_Y + i); cout << "|";
}
int charY = MAP_START_Y + CHARACTER_ROW;
int enemyDrawY = charY;
// 击飞处理
if (playerLaunched) {
auto now = chrono::steady_clock::now();
auto elapsed = chrono::duration_cast<chrono::milliseconds>(now – playerLaunchTime).count();
if (elapsed < 2500) {
charY = MAP_START_Y + CHARACTER_ROW – 1;
}
else {
playerLaunched = false;
}
}
if (enemyLaunched) {
auto now = chrono::steady_clock::now();
auto elapsed = chrono::duration_cast<chrono::milliseconds>(now – enemyLaunchTime).count();
if (elapsed < 2500) {
enemyDrawY = MAP_START_Y + CHARACTER_ROW – 1;
}
else {
enemyLaunched = false;
}
}
// 震刀/转刀时敌人高度调整
if (enemyWandererShockActive) enemyDrawY = MAP_START_Y + enemyWandererShockEnemyY;
else if (playerWandererShockActive) enemyDrawY = MAP_START_Y + CHARACTER_ROW;
if (playerWandererSpinActive && playerWandererSpinEnemyTransferred) enemyDrawY = MAP_START_Y + CHARACTER_ROW – 2;
else if (enemyWandererSpinActive && enemyWandererSpinEnemyTransferred) enemyDrawY = MAP_START_Y + CHARACTER_ROW – 2;
if (!playerObitoEnemyInSpace && !enemyObitoPlayerInSpace) {
gotoxy(MAP_START_X + enemy.x, enemyDrawY); setColor(12); cout << "&";
}
int borutoY = charY;
if (playerBorutoFlying) {
auto now = chrono::steady_clock::now();
if (now < playerBorutoFlyingEnd) borutoY = charY – 2; else playerBorutoFlying = false;
}
if (enemyBorutoFlying) {
auto now = chrono::steady_clock::now();
if (now < enemyBorutoFlyingEnd) charY = MAP_START_Y + CHARACTER_ROW – 2; else enemyBorutoFlying = false;
}
if (playerWandererSpinActive) { gotoxy(MAP_START_X + player.x, borutoY – 1); setColor(13); cout << "-"; }
if (enemyWandererSpinActive) { gotoxy(MAP_START_X + enemy.x, charY – 1); setColor(13); cout << "-"; }
gotoxy(MAP_START_X + player.x, borutoY); setColor(10); cout << "@";
if ((playerCharacterType == 8 && playerWandererState == 1) || playerWandererShockActive) { gotoxy(MAP_START_X + player.x – 1, borutoY); setColor(13); cout << "|"; }
if ((enemyCharacterType == 8 && enemyWandererState == 1) || enemyWandererShockActive) { gotoxy(MAP_START_X + enemy.x – 1, charY); setColor(13); cout << "|"; }
// 佩恩六道召唤物绘制
if (playerPainSixPathSummonActive) {
auto now = chrono::steady_clock::now();
if (now < playerPainSixPathSummonEnd) {
for (int dy = 0; dy < 3; dy++) {
for (int dx = 0; dx < 2; dx++) {
int sx = MAP_START_X + playerPainSixPathSummonX + dx;
int sy = MAP_START_Y + playerPainSixPathSummonY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0 && sy < MAP_START_Y + MAP_HEIGHT) {
gotoxy(sx, sy); setColor(6); cout << "*";
}
}
}
}
else { playerPainSixPathSummonActive = false; }
}
if (enemyPainSixPathSummonActive) {
auto now = chrono::steady_clock::now();
if (now < enemyPainSixPathSummonEnd) {
for (int dy = 0; dy < 3; dy++) {
for (int dx = 0; dx < 2; dx++) {
int sx = MAP_START_X + enemyPainSixPathSummonX + dx;
int sy = MAP_START_Y + enemyPainSixPathSummonY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0 && sy < MAP_START_Y + MAP_HEIGHT) {
gotoxy(sx, sy); setColor(6); cout << "*";
}
}
}
}
else { enemyPainSixPathSummonActive = false; }
}
// 佩恩六道灵魂体绘制
if (playerPainSixPathSoulActive) {
auto now = chrono::steady_clock::now();
if (now < playerPainSixPathSoulEnd) {
gotoxy(MAP_START_X + playerPainSixPathSoulX, MAP_START_Y + playerPainSixPathSoulY); setColor(9); cout << "&";
}
else { playerPainSixPathSoulActive = false; }
}
if (enemyPainSixPathSoulActive) {
auto now = chrono::steady_clock::now();
if (now < enemyPainSixPathSoulEnd) {
gotoxy(MAP_START_X + enemyPainSixPathSoulX, MAP_START_Y + enemyPainSixPathSoulY); setColor(9); cout << "&";
}
else { enemyPainSixPathSoulActive = false; }
}
// 佩恩六道盾牌绘制
if (playerPainSixPathShieldActive) {
auto now = chrono::steady_clock::now();
if (now < playerPainSixPathShieldEnd) {
gotoxy(MAP_START_X + player.x – 1, borutoY); setColor(11); cout << "(";
gotoxy(MAP_START_X + player.x + 1, borutoY); setColor(11); cout << ")";
}
else { playerPainSixPathShieldActive = false; }
}
if (enemyPainSixPathShieldActive) {
auto now = chrono::steady_clock::now();
if (now < enemyPainSixPathShieldEnd) {
gotoxy(MAP_START_X + enemy.x – 1, charY); setColor(11); cout << "(";
gotoxy(MAP_START_X + enemy.x + 1, charY); setColor(11); cout << ")";
}
else { enemyPainSixPathShieldActive = false; }
}
// 佩恩六道封印状态
if (playerPainSixPathEnemySealed) {
auto now = chrono::steady_clock::now();
if (now >= playerPainSixPathEnemySealedEnd) { playerPainSixPathEnemySealed = false; }
}
if (enemyPainSixPathPlayerSealed) {
auto now = chrono::steady_clock::now();
if (now >= enemyPainSixPathPlayerSealedEnd) { enemyPainSixPathPlayerSealed = false; }
}
// 佩恩六道无敌状态
if (playerPainSixPathInvincible) {
auto now = chrono::steady_clock::now();
if (now >= playerPainSixPathInvincibleEnd) { playerPainSixPathInvincible = false; }
}
if (enemyPainSixPathInvincible) {
auto now = chrono::steady_clock::now();
if (now >= enemyPainSixPathInvincibleEnd) { enemyPainSixPathInvincible = false; }
}
// 鸣人尾巴
if (playerNarutoTailActive) {
auto now = chrono::steady_clock::now();
if (now < playerNarutoTailEnd) {
for (int i = 0; i < 3; i++) {
if (playerNarutoTailX[i] > 0 && playerNarutoTailX[i] < MAP_WIDTH && playerNarutoTailX[i] != enemy.x) {
gotoxy(MAP_START_X + playerNarutoTailX[i], charY); setColor(14); cout << "-";
}
}
}
else { playerNarutoTailActive = false; }
}
if (enemyNarutoTailActive) {
auto now = chrono::steady_clock::now();
if (now < enemyNarutoTailEnd) {
for (int i = 0; i < 3; i++) {
if (enemyNarutoTailX[i] > 0 && enemyNarutoTailX[i] < MAP_WIDTH && enemyNarutoTailX[i] != player.x) {
gotoxy(MAP_START_X + enemyNarutoTailX[i], charY); setColor(14); cout << "-";
}
}
}
else { enemyNarutoTailActive = false; }
}
// 黑棒
if (playerPainRodActive) {
auto now = chrono::steady_clock::now();
if (now < playerPainRodEnd) {
if (playerPainRodX > 0 && playerPainRodX < MAP_WIDTH && playerPainRodX != enemy.x && playerPainRodX != player.x) {
gotoxy(MAP_START_X + playerPainRodX, charY); setColor(8); cout << "\\\\";
}
}
else { playerPainRodActive = false; playerRodHitting = false; }
}
if (enemyPainRodActive) {
auto now = chrono::steady_clock::now();
if (now < enemyPainRodEnd) {
if (enemyPainRodX > 0 && enemyPainRodX < MAP_WIDTH && enemyPainRodX != player.x && enemyPainRodX != enemy.x) {
gotoxy(MAP_START_X + enemyPainRodX, charY); setColor(8); cout << "\\\\";
}
}
else { enemyPainRodActive = false; enemyRodHitting = false; }
}
// 万象天引黑棒(佩恩天道和六道佩恩共用)
if (playerBanshoTeninActive) {
auto now = chrono::steady_clock::now();
if (now < playerBanshoTeninEnd) {
if (playerBlackRodLeftX > 0 && playerBlackRodLeftX != enemy.x && playerBlackRodLeftX != player.x) {
gotoxy(MAP_START_X + playerBlackRodLeftX, charY); setColor(8); cout << "\\\\";
}
if (playerBlackRodRightX < MAP_WIDTH && playerBlackRodRightX != enemy.x && playerBlackRodRightX != player.x) {
gotoxy(MAP_START_X + playerBlackRodRightX, charY); setColor(8); cout << "/";
}
}
else { playerBanshoTeninActive = false; }
}
if (enemyBanshoTeninActive) {
auto now = chrono::steady_clock::now();
if (now < enemyBanshoTeninEnd) {
if (enemyBlackRodLeftX > 0 && enemyBlackRodLeftX != player.x && enemyBlackRodLeftX != enemy.x) {
gotoxy(MAP_START_X + enemyBlackRodLeftX, charY); setColor(8); cout << "\\\\";
}
if (enemyBlackRodRightX < MAP_WIDTH && enemyBlackRodRightX != player.x && enemyBlackRodRightX != enemy.x) {
gotoxy(MAP_START_X + enemyBlackRodRightX, charY); setColor(8); cout << "/";
}
}
else { enemyBanshoTeninActive = false; }
}
// 带土踢
if (playerObitoKickActive) {
auto now = chrono::steady_clock::now();
if (now < playerObitoKickEnd) {
if (playerObitoKickX > 0 && playerObitoKickX < MAP_WIDTH && playerObitoKickX != enemy.x) {
gotoxy(MAP_START_X + playerObitoKickX, charY); setColor(8); cout << "-";
}
}
else { playerObitoKickActive = false; }
}
if (enemyObitoKickActive) {
auto now = chrono::steady_clock::now();
if (now < enemyObitoKickEnd) {
if (enemyObitoKickX > 0 && enemyObitoKickX < MAP_WIDTH && enemyObitoKickX != player.x) {
gotoxy(MAP_START_X + enemyObitoKickX, charY); setColor(8); cout << "-";
}
}
else { enemyObitoKickActive = false; }
}
// 木遁扦插
if (playerObitoWoodSpikeActive) {
auto now = chrono::steady_clock::now();
if (now < playerObitoWoodSpikeEnd && playerObitoWoodSpikeX > 0 && playerObitoWoodSpikeX < MAP_WIDTH) {
if (playerObitoWoodSpikeX != enemy.x && playerObitoWoodSpikeX != player.x) {
gotoxy(MAP_START_X + playerObitoWoodSpikeX, charY); setColor(2); cout << "-";
}
}
if (playerObitoEnemyTrapped && now < playerObitoEnemyTrappedEnd) {
if (enemy.x – 1 > 0 && enemy.x – 1 != player.x) { gotoxy(MAP_START_X + enemy.x – 1, charY); setColor(2); cout << ">"; }
if (enemy.x + 1 < MAP_WIDTH && enemy.x + 1 != player.x) { gotoxy(MAP_START_X + enemy.x + 1, charY); setColor(2); cout << "<"; }
}
else if (now >= playerObitoEnemyTrappedEnd) { playerObitoEnemyTrapped = false; playerObitoWoodSpikeActive = false; }
}
if (enemyObitoWoodSpikeActive) {
auto now = chrono::steady_clock::now();
if (now < enemyObitoWoodSpikeEnd && enemyObitoWoodSpikeX > 0 && enemyObitoWoodSpikeX < MAP_WIDTH) {
if (enemyObitoWoodSpikeX != player.x && enemyObitoWoodSpikeX != enemy.x) {
gotoxy(MAP_START_X + enemyObitoWoodSpikeX, charY); setColor(2); cout << "-";
}
}
if (enemyObitoEnemyTrapped && now < enemyObitoEnemyTrappedEnd) {
if (player.x – 1 > 0 && player.x – 1 != enemy.x) { gotoxy(MAP_START_X + player.x – 1, charY); setColor(2); cout << ">"; }
if (player.x + 1 < MAP_WIDTH && player.x + 1 != enemy.x) { gotoxy(MAP_START_X + player.x + 1, charY); setColor(2); cout << "<"; }
}
}
// 神威
if (playerObitoKamuiActive && !playerObitoKamuiSpaceActive) {
auto now = chrono::steady_clock::now();
if (now < playerObitoKamuiEnd) {
if (player.x – 1 > 0) { gotoxy(MAP_START_X + player.x – 1, charY); setColor(4); cout << "("; }
if (player.x + 1 < MAP_WIDTH) { gotoxy(MAP_START_X + player.x + 1, charY); setColor(4); cout << ")"; }
}
else { playerObitoKamuiActive = false; }
}
if (enemyObitoKamuiActive && !enemyObitoKamuiSpaceActive) {
auto now = chrono::steady_clock::now();
if (now < enemyObitoKamuiEnd) {
if (enemy.x – 1 > 0) { gotoxy(MAP_START_X + enemy.x – 1, charY); setColor(4); cout << "("; }
if (enemy.x + 1 < MAP_WIDTH) { gotoxy(MAP_START_X + enemy.x + 1, charY); setColor(4); cout << ")"; }
}
else { enemyObitoKamuiActive = false; }
}
// 博人剑术
if (playerBorutoSwordActive && playerBorutoSwordSlashing) {
if (playerBorutoSwordX > 0 && playerBorutoSwordX < MAP_WIDTH) {
gotoxy(MAP_START_X + playerBorutoSwordX, charY); setColor(15); cout << "-";
if (playerBorutoSwordX + 1 < MAP_WIDTH) { gotoxy(MAP_START_X + playerBorutoSwordX + 1, charY); setColor(15); cout << "-"; }
}
}
if (enemyBorutoSwordActive && enemyBorutoSwordSlashing) {
if (enemyBorutoSwordX > 0 && enemyBorutoSwordX < MAP_WIDTH) {
gotoxy(MAP_START_X + enemyBorutoSwordX, charY); setColor(15); cout << "-";
if (enemyBorutoSwordX + 1 < MAP_WIDTH) { gotoxy(MAP_START_X + enemyBorutoSwordX + 1, charY); setColor(15); cout << "-"; }
}
}
// 螺旋丸涡彦
if (playerBorutoRasenganActive) {
auto now = chrono::steady_clock::now();
if (now < playerBorutoRasenganEnd) { gotoxy(MAP_START_X + enemy.x – 1, charY); setColor(11); cout << "O"; }
else { playerBorutoRasenganActive = false; }
}
if (enemyBorutoRasenganActive) {
auto now = chrono::steady_clock::now();
if (now < enemyBorutoRasenganEnd) { gotoxy(MAP_START_X + player.x + 1, charY); setColor(11); cout << "O"; }
else { enemyBorutoRasenganActive = false; }
}
// 飞雷神标记(博人/水门通用)
if (playerBorutoMarkActive) {
auto now = chrono::steady_clock::now();
if (now < playerBorutoMarkEnd) {
if (playerBorutoMarkX > 0 && playerBorutoMarkX < MAP_WIDTH) {
gotoxy(MAP_START_X + playerBorutoMarkX, charY – 1); setColor(9); cout << "*";
}
}
else { playerBorutoMarkActive = false; }
}
if (enemyBorutoMarkActive) {
auto now = chrono::steady_clock::now();
if (now < enemyBorutoMarkEnd) {
if (enemyBorutoMarkX > 0 && enemyBorutoMarkX < MAP_WIDTH) {
gotoxy(MAP_START_X + enemyBorutoMarkX, charY – 1); setColor(9); cout << "*";
}
}
else { enemyBorutoMarkActive = false; }
}
// 水门标记
if (playerMinatoMarkActive) {
gotoxy(MAP_START_X + playerMinatoMarkX, charY – 1); setColor(6); cout << "#";
}
if (enemyMinatoMarkActive) {
gotoxy(MAP_START_X + enemyMinatoMarkX, charY – 1); setColor(6); cout << "#";
}
// 柱间跺脚
if (playerHashiramaStompActive) {
auto now = chrono::steady_clock::now();
if (now < playerHashiramaStompEnd) {
if (playerHashiramaStompX > 0 && playerHashiramaStompX < MAP_WIDTH && playerHashiramaStompX != enemy.x) {
gotoxy(MAP_START_X + playerHashiramaStompX, charY); setColor(8); cout << "L";
}
}
else { playerHashiramaStompActive = false; }
}
if (enemyHashiramaStompActive) {
auto now = chrono::steady_clock::now();
if (now < enemyHashiramaStompEnd) {
if (enemyHashiramaStompX > 0 && enemyHashiramaStompX < MAP_WIDTH && enemyHashiramaStompX != player.x) {
gotoxy(MAP_START_X + enemyHashiramaStompX, charY); setColor(8); cout << "L";
}
}
else { enemyHashiramaStompActive = false; }
}
// 木龙
if (playerHashiramaWoodDragonActive) {
auto now = chrono::steady_clock::now();
if (now < playerHashiramaWoodDragonEnd) {
for (int i = 0; i < 10; i++) {
int dx = player.x + 1 + i;
if (dx < MAP_WIDTH && dx != enemy.x && dx != player.x) { gotoxy(MAP_START_X + dx, charY); setColor(2); cout << "~"; }
}
if (player.x + 1 < MAP_WIDTH) { gotoxy(MAP_START_X + player.x + 1, charY); setColor(2); cout << "€"; }
}
if (playerHashiramaEnemyTrapped && now < playerHashiramaWoodDragonTrapEnd) {
if (enemy.x – 1 > 0 && enemy.x – 1 != player.x) { gotoxy(MAP_START_X + enemy.x – 1, charY); setColor(2); cout << ">"; }
if (enemy.x + 1 < MAP_WIDTH && enemy.x + 1 != player.x) { gotoxy(MAP_START_X + enemy.x + 1, charY); setColor(2); cout << "<"; }
}
}
if (enemyHashiramaWoodDragonActive) {
auto now = chrono::steady_clock::now();
if (now < enemyHashiramaWoodDragonEnd) {
for (int i = 0; i < 10; i++) {
int dx = enemy.x – 1 – i;
if (dx > 0 && dx != player.x && dx != enemy.x) { gotoxy(MAP_START_X + dx, charY); setColor(2); cout << "~"; }
}
if (enemy.x – 1 > 0) { gotoxy(MAP_START_X + enemy.x – 1, charY); setColor(2); cout << "€"; }
}
if (enemyHashiramaEnemyTrapped && now < enemyHashiramaWoodDragonTrapEnd) {
if (player.x – 1 > 0 && player.x – 1 != enemy.x) { gotoxy(MAP_START_X + player.x – 1, charY); setColor(2); cout << ">"; }
if (player.x + 1 < MAP_WIDTH && player.x + 1 != enemy.x) { gotoxy(MAP_START_X + player.x + 1, charY); setColor(2); cout << "<"; }
}
}
// 明神门
if (playerHashiramaMyojinmonActive) {
if (enemy.x – 2 > 0 && enemy.x – 2 != player.x) { gotoxy(MAP_START_X + enemy.x – 2, charY); setColor(12); cout << "|"; }
if (enemy.x + 2 < MAP_WIDTH && enemy.x + 2 != player.x) { gotoxy(MAP_START_X + enemy.x + 2, charY); setColor(12); cout << "|"; }
}
if (enemyHashiramaMyojinmonActive) {
if (player.x – 2 > 0 && player.x – 2 != enemy.x) { gotoxy(MAP_START_X + player.x – 2, charY); setColor(12); cout << "|"; }
if (player.x + 2 < MAP_WIDTH && player.x + 2 != enemy.x) { gotoxy(MAP_START_X + player.x + 2, charY); setColor(12); cout << "|"; }
}
// 木人
if (playerHashiramaWoodGolemActive) {
auto now = chrono::steady_clock::now();
if (now < playerHashiramaWoodGolemEnd) {
for (int row = 0; row < 3; row++) {
for (int col = 0; col < 4; col++) {
int gx = player.x – 1 + col, gy = charY – 3 – row;
if (gx > 0 && gx < MAP_WIDTH && gy > 0) { gotoxy(MAP_START_X + gx, MAP_START_Y + gy); setColor(6); cout << "¥"; }
}
}
}
else { playerHashiramaWoodGolemActive = false; playerHashiramaWoodGolemAttackCount = 0; }
}
if (enemyHashiramaWoodGolemActive) {
auto now = chrono::steady_clock::now();
if (now < enemyHashiramaWoodGolemEnd) {
for (int row = 0; row < 3; row++) {
for (int col = 0; col < 4; col++) {
int gx = enemy.x – 1 + col, gy = charY – 3 – row;
if (gx > 0 && gx < MAP_WIDTH && gy > 0) { gotoxy(MAP_START_X + gx, MAP_START_Y + gy); setColor(6); cout << "¥"; }
}
}
}
else { enemyHashiramaWoodGolemActive = false; enemyHashiramaWoodGolemAttackCount = 0; }
}
// 佐助剑气/天照/须佐
if (playerSasukeSlashActive) {
auto now = chrono::steady_clock::now();
if (now < playerSasukeSlashEnd) { gotoxy(MAP_START_X + player.x + 1, charY); setColor(13); cout << ")"; }
else { playerSasukeSlashActive = false; }
}
if (enemySasukeSlashActive) {
auto now = chrono::steady_clock::now();
if (now < enemySasukeSlashEnd) { gotoxy(MAP_START_X + enemy.x – 1, charY); setColor(13); cout << ")"; }
else { enemySasukeSlashActive = false; }
}
if (playerSasukeAmaterasuActive) {
auto now = chrono::steady_clock::now();
if (now < playerSasukeAmaterasuEnd) {
for (int i = 1; i <= 8; i++) {
int ax = player.x + i; if (ax < MAP_WIDTH && ax < enemy.x && ax != player.x) {
gotoxy(MAP_START_X + ax, charY); setColor(13); cout << "-";
}
}
if (enemy.x – 1 > 0) { gotoxy(MAP_START_X + enemy.x – 1, charY); setColor(13); cout << "|"; }
if (enemy.x + 1 < MAP_WIDTH) { gotoxy(MAP_START_X + enemy.x + 1, charY); setColor(13); cout << "|"; }
if (playerSasukeAmaterasuHit) {
if (now >= playerSasukeAmaterasuTick) {
enemy.hp -= increasePlayerDamage(5); if (enemy.hp < 0) enemy.hp = 0;
playerSasukeAmaterasuTick = now + chrono::milliseconds(500);
}
}
}
else { playerSasukeAmaterasuActive = false; playerSasukeAmaterasuHit = false; skillInProgress = false; }
}
if (enemySasukeAmaterasuActive) {
auto now = chrono::steady_clock::now();
if (now < enemySasukeAmaterasuEnd) {
for (int i = 1; i <= 8; i++) {
int ax = enemy.x – i; if (ax > 0 && ax > player.x && ax != enemy.x) {
gotoxy(MAP_START_X + ax, charY); setColor(13); cout << "-";
}
}
if (player.x – 1 > 0) { gotoxy(MAP_START_X + player.x – 1, charY); setColor(13); cout << "|"; }
if (player.x + 1 < MAP_WIDTH) { gotoxy(MAP_START_X + player.x + 1, charY); setColor(13); cout << "|"; }
if (enemySasukeAmaterasuHit) {
if (now >= enemySasukeAmaterasuTick) {
player.hp -= reducePlayerDamage(5); if (player.hp < 0) player.hp = 0;
enemySasukeAmaterasuTick = now + chrono::milliseconds(500);
}
}
}
else { enemySasukeAmaterasuActive = false; enemySasukeAmaterasuHit = false; enemySkillInProgress = false; }
}
if (playerSasukeSusanooActive) {
auto now = chrono::steady_clock::now();
if (now < playerSasukeSusanooEnd) {
for (int row = 0; row < 8; row++) {
for (int col = 0; col < 4; col++) {
int sx = player.x – 1 + col, sy = charY – 2 – row;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) { gotoxy(MAP_START_X + sx, MAP_START_Y + sy); setColor(13); cout << "#"; }
}
}
}
if (playerSasukeSusanooSlashActive) {
for (int row = 0; row < 8; row++) {
int sx = player.x + 3, sy = charY – 2 – row;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) { gotoxy(MAP_START_X + sx, MAP_START_Y + sy); setColor(13); cout << "}"; }
}
}
}
else { playerSasukeSusanooActive = false; playerSasukeSusanooSlashCount = 0; }
if (enemySasukeSusanooActive) {
auto now = chrono::steady_clock::now();
if (now < enemySasukeSusanooEnd) {
for (int row = 0; row < 8; row++) {
for (int col = 0; col < 4; col++) {
int sx = enemy.x – 1 + col, sy = charY – 2 – row;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) { gotoxy(MAP_START_X + sx, MAP_START_Y + sy); setColor(13); cout << "#"; }
}
}
}
if (enemySasukeSusanooSlashActive) {
for (int row = 0; row < 8; row++) {
int sx = enemy.x – 3, sy = charY – 2 – row;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) { gotoxy(MAP_START_X + sx, MAP_START_Y + sy); setColor(13); cout << "}"; }
}
}
}
else { enemySasukeSusanooActive = false; enemySasukeSusanooSlashCount = 0; }
// 泉奈
if (playerIzunaSlashActive) {
auto now = chrono::steady_clock::now();
if (now < playerIzunaSlashEnd) { gotoxy(MAP_START_X + player.x + 1, charY); setColor(9); cout << ")"; }
else { playerIzunaSlashActive = false; }
}
if (enemyIzunaSlashActive) {
auto now = chrono::steady_clock::now();
if (now < enemyIzunaSlashEnd) { gotoxy(MAP_START_X + enemy.x – 1, charY); setColor(9); cout << ")"; }
else { enemyIzunaSlashActive = false; }
}
if (playerIzunaFireballActive) {
auto now = chrono::steady_clock::now();
if (now < playerIzunaFireballEnd) {
for (int i = 0; i < 6; i++) {
int fx = player.x + 1 + i; if (fx < MAP_WIDTH && fx != enemy.x && fx != player.x) { gotoxy(MAP_START_X + fx, charY); setColor(12); cout << "-"; }
}
if (player.x + 7 < MAP_WIDTH) { gotoxy(MAP_START_X + player.x + 7, charY); setColor(14); cout << "*"; }
}
else { playerIzunaFireballActive = false; }
}
if (enemyIzunaFireballActive) {
auto now = chrono::steady_clock::now();
if (now < enemyIzunaFireballEnd) {
for (int i = 0; i < 6; i++) {
int fx = enemy.x – 1 – i; if (fx > 0 && fx != player.x && fx != enemy.x) { gotoxy(MAP_START_X + fx, charY); setColor(12); cout << "-"; }
}
if (enemy.x – 7 > 0) { gotoxy(MAP_START_X + enemy.x – 7, charY); setColor(14); cout << "*"; }
}
else { enemyIzunaFireballActive = false; }
}
if (playerIzunaSwordActive) {
auto now = chrono::steady_clock::now();
if (now < playerIzunaSwordEnd) {
for (int i = 0; i < 3; i++) {
int sx = player.x + 1 + i; if (sx < MAP_WIDTH && sx != enemy.x && sx != player.x) { gotoxy(MAP_START_X + sx, charY); setColor(9); cout << "-"; }
}
}
else { playerIzunaSwordActive = false; }
}
if (enemyIzunaSwordActive) {
auto now = chrono::steady_clock::now();
if (now < enemyIzunaSwordEnd) {
for (int i = 0; i < 3; i++) {
int sx = enemy.x – 1 – i; if (sx > 0 && sx != player.x && sx != enemy.x) { gotoxy(MAP_START_X + sx, charY); setColor(9); cout << "-"; }
}
}
else { enemyIzunaSwordActive = false; }
}
if (playerIzunaCounterActive && !playerIzunaCounterTriggered) {
gotoxy(MAP_START_X + player.x, charY – 1); setColor(11); cout << "!";
}
if (enemyIzunaCounterActive && !enemyIzunaCounterTriggered) {
gotoxy(MAP_START_X + enemy.x, charY – 1); setColor(11); cout << "!";
}
// 博人超大玉螺旋丸持续伤害
if (playerBorutoBigRasenganHit) {
auto now = chrono::steady_clock::now();
if (now < playerBorutoBigRasenganDotEnd) {
int dotDamage = rand() % 4 + 2;
enemy.hp -= increasePlayerDamage(dotDamage); if (enemy.hp < 0) enemy.hp = 0;
}
else { playerBorutoBigRasenganHit = false; }
}
// 博人楔状态结束
if (playerBorutoKarmaActive) {
auto now = chrono::steady_clock::now();
if (now >= playerBorutoKarmaEnd) { playerBorutoKarmaActive = false; playerBorutoFlying = false; playerBorutoEnhancedAttackCount = 0; playerBorutoBigRasenganHit = false; }
}
if (enemyBorutoKarmaActive) {
auto now = chrono::steady_clock::now();
if (now >= enemyBorutoKarmaEnd) { enemyBorutoKarmaActive = false; enemyBorutoFlying = false; enemyBorutoEnhancedAttackCount = 0; }
}
// 技能信息栏
setColor(7); gotoxy(MAP_START_X, MAP_START_Y + MAP_HEIGHT + 2);
if (playerCharacterType == 7) {
int cd = getRemainingCD(playerBlackZetsuNormalCDEnd);
cout << "技能: K-普攻(移至左侧)";
if (cd > 0) { setColor(8); cout << "(CD:" << cd << "s)"; }
else { setColor(10); cout << "(就绪)"; }
setColor(7); cout << " | J/I/O-无技能";
}
else if (playerCharacterType == 8) {
cout << "状态:" << (playerWandererState == 0 ? "短刀" : "长刀") << " | K-剑气(CD:" << getRemainingCD(playerWandererNormalCDEnd) << "s)";
cout << " | J-挥砍(CD:" << getRemainingCD(playerWandererSkill1CDEnd) << "s)";
if (playerWandererState == 0) {
cout << " | I-三连斩(" << (playerWandererShortSkill2Used ? "已用" : "可用") << ")";
if (playerWandererShortSkill2Used) cout << " | U-转刀(CD:" << getRemainingCD(playerWandererShortSubSkillCDEnd) << "s)";
}
else {
cout << " | I-神威虚化(剩余" << playerWandererLongSkill2Count << "次,CD:" << getRemainingCD(playerWandererLongSkill2CDEnd) << "s)";
cout << " | U-震刀(CD:" << getRemainingCD(playerWandererLongSubSkillCDEnd) << "s)";
}
cout << " | O-奥义(消耗4技能点)";
}
else if (playerCharacterType == 9) {
cout << "技能: K-苦无刺击(CD:" << getRemainingCD(playerMinatoNormalCDEnd) << "s) | J-螺旋丸(CD:" << getRemainingCD(playerMinatoSkill1CDEnd) << "s)";
cout << " | I-神速(CD:" << getRemainingCD(playerMinatoSkill2CDEnd) << "s)";
if (playerMinatoCounterReady) cout << "(可防反)";
cout << " | O-超大玉螺旋丸(消耗4技能点)";
}
else if (playerCharacterType == 0) {
int cd1 = getRemainingCD(playerSkill1CDEnd), cd2 = getRemainingCD(playerSkill2CDEnd);
cout << "技能: K-普攻 | J-螺旋丸";
if (cd1 > 0) { setColor(8); cout << "(CD:" << cd1 << "s)"; }
else { setColor(10); cout << "(就绪)"; }
setColor(7); cout << " | I-九尾抓取";
if (cd2 > 0) { setColor(8); cout << "(CD:" << cd2 << "s)"; }
else { setColor(10); cout << "(就绪)"; }
setColor(7); cout << " | O-尾兽玉(消耗4技能点)";
}
else if (playerCharacterType == 1) {
int cd1 = getRemainingCD(playerSkill1CDEnd), cd2 = getRemainingCD(playerSkill2CDEnd);
cout << "技能: K-普攻 | J-万象天引";
if (cd1 > 0) { setColor(8); cout << "(CD:" << cd1 << "s)"; }
else { setColor(10); cout << "(就绪)"; }
setColor(7); cout << " | I-神罗天征";
if (playerShinraTenseiActive) { setColor(11); cout << "(激活中)"; }
else if (cd2 > 0) { setColor(8); cout << "(CD:" << cd2 << "s)"; }
else { setColor(10); cout << "(就绪)"; }
setColor(7); cout << " | O-超神罗天征(消耗4技能点)";
}
else if (playerCharacterType == 2) {
int cd1 = getRemainingCD(playerSkill1CDEnd), cd2 = getRemainingCD(playerSkill2CDEnd);
cout << "技能: K-普攻 | J-";
if (playerObitoEnemyTrapped) { if (playerObitoFireActive) cout << "火遁-火龙卷(已用)"; else cout << "火遁-火龙卷(可用)"; }
else cout << "木遁-扦插";
if (cd1 > 0) { setColor(8); cout << "(CD:" << cd1 << "s)"; }
else { setColor(10); cout << "(就绪)"; }
setColor(7); cout << " | I-";
if (playerObitoKamuiSpaceActive) { cout << "神威空间"; setColor(11); cout << "(空间中)"; }
else if (playerObitoEnemyTrapped && !playerObitoWoodStormActive) { cout << "木遁-暴风乱舞(可用)"; }
else if (playerObitoEnemyTrapped && playerObitoWoodStormActive) { cout << "暴风乱舞(已用)"; }
else if (playerObitoKamuiActive) { cout << "神威-空间"; setColor(11); cout << "(虚化中)"; }
else { cout << "神威"; if (cd2 > 0) { setColor(8); cout << "(CD:" << cd2 << "s)"; } else { setColor(10); cout << "(就绪)"; } }
setColor(7); cout << " | O-十尾入侵(消耗4技能点)";
}
else if (playerCharacterType == 3) {
if (playerBorutoKarmaActive) {
auto now = chrono::steady_clock::now();
int remaining = chrono::duration_cast<chrono::seconds>(playerBorutoKarmaEnd – now).count(); if (remaining < 0) remaining = 0;
int cd1 = getRemainingCD(playerSkill1CDEnd), cd2 = getRemainingCD(playerSkill2CDEnd);
cout << "技能: K-"; if (playerBorutoFlying) cout << "强化螺旋丸(" << 3 – playerBorutoEnhancedAttackCount << ")"; else cout << "普攻";
cout << " | J-大筒木飞行";
if (cd1 > 0) { setColor(8); cout << "(CD:" << cd1 << "s)"; }
else { setColor(10); cout << "(就绪)"; }
setColor(7); cout << " | I-超大玉螺旋丸";
if (cd2 > 0) { setColor(8); cout << "(CD:" << cd2 << "s)"; }
else { setColor(10); cout << "(就绪)"; }
setColor(7); cout << " | 楔:" << remaining << "s";
}
else {
int cd1 = getRemainingCD(playerSkill1CDEnd), cd2 = getRemainingCD(playerSkill2CDEnd);
cout << "技能: K-普攻 | J-螺旋丸涡彦";
if (cd1 > 0) { setColor(8); cout << "(CD:" << cd1 << "s)"; }
else { setColor(10); cout << "(就绪)"; }
setColor(7); cout << " | I-亚飞雷神";
if (playerBorutoTeleported && playerBorutoTeleportBack) { setColor(10); cout << "(可返回)"; }
else if (cd2 > 0) { setColor(8); cout << "(CD:" << cd2 << "s)"; }
else { setColor(10); cout << "(就绪)"; }
setColor(7); int ucd = getRemainingCD(playerSkill3CDEnd);
if (ucd > 0) cout << " | O-楔(CD:" << ucd << "s)"; else cout << " | O-楔(可用)";
}
}
else if (playerCharacterType == 4) {
int cd1 = getRemainingCD(playerSkill1CDEnd), cd2 = getRemainingCD(playerSkill2CDEnd);
cout << "技能: K-普攻 | J-";
if (playerHashiramaEnemyTrapped && !playerHashiramaMyojinmonUsed) cout << "明神门(可用)";
else cout << "木龙扦插之术";
if (cd1 > 0) { setColor(8); cout << "(CD:" << cd1 << "s)"; }
else { setColor(10); cout << "(就绪)"; }
setColor(7); cout << " | I-木人之术";
if (playerHashiramaWoodGolemActive) { cout << "(激活中"; if (playerHashiramaWoodGolemAttackCount < 2) cout << ",可按K攻击"; cout << ")"; }
else if (cd2 > 0) { setColor(8); cout << "(CD:" << cd2 << "s)"; }
else { setColor(10); cout << "(就绪)"; }
setColor(7); cout << " | O-千手观音(消耗4技能点)";
}
else if (playerCharacterType == 5) {
int cd1 = getRemainingCD(playerSkill1CDEnd), cd2 = getRemainingCD(playerSkill2CDEnd);
cout << "技能: K-普攻 | J-天照";
if (cd1 > 0) { setColor(8); cout << "(CD:" << cd1 << "s)"; }
else { setColor(10); cout << "(就绪)"; }
setColor(7); cout << " | I-天手力";
if (cd2 > 0) { setColor(8); cout << "(CD:" << cd2 << "s)"; }
else { setColor(10); cout << "(就绪)"; }
setColor(7); cout << " | U-须佐能乎";
if (playerSasukeSusanooActive) cout << "(开启中)"; else { int scd = getRemainingCD(playerSasukeSubSkillCD); if (scd > 0) { setColor(8); cout << "(CD:" << scd << "s)"; } else { setColor(10); cout << "(可用)"; } }
setColor(7); cout << " | O-地爆天星斩(消耗4技能点)";
}
else if (playerCharacterType == 6) {
int cd1 = getRemainingCD(playerSkill1CDEnd), cd2 = getRemainingCD(playerSkill2CDEnd);
cout << "技能: K-普攻 | J-豪火球";
if (cd1 > 0) { setColor(8); cout << "(CD:" << cd1 << "s)"; }
else { setColor(10); cout << "(就绪)"; }
setColor(7); cout << " | I-宇智波流剑术";
auto nc = chrono::steady_clock::now();
if (playerIzunaSword2ndWindow > nc && !playerIzunaSword2ndUsed) { setColor(10); cout << "(二段可用)"; }
else if (cd2 > 0) { setColor(8); cout << "(CD:" << cd2 << "s)"; }
else { setColor(10); cout << "(就绪)"; }
setColor(7); cout << " | U-宇智波防反";
int scd = getRemainingCD(playerSkill3CDEnd); if (scd > 0) { setColor(8); cout << "(CD:" << scd << "s)"; }
else { setColor(10); cout << "(可用)"; }
setColor(7); cout << " | O-宇智波的荣耀(消耗4技能点)";
}
else if (playerCharacterType == 10) {
string stateName[] = { "天道","畜生道-男","畜生道-女","修罗道","饿鬼道","人间道","地狱道" };
cout << "状态:" << stateName[playerPainSixPathState] << " | ";
cout << "K-剑气(CD:0.5s) | ";
cout << "J-";
if (playerPainSixPathState == 0) cout << "万象天引";
else if (playerPainSixPathState == 1) cout << "地狱犬";
else if (playerPainSixPathState == 2) cout << "突刺";
else if (playerPainSixPathState == 3) cout << "导弹";
else if (playerPainSixPathState == 4) cout << "抱摔";
else if (playerPainSixPathState == 5) cout << "封印术";
else if (playerPainSixPathState == 6) cout << "阎王";
cout << " | I-";
if (playerPainSixPathState == 0) cout << "神罗天征";
else if (playerPainSixPathState == 1) cout << "panda";
else if (playerPainSixPathState == 2) cout << "变色龙";
else if (playerPainSixPathState == 3) cout << "铁臂捉取";
else if (playerPainSixPathState == 4) cout << "忍术吸收";
else if (playerPainSixPathState == 5) cout << "阎王";
else if (playerPainSixPathState == 6) {
if (playerPainSixPathSummonActive) cout << "发射黑棒";
else cout << "阎王(需先召唤)";
}
cout << " | U-切换状态 | O-六道轮回(消耗4技能点)";
cout << " [轮换:" << playerPainSixPathCycleCount << "]";
}
gotoxy(MAP_START_X, MAP_START_Y + MAP_HEIGHT + 3); cout << "移动: A-左移 D-右移 | 替身: S(被击飞时)";
}
// ==================== 伤害辅助 ====================
int getShinraTenseiDamage(int stack) {
int minDamage, maxDamage;
switch (stack) {
case 1: minDamage = 8; maxDamage = 12; break;
case 2: minDamage = 9; maxDamage = 13; break;
case 3: minDamage = 10; maxDamage = 14; break;
case 4: minDamage = 11; maxDamage = 15; break;
case 5: minDamage = 12; maxDamage = 15; break;
default: minDamage = 8; maxDamage = 12; break;
}
return rand() % (maxDamage – minDamage + 1) + minDamage;
}
// ==================== 技能点/击飞/替身辅助函数 ====================
void addPlayerSkillPoint() {
if (playerSkillPoints < MAX_SKILL_POINTS) {
playerSkillPoints++;
}
}
void addEnemySkillPoint() {
if (enemySkillPoints < MAX_SKILL_POINTS) {
enemySkillPoints++;
}
}
bool canPlayerUseUltimate() {
return playerSkillPoints >= MAX_SKILL_POINTS;
}
bool canEnemyUseUltimate() {
return enemySkillPoints >= MAX_SKILL_POINTS;
}
void consumePlayerSkillPoints(int amount) {
playerSkillPoints -= amount;
if (playerSkillPoints < 0) playerSkillPoints = 0;
}
void consumeEnemySkillPoints(int amount) {
enemySkillPoints -= amount;
if (enemySkillPoints < 0) enemySkillPoints = 0;
}
void launchPlayer() {
if (!playerLaunched && !playerPinned) {
playerLaunched = true;
playerLaunchTime = chrono::steady_clock::now();
}
}
void launchEnemy() {
if (!enemyLaunched && !enemyPinned) {
enemyLaunched = true;
enemyLaunchTime = chrono::steady_clock::now();
}
}
void resetEnemyLaunchTimer() {
if (enemyLaunched) {
enemyLaunchTime = chrono::steady_clock::now();
}
}
void resetPlayerLaunchTimer() {
if (playerLaunched) {
playerLaunchTime = chrono::steady_clock::now();
}
}
bool playerSubstitute() {
if (!playerLaunched) return false;
if (!playerSubstitutionReady) return false;
if (playerPinned) return false;
if (playerSkillPoints < 1) return false;
consumePlayerSkillPoints(1);
playerSubstitutionReady = false;
playerSubstitutionCD = chrono::steady_clock::now() + chrono::seconds(SUBSTITUTION_COOLDOWN);
int newX = enemy.x – 5;
if (newX < 2) newX = 2;
if (newX >= enemy.x) newX = enemy.x – 2;
player.x = newX;
playerLaunched = false;
return true;
}
bool enemySubstitute() {
if (!enemyLaunched) return false;
if (!enemySubstitutionReady) return false;
if (enemyPinned) return false;
if (enemySkillPoints < 1) return false;
consumeEnemySkillPoints(1);
enemySubstitutionReady = false;
enemySubstitutionCD = chrono::steady_clock::now() + chrono::seconds(SUBSTITUTION_COOLDOWN);
int newX = player.x + 5;
if (newX >= MAP_WIDTH – 2) newX = MAP_WIDTH – 3;
if (newX <= player.x) newX = player.x + 2;
enemy.x = newX;
enemyLaunched = false;
return true;
}
// ———- 鸣人 ———-
void playerNarutoNormalAttack() {
int d = abs(player.x – enemy.x);
if (player.x < enemy.x && d >= 1 && d <= 3) {
int dmg = increasePlayerDamage(rand() % 4 + 3);
if (playerNarutoTailActive) {
for (int i = 0; i < 3; i++) if (playerNarutoTailX[i] > 0 && playerNarutoTailX[i] < MAP_WIDTH && playerNarutoTailX[i] != enemy.x) { gotoxy(MAP_START_X + playerNarutoTailX[i], MAP_START_Y + CHARACTER_ROW); cout << " "; }
}
playerNarutoTailActive = true; playerNarutoTailEnd = chrono::steady_clock::now() + chrono::milliseconds(1500);
for (int i = 0; i < 3; i++) { playerNarutoTailX[i] = player.x + 1 + i; if (playerNarutoTailX[i] >= enemy.x) { playerNarutoTailX[i] = 0; break; } }
enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "玩家普攻造成 " << dmg << " 点伤害! ";
}
else { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << (player.x >= enemy.x ? "无法向后攻击!" : "距离太远,无法攻击!"); }
}
void playerNarutoSkill1() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < playerSkill1CDEnd) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "螺旋丸冷却中…"; return; }
skillInProgress = true; int t = enemy.x – 1; if (t < player.x + 1) t = player.x + 1;
while (player.x < t) { player.x++; if (player.x >= enemy.x) { player.x = enemy.x – 1; break; } drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(50)); }
int sx = player.x + 1; if (sx < enemy.x && sx != enemy.x && sx != player.x) { gotoxy(MAP_START_X + sx, MAP_START_Y + CHARACTER_ROW); setColor(14); cout << "O"; }
this_thread::sleep_for(chrono::seconds(1)); if (sx < enemy.x && sx != enemy.x && sx != player.x) { gotoxy(MAP_START_X + sx, MAP_START_Y + CHARACTER_ROW); cout << " "; }
int dmg = increasePlayerDamage(rand() % 8 + 8); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "螺旋丸造成 " << dmg << " 点伤害!"; playerSkill1CDEnd = now + chrono::seconds(8); skillInProgress = false;
}
void playerNarutoSkill2() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < playerSkill2CDEnd) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "九尾抓取冷却中…"; return; }
skillInProgress = true; bool caught = false; int len = 20;
for (int i = 0; i < len; i++) { int cx = player.x + 1 + i; if (cx >= MAP_WIDTH || cx >= enemy.x) break; if (cx != enemy.x && cx != player.x) { gotoxy(MAP_START_X + cx, MAP_START_Y + CHARACTER_ROW); setColor(14); cout << "-"; } if (cx == enemy.x – 1) { caught = true; break; } }
if (caught && enemy.x – 1 != player.x && enemy.x – 1 != enemy.x) { gotoxy(MAP_START_X + (enemy.x – 1), MAP_START_Y + CHARACTER_ROW); setColor(14); cout << "O"; }
this_thread::sleep_for(chrono::milliseconds(500)); for (int i = 0; i < len; i++) { int cx = player.x + 1 + i; if (cx >= MAP_WIDTH || cx >= enemy.x) break; if (cx != enemy.x && cx != player.x) { gotoxy(MAP_START_X + cx, MAP_START_Y + CHARACTER_ROW); cout << " "; } }
if (caught) {
enemyPinned = true;
int dmg = increasePlayerDamage(rand() % 6 + 20); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "九尾抓取造成 " << dmg << " 点伤害!"; playerSkill2CDEnd = now + chrono::seconds(15);
this_thread::sleep_for(chrono::seconds(2));
enemyPinned = false;
}
else { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "未抓取到敌人,CD减半"; playerSkill2CDEnd = now + chrono::seconds(7); }
skillInProgress = false;
}
void playerNarutoUltimate() {
if (skillInProgress || enemySkillInProgress) return;
if (!canPlayerUseUltimate()) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "技能点不足!需要4个技能点"; return; }
skillInProgress = true; consumePlayerSkillPoints(4);
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "尾兽玉蓄力中…";
int sx = player.x + 1, ex = enemy.x – 1, dist = ex – sx, steps = 30;
for (int i = 0; i <= steps; i++) {
int cx = sx + (dist * i / steps); if (cx >= enemy.x) cx = enemy.x – 1;
if (i > 0) { int px = sx + (dist * (i – 1) / steps); if (px >= enemy.x) px = enemy.x – 1; if (px != enemy.x && px != player.x) { gotoxy(MAP_START_X + px, MAP_START_Y + CHARACTER_ROW); cout << " "; } }
if (cx != enemy.x && cx != player.x) { gotoxy(MAP_START_X + cx, MAP_START_Y + CHARACTER_ROW); setColor(14); cout << "0"; }
this_thread::sleep_for(chrono::milliseconds(100));
}
if (ex != enemy.x && ex != player.x) { gotoxy(MAP_START_X + ex, MAP_START_Y + CHARACTER_ROW); cout << " "; }
enemy.hp -= increasePlayerDamage(35); if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "尾兽玉造成35点伤害!"; skillInProgress = false;
}
// ———- 佩恩天道 ———-
void playerPainNormalAttack() {
if (player.x >= enemy.x) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "无法向后攻击!"; return; }
if (playerPainRodActive) { if (playerPainRodX > 0 && playerPainRodX < MAP_WIDTH && playerPainRodX != enemy.x && playerPainRodX != player.x) { gotoxy(MAP_START_X + playerPainRodX, MAP_START_Y + CHARACTER_ROW); cout << " "; } playerPainRodActive = false; playerRodHitting = false; }
int rx = player.x + 3; if (rx >= enemy.x) rx = enemy.x – 1; if (rx <= player.x) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "敌人太近!"; return; }
if (rx == enemy.x) rx = enemy.x – 1;
playerPainRodActive = true; playerPainRodX = rx; playerPainRodEnd = chrono::steady_clock::now() + chrono::milliseconds(1500);
int dmg = increasePlayerDamage(rand() % 3 + 4); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
addPlayerSkillPoint();
if (rx == enemy.x – 1) { playerRodHitting = true; playerRodHitEnd = playerPainRodEnd; gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "黑棒命中!造成" << dmg << "点伤害!"; }
else { playerRodHitting = false; gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "黑棒造成" << dmg << "点伤害!"; }
}
void playerPainSkill1() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < playerSkill1CDEnd) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "万象天引冷却中…"; return; }
int tx = player.x + 2; if (tx >= MAP_WIDTH – 1) tx = MAP_WIDTH – 2;
enemySkillInProgress = true;
while (enemy.x > tx) { enemy.x–; if (enemy.x <= player.x) { enemy.x = player.x + 2; break; } drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(30)); }
enemy.x = tx;
playerBlackRodLeftX = enemy.x – 1; playerBlackRodRightX = enemy.x + 1;
if (playerBlackRodLeftX > 0 && playerBlackRodLeftX != enemy.x && playerBlackRodLeftX != player.x) {
gotoxy(MAP_START_X + playerBlackRodLeftX, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "\\\\";
}
if (playerBlackRodRightX < MAP_WIDTH && playerBlackRodRightX != enemy.x && playerBlackRodRightX != player.x) {
gotoxy(MAP_START_X + playerBlackRodRightX, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "/";
}
playerBanshoTeninActive = true; playerBanshoTeninEnd = now + chrono::seconds(5);
enemyPinned = true;
int dmg = increasePlayerDamage(rand() % 4 + 10); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "万象天引造成" << dmg << "点伤害!";
playerSkill1CDEnd = now + chrono::seconds(12);
this_thread::sleep_for(chrono::seconds(3));
if (playerBlackRodLeftX > 0 && playerBlackRodLeftX != enemy.x && playerBlackRodLeftX != player.x) {
gotoxy(MAP_START_X + playerBlackRodLeftX, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
if (playerBlackRodRightX < MAP_WIDTH && playerBlackRodRightX != enemy.x && playerBlackRodRightX != player.x) {
gotoxy(MAP_START_X + playerBlackRodRightX, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
enemyPinned = false;
enemySkillInProgress = false;
}
void finishPlayerShinraTensei() {
for (int r = 1; r <= playerShinraTenseiRadius; r++) {
int lx = player.x – r, rx = player.x + r;
if (lx > 0 && lx != enemy.x && lx != player.x) { gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); cout << " "; }
if (rx < MAP_WIDTH && rx != enemy.x && rx != player.x) { gotoxy(MAP_START_X + rx, MAP_START_Y + CHARACTER_ROW); cout << " "; }
}
playerSkill2CDEnd = chrono::steady_clock::now() + chrono::seconds(playerShinraTenseiCurrentCD);
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "神罗天征结束,CD:" << playerShinraTenseiCurrentCD << "s";
playerShinraTenseiActive = false; playerShinraTenseiStack = 0; playerShinraTenseiRadius = 1; skillInProgress = false;
}
void playerPainSkill2() {
if (enemySkillInProgress) return;
if (skillInProgress && !playerShinraTenseiActive) return;
auto now = chrono::steady_clock::now();
if (!playerShinraTenseiActive) {
if (now < playerSkill2CDEnd) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "神罗天征冷却中…"; return; }
playerShinraTenseiActive = true; playerShinraTenseiStack = 1; playerShinraTenseiRadius = 1;
playerShinraTenseiStart = now; playerShinraTenseiCurrentCD = 15; skillInProgress = true;
int dmg = increasePlayerDamage(getShinraTenseiDamage(1)); bool hit = (enemy.x >= player.x – 1 && enemy.x <= player.x + 1);
if (hit) { enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0; launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint(); }
for (int r = 1; r <= 1; r++) { int lx = player.x – r, rx = player.x + r; if (lx > 0 && lx != enemy.x && lx != player.x) { gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); setColor(11); cout << "("; } if (rx < MAP_WIDTH && rx != enemy.x && rx != player.x) { gotoxy(MAP_START_X + rx, MAP_START_Y + CHARACTER_ROW); cout << ")"; } }
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << (hit ? "神罗天征造成" + to_string(dmg) + "点伤害!" : "神罗天征激活!再次按I叠加");
this_thread::sleep_for(chrono::milliseconds(500));
}
else {
auto el = chrono::duration_cast<chrono::seconds>(now – playerShinraTenseiStart).count();
if (el >= 3) { finishPlayerShinraTensei(); return; }
if (playerShinraTenseiStack < 5) {
playerShinraTenseiStack++; playerShinraTenseiRadius++; playerShinraTenseiCurrentCD += 2;
int dmg = increasePlayerDamage(getShinraTenseiDamage(playerShinraTenseiStack));
int lb = player.x – playerShinraTenseiRadius, rb = player.x + playerShinraTenseiRadius;
bool hit = (enemy.x >= lb && enemy.x <= rb); if (hit) { enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0; launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint(); }
for (int r = 1; r < playerShinraTenseiRadius; r++) { int lx = player.x – r, rx = player.x + r; if (lx > 0 && lx != enemy.x && lx != player.x) { gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); cout << " "; } if (rx < MAP_WIDTH && rx != enemy.x && rx != player.x) { gotoxy(MAP_START_X + rx, MAP_START_Y + CHARACTER_ROW); cout << " "; } }
for (int r = 1; r <= playerShinraTenseiRadius; r++) { int lx = player.x – r, rx = player.x + r; if (lx > 0 && lx != enemy.x && lx != player.x) { gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); setColor(11); cout << "("; } if (rx < MAP_WIDTH && rx != enemy.x && rx != player.x) { gotoxy(MAP_START_X + rx, MAP_START_Y + CHARACTER_ROW); cout << ")"; } }
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << (hit ? "神罗天征第" + to_string(playerShinraTenseiStack) + "层造成" + to_string(dmg) + "点伤害!" : "扩大到第" + to_string(playerShinraTenseiStack) + "层");
}
this_thread::sleep_for(chrono::milliseconds(500));
}
auto cn = chrono::steady_clock::now(); auto el = chrono::duration_cast<chrono::seconds>(cn – playerShinraTenseiStart).count();
if (el >= 3 || playerShinraTenseiStack >= 5) { this_thread::sleep_for(chrono::milliseconds(500)); finishPlayerShinraTensei(); }
}
void playerPainUltimate() {
if (skillInProgress || enemySkillInProgress) return;
if (!canPlayerUseUltimate()) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "技能点不足!需要4个技能点"; return; }
skillInProgress = true; consumePlayerSkillPoints(4);
int tx = MAP_WIDTH / 2;
while (player.x != tx) { if (player.x < tx) player.x++; else player.x–; drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(20)); }
for (int s = 1; s <= 5; s++) {
for (int r = 1; r <= s; r++) { int lx = player.x – r, rx = player.x + r; if (lx > 1 && lx != enemy.x && lx != player.x) { gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); setColor(13); cout << "{"; } if (rx < MAP_WIDTH && rx != enemy.x && rx != player.x) { gotoxy(MAP_START_X + rx, MAP_START_Y + CHARACTER_ROW); cout << "}"; } }
enemy.hp -= increasePlayerDamage(10); if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "超神罗天征第" << s << "秒造成10点伤害!"; this_thread::sleep_for(chrono::seconds(1)); if (enemy.hp <= 0) break;
}
for (int r = 1; r <= 5; r++) { int lx = player.x – r, rx = player.x + r; if (lx > 1 && lx != enemy.x && lx != player.x) { gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); cout << " "; } if (rx < MAP_WIDTH && rx != enemy.x && rx != player.x) { gotoxy(MAP_START_X + rx, MAP_START_Y + CHARACTER_ROW); cout << " "; } }
playerSkill1CDEnd = chrono::steady_clock::now(); gotoxy(2, MAP_START_Y + MAP_HEIGHT + 5); cout << "万象天引CD已重置!"; skillInProgress = false;
}
// ———- 带土 ———-
void playerObitoNormalAttack() {
if (player.x >= enemy.x) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "无法向后攻击!"; return; }
int d = abs(player.x – enemy.x); if (d < 1 || d > 2) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "距离不合适!"; return; }
int kx = player.x + 1; if (kx >= enemy.x) kx = enemy.x – 1; if (kx <= player.x) return;
playerObitoKickActive = true; playerObitoKickX = kx; playerObitoKickEnd = chrono::steady_clock::now() + chrono::milliseconds(1000);
int dmg = increasePlayerDamage(rand() % 3 + 6); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "踢腿造成" << dmg << "点伤害!";
}
void playerObitoSkill1() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now();
if (playerObitoEnemyTrapped && !playerObitoFireActive) {
int sx = player.x, tx = enemy.x – 3; if (tx < 2) tx = 2;
skillInProgress = true; playerObitoFireActive = true; player.x = tx; drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(300));
int fx = player.x + 1; for (int i = 0; i < 8; i++) { int px = fx + i; if (px < MAP_WIDTH && px != enemy.x && px != player.x) { gotoxy(MAP_START_X + px, MAP_START_Y + CHARACTER_ROW); setColor(6); cout << "~"; } }
int dmg = increasePlayerDamage(rand() % 5 + 14); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "火遁-火龙卷造成" << dmg << "点伤害!";
this_thread::sleep_for(chrono::seconds(2)); for (int i = 0; i < 8; i++) { int px = fx + i; if (px < MAP_WIDTH && px != enemy.x && px != player.x) { gotoxy(MAP_START_X + px, MAP_START_Y + CHARACTER_ROW); cout << " "; } }
player.x = sx; playerObitoFireActive = false; skillInProgress = false; return;
}
if (now < playerSkill1CDEnd) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "木遁-扦插冷却中…"; return; }
skillInProgress = true; playerObitoWoodSpikeX = player.x + 1; playerObitoWoodSpikeActive = true; playerObitoWoodSpikeEnd = now + chrono::milliseconds(500);
bool hit = false;
for (int i = 0; i < 30; i++) {
int cx = player.x + 1 + i; if (cx >= MAP_WIDTH || cx >= enemy.x) break; if (cx != enemy.x && cx != player.x) { gotoxy(MAP_START_X + cx, MAP_START_Y + CHARACTER_ROW); setColor(2); cout << "-"; }
if (cx == enemy.x – 1) { hit = true; break; } this_thread::sleep_for(chrono::milliseconds(20));
}
if (hit) {
playerObitoEnemyTrapped = true; playerObitoEnemyTrappedEnd = now + chrono::seconds(15);
enemyPinned = true;
int dmg = increasePlayerDamage(rand() % 5 + 12); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "木遁-扦插命中!";
}
else { playerObitoWoodSpikeActive = false; gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "未命中!"; }
for (int i = 0; i < 30; i++) { int cx = player.x + 1 + i; if (cx >= MAP_WIDTH || cx >= enemy.x) break; if (cx != enemy.x && cx != player.x) { gotoxy(MAP_START_X + cx, MAP_START_Y + CHARACTER_ROW); cout << " "; } }
playerSkill1CDEnd = now + chrono::seconds(hit ? 20 : 10);
if (hit) {
this_thread::sleep_for(chrono::seconds(3));
enemyPinned = false;
}
skillInProgress = false;
}
void playerObitoSkill2() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now();
if (playerObitoKamuiActive && !playerObitoKamuiSpaceActive) {
playerObitoKamuiActive = false; playerObitoKamuiSpaceActive = true; playerObitoSavedX = player.x;
int tx = enemy.x – 1; if (tx < 1) tx = 1; player.x = tx; playerObitoEnemyInSpace = true; playerObitoKamuiSpaceEnd = now + chrono::seconds(3);
addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "神威-空间!"; drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(500));
for (int s = 0; s < 3; s++) { int dmg = increasePlayerDamage(rand() % 3 + 8); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0; launchEnemy(); resetEnemyLaunchTimer(); this_thread::sleep_for(chrono::seconds(1)); if (enemy.hp <= 0) break; }
playerObitoEnemyInSpace = false; playerObitoKamuiSpaceActive = false; enemy.x = player.x + 3; if (enemy.x >= MAP_WIDTH – 2) enemy.x = MAP_WIDTH – 3;
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "敌人被吐出!"; playerSkill2CDEnd = now + chrono::seconds(10); return;
}
if (playerObitoEnemyTrapped && !playerObitoWoodStormActive) {
skillInProgress = true; playerObitoWoodStormActive = true; int sx = player.x, tx = enemy.x – 5; if (tx < 2) tx = 2; player.x = tx;
drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(300));
for (int i = 0; i < 20; i++) { int bx = player.x + 1 + i; if (bx >= MAP_WIDTH || bx >= enemy.x) break; if (bx != enemy.x && bx != player.x) { gotoxy(MAP_START_X + bx, MAP_START_Y + CHARACTER_ROW – 1); setColor(2); cout << "_"; gotoxy(MAP_START_X + bx, MAP_START_Y + CHARACTER_ROW); setColor(2); cout << "-"; } }
for (int s = 0; s < 6; s++) { if (abs(player.x – enemy.x) <= 20) { enemy.hp -= increasePlayerDamage(8); if (enemy.hp < 0) enemy.hp = 0; launchEnemy(); resetEnemyLaunchTimer(); } this_thread::sleep_for(chrono::seconds(1)); if (enemy.hp <= 0) break; }
for (int i = 0; i < 20; i++) { int bx = player.x + 1 + i; if (bx >= MAP_WIDTH) break; if (bx != enemy.x && bx != player.x) { gotoxy(MAP_START_X + bx, MAP_START_Y + CHARACTER_ROW – 1); cout << " "; gotoxy(MAP_START_X + bx, MAP_START_Y + CHARACTER_ROW); cout << " "; } }
player.x = sx; playerObitoWoodStormActive = false; skillInProgress = false; return;
}
if (now < playerSkill2CDEnd) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "神威冷却中…"; return; }
playerObitoKamuiActive = true; playerObitoKamuiEnd = now + chrono::seconds(5); gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "神威激活!按I进入空间";
}
void playerObitoUltimate() {
if (skillInProgress || enemySkillInProgress) return;
if (!canPlayerUseUltimate()) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "技能点不足!需要4个技能点"; return; }
skillInProgress = true; consumePlayerSkillPoints(4);
playerObitoUltimateActive = true; int cy = MAP_START_Y + CHARACTER_ROW, tby = cy – 5;
for (int r = 0; r < 5; r++) for (int c = 0; c < 10; c++) { int x = player.x – 5 + c, y = tby – r; if (x > 0 && x < MAP_WIDTH && y > 0) { gotoxy(MAP_START_X + x, MAP_START_Y + y); setColor(8); cout << "*"; } }
gotoxy(MAP_START_X + player.x, MAP_START_Y + tby – 5); setColor(10); cout << "@"; this_thread::sleep_for(chrono::seconds(2));
int bx = player.x;
for (int s = 0; s < 25; s++) {
int by = tby – 5 + s; if (by >= cy) break; if (s > 0) { int py = tby – 5 + s – 1; if (py < cy && py > 0) { gotoxy(MAP_START_X + bx, MAP_START_Y + py); cout << " "; } }
if (by > 0 && bx != enemy.x) { gotoxy(MAP_START_X + bx, MAP_START_Y + by); setColor(7); cout << "O"; } this_thread::sleep_for(chrono::milliseconds(150));
}
gotoxy(MAP_START_X + bx, MAP_START_Y + cy – 1); cout << " ";
for (int r = 0; r < 5; r++) for (int c = 0; c < 10; c++) { int x = player.x – 5 + c, y = tby – r; if (x > 0 && x < MAP_WIDTH && y > 0) { gotoxy(MAP_START_X + x, MAP_START_Y + y); cout << " "; } }
gotoxy(MAP_START_X + player.x, MAP_START_Y + tby – 5); cout << " ";
enemy.hp -= increasePlayerDamage(50); if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "十尾入侵造成50点伤害!"; playerObitoUltimateActive = false; skillInProgress = false;
}
// ———- 博人 ———-
void playerBorutoNormalAttack() {
if (player.x >= enemy.x) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "无法向后攻击!"; return; }
int d = abs(player.x – enemy.x); if (d < 1 || d > 4) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "距离不合适!"; return; }
if (playerObitoKamuiActive && !playerObitoKamuiSpaceActive) return;
playerBorutoSwordActive = true; playerBorutoSwordSlashing = true; playerBorutoSwordEnd = chrono::steady_clock::now() + chrono::milliseconds(2000); playerBorutoSwordX = player.x + 1;
int d1 = increasePlayerDamage(rand() % 3 + 7); enemy.hp -= d1; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "第一刀造成" << d1 << "点伤害!"; this_thread::sleep_for(chrono::milliseconds(400));
if (playerRodHitting || playerBanshoTeninActive || playerObitoEnemyTrapped || playerHashiramaEnemyTrapped || playerSasukeAmaterasuHit || playerIzunaCounterActive) { playerBorutoSwordActive = false; playerBorutoSwordSlashing = false; return; }
int d2 = increasePlayerDamage(rand() % 4 + 7); enemy.hp -= d2; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "第二刀造成" << d2 << "点伤害!"; this_thread::sleep_for(chrono::milliseconds(400));
if (playerRodHitting || playerBanshoTeninActive || playerObitoEnemyTrapped || playerHashiramaEnemyTrapped || playerSasukeAmaterasuHit || playerIzunaCounterActive) { playerBorutoSwordActive = false; playerBorutoSwordSlashing = false; return; }
int d3 = increasePlayerDamage(rand() % 5 + 8); enemy.hp -= d3; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "第三刀造成" << d3 << "点伤害!"; playerBorutoSwordActive = false; playerBorutoSwordSlashing = false;
}
void playerBorutoEnhancedAttack() {
if (!playerBorutoFlying) return; if (playerBorutoEnhancedAttackCount >= 3) return;
auto now = chrono::steady_clock::now(); if (now < playerBorutoEnhancedAttackCD) return;
playerBorutoEnhancedAttackCount++; playerBorutoEnhancedAttackCD = now + chrono::milliseconds(2500);
int sx = player.x + 1, ex = enemy.x, steps = 25, lx = 0;
for (int i = 0; i <= steps; i++) {
int cx = sx + ((ex – sx) * i / steps); if (cx >= enemy.x) break;
if (i > 0) { int px = sx + ((ex – sx) * (i – 1) / steps); if (px != enemy.x && px != player.x) { gotoxy(MAP_START_X + px, MAP_START_Y + CHARACTER_ROW); cout << " "; } }
if (cx != enemy.x && cx != player.x) { gotoxy(MAP_START_X + cx, MAP_START_Y + CHARACTER_ROW); setColor(11); cout << "O"; } lx = cx;
this_thread::sleep_for(chrono::milliseconds(100));
}
int dmg = increasePlayerDamage(rand() % 7 + 8); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "强化螺旋丸造成" << dmg << "点伤害!"; if (lx != enemy.x && lx != player.x) { gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); cout << " "; }
}
void playerBorutoSkill1() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now();
if (playerBorutoKarmaActive) { if (playerBorutoFlying) return; if (now < playerSkill1CDEnd) return; playerBorutoFlying = true; playerBorutoFlyingEnd = now + chrono::seconds(10); playerBorutoEnhancedAttackCount = 0; playerSkill1CDEnd = now + chrono::seconds(6); gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "大筒木-飞行!"; return; }
if (now < playerSkill1CDEnd) return;
skillInProgress = true; int tx = enemy.x – 3; if (tx < 2) tx = 2;
while (player.x > tx) { player.x–; drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(30)); }
while (player.x < tx) { player.x++; drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(30)); }
playerBorutoRasenganActive = true; playerBorutoRasenganEnd = now + chrono::seconds(3); playerBorutoRasenganHit = true;
for (int s = 0; s < 3; s++) { int dmg = increasePlayerDamage(rand() % 5 + 8); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0; launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint(); gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "螺旋丸涡彦第" << s + 1 << "秒造成" << dmg << "点伤害!"; this_thread::sleep_for(chrono::seconds(1)); if (enemy.hp <= 0) break; }
playerBorutoRasenganActive = false; tx = enemy.x – 8; if (tx < 1) tx = 1; player.x = tx;
playerBorutoMarkActive = true; playerBorutoMarkX = enemy.x; playerBorutoMarkEnd = now + chrono::seconds(10);
playerBorutoTeleported = false; playerBorutoTeleportBack = false; playerSkill1CDEnd = now + chrono::seconds(18); skillInProgress = false;
}
void playerBorutoSkill2() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now();
if (playerBorutoKarmaActive) { if (playerBorutoFlying) return; if (now < playerSkill2CDEnd) return; skillInProgress = true; int bx = player.x + 1; for (int s = 0; s < 20; s++) { int cx = bx + s; if (cx >= enemy.x) break; if (s > 0) { gotoxy(MAP_START_X + cx – 1, MAP_START_Y + CHARACTER_ROW); cout << " "; } if (cx != enemy.x && cx != player.x) { gotoxy(MAP_START_X + cx, MAP_START_Y + CHARACTER_ROW); setColor(11); cout << "O"; } this_thread::sleep_for(chrono::milliseconds(50)); } int dmg = increasePlayerDamage(rand() % 6 + 15); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0; launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint(); playerBorutoBigRasenganHit = true; playerBorutoBigRasenganDotEnd = now + chrono::seconds(5); gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "超大玉螺旋丸造成" << dmg << "点伤害!"; gotoxy(MAP_START_X + enemy.x – 1, MAP_START_Y + CHARACTER_ROW); cout << " "; playerSkill2CDEnd = now + chrono::seconds(15); skillInProgress = false; return; }
if (playerBorutoMarkActive && !playerBorutoTeleported) { playerBorutoTeleportSavedX = player.x; player.x = enemy.x – 3; if (player.x < 1) player.x = 1; playerBorutoTeleported = true; playerBorutoTeleportTime = now; int dmg = increasePlayerDamage(rand() % 9 + 10); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0; launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint(); gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "飞雷神·草薙剑造成" << dmg << "点伤害!"; playerBorutoTeleportBack = true; return; }
if (playerBorutoTeleported && playerBorutoTeleportBack) { auto ts = chrono::duration_cast<chrono::seconds>(now – playerBorutoTeleportTime).count(); if (ts <= 5) { player.x = playerBorutoTeleportSavedX; playerBorutoTeleported = false; playerBorutoTeleportBack = false; playerSkill2CDEnd = now + chrono::seconds(8); gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "飞雷神返回!"; return; } else { playerBorutoTeleportBack = false; } }
if (now < playerSkill2CDEnd) return;
}
void playerBorutoUltimate() {
if (skillInProgress || enemySkillInProgress) return; if (playerBorutoKarmaActive) return;
auto now = chrono::steady_clock::now(); if (now < playerSkill3CDEnd) return;
if (!canPlayerUseUltimate()) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "技能点不足!需要4个技能点"; return; }
skillInProgress = true; consumePlayerSkillPoints(4);
playerBorutoKarmaActive = true; playerBorutoKarmaEnd = now + chrono::seconds(60); playerSkill3CDEnd = now + chrono::seconds(45);
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "楔激活!"; skillInProgress = false;
}
// ———- 柱间 ———-
void playerHashiramaNormalAttack() {
if (player.x >= enemy.x) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "无法向后攻击!"; return; }
int d = abs(player.x – enemy.x); if (d < 1 || d > 5) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "距离不合适!"; return; }
playerHashiramaStompActive = true; playerHashiramaStompX = player.x + 1; playerHashiramaStompEnd = chrono::steady_clock::now() + chrono::milliseconds(800);
int dmg = increasePlayerDamage(rand() % 3 + 8); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "跺脚造成" << dmg << "点伤害!";
}
void playerHashiramaWoodGolemAttack() {
if (!playerHashiramaWoodGolemActive) return; if (playerHashiramaWoodGolemAttackCount >= 2) return;
auto now = chrono::steady_clock::now(); if (now < playerHashiramaWoodGolemAttackCD) return;
playerHashiramaWoodGolemAttackCount++; playerHashiramaWoodGolemAttackCD = now + chrono::milliseconds(2000);
int sx = player.x + 1; for (int i = 0; i < 15; i++) { int dx = sx + i; if (dx >= MAP_WIDTH || dx >= enemy.x) break; if (dx != enemy.x && dx != player.x) { gotoxy(MAP_START_X + dx, MAP_START_Y + CHARACTER_ROW); setColor(2); cout << "~"; } this_thread::sleep_for(chrono::milliseconds(30)); }
int dmg = increasePlayerDamage(rand() % 14 + 22); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "化龙造成" << dmg << "点伤害!"; for (int i = 0; i < 15; i++) { int dx = sx + i; if (dx >= MAP_WIDTH || dx >= enemy.x) break; if (dx != enemy.x && dx != player.x) { gotoxy(MAP_START_X + dx, MAP_START_Y + CHARACTER_ROW); cout << " "; } }
}
void playerHashiramaSkill1() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now();
if (playerHashiramaEnemyTrapped && !playerHashiramaMyojinmonUsed) { skillInProgress = true; playerHashiramaMyojinmonActive = true; playerHashiramaMyojinmonUsed = true; int dmg = increasePlayerDamage(rand() % 16 + 20); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0; launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint(); gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "明神门造成" << dmg << "点伤害!"; this_thread::sleep_for(chrono::seconds(2)); playerHashiramaMyojinmonActive = false; playerHashiramaEnemyTrapped = false; playerHashiramaWoodDragonActive = false; skillInProgress = false; return; }
if (now < playerSkill1CDEnd) return;
skillInProgress = true; playerHashiramaWoodDragonActive = true; playerHashiramaWoodDragonEnd = now + chrono::milliseconds(1000);
int sx = player.x + 1; bool hit = false;
for (int i = 0; i < 20; i++) { int dx = sx + i; if (dx >= MAP_WIDTH || dx >= enemy.x) break; if (dx != enemy.x && dx != player.x) { gotoxy(MAP_START_X + dx, MAP_START_Y + CHARACTER_ROW); setColor(2); cout << "~"; } if (dx == enemy.x – 1) { hit = true; break; } this_thread::sleep_for(chrono::milliseconds(30)); }
if (hit) {
playerHashiramaEnemyTrapped = true; playerHashiramaWoodDragonTrapEnd = now + chrono::seconds(8);
playerHashiramaMyojinmonUsed = false;
enemyPinned = true;
int dmg = increasePlayerDamage(rand() % 6 + 15); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "木龙扦插命中!";
}
else { playerHashiramaWoodDragonActive = false; gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "未命中!"; }
playerSkill1CDEnd = now + chrono::seconds(15);
if (hit) {
this_thread::sleep_for(chrono::seconds(3));
enemyPinned = false;
}
skillInProgress = false;
}
void playerHashiramaSkill2() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < playerSkill2CDEnd) return; if (playerHashiramaWoodGolemActive) return;
skillInProgress = true; playerHashiramaWoodGolemActive = true; playerHashiramaWoodGolemEnd = now + chrono::seconds(5);
playerHashiramaWoodGolemAttackCount = 0; playerHashiramaWoodGolemAttackCD = now; playerSkill2CDEnd = now + chrono::seconds(18);
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "木人之术!"; skillInProgress = false;
}
void playerHashiramaUltimate() {
if (skillInProgress || enemySkillInProgress) return;
if (!canPlayerUseUltimate()) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "技能点不足!需要4个技能点"; return; }
skillInProgress = true; consumePlayerSkillPoints(4);
int tx = 15; while (player.x > tx) { player.x–; drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(20)); }
int cy = MAP_START_Y + CHARACTER_ROW; for (int r = 0; r < 3; r++) for (int c = 0; c < 4; c++) { int gx = player.x – 1 + c, gy = cy – 3 – r; if (gx > 0 && gx < MAP_WIDTH && gy > 0) { gotoxy(MAP_START_X + gx, MAP_START_Y + gy); setColor(6); cout << "¥"; } }
for (int i = 0; i < 10; i++) { int ax = player.x + 4 + i; if (ax < MAP_WIDTH && ax != enemy.x) { gotoxy(MAP_START_X + ax, cy); setColor(6); cout << "\\\\"; } this_thread::sleep_for(chrono::milliseconds(100)); }
enemy.hp -= increasePlayerDamage(80); if (enemy.hp < 0) enemy.hp = 0;
launchEnemy();
resetEnemyLaunchTimer();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "千手观音造成80点伤害!"; this_thread::sleep_for(chrono::seconds(2));
for (int i = 0; i < 10; i++) { int ax = player.x + 4 + i; if (ax < MAP_WIDTH) { gotoxy(MAP_START_X + ax, cy); cout << " "; } }
for (int r = 0; r < 3; r++) for (int c = 0; c < 4; c++) { int gx = player.x – 1 + c, gy = cy – 3 – r; if (gx > 0 && gx < MAP_WIDTH && gy > 0) { gotoxy(MAP_START_X + gx, MAP_START_Y + gy); cout << " "; } }
skillInProgress = false;
}
// ———- 佐助 ———-
void playerSasukeNormalAttack() {
if (player.x >= enemy.x) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "无法向后攻击!"; return; }
int d = abs(player.x – enemy.x); if (d < 1 || d > 10) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "距离不合适!"; return; }
auto now = chrono::steady_clock::now(); if (now < playerSasukeSlashCD) return;
if (playerSasukeSusanooActive && playerSasukeSusanooSlashCount < 3) {
playerSasukeSusanooSlashActive = true; playerSasukeSusanooSlashEnd = now + chrono::milliseconds(1500); playerSasukeSusanooSlashCount++;
int sx = player.x + 3; for (int i = 0; i <= d; i++) { int cx = sx + i; if (cx >= enemy.x) break; if (i > 0) { int px = sx + (i – 1); for (int r = 0; r < 8; r++) { int sy = MAP_START_Y + CHARACTER_ROW – 2 – r; if (sy > 0) { gotoxy(MAP_START_X + px, MAP_START_Y + sy); cout << " "; } } } for (int r = 0; r < 8; r++) { int sy = MAP_START_Y + CHARACTER_ROW – 2 – r; if (sy > 0 && cx != enemy.x && cx != player.x) { gotoxy(MAP_START_X + cx, MAP_START_Y + sy); setColor(13); cout << "}"; } } this_thread::sleep_for(chrono::milliseconds(80)); }
int lx = sx + d; if (lx >= enemy.x) lx = enemy.x – 1; for (int r = 0; r < 8; r++) { int sy = MAP_START_Y + CHARACTER_ROW – 2 – r; if (sy > 0) { gotoxy(MAP_START_X + lx, MAP_START_Y + sy); cout << " "; } }
int dmg = increasePlayerDamage(rand() % 6 + 25); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "须佐能乎斩造成" << dmg << "点伤害!"; if (playerSasukeSusanooSlashCount >= 3) { playerSasukeSusanooActive = false; playerSasukeSusanooSlashCount = 0; } return;
}
playerSasukeSlashActive = true; playerSasukeSlashEnd = now + chrono::milliseconds(500); playerSasukeSlashCD = now + chrono::milliseconds(1500);
int sx = player.x + 1; for (int i = 0; i <= d; i++) { int cx = sx + i; if (cx >= enemy.x) break; if (i > 0) { int px = sx + (i – 1); if (px != enemy.x && px != player.x) { gotoxy(MAP_START_X + px, MAP_START_Y + CHARACTER_ROW); cout << " "; } } if (cx != enemy.x && cx != player.x) { gotoxy(MAP_START_X + cx, MAP_START_Y + CHARACTER_ROW); setColor(13); cout << ")"; } this_thread::sleep_for(chrono::milliseconds(30)); }
int lx = sx + d; if (lx >= enemy.x) lx = enemy.x – 1; if (lx != enemy.x && lx != player.x) { gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); cout << " "; }
int dmg = increasePlayerDamage(rand() % 3 + 8); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "剑气造成" << dmg << "点伤害!";
}
void playerSasukeSkill1() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < playerSkill1CDEnd) return; int d = abs(player.x – enemy.x); if (d > 8) return;
skillInProgress = true; playerSasukeAmaterasuActive = true; playerSasukeAmaterasuEnd = now + chrono::seconds(5);
playerSasukeAmaterasuTick = now + chrono::milliseconds(500); playerSasukeAmaterasuHit = true;
enemyPinned = true;
playerSkill1CDEnd = now + chrono::seconds(10);
addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "天照!";
this_thread::sleep_for(chrono::seconds(3));
enemyPinned = false;
}
void playerSasukeSkill2() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < playerSkill2CDEnd) return;
skillInProgress = true; int tx = enemy.x – 5; if (tx < 1) tx = 1; player.x = tx;
int dmg = increasePlayerDamage(rand() % 7 + 12); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "天手力造成" << dmg << "点伤害!"; playerSkill2CDEnd = now + chrono::seconds(8); skillInProgress = false;
}
void playerSasukeSubSkill() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < playerSasukeSubSkillCD) return;
if (playerSkillPoints < 2) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "技能点不足!需要2个技能点"; return; }
if (playerSasukeSusanooActive) {
playerSasukeSusanooActive = false; playerSasukeSusanooSlashCount = 0;
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "须佐能乎关闭!"; return;
}
consumePlayerSkillPoints(2);
playerSasukeSusanooActive = true; playerSasukeSusanooEnd = now + chrono::seconds(45);
playerSasukeSusanooSlashCount = 0; playerSasukeSubSkillCD = now + chrono::seconds(15);
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "完全体须佐能乎!";
}
void playerSasukeUltimate() {
if (skillInProgress || enemySkillInProgress) return; if (!playerSasukeSusanooActive) return;
if (!canPlayerUseUltimate()) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "技能点不足!需要4个技能点"; return; }
skillInProgress = true; consumePlayerSkillPoints(4);
int tx = 5; while (player.x > tx) { player.x–; drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(20)); }
int d1 = increasePlayerDamage(rand() % 16 + 20); enemy.hp -= d1; if (enemy.hp < 0) enemy.hp = 0;
int cy = MAP_START_Y + CHARACTER_ROW; for (int r = 0; r < 5; r++) for (int c = 0; c < 5; c++) { int bx = enemy.x – 2 + c, by = cy – 4 – r; if (bx > 0 && bx < MAP_WIDTH && by > 0) { gotoxy(MAP_START_X + bx, MAP_START_Y + by); setColor(8); cout << "*"; } } this_thread::sleep_for(chrono::seconds(1));
for (int r = 0; r < 8; r++) { int sx = player.x + 3, sy = cy – 2 – r; if (sx > 0 && sx < MAP_WIDTH && sy > 0) { gotoxy(MAP_START_X + sx, MAP_START_Y + sy); setColor(13); cout << "}"; } }
enemy.hp -= increasePlayerDamage(45); if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "地爆天星斩造成" << d1 + 45 << "点伤害!"; this_thread::sleep_for(chrono::seconds(2));
for (int r = 0; r < 5; r++) for (int c = 0; c < 5; c++) { int bx = enemy.x – 2 + c, by = cy – 4 – r; if (bx > 0 && bx < MAP_WIDTH && by > 0) { gotoxy(MAP_START_X + bx, MAP_START_Y + by); cout << " "; } }
for (int r = 0; r < 8; r++) { int sx = player.x + 3, sy = cy – 2 – r; if (sx > 0 && sx < MAP_WIDTH && sy > 0) { gotoxy(MAP_START_X + sx, MAP_START_Y + sy); cout << " "; } }
playerSasukeSusanooActive = false; playerSasukeSusanooSlashCount = 0; skillInProgress = false;
}
// ———- 泉奈 ———-
void playerIzunaNormalAttack() {
if (player.x >= enemy.x) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "无法向后攻击!"; return; }
auto now = chrono::steady_clock::now(); if (now < playerIzunaSlashCD) return;
playerIzunaSlashActive = true; playerIzunaSlashEnd = now + chrono::milliseconds(2000); playerIzunaSlashCD = now + chrono::milliseconds(1500);
int sx = player.x + 1, d = abs(player.x – enemy.x); for (int i = 0; i <= d; i++) { int cx = sx + i; if (cx >= enemy.x) break; if (i > 0) { int px = sx + (i – 1); if (px != enemy.x && px != player.x) { gotoxy(MAP_START_X + px, MAP_START_Y + CHARACTER_ROW); cout << " "; } } if (cx != enemy.x && cx != player.x) { gotoxy(MAP_START_X + cx, MAP_START_Y + CHARACTER_ROW); setColor(9); cout << ")"; } this_thread::sleep_for(chrono::milliseconds(30)); }
int lx = sx + d; if (lx >= enemy.x) lx = enemy.x – 1; if (lx != enemy.x && lx != player.x) { gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); cout << " "; }
int dmg = increasePlayerDamage(rand() % 3 + 8); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "剑气造成" << dmg << "点伤害!";
}
void playerIzunaSkill1() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < playerSkill1CDEnd) return; int d = abs(player.x – enemy.x); if (d > 8) return;
skillInProgress = true; playerIzunaFireballActive = true; playerIzunaFireballEnd = now + chrono::milliseconds(1500);
for (int i = 0; i < 8; i++) { int fx = player.x + 1 + i; if (fx < MAP_WIDTH && fx != enemy.x && fx != player.x) { gotoxy(MAP_START_X + fx, MAP_START_Y + CHARACTER_ROW); setColor(12); cout << "-"; } this_thread::sleep_for(chrono::milliseconds(30)); }
if (player.x + 7 < MAP_WIDTH) { gotoxy(MAP_START_X + player.x + 7, MAP_START_Y + CHARACTER_ROW); setColor(14); cout << "*"; }
int dmg = increasePlayerDamage(rand() % 4 + 18); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "火遁-豪火球造成" << dmg << "点伤害!";
this_thread::sleep_for(chrono::milliseconds(500)); for (int i = 0; i < 8; i++) { int fx = player.x + 1 + i; if (fx < MAP_WIDTH && fx != enemy.x && fx != player.x) { gotoxy(MAP_START_X + fx, MAP_START_Y + CHARACTER_ROW); cout << " "; } }
playerIzunaFireballActive = false; playerSkill1CDEnd = now + chrono::seconds(18); skillInProgress = false;
}
void playerIzunaSubSkill() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < playerSkill3CDEnd) return; if (playerIzunaCounterActive) return;
playerIzunaCounterActive = true; playerIzunaCounterEnd = now + chrono::seconds(5); playerIzunaCounterTriggered = false;
if (player.x > 2) player.x–; gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "宇智波防反!";
}
void playerIzunaSkill2() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now(); int cy = MAP_START_Y + CHARACTER_ROW;
if (playerIzunaSword2ndWindow > now && !playerIzunaSword2ndUsed) {
playerIzunaSword2ndUsed = true; skillInProgress = true;
for (int r = 0; r < 2; r++) { int sx = player.x + 1, d = abs(player.x – enemy.x), y = cy – 1 + r; for (int i = 0; i <= d; i++) { int cx = sx + i; if (cx >= enemy.x) break; if (i > 0) { int px = sx + (i – 1); if (px != enemy.x && px != player.x) { gotoxy(MAP_START_X + px, MAP_START_Y + y); cout << " "; } } if (cx != enemy.x && cx != player.x) { gotoxy(MAP_START_X + cx, MAP_START_Y + y); setColor(9); cout << ")"; } this_thread::sleep_for(chrono::milliseconds(30)); } int lx = sx + d; if (lx >= enemy.x) lx = enemy.x – 1; if (lx != enemy.x && lx != player.x) { gotoxy(MAP_START_X + lx, MAP_START_Y + y); cout << " "; } }
int dmg = increasePlayerDamage(rand() % 4 + 15); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "二段剑气造成" << dmg << "点伤害!"; playerSkill2CDEnd = now + chrono::seconds(20); skillInProgress = false; return;
}
if (now < playerSkill2CDEnd) return;
skillInProgress = true; playerIzunaSwordActive = true; playerIzunaSwordEnd = now + chrono::milliseconds(1000);
for (int i = 0; i < 3; i++) { int sx = player.x + 1 + i; if (sx < MAP_WIDTH && sx != enemy.x && sx != player.x) { gotoxy(MAP_START_X + sx, cy); setColor(9); cout << "-"; } }
int dmg = increasePlayerDamage(rand() % 5 + 20); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "宇智波流剑术造成" << dmg << "点伤害!";
playerIzunaSword2ndWindow = now + chrono::seconds(3); playerIzunaSword2ndUsed = false; skillInProgress = false;
}
void playerIzunaUltimate() {
if (skillInProgress || enemySkillInProgress) return;
if (!canPlayerUseUltimate()) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "技能点不足!需要4个技能点"; return; }
skillInProgress = true; consumePlayerSkillPoints(4);
int cy = MAP_START_Y + CHARACTER_ROW; int mx = MAP_WIDTH / 2; enemy.x = mx;
for (int s = 0; s < 15; s++) { int ry = MAP_START_Y + s; for (int c = 0; c < MAP_WIDTH; c += 3) { if (c != player.x) { gotoxy(MAP_START_X + c, ry); setColor(12); cout << "|"; } if (c + 1 != player.x) { gotoxy(MAP_START_X + c + 1, ry); setColor(14); cout << "*"; } } this_thread::sleep_for(chrono::milliseconds(100)); if (s > 0) { int py = MAP_START_Y + s – 1; for (int c = 0; c < MAP_WIDTH; c += 3) { gotoxy(MAP_START_X + c, py); cout << " "; gotoxy(MAP_START_X + c + 1, py); cout << " "; } } }
enemy.hp -= increasePlayerDamage(40); if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer();
for (int i = 0; i < 3; i++) { int sx = player.x + 1 + i; if (sx < MAP_WIDTH) { gotoxy(MAP_START_X + sx, cy); setColor(9); cout << "-"; } } this_thread::sleep_for(chrono::seconds(1));
enemy.hp -= increasePlayerDamage(30); if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "宇智波的荣耀造成70点伤害!"; for (int i = 0; i < 3; i++) { int sx = player.x + 1 + i; if (sx < MAP_WIDTH) { gotoxy(MAP_START_X + sx, cy); cout << " "; } }
skillInProgress = false;
}
// ———- 漂泊浪客 ———-
void playerWandererNormalAttack() {
if (skillInProgress || enemySkillInProgress || playerWandererSpinActive || playerWandererShockActive) return;
auto now = chrono::steady_clock::now(); if (now < playerWandererNormalCDEnd) return;
for (int i = player.x + 1; i < enemy.x; i++) {
gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); setColor(13); cout << ")";
this_thread::sleep_for(chrono::milliseconds(15));
if (i != enemy.x – 1) { gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); cout << " "; }
}
int dmg = increasePlayerDamage(rand() % 3 + 10); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
playerWandererNormalCDEnd = now + chrono::milliseconds(300);
}
void playerWandererSkill1() {
if (playerWandererShockActive) { playerWandererShockActive = false; enemySkillInProgress = false; }
if (skillInProgress || enemySkillInProgress || playerWandererSpinActive || playerWandererShockActive) return;
auto now = chrono::steady_clock::now(); if (now < playerWandererSkill1CDEnd) return;
skillInProgress = true;
for (int i = player.x + 1; i < enemy.x; i++) { gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); setColor(13); cout << "]"; this_thread::sleep_for(chrono::milliseconds(20)); if (i != enemy.x – 1) { gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); cout << " "; } }
int dmg1 = increasePlayerDamage(rand() % 3 + 8); enemy.hp -= dmg1; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer();
this_thread::sleep_for(chrono::milliseconds(500));
for (int i = player.x + 1; i < enemy.x; i++) { gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); setColor(13); cout << "}"; this_thread::sleep_for(chrono::milliseconds(20)); if (i != enemy.x – 1) { gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); cout << " "; } }
int dmg2 = increasePlayerDamage(rand() % 4 + 12); enemy.hp -= dmg2; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer();
playerWandererSkill1CDEnd = now + chrono::milliseconds(500);
playerWandererStateSwitchWindow = now + chrono::seconds(1);
skillInProgress = false;
}
void playerWandererShortSkill2() {
if (playerWandererShockActive) { playerWandererShockActive = false; enemySkillInProgress = false; }
if (skillInProgress || enemySkillInProgress || playerWandererSpinActive || playerWandererShockActive) return;
if (playerWandererShortSkill2Used || playerWandererState != 0) return;
skillInProgress = true;
for (int j = 0; j < 3; j++) {
for (int i = player.x + 1; i < enemy.x; i++) { gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); setColor(13); cout << "]"; this_thread::sleep_for(chrono::milliseconds(10)); if (i != enemy.x – 1) { gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); cout << " "; } }
int dmg = increasePlayerDamage(rand() % 5 + 12); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
}
playerWandererShortSkill2Used = true;
playerWandererShortSubSkillCDEnd = chrono::steady_clock::now() + chrono::seconds(5);
skillInProgress = false;
}
void playerWandererShortSubSkill() {
if (skillInProgress || enemySkillInProgress || !playerWandererShortSkill2Used || playerWandererState != 0) return;
if (playerWandererSpinActive) return;
auto now = chrono::steady_clock::now();
if (now < playerWandererShortSubSkillCDEnd) return;
playerWandererSpinActive = true;
playerWandererSpinEnd = now + chrono::seconds(15);
enemySkillInProgress = true;
playerWandererSpinEnemySavedX = enemy.x;
playerWandererSpinEnemyTransferred = true;
enemy.x = player.x;
}
void playerWandererLongSkill2() {
if (playerWandererShockActive) { playerWandererShockActive = false; enemySkillInProgress = false; }
if (skillInProgress || enemySkillInProgress || playerWandererSpinActive || playerWandererShockActive) return;
if (playerWandererState != 1 || playerWandererLongSkill2Count <= 0) return;
auto now = chrono::steady_clock::now();
if (now < playerWandererLongSkill2CDEnd) return;
playerObitoKamuiActive = true; playerObitoKamuiEnd = now + chrono::seconds(5);
playerWandererLongSkill2Count–;
playerWandererLongSkill2CDEnd = now + chrono::seconds(8);
addPlayerSkillPoint();
}
void playerWandererLongSubSkill() {
if (skillInProgress || enemySkillInProgress || playerWandererSpinActive || playerWandererShockActive) return;
if (playerWandererState != 1) return;
int dist = enemy.x – player.x;
if (dist < 1 || dist > 8) {
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "距离太远,无法震刀!";
return;
}
playerWandererShockActive = true;
playerWandererShockEnemyY = CHARACTER_ROW – 5;
enemySkillInProgress = true;
int dmg = increasePlayerDamage(rand() % 6 + 25);
enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
playerWandererShockDropTime = chrono::steady_clock::now();
}
void playerWandererUltimate() {
if (playerWandererShockActive) { playerWandererShockActive = false; enemySkillInProgress = false; }
if (skillInProgress || enemySkillInProgress || playerWandererSpinActive || playerWandererShockActive) return;
if (!canPlayerUseUltimate()) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "技能点不足!需要4个技能点"; return; }
skillInProgress = true; enemySkillInProgress = true; consumePlayerSkillPoints(4);
int targetX = MAP_WIDTH / 2;
while (player.x < targetX) player.x++;
drawBattleMap();
gotoxy(MAP_START_X + player.x + 1, MAP_START_Y + CHARACTER_ROW); setColor(13); cout << "——";
this_thread::sleep_for(chrono::seconds(1));
enemy.hp -= increasePlayerDamage(80); if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer();
gotoxy(MAP_START_X + player.x + 1, MAP_START_Y + CHARACTER_ROW); cout << " ";
skillInProgress = false; enemySkillInProgress = false;
}
void playerWandererSwitchState() {
if (playerWandererState == 0) playerWandererState = 1;
else playerWandererState = 0;
}
// ———- 水门 ———-
void playerMinatoNormalAttack() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now();
if (now < playerMinatoNormalCDEnd) return;
for (int i = player.x + 1; i < enemy.x; i++) {
gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); setColor(14); cout << "-";
this_thread::sleep_for(chrono::milliseconds(20));
gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
int dmg = increasePlayerDamage(rand() % 3 + 8);
enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
playerMinatoNormalCDEnd = now + chrono::milliseconds(500);
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "苦无刺击造成" << dmg << "点伤害!";
}
void playerMinatoSkill1() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < playerMinatoSkill1CDEnd) return;
skillInProgress = true;
player.x = enemy.x – 2; if (player.x < 1) player.x = 1;
drawBattleMap();
gotoxy(MAP_START_X + player.x + 1, MAP_START_Y + CHARACTER_ROW); setColor(14); cout << "〇";
this_thread::sleep_for(chrono::milliseconds(800));
int dmg = increasePlayerDamage(rand() % 7 + 18); enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
gotoxy(MAP_START_X + player.x + 1, MAP_START_Y + CHARACTER_ROW); cout << " ";
playerMinatoSkill1CDEnd = now + chrono::seconds(15);
skillInProgress = false;
}
void playerMinatoSkill2() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < playerMinatoSkill2CDEnd) return;
if (!playerMinatoMarkActive) {
skillInProgress = true;
for (int i = player.x + 1; i < enemy.x; i++) {
gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); setColor(14); cout << "-";
this_thread::sleep_for(chrono::milliseconds(10));
gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
playerMinatoMarkActive = true; playerMinatoMarkX = enemy.x; playerMinatoMarkEnd = now + chrono::seconds(10);
playerMinatoCounterReady = true;
skillInProgress = false;
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "飞雷神标记已刻印";
}
else if (playerMinatoCounterReady) {
enemySkillInProgress = true;
playerMinatoSkill1();
playerMinatoCounterReady = false;
playerMinatoMarkActive = false;
}
playerMinatoSkill2CDEnd = now + chrono::seconds(10);
}
void playerMinatoUltimate() {
if (skillInProgress || enemySkillInProgress) return;
if (!canPlayerUseUltimate()) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "技能点不足!需要4个技能点"; return; }
skillInProgress = true; enemySkillInProgress = true; consumePlayerSkillPoints(4);
gotoxy(MAP_START_X + enemy.x – 1, MAP_START_Y + CHARACTER_ROW); setColor(14); cout << "(0)";
this_thread::sleep_for(chrono::seconds(2));
int dmg = increasePlayerDamage(rand() % 6 + 75);
enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer();
gotoxy(MAP_START_X + enemy.x – 1, MAP_START_Y + CHARACTER_ROW); cout << " ";
skillInProgress = false; enemySkillInProgress = false;
}
// ———- 黑绝 ———-
void playerBlackZetsuNormalAttack() {
if (player.x >= enemy.x) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "必须在敌人左侧!"; return; }
auto now = chrono::steady_clock::now(); if (now < playerBlackZetsuNormalCDEnd) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "黑绝普攻冷却中…"; return; }
player.x = enemy.x – 1; if (player.x < 1) player.x = 1;
int dmg = rand() % 3 + 8; enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer();
playerBlackZetsuNormalCDEnd = now + chrono::seconds(3);
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "黑绝普攻造成 " << dmg << " 点伤害!";
}
// ==================== 敌人技能函数 ====================
// ———- 敌人鸣人 ———-
void enemyNarutoNormalAttack() {
int d = abs(player.x – enemy.x);
if (enemy.x > player.x && d >= 1 && d <= 3) {
int dmg = reducePlayerDamage(rand() % 4 + 3);
enemyNarutoTailActive = true; enemyNarutoTailEnd = chrono::steady_clock::now() + chrono::milliseconds(1500);
for (int i = 0; i < 3; i++) { enemyNarutoTailX[i] = enemy.x – 1 – i; if (enemyNarutoTailX[i] <= player.x) { enemyNarutoTailX[i] = 0; break; } }
player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer();
enemyNormalAttackCount++;
addEnemySkillPoint();
}
}
void enemyNarutoSkill1() {
if (enemySkillInProgress || skillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < enemySkill1CDEnd) return;
enemySkillInProgress = true; int tx = player.x + 1;
while (enemy.x > tx) { enemy.x–; if (enemy.x <= player.x) { enemy.x = player.x + 1; break; } this_thread::sleep_for(chrono::milliseconds(50)); }
int dmg = reducePlayerDamage(rand() % 8 + 8); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
enemySkill1CDEnd = now + chrono::seconds(8); enemySkillInProgress = false;
}
void enemyNarutoSkill2() {
if (enemySkillInProgress || skillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < enemySkill2CDEnd) return;
enemySkillInProgress = true; bool caught = false;
for (int i = 0; i < 20; i++) { int cx = enemy.x – 1 – i; if (cx <= 0 || cx <= player.x) break; if (cx == player.x + 1) { caught = true; break; } }
this_thread::sleep_for(chrono::milliseconds(500));
if (caught) {
playerPinned = true;
int dmg = reducePlayerDamage(rand() % 6 + 20); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
enemySkill2CDEnd = now + chrono::seconds(15);
this_thread::sleep_for(chrono::seconds(2));
playerPinned = false;
}
else { enemySkill2CDEnd = now + chrono::seconds(7); }
enemySkillInProgress = false;
}
void enemyNarutoUltimate() {
if (enemySkillInProgress || skillInProgress) return;
if (!canEnemyUseUltimate()) return;
enemySkillInProgress = true; consumeEnemySkillPoints(4);
player.hp -= reducePlayerDamage(35); if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer();
this_thread::sleep_for(chrono::seconds(3)); enemySkillInProgress = false;
}
// ———- 敌人佩恩天道 ———-
void enemyPainNormalAttack() {
if (enemy.x <= player.x) return;
int cy = MAP_START_Y + CHARACTER_ROW;
if (enemyPainRodActive) { if (enemyPainRodX > 0 && enemyPainRodX < MAP_WIDTH && enemyPainRodX != player.x && enemyPainRodX != enemy.x) { gotoxy(MAP_START_X + enemyPainRodX, cy); cout << " "; } enemyPainRodActive = false; enemyRodHitting = false; }
int rx = enemy.x – 3; if (rx <= player.x) rx = player.x + 1; if (rx >= enemy.x) return; if (rx == player.x) rx = player.x + 1;
enemyPainRodActive = true; enemyPainRodX = rx; enemyPainRodEnd = chrono::steady_clock::now() + chrono::milliseconds(1500);
int dmg = reducePlayerDamage(rand() % 3 + 4); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
if (rx == player.x + 1) { enemyRodHitting = true; enemyRodHitEnd = enemyPainRodEnd; }
else { enemyRodHitting = false; }
enemyNormalAttackCount++;
}
void enemyPainSkill1() {
if (enemySkillInProgress || skillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < enemySkill1CDEnd) return;
skillInProgress = true; enemySkillInProgress = true; int tx = enemy.x – 2;
while (player.x < tx) { player.x++; if (player.x >= enemy.x) { player.x = enemy.x – 2; break; } this_thread::sleep_for(chrono::milliseconds(30)); }
player.x = tx;
enemyBlackRodLeftX = player.x – 1; enemyBlackRodRightX = player.x + 1;
if (enemyBlackRodLeftX > 0 && enemyBlackRodLeftX != player.x && enemyBlackRodLeftX != enemy.x) {
gotoxy(MAP_START_X + enemyBlackRodLeftX, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "\\\\";
}
if (enemyBlackRodRightX < MAP_WIDTH && enemyBlackRodRightX != player.x && enemyBlackRodRightX != enemy.x) {
gotoxy(MAP_START_X + enemyBlackRodRightX, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "/";
}
enemyBanshoTeninActive = true; enemyBanshoTeninEnd = now + chrono::seconds(5);
playerPinned = true;
int dmg = reducePlayerDamage(rand() % 4 + 10); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
enemySkill1CDEnd = now + chrono::seconds(12);
this_thread::sleep_for(chrono::seconds(3));
if (enemyBlackRodLeftX > 0 && enemyBlackRodLeftX != player.x && enemyBlackRodLeftX != enemy.x) {
gotoxy(MAP_START_X + enemyBlackRodLeftX, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
if (enemyBlackRodRightX < MAP_WIDTH && enemyBlackRodRightX != player.x && enemyBlackRodRightX != enemy.x) {
gotoxy(MAP_START_X + enemyBlackRodRightX, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
playerPinned = false;
enemySkillInProgress = false; skillInProgress = false;
}
void enemyPainSkill2() {
if (enemySkillInProgress || skillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < enemySkill2CDEnd) return;
enemySkillInProgress = true; int dmg = reducePlayerDamage(rand() % 5 + 8);
if (abs(player.x – enemy.x) <= 1) { player.hp -= dmg; if (player.hp < 0) player.hp = 0; launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint(); }
this_thread::sleep_for(chrono::seconds(1)); enemySkill2CDEnd = now + chrono::seconds(15); enemySkillInProgress = false;
}
void enemyPainUltimate() {
if (enemySkillInProgress || skillInProgress) return;
if (!canEnemyUseUltimate()) return;
enemySkillInProgress = true; consumeEnemySkillPoints(4);
int tx = MAP_WIDTH / 2;
while (enemy.x != tx) { if (enemy.x < tx) enemy.x++; else enemy.x–; this_thread::sleep_for(chrono::milliseconds(20)); }
for (int s = 1; s <= 5; s++) { player.hp -= reducePlayerDamage(10); if (player.hp < 0) player.hp = 0; launchPlayer(); resetPlayerLaunchTimer(); this_thread::sleep_for(chrono::seconds(1)); if (player.hp <= 0) break; }
enemySkillInProgress = false;
}
// ———- 敌人带土 ———-
void enemyObitoNormalAttack() {
if (enemy.x <= player.x) return;
int d = abs(player.x – enemy.x); if (d < 1 || d > 2) return;
int kx = enemy.x – 1; if (kx <= player.x) kx = player.x + 1; if (kx >= enemy.x) return;
enemyObitoKickActive = true; enemyObitoKickX = kx; enemyObitoKickEnd = chrono::steady_clock::now() + chrono::milliseconds(1000);
int dmg = reducePlayerDamage(rand() % 3 + 6); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
enemyNormalAttackCount++;
}
void enemyObitoSkill1() {
if (enemySkillInProgress || skillInProgress) return;
auto now = chrono::steady_clock::now(); int cy = MAP_START_Y + CHARACTER_ROW;
if (enemyObitoEnemyTrapped && !enemyObitoFireActive) {
int sx = enemy.x, tx = player.x + 3; if (tx >= MAP_WIDTH – 2) tx = MAP_WIDTH – 3;
enemySkillInProgress = true; enemyObitoFireActive = true; enemy.x = tx; drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(300));
int fx = enemy.x – 1; for (int i = 0; i < 8; i++) { int px = fx – i; if (px > 0 && px != player.x && px != enemy.x) { gotoxy(MAP_START_X + px, cy); setColor(6); cout << "~"; } }
int dmg = reducePlayerDamage(rand() % 5 + 14); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
this_thread::sleep_for(chrono::seconds(2)); for (int i = 0; i < 8; i++) { int px = fx – i; if (px > 0 && px != player.x && px != enemy.x) { gotoxy(MAP_START_X + px, cy); cout << " "; } }
enemy.x = sx; enemyObitoFireActive = false; enemySkillInProgress = false; return;
}
if (now < enemySkill1CDEnd) return;
enemySkillInProgress = true; enemyObitoWoodSpikeX = enemy.x – 1; enemyObitoWoodSpikeActive = true; enemyObitoWoodSpikeEnd = now + chrono::milliseconds(500);
bool hit = false;
for (int i = 0; i < 30; i++) { int cx = enemy.x – 1 – i; if (cx <= 0 || cx <= player.x) break; if (cx != player.x && cx != enemy.x) { gotoxy(MAP_START_X + cx, cy); setColor(2); cout << "-"; } if (cx == player.x + 1) { hit = true; break; } this_thread::sleep_for(chrono::milliseconds(20)); }
if (hit) {
enemyObitoEnemyTrapped = true; enemyObitoEnemyTrappedEnd = now + chrono::seconds(15);
playerPinned = true;
int dmg = reducePlayerDamage(rand() % 5 + 12); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
}
else { enemyObitoWoodSpikeActive = false; }
for (int i = 0; i < 30; i++) { int cx = enemy.x – 1 – i; if (cx <= 0 || cx <= player.x) break; if (cx != player.x && cx != enemy.x) { gotoxy(MAP_START_X + cx, cy); cout << " "; } }
enemySkill1CDEnd = now + chrono::seconds(hit ? 20 : 10);
if (hit) {
this_thread::sleep_for(chrono::seconds(3));
playerPinned = false;
}
enemySkillInProgress = false;
}
void enemyObitoSkill2() {
if (enemySkillInProgress || skillInProgress) return;
auto now = chrono::steady_clock::now(); int cy = MAP_START_Y + CHARACTER_ROW;
if (enemyObitoKamuiActive && !enemyObitoKamuiSpaceActive) {
enemyObitoKamuiActive = false; enemyObitoKamuiSpaceActive = true; enemyObitoSavedX = enemy.x;
int tx = player.x + 1; if (tx >= MAP_WIDTH – 2) tx = MAP_WIDTH – 3; enemy.x = tx; enemyObitoPlayerInSpace = true; enemyObitoKamuiSpaceEnd = now + chrono::seconds(3);
addEnemySkillPoint();
drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(500));
for (int s = 0; s < 3; s++) { int dmg = reducePlayerDamage(rand() % 3 + 8); player.hp -= dmg; if (player.hp < 0) player.hp = 0; launchPlayer(); resetPlayerLaunchTimer(); this_thread::sleep_for(chrono::seconds(1)); if (player.hp <= 0) break; }
enemyObitoPlayerInSpace = false; enemyObitoKamuiSpaceActive = false; player.x = enemy.x – 3; if (player.x < 1) player.x = 1;
enemySkill2CDEnd = now + chrono::seconds(10); return;
}
if (enemyObitoEnemyTrapped && !enemyObitoWoodStormActive) {
enemySkillInProgress = true; enemyObitoWoodStormActive = true; int sx = enemy.x, tx = player.x – 5; if (tx < 2) tx = 2; enemy.x = tx;
drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(300));
for (int i = 0; i < 20; i++) { int bx = enemy.x + 1 + i; if (bx >= MAP_WIDTH || bx >= player.x) break; if (bx != player.x && bx != enemy.x) { gotoxy(MAP_START_X + bx, cy – 1); setColor(2); cout << "_"; gotoxy(MAP_START_X + bx, cy); setColor(2); cout << "-"; } }
for (int s = 0; s < 6; s++) { if (abs(enemy.x – player.x) <= 20) { player.hp -= reducePlayerDamage(8); if (player.hp < 0) player.hp = 0; launchPlayer(); resetPlayerLaunchTimer(); } this_thread::sleep_for(chrono::seconds(1)); if (player.hp <= 0) break; }
for (int i = 0; i < 20; i++) { int bx = enemy.x + 1 + i; if (bx >= MAP_WIDTH) break; if (bx != player.x && bx != enemy.x) { gotoxy(MAP_START_X + bx, cy – 1); cout << " "; gotoxy(MAP_START_X + bx, cy); cout << " "; } }
enemy.x = sx; enemyObitoWoodStormActive = false; enemySkillInProgress = false; return;
}
if (now < enemySkill2CDEnd) return;
enemyObitoKamuiActive = true; enemyObitoKamuiEnd = now + chrono::seconds(5);
}
void enemyObitoUltimate() {
if (enemySkillInProgress || skillInProgress) return;
if (!canEnemyUseUltimate()) return;
enemySkillInProgress = true; consumeEnemySkillPoints(4);
int cy = MAP_START_Y + CHARACTER_ROW, tby = cy – 5;
for (int r = 0; r < 5; r++) for (int c = 0; c < 10; c++) { int x = enemy.x – 5 + c, y = tby – r; if (x > 0 && x < MAP_WIDTH && y > 0) { gotoxy(MAP_START_X + x, MAP_START_Y + y); setColor(8); cout << "*"; } }
gotoxy(MAP_START_X + enemy.x, MAP_START_Y + tby – 5); setColor(12); cout << "&"; this_thread::sleep_for(chrono::seconds(2));
player.hp -= reducePlayerDamage(50); if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer();
for (int r = 0; r < 5; r++) for (int c = 0; c < 10; c++) { int x = enemy.x – 5 + c, y = tby – r; if (x > 0 && x < MAP_WIDTH && y > 0) { gotoxy(MAP_START_X + x, MAP_START_Y + y); cout << " "; } }
gotoxy(MAP_START_X + enemy.x, MAP_START_Y + tby – 5); cout << " ";
enemySkillInProgress = false;
}
// ———- 敌人博人 ———-
void enemyBorutoNormalAttack() {
if (enemy.x <= player.x) return;
int d = abs(player.x – enemy.x); if (d < 1 || d > 4) return;
if (playerObitoKamuiActive && !playerObitoKamuiSpaceActive) return;
enemyBorutoSwordActive = true; enemyBorutoSwordSlashing = true; enemyBorutoSwordEnd = chrono::steady_clock::now() + chrono::milliseconds(2000); enemyBorutoSwordX = enemy.x – 1;
int d1 = reducePlayerDamage(rand() % 3 + 7); player.hp -= d1; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
this_thread::sleep_for(chrono::milliseconds(400));
if (enemyRodHitting || enemyBanshoTeninActive || enemyObitoEnemyTrapped || enemyHashiramaEnemyTrapped || enemySasukeAmaterasuHit || enemyIzunaCounterActive) { enemyBorutoSwordActive = false; enemyBorutoSwordSlashing = false; return; }
int d2 = reducePlayerDamage(rand() % 4 + 7); player.hp -= d2; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
this_thread::sleep_for(chrono::milliseconds(400));
if (enemyRodHitting || enemyBanshoTeninActive || enemyObitoEnemyTrapped || enemyHashiramaEnemyTrapped || enemySasukeAmaterasuHit || enemyIzunaCounterActive) { enemyBorutoSwordActive = false; enemyBorutoSwordSlashing = false; return; }
int d3 = reducePlayerDamage(rand() % 5 + 8); player.hp -= d3; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
enemyBorutoSwordActive = false; enemyBorutoSwordSlashing = false; enemyNormalAttackCount++;
}
void enemyBorutoSkill1() {
if (enemySkillInProgress || skillInProgress) return;
auto now = chrono::steady_clock::now();
if (enemyBorutoKarmaActive) { if (enemyBorutoFlying) return; if (now < enemySkill1CDEnd) return; enemyBorutoFlying = true; enemyBorutoFlyingEnd = now + chrono::seconds(10); enemyBorutoEnhancedAttackCount = 0; enemySkill1CDEnd = now + chrono::seconds(6); return; }
if (now < enemySkill1CDEnd) return;
enemySkillInProgress = true; int tx = player.x + 3; if (tx >= MAP_WIDTH – 2) tx = MAP_WIDTH – 3;
while (enemy.x < tx) { enemy.x++; drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(30)); }
while (enemy.x > tx) { enemy.x–; drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(30)); }
enemyBorutoRasenganActive = true; enemyBorutoRasenganEnd = now + chrono::seconds(3); enemyBorutoRasenganHit = true;
for (int s = 0; s < 3; s++) { int dmg = reducePlayerDamage(rand() % 5 + 8); player.hp -= dmg; if (player.hp < 0) player.hp = 0; launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint(); this_thread::sleep_for(chrono::seconds(1)); if (player.hp <= 0) break; }
enemyBorutoRasenganActive = false; tx = player.x + 8; if (tx >= MAP_WIDTH – 2) tx = MAP_WIDTH – 3; enemy.x = tx;
enemyBorutoMarkActive = true; enemyBorutoMarkX = player.x; enemyBorutoMarkEnd = now + chrono::seconds(10);
enemyBorutoTeleported = false; enemyBorutoTeleportBack = false;
enemySkill1CDEnd = now + chrono::seconds(18); enemySkillInProgress = false;
}
void enemyBorutoSkill2() {
if (enemySkillInProgress || skillInProgress) return;
auto now = chrono::steady_clock::now();
if (enemyBorutoKarmaActive) { if (enemyBorutoFlying) return; if (now < enemySkill2CDEnd) return; enemySkillInProgress = true; int bx = enemy.x – 1, cy = MAP_START_Y + CHARACTER_ROW; for (int s = 0; s < 20; s++) { int cx = bx – s; if (cx <= player.x) break; if (s > 0) { gotoxy(MAP_START_X + cx + 1, cy); cout << " "; } if (cx != player.x && cx != enemy.x) { gotoxy(MAP_START_X + cx, cy); setColor(11); cout << "O"; } this_thread::sleep_for(chrono::milliseconds(50)); } int dmg = reducePlayerDamage(rand() % 6 + 15); player.hp -= dmg; if (player.hp < 0) player.hp = 0; launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint(); gotoxy(MAP_START_X + player.x + 1, cy); cout << " "; enemySkill2CDEnd = now + chrono::seconds(15); enemySkillInProgress = false; return; }
if (enemyBorutoMarkActive && !enemyBorutoTeleported) { enemyBorutoTeleportSavedX = enemy.x; enemy.x = player.x + 3; if (enemy.x >= MAP_WIDTH – 2) enemy.x = MAP_WIDTH – 3; enemyBorutoTeleported = true; enemyBorutoTeleportTime = now; int dmg = reducePlayerDamage(rand() % 9 + 10); player.hp -= dmg; if (player.hp < 0) player.hp = 0; launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint(); enemyBorutoTeleportBack = true; return; }
if (enemyBorutoTeleported && enemyBorutoTeleportBack) { auto ts = chrono::duration_cast<chrono::seconds>(now – enemyBorutoTeleportTime).count(); if (ts <= 5) { enemy.x = enemyBorutoTeleportSavedX; enemyBorutoTeleported = false; enemyBorutoTeleportBack = false; enemySkill2CDEnd = now + chrono::seconds(8); return; } else { enemyBorutoTeleportBack = false; } }
if (now < enemySkill2CDEnd) return;
}
void enemyBorutoUltimate() {
if (enemySkillInProgress || skillInProgress) return; if (enemyBorutoKarmaActive) return;
auto now = chrono::steady_clock::now(); if (now < enemySkill3CDEnd) return;
if (!canEnemyUseUltimate()) return;
enemySkillInProgress = true; consumeEnemySkillPoints(4);
enemyBorutoKarmaActive = true; enemyBorutoKarmaEnd = now + chrono::seconds(60);
enemySkill3CDEnd = now + chrono::seconds(45); enemySkillInProgress = false;
}
// ———- 敌人柱间 ———-
void enemyHashiramaNormalAttack() {
if (enemy.x <= player.x) return;
int d = abs(player.x – enemy.x); if (d < 1 || d > 5) return;
enemyHashiramaStompActive = true; enemyHashiramaStompX = enemy.x – 1; enemyHashiramaStompEnd = chrono::steady_clock::now() + chrono::milliseconds(800);
int dmg = reducePlayerDamage(rand() % 3 + 8); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
enemyNormalAttackCount++;
}
void enemyHashiramaSkill1() {
if (enemySkillInProgress || skillInProgress) return;
auto now = chrono::steady_clock::now();
if (enemyHashiramaEnemyTrapped && !enemyHashiramaMyojinmonUsed) {
enemySkillInProgress = true; enemyHashiramaMyojinmonActive = true; enemyHashiramaMyojinmonUsed = true;
int dmg = reducePlayerDamage(rand() % 16 + 20); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
this_thread::sleep_for(chrono::seconds(2)); enemyHashiramaMyojinmonActive = false; enemyHashiramaEnemyTrapped = false; enemyHashiramaWoodDragonActive = false;
enemySkillInProgress = false; return;
}
if (now < enemySkill1CDEnd) return;
enemySkillInProgress = true; enemyHashiramaWoodDragonActive = true; enemyHashiramaWoodDragonEnd = now + chrono::milliseconds(1000);
int sx = enemy.x – 1, cy = MAP_START_Y + CHARACTER_ROW; bool hit = false;
for (int i = 0; i < 20; i++) { int dx = sx – i; if (dx <= 0 || dx <= player.x) break; if (dx != player.x && dx != enemy.x) { gotoxy(MAP_START_X + dx, cy); setColor(2); cout << "~"; } if (dx == player.x + 1) { hit = true; break; } this_thread::sleep_for(chrono::milliseconds(30)); }
if (hit) {
enemyHashiramaEnemyTrapped = true; enemyHashiramaWoodDragonTrapEnd = now + chrono::seconds(8);
enemyHashiramaMyojinmonUsed = false;
playerPinned = true;
int dmg = reducePlayerDamage(rand() % 6 + 15); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
}
else { enemyHashiramaWoodDragonActive = false; }
enemySkill1CDEnd = now + chrono::seconds(15);
if (hit) {
this_thread::sleep_for(chrono::seconds(3));
playerPinned = false;
}
enemySkillInProgress = false;
}
void enemyHashiramaSkill2() {
if (enemySkillInProgress || skillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < enemySkill2CDEnd) return; if (enemyHashiramaWoodGolemActive) return;
enemySkillInProgress = true; enemyHashiramaWoodGolemActive = true; enemyHashiramaWoodGolemEnd = now + chrono::seconds(5);
enemyHashiramaWoodGolemAttackCount = 0; enemySkill2CDEnd = now + chrono::seconds(18); enemySkillInProgress = false;
}
void enemyHashiramaUltimate() {
if (enemySkillInProgress || skillInProgress) return;
if (!canEnemyUseUltimate()) return;
enemySkillInProgress = true; consumeEnemySkillPoints(4);
int tx = MAP_WIDTH – 15;
while (enemy.x < tx) { enemy.x++; drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(20)); }
int cy = MAP_START_Y + CHARACTER_ROW; for (int r = 0; r < 3; r++) for (int c = 0; c < 4; c++) { int gx = enemy.x – 1 + c, gy = cy – 3 – r; if (gx > 0 && gx < MAP_WIDTH && gy > 0) { gotoxy(MAP_START_X + gx, MAP_START_Y + gy); setColor(6); cout << "¥"; } }
for (int i = 0; i < 10; i++) { int ax = enemy.x – 4 – i; if (ax > 0 && ax != player.x) { gotoxy(MAP_START_X + ax, cy); setColor(6); cout << "\\\\"; } this_thread::sleep_for(chrono::milliseconds(100)); }
player.hp -= reducePlayerDamage(80); if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer();
this_thread::sleep_for(chrono::seconds(2)); for (int i = 0; i < 10; i++) { int ax = enemy.x – 4 – i; if (ax > 0) { gotoxy(MAP_START_X + ax, cy); cout << " "; } }
for (int r = 0; r < 3; r++) for (int c = 0; c < 4; c++) { int gx = enemy.x – 1 + c, gy = cy – 3 – r; if (gx > 0 && gx < MAP_WIDTH && gy > 0) { gotoxy(MAP_START_X + gx, MAP_START_Y + gy); cout << " "; } }
enemySkillInProgress = false;
}
// ———- 敌人佐助 ———-
void enemySasukeNormalAttack() {
if (enemy.x <= player.x) return;
int d = abs(player.x – enemy.x); if (d < 1 || d > 10) return;
auto now = chrono::steady_clock::now(); if (now < enemySasukeSlashCD) return;
if (enemySasukeSusanooActive && enemySasukeSusanooSlashCount < 3) {
enemySasukeSusanooSlashActive = true; enemySasukeSusanooSlashEnd = now + chrono::milliseconds(1500); enemySasukeSusanooSlashCount++;
int sx = enemy.x – 3; for (int i = 0; i <= d; i++) { int cx = sx – i; if (cx <= player.x) break; if (i > 0) { int px = sx – (i – 1); for (int r = 0; r < 8; r++) { int sy = MAP_START_Y + CHARACTER_ROW – 2 – r; if (sy > 0) { gotoxy(MAP_START_X + px, MAP_START_Y + sy); cout << " "; } } } for (int r = 0; r < 8; r++) { int sy = MAP_START_Y + CHARACTER_ROW – 2 – r; if (sy > 0 && cx != player.x && cx != enemy.x) { gotoxy(MAP_START_X + cx, MAP_START_Y + sy); setColor(13); cout << "}"; } } this_thread::sleep_for(chrono::milliseconds(80)); }
int lx = sx – d; if (lx <= player.x) lx = player.x + 1; for (int r = 0; r < 8; r++) { int sy = MAP_START_Y + CHARACTER_ROW – 2 – r; if (sy > 0) { gotoxy(MAP_START_X + lx, MAP_START_Y + sy); cout << " "; } }
int dmg = reducePlayerDamage(rand() % 6 + 25); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
if (enemySasukeSusanooSlashCount >= 3) { enemySasukeSusanooActive = false; enemySasukeSusanooSlashCount = 0; }
enemyNormalAttackCount++; return;
}
enemySasukeSlashActive = true; enemySasukeSlashEnd = now + chrono::milliseconds(500); enemySasukeSlashCD = now + chrono::milliseconds(1500);
int sx = enemy.x – 1; for (int i = 0; i <= d; i++) { int cx = sx – i; if (cx <= player.x) break; if (i > 0) { int px = sx – (i – 1); if (px != player.x && px != enemy.x) { gotoxy(MAP_START_X + px, MAP_START_Y + CHARACTER_ROW); cout << " "; } } if (cx != player.x && cx != enemy.x) { gotoxy(MAP_START_X + cx, MAP_START_Y + CHARACTER_ROW); setColor(13); cout << ")"; } this_thread::sleep_for(chrono::milliseconds(30)); }
int lx = sx – d; if (lx <= player.x) lx = player.x + 1; if (lx != player.x && lx != enemy.x) { gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); cout << " "; }
int dmg = reducePlayerDamage(rand() % 3 + 8); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
enemyNormalAttackCount++;
}
void enemySasukeSkill1() {
if (enemySkillInProgress || skillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < enemySkill1CDEnd) return; int d = abs(player.x – enemy.x); if (d > 8) return;
enemySkillInProgress = true; enemySasukeAmaterasuActive = true; enemySasukeAmaterasuEnd = now + chrono::seconds(5);
enemySasukeAmaterasuTick = now + chrono::milliseconds(500); enemySasukeAmaterasuHit = true;
playerPinned = true;
enemySkill1CDEnd = now + chrono::seconds(10);
addEnemySkillPoint();
this_thread::sleep_for(chrono::seconds(3));
playerPinned = false;
enemySkillInProgress = false;
}
void enemySasukeSkill2() {
if (enemySkillInProgress || skillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < enemySkill2CDEnd) return;
enemySkillInProgress = true; int tx = player.x + 5; if (tx >= MAP_WIDTH – 2) tx = MAP_WIDTH – 3; enemy.x = tx;
int dmg = reducePlayerDamage(rand() % 7 + 12); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
enemySkill2CDEnd = now + chrono::seconds(8); enemySkillInProgress = false;
}
void enemySasukeSubSkill() {
if (enemySkillInProgress || skillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < enemySasukeSubSkillCD) return;
if (enemySkillPoints < 2) return;
if (enemySasukeSusanooActive) {
enemySasukeSusanooActive = false; enemySasukeSusanooSlashCount = 0;
return;
}
consumeEnemySkillPoints(2);
enemySasukeSusanooActive = true; enemySasukeSusanooEnd = now + chrono::seconds(45);
enemySasukeSusanooSlashCount = 0; enemySasukeSubSkillCD = now + chrono::seconds(15);
}
void enemySasukeUltimate() {
if (enemySkillInProgress || skillInProgress) return; if (!enemySasukeSusanooActive) return;
if (!canEnemyUseUltimate()) return;
enemySkillInProgress = true; consumeEnemySkillPoints(4);
int tx = MAP_WIDTH – 5;
while (enemy.x < tx) { enemy.x++; drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(20)); }
int d1 = reducePlayerDamage(rand() % 16 + 20); player.hp -= d1; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer();
this_thread::sleep_for(chrono::seconds(2)); player.hp -= reducePlayerDamage(45); if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer();
enemySasukeSusanooActive = false; enemySasukeSusanooSlashCount = 0; enemySkillInProgress = false;
}
// ———- 敌人泉奈 ———-
void enemyIzunaNormalAttack() {
if (enemy.x <= player.x) return;
auto now = chrono::steady_clock::now(); if (now < enemyIzunaSlashCD) return;
enemyIzunaSlashActive = true; enemyIzunaSlashEnd = now + chrono::milliseconds(2000); enemyIzunaSlashCD = now + chrono::milliseconds(1500);
int sx = enemy.x – 1, d = abs(player.x – enemy.x);
for (int i = 0; i <= d; i++) { int cx = sx – i; if (cx <= player.x) break; if (i > 0) { int px = sx – (i – 1); if (px != player.x && px != enemy.x) { gotoxy(MAP_START_X + px, MAP_START_Y + CHARACTER_ROW); cout << " "; } } if (cx != player.x && cx != enemy.x) { gotoxy(MAP_START_X + cx, MAP_START_Y + CHARACTER_ROW); setColor(9); cout << ")"; } this_thread::sleep_for(chrono::milliseconds(30)); }
int lx = sx – d; if (lx <= player.x) lx = player.x + 1; if (lx != player.x && lx != enemy.x) { gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); cout << " "; }
int dmg = reducePlayerDamage(rand() % 3 + 8); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
enemyNormalAttackCount++;
}
void enemyIzunaSkill1() {
if (enemySkillInProgress || skillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < enemySkill1CDEnd) return; int d = abs(player.x – enemy.x); if (d > 8) return;
enemySkillInProgress = true; enemyIzunaFireballActive = true; enemyIzunaFireballEnd = now + chrono::milliseconds(1500);
int cy = MAP_START_Y + CHARACTER_ROW;
for (int i = 0; i < 8; i++) { int fx = enemy.x – 1 – i; if (fx > 0 && fx != player.x && fx != enemy.x) { gotoxy(MAP_START_X + fx, cy); setColor(12); cout << "-"; } this_thread::sleep_for(chrono::milliseconds(30)); }
if (enemy.x – 7 > 0) { gotoxy(MAP_START_X + enemy.x – 7, cy); setColor(14); cout << "*"; }
int dmg = reducePlayerDamage(rand() % 4 + 18); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
this_thread::sleep_for(chrono::milliseconds(500)); for (int i = 0; i < 8; i++) { int fx = enemy.x – 1 – i; if (fx > 0 && fx != player.x && fx != enemy.x) { gotoxy(MAP_START_X + fx, cy); cout << " "; } }
enemyIzunaFireballActive = false; enemySkill1CDEnd = now + chrono::seconds(18); enemySkillInProgress = false;
}
void enemyIzunaSkill2() {
if (enemySkillInProgress || skillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < enemySkill2CDEnd) return;
enemySkillInProgress = true; int cy = MAP_START_Y + CHARACTER_ROW;
enemyIzunaSwordActive = true; enemyIzunaSwordEnd = now + chrono::milliseconds(1000);
for (int i = 0; i < 3; i++) { int sx = enemy.x – 1 – i; if (sx > 0 && sx != player.x && sx != enemy.x) { gotoxy(MAP_START_X + sx, cy); setColor(9); cout << "-"; } }
int dmg = reducePlayerDamage(rand() % 5 + 20); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
enemySkill2CDEnd = now + chrono::seconds(20); enemySkillInProgress = false;
}
void enemyIzunaUltimate() {
if (enemySkillInProgress || skillInProgress) return;
if (!canEnemyUseUltimate()) return;
enemySkillInProgress = true; consumeEnemySkillPoints(4);
int mx = MAP_WIDTH / 2; player.x = mx; int cy = MAP_START_Y + CHARACTER_ROW;
for (int s = 0; s < 15; s++) { int ry = MAP_START_Y + s; for (int c = 0; c < MAP_WIDTH; c += 3) { if (c != enemy.x) { gotoxy(MAP_START_X + c, ry); setColor(12); cout << "|"; } if (c + 1 != enemy.x) { gotoxy(MAP_START_X + c + 1, ry); setColor(14); cout << "*"; } } this_thread::sleep_for(chrono::milliseconds(100)); if (s > 0) { int py = MAP_START_Y + s – 1; for (int c = 0; c < MAP_WIDTH; c += 3) { gotoxy(MAP_START_X + c, py); cout << " "; gotoxy(MAP_START_X + c + 1, py); cout << " "; } } }
player.hp -= reducePlayerDamage(40); if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer();
for (int i = 0; i < 3; i++) { int sx = enemy.x – 1 – i; if (sx > 0) { gotoxy(MAP_START_X + sx, cy); setColor(9); cout << "-"; } } this_thread::sleep_for(chrono::seconds(1));
player.hp -= reducePlayerDamage(30); if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer();
for (int i = 0; i < 3; i++) { int sx = enemy.x – 1 – i; if (sx > 0) { gotoxy(MAP_START_X + sx, cy); cout << " "; } }
enemySkillInProgress = false;
}
// ———- 敌人漂泊浪客 ———-
void enemyWandererNormalAttack() {
if (skillInProgress || enemySkillInProgress || enemyWandererSpinActive || enemyWandererShockActive) return;
auto now = chrono::steady_clock::now(); if (now < enemyWandererNormalCDEnd) return;
for (int i = enemy.x – 1; i > player.x; i–) {
gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); setColor(13); cout << ")";
this_thread::sleep_for(chrono::milliseconds(15));
if (i != player.x + 1) { gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); cout << " "; }
}
int dmg = reducePlayerDamage(rand() % 3 + 10); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
enemyWandererNormalCDEnd = now + chrono::milliseconds(300);
}
void enemyWandererSkill1() {
if (enemyWandererShockActive) { enemyWandererShockActive = false; skillInProgress = false; }
if (skillInProgress || enemySkillInProgress || enemyWandererSpinActive || enemyWandererShockActive) return;
auto now = chrono::steady_clock::now(); if (now < enemyWandererSkill1CDEnd) return;
enemySkillInProgress = true;
for (int i = enemy.x – 1; i > player.x; i–) { gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); setColor(13); cout << "]"; this_thread::sleep_for(chrono::milliseconds(20)); if (i != player.x + 1) { gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); cout << " "; } }
int dmg1 = reducePlayerDamage(rand() % 3 + 8); player.hp -= dmg1; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer();
this_thread::sleep_for(chrono::milliseconds(500));
for (int i = enemy.x – 1; i > player.x; i–) { gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); setColor(13); cout << "}"; this_thread::sleep_for(chrono::milliseconds(20)); if (i != player.x + 1) { gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); cout << " "; } }
int dmg2 = reducePlayerDamage(rand() % 4 + 12); player.hp -= dmg2; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer();
enemyWandererSkill1CDEnd = now + chrono::milliseconds(500);
enemyWandererStateSwitchWindow = now + chrono::seconds(1);
enemySkillInProgress = false;
}
void enemyWandererShortSkill2() {
if (enemyWandererShockActive) { enemyWandererShockActive = false; skillInProgress = false; }
if (skillInProgress || enemySkillInProgress || enemyWandererSpinActive || enemyWandererShockActive) return;
if (enemyWandererShortSkill2Used || enemyWandererState != 0) return;
enemySkillInProgress = true;
for (int j = 0; j < 3; j++) {
for (int i = enemy.x – 1; i > player.x; i–) { gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); setColor(13); cout << "]"; this_thread::sleep_for(chrono::milliseconds(10)); if (i != player.x + 1) { gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); cout << " "; } }
int dmg = reducePlayerDamage(rand() % 5 + 12); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
}
enemyWandererShortSkill2Used = true;
enemyWandererShortSubSkillCDEnd = chrono::steady_clock::now() + chrono::seconds(5);
enemySkillInProgress = false;
}
void enemyWandererShortSubSkill() {
if (skillInProgress || enemySkillInProgress || !enemyWandererShortSkill2Used || enemyWandererState != 0) return;
if (enemyWandererSpinActive) return;
auto now = chrono::steady_clock::now();
if (now < enemyWandererShortSubSkillCDEnd) return;
enemyWandererSpinActive = true;
enemyWandererSpinEnd = now + chrono::seconds(15);
skillInProgress = true;
enemyWandererSpinEnemySavedX = player.x;
enemyWandererSpinEnemyTransferred = true;
player.x = enemy.x;
}
void enemyWandererLongSkill2() {
if (enemyWandererShockActive) { enemyWandererShockActive = false; skillInProgress = false; }
if (skillInProgress || enemySkillInProgress || enemyWandererSpinActive || enemyWandererShockActive) return;
if (enemyWandererState != 1 || enemyWandererLongSkill2Count <= 0) return;
auto now = chrono::steady_clock::now();
if (now < enemyWandererLongSkill2CDEnd) return;
enemyObitoKamuiActive = true; enemyObitoKamuiEnd = now + chrono::seconds(5);
enemyWandererLongSkill2Count–;
enemyWandererLongSkill2CDEnd = now + chrono::seconds(8);
addEnemySkillPoint();
}
void enemyWandererLongSubSkill() {
if (skillInProgress || enemySkillInProgress || enemyWandererSpinActive || enemyWandererShockActive) return;
if (enemyWandererState != 1) return;
int dist = player.x – enemy.x;
if (dist < 1 || dist > 8) return;
enemyWandererShockActive = true;
enemyWandererShockEnemyY = CHARACTER_ROW – 5;
skillInProgress = true;
int dmg = reducePlayerDamage(rand() % 6 + 25);
player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
enemyWandererShockDropTime = chrono::steady_clock::now();
}
void enemyWandererUltimate() {
if (enemyWandererShockActive) { enemyWandererShockActive = false; skillInProgress = false; }
if (skillInProgress || enemySkillInProgress || enemyWandererSpinActive || enemyWandererShockActive) return;
if (!canEnemyUseUltimate()) return;
enemySkillInProgress = true; skillInProgress = true; consumeEnemySkillPoints(4);
int targetX = MAP_WIDTH / 2;
while (enemy.x > targetX) enemy.x–;
drawBattleMap();
gotoxy(MAP_START_X + enemy.x – 3, MAP_START_Y + CHARACTER_ROW); setColor(13); cout << "——";
this_thread::sleep_for(chrono::seconds(1));
player.hp -= reducePlayerDamage(80); if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer();
gotoxy(MAP_START_X + enemy.x – 3, MAP_START_Y + CHARACTER_ROW); cout << " ";
skillInProgress = false; enemySkillInProgress = false;
}
void enemyWandererSwitchState() {
if (enemyWandererState == 0) enemyWandererState = 1;
else enemyWandererState = 0;
}
// ———- 敌人水门 ———-
void enemyMinatoNormalAttack() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now();
if (now < enemyMinatoNormalCDEnd) return;
for (int i = enemy.x – 1; i > player.x; i–) {
gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); setColor(14); cout << "-";
this_thread::sleep_for(chrono::milliseconds(20));
gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
int dmg = reducePlayerDamage(rand() % 3 + 8);
player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
enemyMinatoNormalCDEnd = now + chrono::milliseconds(500);
}
void enemyMinatoSkill1() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < enemyMinatoSkill1CDEnd) return;
enemySkillInProgress = true;
enemy.x = player.x + 2; if (enemy.x > MAP_WIDTH – 2) enemy.x = MAP_WIDTH – 2;
drawBattleMap();
gotoxy(MAP_START_X + enemy.x – 1, MAP_START_Y + CHARACTER_ROW); setColor(14); cout << "〇";
this_thread::sleep_for(chrono::milliseconds(800));
int dmg = reducePlayerDamage(rand() % 7 + 18); player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
gotoxy(MAP_START_X + enemy.x – 1, MAP_START_Y + CHARACTER_ROW); cout << " ";
enemyMinatoSkill1CDEnd = now + chrono::seconds(15);
enemySkillInProgress = false;
}
void enemyMinatoSkill2() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now(); if (now < enemyMinatoSkill2CDEnd) return;
if (!enemyMinatoMarkActive) {
enemySkillInProgress = true;
for (int i = enemy.x – 1; i > player.x; i–) {
gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); setColor(14); cout << "-";
this_thread::sleep_for(chrono::milliseconds(10));
gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
enemyMinatoMarkActive = true; enemyMinatoMarkX = player.x; enemyMinatoMarkEnd = now + chrono::seconds(10);
enemyMinatoCounterReady = true;
enemySkillInProgress = false;
}
else if (enemyMinatoCounterReady) {
skillInProgress = true;
enemyMinatoSkill1();
enemyMinatoCounterReady = false;
enemyMinatoMarkActive = false;
}
enemyMinatoSkill2CDEnd = now + chrono::seconds(10);
}
void enemyMinatoUltimate() {
if (skillInProgress || enemySkillInProgress) return;
if (!canEnemyUseUltimate()) return;
enemySkillInProgress = true; skillInProgress = true; consumeEnemySkillPoints(4);
gotoxy(MAP_START_X + player.x + 1, MAP_START_Y + CHARACTER_ROW); setColor(14); cout << "(0)";
this_thread::sleep_for(chrono::seconds(2));
int dmg = reducePlayerDamage(rand() % 6 + 75);
player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer();
gotoxy(MAP_START_X + player.x + 1, MAP_START_Y + CHARACTER_ROW); cout << " ";
skillInProgress = false; enemySkillInProgress = false;
}
// ==================== 佩恩六道(玩家) ====================
// 佩恩六道普通攻击 – 剑气
void playerPainSixPathNormalAttack() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now();
// 剑气攻击 – 向前砍出剑气直到命中敌人
for (int i = player.x + 1; i < MAP_WIDTH; i++) {
gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); setColor(6); cout << ")";
if (i == enemy.x) {
int dmg = increasePlayerDamage(rand() % 4 + 12); // 12-15
enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "剑气造成" << dmg << "点伤害!";
this_thread::sleep_for(chrono::milliseconds(100));
gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); cout << " ";
return;
}
this_thread::sleep_for(chrono::milliseconds(20));
gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
}
// 佩恩六道玩家一技能
void playerPainSixPathSkill1() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now();
if (now < playerPainSixPathSkill1CD) return;
switch (playerPainSixPathState) {
case 0: { // 天道 – 万象天引
if (playerPainSixPathSkill1Used) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "天道万象天引已使用!"; return; }
skillInProgress = true;
int tx = player.x + 3; if (tx >= MAP_WIDTH – 1) tx = MAP_WIDTH – 2;
while (enemy.x > tx) { enemy.x–; if (enemy.x <= player.x) { enemy.x = player.x + 3; break; } drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(30)); }
enemy.x = tx;
// 在敌人两侧显示黑棒(灰色\\和/)
playerBlackRodLeftX = enemy.x – 1;
playerBlackRodRightX = enemy.x + 1;
if (playerBlackRodLeftX > 0 && playerBlackRodLeftX != enemy.x && playerBlackRodLeftX != player.x) {
gotoxy(MAP_START_X + playerBlackRodLeftX, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "\\\\";
}
if (playerBlackRodRightX < MAP_WIDTH && playerBlackRodRightX != enemy.x && playerBlackRodRightX != player.x) {
gotoxy(MAP_START_X + playerBlackRodRightX, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "/";
}
enemyPinned = true;
int dmg = increasePlayerDamage(rand() % 6 + 20); // 20-25
enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
playerPainSixPathSkill1Used = true;
playerPainSixPathSkill1CD = now + chrono::seconds(3);
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "万象天引造成" << dmg << "点伤害!";
this_thread::sleep_for(chrono::seconds(3));
// 清除黑棒
if (playerBlackRodLeftX > 0 && playerBlackRodLeftX != enemy.x && playerBlackRodLeftX != player.x) {
gotoxy(MAP_START_X + playerBlackRodLeftX, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
if (playerBlackRodRightX < MAP_WIDTH && playerBlackRodRightX != enemy.x && playerBlackRodRightX != player.x) {
gotoxy(MAP_START_X + playerBlackRodRightX, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
enemyPinned = false;
skillInProgress = false;
break;
}
case 1: { // 畜生道-男 – 地狱犬
if (playerPainSixPathSkill1Used) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "地狱犬已使用!"; return; }
skillInProgress = true;
playerPainSixPathSummonX = player.x + 5;
playerPainSixPathSummonY = CHARACTER_ROW – 2;
playerPainSixPathSummonActive = true;
playerPainSixPathSummonEnd = now + chrono::milliseconds(1500);
int startX = playerPainSixPathSummonX;
for (int x = startX; x < enemy.x; x++) {
for (int dy = 0; dy < 2; dy++) {
for (int dx = 0; dx < 3; dx++) {
int sx = MAP_START_X + x + dx;
int sy = MAP_START_Y + playerPainSixPathSummonY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) {
gotoxy(sx, sy); setColor(6); cout << "*";
}
}
}
if (x + 3 >= enemy.x) {
int dmg = increasePlayerDamage(rand() % 5 + 18); // 18-22
enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "地狱犬造成" << dmg << "点伤害!";
break;
}
this_thread::sleep_for(chrono::milliseconds(50));
for (int dy = 0; dy < 2; dy++) {
for (int dx = 0; dx < 3; dx++) {
int sx = MAP_START_X + x + dx;
int sy = MAP_START_Y + playerPainSixPathSummonY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) {
gotoxy(sx, sy); cout << " ";
}
}
}
}
playerPainSixPathSummonActive = false;
playerPainSixPathSkill1Used = true;
playerPainSixPathSkill1CD = now + chrono::seconds(3);
skillInProgress = false;
break;
}
case 2: { // 畜生道-女 – 突刺
if (playerPainSixPathSkill1Used) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "突刺已使用!"; return; }
skillInProgress = true;
int targetX = enemy.x – 2; if (targetX < 2) targetX = 2;
while (player.x < targetX) { player.x++; drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(30)); }
// 显示黑棒
gotoxy(MAP_START_X + player.x + 1, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "—";
this_thread::sleep_for(chrono::milliseconds(500));
int dmg = increasePlayerDamage(rand() % 7 + 12); // 12-18
enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
gotoxy(MAP_START_X + player.x + 1, MAP_START_Y + CHARACTER_ROW); cout << " ";
playerPainSixPathSkill1Used = true;
playerPainSixPathSkill1CD = now + chrono::seconds(3);
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "突刺造成" << dmg << "点伤害!";
skillInProgress = false;
break;
}
case 3: { // 修罗道 – 导弹
if (playerPainSixPathSkill1Count >= 2) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "导弹已使用完毕!"; return; }
skillInProgress = true;
int missileX = player.x + 1;
while (missileX < enemy.x) {
gotoxy(MAP_START_X + missileX, MAP_START_Y + CHARACTER_ROW); setColor(7); cout << "->";
if (missileX + 1 >= enemy.x) {
int dmg = increasePlayerDamage(rand() % 6 + 15); // 15-20
enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "导弹造成" << dmg << "点伤害!";
gotoxy(MAP_START_X + missileX, MAP_START_Y + CHARACTER_ROW); cout << " ";
break;
}
this_thread::sleep_for(chrono::milliseconds(30));
gotoxy(MAP_START_X + missileX, MAP_START_Y + CHARACTER_ROW); cout << " ";
missileX++;
}
playerPainSixPathSkill1Count++;
playerPainSixPathSkill1CD = now + chrono::seconds(9);
skillInProgress = false;
break;
}
case 4: { // 饿鬼道 – 抱摔
if (playerPainSixPathSkill1Used) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "抱摔已使用!"; return; }
skillInProgress = true;
while (player.x < enemy.x – 1) { player.x++; drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(30)); }
int dmg = increasePlayerDamage(rand() % 5 + 18); // 18-22
enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
playerPainSixPathSkill1Used = true;
playerPainSixPathSkill1CD = now + chrono::seconds(3);
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "抱摔造成" << dmg << "点伤害!";
skillInProgress = false;
break;
}
case 5: { // 人间道 – 封印术
if (playerPainSixPathSkill1Used) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "封印术已使用!"; return; }
skillInProgress = true;
int targetX = enemy.x – 2; if (targetX < 2) targetX = 2;
while (player.x < targetX) { player.x++; drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(30)); }
gotoxy(MAP_START_X + player.x + 1, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "—";
this_thread::sleep_for(chrono::milliseconds(500));
int dmg = increasePlayerDamage(rand() % 4 + 15); // 15-18
enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
// 封印技能5秒
enemyPinned = true;
playerPainSixPathEnemySealed = true;
playerPainSixPathEnemySealedEnd = now + chrono::seconds(5);
gotoxy(MAP_START_X + player.x + 1, MAP_START_Y + CHARACTER_ROW); cout << " ";
playerPainSixPathSkill1Used = true;
playerPainSixPathSkill1CD = now + chrono::seconds(3);
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "封印术造成" << dmg << "点伤害!";
this_thread::sleep_for(chrono::seconds(5));
enemyPinned = false;
skillInProgress = false;
break;
}
case 6: { // 地狱道 – 阎王(召唤)
if (playerPainSixPathSkill1Used) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "阎王已使用!"; return; }
skillInProgress = true;
// 召唤阎王
playerPainSixPathSummonX = player.x – 3;
playerPainSixPathSummonY = CHARACTER_ROW – 3;
playerPainSixPathSummonActive = true;
playerPainSixPathSummonEnd = now + chrono::seconds(15);
for (int dy = 0; dy < 3; dy++) {
for (int dx = 0; dx < 2; dx++) {
int sx = MAP_START_X + playerPainSixPathSummonX + dx;
int sy = MAP_START_Y + playerPainSixPathSummonY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) {
gotoxy(sx, sy); setColor(12); cout << "#";
}
}
}
playerPainSixPathSkill1Used = true;
playerPainSixPathSkill1CD = now + chrono::seconds(3);
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "阎王召唤!";
skillInProgress = false;
break;
}
}
}
// 佩恩六道玩家二技能
void playerPainSixPathSkill2() {
if (skillInProgress || enemySkillInProgress) return;
auto now = chrono::steady_clock::now();
if (now < playerPainSixPathSkill2CD) return;
switch (playerPainSixPathState) {
case 0: { // 天道 – 神罗天征
if (playerPainSixPathSkill2Used) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "天道神罗天征已使用!"; return; }
skillInProgress = true;
// 左侧3格范围内攻击
for (int i = 1; i <= 3; i++) {
int lx = player.x – i;
if (lx > 0) {
gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); setColor(7); cout << "(";
if (lx == enemy.x) {
int dmg = increasePlayerDamage(rand() % 6 + 25); // 25-30
enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "神罗天征造成" << dmg << "点伤害!";
}
}
int rx = player.x + i;
if (rx < MAP_WIDTH) {
gotoxy(MAP_START_X + rx, MAP_START_Y + CHARACTER_ROW); setColor(7); cout << ")";
if (rx == enemy.x) {
int dmg = increasePlayerDamage(rand() % 6 + 25);
enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "神罗天征造成" << dmg << "点伤害!";
}
}
this_thread::sleep_for(chrono::milliseconds(300));
}
for (int i = 1; i <= 3; i++) {
int lx = player.x – i;
if (lx > 0) { gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); cout << " "; }
int rx = player.x + i;
if (rx < MAP_WIDTH) { gotoxy(MAP_START_X + rx, MAP_START_Y + CHARACTER_ROW); cout << " "; }
}
playerPainSixPathSkill2Used = true;
playerPainSixPathSkill2CD = now + chrono::seconds(3);
skillInProgress = false;
break;
}
case 1: { // 畜生道-男 – Panda(无敌)
if (playerPainSixPathSkill2Used) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "panda已使用!"; return; }
skillInProgress = true;
// 显示熊猫
int pandaX = player.x + 5;
int pandaY = CHARACTER_ROW – 2;
for (int dy = 0; dy < 3; dy++) {
for (int dx = 0; dx < 2; dx++) {
int sx = MAP_START_X + pandaX + dx;
int sy = MAP_START_Y + pandaY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) {
gotoxy(sx, sy); setColor(7); cout << "#";
}
}
}
this_thread::sleep_for(chrono::milliseconds(1500));
for (int dy = 0; dy < 3; dy++) {
for (int dx = 0; dx < 2; dx++) {
int sx = MAP_START_X + pandaX + dx;
int sy = MAP_START_Y + pandaY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) {
gotoxy(sx, sy); cout << " ";
}
}
}
// 获得8秒无敌
playerPainSixPathInvincible = true;
playerPainSixPathInvincibleEnd = now + chrono::seconds(8);
playerPainSixPathSkill2Used = true;
playerPainSixPathSkill2CD = now + chrono::seconds(3);
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "获得8秒无敌!";
skillInProgress = false;
break;
}
case 2: { // 畜生道-女 – 变色龙
if (playerPainSixPathSkill2Used) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "变色龙已使用!"; return; }
skillInProgress = true;
// 召唤变色龙
int chameleonX = player.x + 5;
int chameleonY = CHARACTER_ROW – 2;
for (int dy = 0; dy < 2; dy++) {
for (int dx = 0; dx < 3; dx++) {
int sx = MAP_START_X + chameleonX + dx;
int sy = MAP_START_Y + chameleonY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) {
gotoxy(sx, sy); setColor(2); cout << "*";
}
}
}
this_thread::sleep_for(chrono::milliseconds(500));
// 将敌人吸到变色龙右侧
enemy.x = chameleonX + 4;
if (enemy.x >= MAP_WIDTH – 1) enemy.x = MAP_WIDTH – 2;
int dmg = increasePlayerDamage(rand() % 5 + 18); // 18-22
enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
for (int dy = 0; dy < 2; dy++) {
for (int dx = 0; dx < 3; dx++) {
int sx = MAP_START_X + chameleonX + dx;
int sy = MAP_START_Y + chameleonY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) {
gotoxy(sx, sy); cout << " ";
}
}
}
playerPainSixPathSkill2Used = true;
playerPainSixPathSkill2CD = now + chrono::seconds(3);
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "变色龙造成" << dmg << "点伤害!";
skillInProgress = false;
break;
}
case 3: { // 修罗道 – 铁臂捉取
if (playerPainSixPathSkill2Used) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "铁臂捉取已使用!"; return; }
skillInProgress = true;
bool caught = false;
for (int i = 1; i <= 20; i++) {
int cx = player.x + i;
if (cx >= MAP_WIDTH) break;
if (cx < enemy.x) {
gotoxy(MAP_START_X + cx, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "—";
}
if (cx == enemy.x – 1) { caught = true; break; }
this_thread::sleep_for(chrono::milliseconds(30));
}
if (caught) {
enemy.x = player.x + 2;
int dmg = increasePlayerDamage(rand() % 4 + 15); // 15-18
enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "铁臂捉取造成" << dmg << "点伤害!";
}
for (int i = 1; i <= 20; i++) {
int cx = player.x + i;
if (cx >= MAP_WIDTH) break;
gotoxy(MAP_START_X + cx, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
playerPainSixPathSkill2Used = true;
playerPainSixPathSkill2CD = now + chrono::seconds(3);
skillInProgress = false;
break;
}
case 4: { // 饿鬼道 – 忍术吸收(能量盾)
if (playerPainSixPathSkill2Used) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "忍术吸收已使用!"; return; }
skillInProgress = true;
playerPainSixPathShieldActive = true;
playerPainSixPathShieldEnd = now + chrono::seconds(8);
gotoxy(MAP_START_X + player.x – 1, MAP_START_Y + CHARACTER_ROW); setColor(11); cout << "(";
gotoxy(MAP_START_X + player.x + 1, MAP_START_Y + CHARACTER_ROW); setColor(11); cout << ")";
playerPainSixPathSkill2Used = true;
playerPainSixPathSkill2CD = now + chrono::seconds(3);
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "忍术吸收开启!";
skillInProgress = false;
break;
}
case 5: { // 人间道 – 阎王
if (playerPainSixPathSkill2Used) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "阎王已使用!"; return; }
skillInProgress = true;
// 召唤阎王
int yamaX = player.x – 3;
int yamaY = CHARACTER_ROW – 3;
for (int dy = 0; dy < 3; dy++) {
for (int dx = 0; dx < 2; dx++) {
int sx = MAP_START_X + yamaX + dx;
int sy = MAP_START_Y + yamaY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) {
gotoxy(sx, sy); setColor(12); cout << "#";
}
}
}
// 召唤灵魂体
playerPainSixPathSoulX = player.x + 5;
playerPainSixPathSoulY = CHARACTER_ROW;
playerPainSixPathSoulActive = true;
playerPainSixPathSoulEnd = now + chrono::seconds(5);
enemyPinned = true;
gotoxy(MAP_START_X + playerPainSixPathSoulX, MAP_START_Y + playerPainSixPathSoulY); setColor(9); cout << "&";
playerPainSixPathSkill2Used = true;
playerPainSixPathSkill2CD = now + chrono::seconds(3);
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "阎王和灵魂体召唤!";
this_thread::sleep_for(chrono::seconds(5));
enemyPinned = false;
// 清除阎王
for (int dy = 0; dy < 3; dy++) {
for (int dx = 0; dx < 2; dx++) {
int sx = MAP_START_X + yamaX + dx;
int sy = MAP_START_Y + yamaY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) {
gotoxy(sx, sy); cout << " ";
}
}
}
skillInProgress = false;
break;
}
case 6: { // 地狱道 – 发射黑棒(需要先召唤阎王)
if (!playerPainSixPathSummonActive) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "请先召唤阎王!"; return; }
if (playerPainSixPathSkill2Used) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "发射黑棒已使用!"; return; }
skillInProgress = true;
// 发射黑棒
int rodX = player.x + 1;
while (rodX < enemy.x) {
gotoxy(MAP_START_X + rodX, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "—";
if (rodX == enemy.x – 1) {
int dmg = increasePlayerDamage(rand() % 6 + 15); // 15-20
enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer(); addPlayerSkillPoint();
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "黑棒造成" << dmg << "点伤害!";
break;
}
this_thread::sleep_for(chrono::milliseconds(30));
gotoxy(MAP_START_X + rodX, MAP_START_Y + CHARACTER_ROW); cout << " ";
rodX++;
}
playerPainSixPathSkill2Used = true;
playerPainSixPathSkill2CD = now + chrono::seconds(3);
skillInProgress = false;
break;
}
}
}
// 佩恩六道玩家子技能 – 切换状态(无限使用,轮换重置技能次数)
void playerPainSixPathSubSkill() {
if (skillInProgress || enemySkillInProgress) return;
// 切换到下一个状态
playerPainSixPathState = (playerPainSixPathState + 1) % 7;
playerPainSixPathCycleCount++;
// 重置技能使用次数(每个状态独立)
playerPainSixPathSkill1Used = false;
playerPainSixPathSkill2Used = false;
playerPainSixPathSkill1Count = 0;
playerPainSixPathSkill2Count = 0;
string stateName[] = { "天道","畜生道-男","畜生道-女","修罗道","饿鬼道","人间道","地狱道" };
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "切换至:" << stateName[playerPainSixPathState] << " (轮换:" << playerPainSixPathCycleCount << ")";
}
// 佩恩六道玩家奥义 – 六道轮回(回到原位)
void playerPainSixPathUltimate() {
if (skillInProgress || enemySkillInProgress) return;
if (!canPlayerUseUltimate()) { gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "技能点不足!需要4个技能点"; return; }
skillInProgress = true; consumePlayerSkillPoints(4);
// 保存当前位置
int savedX = player.x;
// 在敌人两侧插黑棒
playerBlackRodLeftX = enemy.x – 1;
playerBlackRodRightX = enemy.x + 1;
if (playerBlackRodLeftX > 0 && playerBlackRodLeftX != enemy.x && playerBlackRodLeftX != player.x) {
gotoxy(MAP_START_X + playerBlackRodLeftX, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "\\\\";
}
if (playerBlackRodRightX < MAP_WIDTH && playerBlackRodRightX != enemy.x && playerBlackRodRightX != player.x) {
gotoxy(MAP_START_X + playerBlackRodRightX, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "/";
}
int dmg = increasePlayerDamage(rand() % 6 + 28); // 28-33
enemy.hp -= dmg; if (enemy.hp < 0) enemy.hp = 0;
launchEnemy(); resetEnemyLaunchTimer();
// 移动到地图中心
int centerX = MAP_WIDTH / 2;
while (player.x < centerX) player.x++;
drawBattleMap();
// 超神罗天征 – 持续5秒,每0.5秒造成5点伤害
for (int s = 1; s <= 5; s++) {
for (int r = 1; r <= s; r++) {
int lx = player.x – r;
int rx = player.x + r;
if (lx > 1 && lx != enemy.x && lx != player.x) {
gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); setColor(7); cout << "{";
}
if (rx < MAP_WIDTH && rx != enemy.x && rx != player.x) {
gotoxy(MAP_START_X + rx, MAP_START_Y + CHARACTER_ROW); setColor(7); cout << "}";
}
}
enemy.hp -= increasePlayerDamage(5);
if (enemy.hp < 0) enemy.hp = 0;
this_thread::sleep_for(chrono::milliseconds(500));
}
// 清除超神罗天征效果
for (int r = 1; r <= 5; r++) {
int lx = player.x – r;
int rx = player.x + r;
if (lx > 1 && lx != enemy.x && lx != player.x) {
gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
if (rx < MAP_WIDTH && rx != enemy.x && rx != player.x) {
gotoxy(MAP_START_X + rx, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
}
// 清除黑棒
if (playerBlackRodLeftX > 0 && playerBlackRodLeftX != enemy.x && playerBlackRodLeftX != player.x) {
gotoxy(MAP_START_X + playerBlackRodLeftX, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
if (playerBlackRodRightX < MAP_WIDTH && playerBlackRodRightX != enemy.x && playerBlackRodRightX != player.x) {
gotoxy(MAP_START_X + playerBlackRodRightX, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
// 回到原位
player.x = savedX;
drawBattleMap();
// 切换回天道,重置技能次数
playerPainSixPathState = 0;
playerPainSixPathSkill1Used = false;
playerPainSixPathSkill2Used = false;
playerPainSixPathSkill1Count = 0;
playerPainSixPathSkill2Count = 0;
gotoxy(2, MAP_START_Y + MAP_HEIGHT + 4); cout << "六道轮回!超神罗天征!";
skillInProgress = false;
}
// ==================== 佩恩六道(敌人) ====================
// 敌人佩恩六道普通攻击 – 剑气
void enemyPainSixPathNormalAttack() {
if (skillInProgress || enemySkillInProgress) return;
// 剑气攻击 – 向左砍出剑气直到命中玩家
for (int i = enemy.x – 1; i > 0; i–) {
gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); setColor(6); cout << ")";
if (i == player.x) {
int dmg = reducePlayerDamage(rand() % 4 + 12);
player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
this_thread::sleep_for(chrono::milliseconds(100));
gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); cout << " ";
return;
}
this_thread::sleep_for(chrono::milliseconds(20));
gotoxy(MAP_START_X + i, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
}
// 敌人佩恩六道一技能
void enemyPainSixPathSkill1() {
if (enemySkillInProgress || skillInProgress) return;
auto now = chrono::steady_clock::now();
if (now < enemyPainSixPathSkill1CD) return;
switch (enemyPainSixPathState) {
case 0: { // 天道 – 万象天引
if (enemyPainSixPathSkill1Used) return;
enemySkillInProgress = true;
int tx = enemy.x – 3; if (tx < 2) tx = 2;
while (player.x < tx) { player.x++; if (player.x >= enemy.x) { player.x = enemy.x – 3; break; } this_thread::sleep_for(chrono::milliseconds(30)); }
player.x = tx;
// 在玩家两侧显示黑棒
enemyBlackRodLeftX = player.x – 1;
enemyBlackRodRightX = player.x + 1;
if (enemyBlackRodLeftX > 0 && enemyBlackRodLeftX != player.x && enemyBlackRodLeftX != enemy.x) {
gotoxy(MAP_START_X + enemyBlackRodLeftX, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "\\\\";
}
if (enemyBlackRodRightX < MAP_WIDTH && enemyBlackRodRightX != player.x && enemyBlackRodRightX != enemy.x) {
gotoxy(MAP_START_X + enemyBlackRodRightX, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "/";
}
playerPinned = true;
int dmg = reducePlayerDamage(rand() % 6 + 20);
player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
enemyPainSixPathSkill1Used = true;
enemyPainSixPathSkill1CD = now + chrono::seconds(3);
this_thread::sleep_for(chrono::seconds(3));
// 清除黑棒
if (enemyBlackRodLeftX > 0 && enemyBlackRodLeftX != player.x && enemyBlackRodLeftX != enemy.x) {
gotoxy(MAP_START_X + enemyBlackRodLeftX, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
if (enemyBlackRodRightX < MAP_WIDTH&& enemyBlackRodRightX != player.x && enemyBlackRodRightX != enemy.x) {
gotoxy(MAP_START_X + enemyBlackRodRightX, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
playerPinned = false;
enemySkillInProgress = false;
break;
}
case 1: { // 畜生道-男 – 地狱犬
if (enemyPainSixPathSkill1Used) return;
enemySkillInProgress = true;
enemyPainSixPathSummonX = enemy.x – 5;
enemyPainSixPathSummonY = CHARACTER_ROW – 2;
enemyPainSixPathSummonActive = true;
enemyPainSixPathSummonEnd = now + chrono::milliseconds(1500);
int startX = enemyPainSixPathSummonX;
for (int x = startX; x > player.x; x–) {
for (int dy = 0; dy < 2; dy++) {
for (int dx = 0; dx < 3; dx++) {
int sx = MAP_START_X + x + dx;
int sy = MAP_START_Y + enemyPainSixPathSummonY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) {
gotoxy(sx, sy); setColor(6); cout << "*";
}
}
}
if (x – 1 <= player.x) {
int dmg = reducePlayerDamage(rand() % 5 + 18);
player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
break;
}
this_thread::sleep_for(chrono::milliseconds(50));
for (int dy = 0; dy < 2; dy++) {
for (int dx = 0; dx < 3; dx++) {
int sx = MAP_START_X + x + dx;
int sy = MAP_START_Y + enemyPainSixPathSummonY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) {
gotoxy(sx, sy); cout << " ";
}
}
}
}
enemyPainSixPathSummonActive = false;
enemyPainSixPathSkill1Used = true;
enemyPainSixPathSkill1CD = now + chrono::seconds(3);
enemySkillInProgress = false;
break;
}
case 2: { // 畜生道-女 – 突刺
if (enemyPainSixPathSkill1Used) return;
enemySkillInProgress = true;
int targetX = player.x + 2; if (targetX >= MAP_WIDTH – 2) targetX = MAP_WIDTH – 3;
while (enemy.x > targetX) { enemy.x–; drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(30)); }
gotoxy(MAP_START_X + enemy.x – 1, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "—";
this_thread::sleep_for(chrono::milliseconds(500));
int dmg = reducePlayerDamage(rand() % 7 + 12);
player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
gotoxy(MAP_START_X + enemy.x – 1, MAP_START_Y + CHARACTER_ROW); cout << " ";
enemyPainSixPathSkill1Used = true;
enemyPainSixPathSkill1CD = now + chrono::seconds(3);
enemySkillInProgress = false;
break;
}
case 3: { // 修罗道 – 导弹
if (enemyPainSixPathSkill1Count >= 2) return;
enemySkillInProgress = true;
int missileX = enemy.x – 1;
while (missileX > player.x) {
gotoxy(MAP_START_X + missileX, MAP_START_Y + CHARACTER_ROW); setColor(7); cout << "->";
if (missileX – 1 <= player.x) {
int dmg = reducePlayerDamage(rand() % 6 + 15);
player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
gotoxy(MAP_START_X + missileX, MAP_START_Y + CHARACTER_ROW); cout << " ";
break;
}
this_thread::sleep_for(chrono::milliseconds(30));
gotoxy(MAP_START_X + missileX, MAP_START_Y + CHARACTER_ROW); cout << " ";
missileX–;
}
enemyPainSixPathSkill1Count++;
enemyPainSixPathSkill1CD = now + chrono::seconds(9);
enemySkillInProgress = false;
break;
}
case 4: { // 饿鬼道 – 抱摔
if (enemyPainSixPathSkill1Used) return;
enemySkillInProgress = true;
while (enemy.x > player.x + 1) { enemy.x–; drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(30)); }
int dmg = reducePlayerDamage(rand() % 5 + 18);
player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
enemyPainSixPathSkill1Used = true;
enemyPainSixPathSkill1CD = now + chrono::seconds(3);
enemySkillInProgress = false;
break;
}
case 5: { // 人间道 – 封印术
if (enemyPainSixPathSkill1Used) return;
enemySkillInProgress = true;
int targetX = player.x + 2; if (targetX >= MAP_WIDTH – 2) targetX = MAP_WIDTH – 3;
while (enemy.x > targetX) { enemy.x–; drawBattleMap(); this_thread::sleep_for(chrono::milliseconds(30)); }
gotoxy(MAP_START_X + enemy.x – 1, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "—";
this_thread::sleep_for(chrono::milliseconds(500));
int dmg = reducePlayerDamage(rand() % 4 + 15);
player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
playerPinned = true;
enemyPainSixPathPlayerSealed = true;
enemyPainSixPathPlayerSealedEnd = now + chrono::seconds(5);
gotoxy(MAP_START_X + enemy.x – 1, MAP_START_Y + CHARACTER_ROW); cout << " ";
enemyPainSixPathSkill1Used = true;
enemyPainSixPathSkill1CD = now + chrono::seconds(3);
this_thread::sleep_for(chrono::seconds(5));
playerPinned = false;
enemySkillInProgress = false;
break;
}
case 6: { // 地狱道 – 阎王
if (enemyPainSixPathSkill1Used) return;
enemySkillInProgress = true;
enemyPainSixPathSummonX = enemy.x + 1;
enemyPainSixPathSummonY = CHARACTER_ROW – 3;
enemyPainSixPathSummonActive = true;
enemyPainSixPathSummonEnd = now + chrono::seconds(15);
for (int dy = 0; dy < 3; dy++) {
for (int dx = 0; dx < 2; dx++) {
int sx = MAP_START_X + enemyPainSixPathSummonX + dx;
int sy = MAP_START_Y + enemyPainSixPathSummonY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) {
gotoxy(sx, sy); setColor(12); cout << "#";
}
}
}
enemyPainSixPathSkill1Used = true;
enemyPainSixPathSkill1CD = now + chrono::seconds(3);
enemySkillInProgress = false;
break;
}
}
}
// 敌人佩恩六道二技能
void enemyPainSixPathSkill2() {
if (enemySkillInProgress || skillInProgress) return;
auto now = chrono::steady_clock::now();
if (now < enemyPainSixPathSkill2CD) return;
switch (enemyPainSixPathState) {
case 0: { // 天道 – 神罗天征
if (enemyPainSixPathSkill2Used) return;
enemySkillInProgress = true;
for (int i = 1; i <= 3; i++) {
int lx = enemy.x – i;
if (lx > 0) {
gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); setColor(7); cout << "(";
if (lx == player.x) {
int dmg = reducePlayerDamage(rand() % 6 + 25);
player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
}
}
int rx = enemy.x + i;
if (rx < MAP_WIDTH) {
gotoxy(MAP_START_X + rx, MAP_START_Y + CHARACTER_ROW); setColor(7); cout << ")";
if (rx == player.x) {
int dmg = reducePlayerDamage(rand() % 6 + 25);
player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
}
}
this_thread::sleep_for(chrono::milliseconds(300));
}
for (int i = 1; i <= 3; i++) {
int lx = enemy.x – i;
if (lx > 0) { gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); cout << " "; }
int rx = enemy.x + i;
if (rx < MAP_WIDTH) { gotoxy(MAP_START_X + rx, MAP_START_Y + CHARACTER_ROW); cout << " "; }
}
enemyPainSixPathSkill2Used = true;
enemyPainSixPathSkill2CD = now + chrono::seconds(3);
enemySkillInProgress = false;
break;
}
case 1: { // 畜生道-男 – Panda
if (enemyPainSixPathSkill2Used) return;
enemySkillInProgress = true;
int pandaX = enemy.x – 5;
int pandaY = CHARACTER_ROW – 2;
for (int dy = 0; dy < 3; dy++) {
for (int dx = 0; dx < 2; dx++) {
int sx = MAP_START_X + pandaX + dx;
int sy = MAP_START_Y + pandaY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) {
gotoxy(sx, sy); setColor(7); cout << "#";
}
}
}
this_thread::sleep_for(chrono::milliseconds(1500));
for (int dy = 0; dy < 3; dy++) {
for (int dx = 0; dx < 2; dx++) {
int sx = MAP_START_X + pandaX + dx;
int sy = MAP_START_Y + pandaY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) {
gotoxy(sx, sy); cout << " ";
}
}
}
enemyPainSixPathInvincible = true;
enemyPainSixPathInvincibleEnd = now + chrono::seconds(8);
enemyPainSixPathSkill2Used = true;
enemyPainSixPathSkill2CD = now + chrono::seconds(3);
enemySkillInProgress = false;
break;
}
case 2: { // 畜生道-女 – 变色龙
if (enemyPainSixPathSkill2Used) return;
enemySkillInProgress = true;
int chameleonX = enemy.x – 5;
int chameleonY = CHARACTER_ROW – 2;
for (int dy = 0; dy < 2; dy++) {
for (int dx = 0; dx < 3; dx++) {
int sx = MAP_START_X + chameleonX + dx;
int sy = MAP_START_Y + chameleonY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) {
gotoxy(sx, sy); setColor(2); cout << "*";
}
}
}
this_thread::sleep_for(chrono::milliseconds(500));
player.x = chameleonX – 2;
if (player.x < 1) player.x = 1;
int dmg = reducePlayerDamage(rand() % 5 + 18);
player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
for (int dy = 0; dy < 2; dy++) {
for (int dx = 0; dx < 3; dx++) {
int sx = MAP_START_X + chameleonX + dx;
int sy = MAP_START_Y + chameleonY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) {
gotoxy(sx, sy); cout << " ";
}
}
}
enemyPainSixPathSkill2Used = true;
enemyPainSixPathSkill2CD = now + chrono::seconds(3);
enemySkillInProgress = false;
break;
}
case 3: { // 修罗道 – 铁臂捉取
if (enemyPainSixPathSkill2Used) return;
enemySkillInProgress = true;
bool caught = false;
for (int i = 1; i <= 20; i++) {
int cx = enemy.x – i;
if (cx < 0) break;
if (cx > player.x) {
gotoxy(MAP_START_X + cx, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "—";
}
if (cx == player.x + 1) { caught = true; break; }
this_thread::sleep_for(chrono::milliseconds(30));
}
if (caught) {
player.x = enemy.x – 2;
int dmg = reducePlayerDamage(rand() % 4 + 15);
player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
}
for (int i = 1; i <= 20; i++) {
int cx = enemy.x – i;
if (cx < 0) break;
gotoxy(MAP_START_X + cx, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
enemyPainSixPathSkill2Used = true;
enemyPainSixPathSkill2CD = now + chrono::seconds(3);
enemySkillInProgress = false;
break;
}
case 4: { // 饿鬼道 – 忍术吸收
if (enemyPainSixPathSkill2Used) return;
enemySkillInProgress = true;
enemyPainSixPathShieldActive = true;
enemyPainSixPathShieldEnd = now + chrono::seconds(8);
gotoxy(MAP_START_X + enemy.x – 1, MAP_START_Y + CHARACTER_ROW); setColor(11); cout << "(";
gotoxy(MAP_START_X + enemy.x + 1, MAP_START_Y + CHARACTER_ROW); setColor(11); cout << ")";
enemyPainSixPathSkill2Used = true;
enemyPainSixPathSkill2CD = now + chrono::seconds(3);
enemySkillInProgress = false;
break;
}
case 5: { // 人间道 – 阎王
if (enemyPainSixPathSkill2Used) return;
enemySkillInProgress = true;
int yamaX = enemy.x + 3;
int yamaY = CHARACTER_ROW – 3;
for (int dy = 0; dy < 3; dy++) {
for (int dx = 0; dx < 2; dx++) {
int sx = MAP_START_X + yamaX + dx;
int sy = MAP_START_Y + yamaY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) {
gotoxy(sx, sy); setColor(12); cout << "#";
}
}
}
enemyPainSixPathSoulX = enemy.x – 5;
enemyPainSixPathSoulY = CHARACTER_ROW;
enemyPainSixPathSoulActive = true;
enemyPainSixPathSoulEnd = now + chrono::seconds(5);
playerPinned = true;
gotoxy(MAP_START_X + enemyPainSixPathSoulX, MAP_START_Y + enemyPainSixPathSoulY); setColor(9); cout << "&";
enemyPainSixPathSkill2Used = true;
enemyPainSixPathSkill2CD = now + chrono::seconds(3);
this_thread::sleep_for(chrono::seconds(5));
playerPinned = false;
for (int dy = 0; dy < 3; dy++) {
for (int dx = 0; dx < 2; dx++) {
int sx = MAP_START_X + yamaX + dx;
int sy = MAP_START_Y + yamaY + dy;
if (sx > 0 && sx < MAP_WIDTH && sy > 0) {
gotoxy(sx, sy); cout << " ";
}
}
}
enemySkillInProgress = false;
break;
}
case 6: { // 地狱道 – 发射黑棒
if (!enemyPainSixPathSummonActive) return;
if (enemyPainSixPathSkill2Used) return;
enemySkillInProgress = true;
int rodX = enemy.x – 1;
while (rodX > player.x) {
gotoxy(MAP_START_X + rodX, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "—";
if (rodX == player.x + 1) {
int dmg = reducePlayerDamage(rand() % 6 + 15);
player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer(); addEnemySkillPoint();
break;
}
this_thread::sleep_for(chrono::milliseconds(30));
gotoxy(MAP_START_X + rodX, MAP_START_Y + CHARACTER_ROW); cout << " ";
rodX–;
}
enemyPainSixPathSkill2Used = true;
enemyPainSixPathSkill2CD = now + chrono::seconds(3);
enemySkillInProgress = false;
break;
}
}
}
// 敌人佩恩六道子技能 – 切换状态(无限使用,轮换重置技能次数)
void enemyPainSixPathSubSkill() {
if (enemySkillInProgress || skillInProgress) return;
enemyPainSixPathState = (enemyPainSixPathState + 1) % 7;
enemyPainSixPathCycleCount++;
enemyPainSixPathSkill1Used = false;
enemyPainSixPathSkill2Used = false;
enemyPainSixPathSkill1Count = 0;
enemyPainSixPathSkill2Count = 0;
}
// 敌人佩恩六道奥义 – 六道轮回(回到原位)
void enemyPainSixPathUltimate() {
if (enemySkillInProgress || skillInProgress) return;
if (!canEnemyUseUltimate()) return;
enemySkillInProgress = true; consumeEnemySkillPoints(4);
// 保存当前位置
int savedX = enemy.x;
// 在玩家两侧插黑棒
enemyBlackRodLeftX = player.x – 1;
enemyBlackRodRightX = player.x + 1;
if (enemyBlackRodLeftX > 0 && enemyBlackRodLeftX != player.x && enemyBlackRodLeftX != enemy.x) {
gotoxy(MAP_START_X + enemyBlackRodLeftX, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "\\\\";
}
if (enemyBlackRodRightX < MAP_WIDTH && enemyBlackRodRightX != player.x && enemyBlackRodRightX != enemy.x) {
gotoxy(MAP_START_X + enemyBlackRodRightX, MAP_START_Y + CHARACTER_ROW); setColor(8); cout << "/";
}
int dmg = reducePlayerDamage(rand() % 6 + 28);
player.hp -= dmg; if (player.hp < 0) player.hp = 0;
launchPlayer(); resetPlayerLaunchTimer();
// 移动到地图中心
int centerX = MAP_WIDTH / 2;
while (enemy.x > centerX) enemy.x–;
drawBattleMap();
// 超神罗天征
for (int s = 1; s <= 5; s++) {
for (int r = 1; r <= s; r++) {
int lx = enemy.x – r;
int rx = enemy.x + r;
if (lx > 1 && lx != player.x && lx != enemy.x) {
gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); setColor(7); cout << "{";
}
if (rx < MAP_WIDTH && rx != player.x && rx != enemy.x) {
gotoxy(MAP_START_X + rx, MAP_START_Y + CHARACTER_ROW); setColor(7); cout << "}";
}
}
player.hp -= reducePlayerDamage(5);
if (player.hp < 0) player.hp = 0;
this_thread::sleep_for(chrono::milliseconds(500));
}
// 清除超神罗天征效果
for (int r = 1; r <= 5; r++) {
int lx = enemy.x – r;
int rx = enemy.x + r;
if (lx > 1 && lx != player.x && lx != enemy.x) {
gotoxy(MAP_START_X + lx, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
if (rx < MAP_WIDTH && rx != player.x && rx != enemy.x) {
gotoxy(MAP_START_X + rx, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
}
// 清除黑棒
if (enemyBlackRodLeftX > 0 && enemyBlackRodLeftX != player.x && enemyBlackRodLeftX != enemy.x) {
gotoxy(MAP_START_X + enemyBlackRodLeftX, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
if (enemyBlackRodRightX < MAP_WIDTH && enemyBlackRodRightX != player.x && enemyBlackRodRightX != enemy.x) {
gotoxy(MAP_START_X + enemyBlackRodRightX, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
// 回到原位
enemy.x = savedX;
drawBattleMap();
// 切换回天道,重置技能次数
enemyPainSixPathState = 0;
enemyPainSixPathSkill1Used = false;
enemyPainSixPathSkill2Used = false;
enemyPainSixPathSkill1Count = 0;
enemyPainSixPathSkill2Count = 0;
enemySkillInProgress = false;
}
// ==================== 第6部分:动作分发 + AI + 战斗主循环 + 界面选择 + 主函数 ====================
// ==================== 玩家动作分发函数 ====================
void playerNormalAttack() {
if (playerCharacterType == 0) playerNarutoNormalAttack();
else if (playerCharacterType == 1) playerPainNormalAttack();
else if (playerCharacterType == 2) playerObitoNormalAttack();
else if (playerCharacterType == 3) {
if (playerBorutoKarmaActive && playerBorutoFlying) playerBorutoEnhancedAttack();
else playerBorutoNormalAttack();
}
else if (playerCharacterType == 4) {
if (playerHashiramaWoodGolemActive) playerHashiramaWoodGolemAttack();
else playerHashiramaNormalAttack();
}
else if (playerCharacterType == 5) playerSasukeNormalAttack();
else if (playerCharacterType == 6) playerIzunaNormalAttack();
else if (playerCharacterType == 7) playerBlackZetsuNormalAttack();
else if (playerCharacterType == 8) playerWandererNormalAttack();
else if (playerCharacterType == 9) playerMinatoNormalAttack();
else if (playerCharacterType == 10) playerPainSixPathNormalAttack();
}
void playerSkill1() {
if (playerCharacterType == 0) playerNarutoSkill1();
else if (playerCharacterType == 1) playerPainSkill1();
else if (playerCharacterType == 2) playerObitoSkill1();
else if (playerCharacterType == 3) playerBorutoSkill1();
else if (playerCharacterType == 4) playerHashiramaSkill1();
else if (playerCharacterType == 5) playerSasukeSkill1();
else if (playerCharacterType == 6) playerIzunaSkill1();
else if (playerCharacterType == 7) return;
else if (playerCharacterType == 8) playerWandererSkill1();
else if (playerCharacterType == 9) playerMinatoSkill1();
else if (playerCharacterType == 10) playerPainSixPathSkill1();
}
void playerSkill2() {
if (playerCharacterType == 0) playerNarutoSkill2();
else if (playerCharacterType == 1) playerPainSkill2();
else if (playerCharacterType == 2) playerObitoSkill2();
else if (playerCharacterType == 3) playerBorutoSkill2();
else if (playerCharacterType == 4) playerHashiramaSkill2();
else if (playerCharacterType == 5) playerSasukeSkill2();
else if (playerCharacterType == 6) playerIzunaSkill2();
else if (playerCharacterType == 7) return;
else if (playerCharacterType == 8) {
if (playerWandererState == 0) playerWandererShortSkill2();
else playerWandererLongSkill2();
}
else if (playerCharacterType == 9) playerMinatoSkill2();
else if (playerCharacterType == 10) playerPainSixPathSkill2();
}
void playerUltimate() {
if (playerCharacterType == 0) playerNarutoUltimate();
else if (playerCharacterType == 1) playerPainUltimate();
else if (playerCharacterType == 2) playerObitoUltimate();
else if (playerCharacterType == 3) playerBorutoUltimate();
else if (playerCharacterType == 4) playerHashiramaUltimate();
else if (playerCharacterType == 5) playerSasukeUltimate();
else if (playerCharacterType == 6) playerIzunaUltimate();
else if (playerCharacterType == 7) return;
else if (playerCharacterType == 8) playerWandererUltimate();
else if (playerCharacterType == 9) playerMinatoUltimate();
else if (playerCharacterType == 10) playerPainSixPathUltimate();
}
void playerSubSkill() {
if (playerCharacterType == 5) playerSasukeSubSkill();
else if (playerCharacterType == 6) playerIzunaSubSkill();
else if (playerCharacterType == 8) {
if (playerWandererState == 0) playerWandererShortSubSkill();
else playerWandererLongSubSkill();
}
else if (playerCharacterType == 10) playerPainSixPathSubSkill();
}
// 注意:playerWandererSwitchState 已在第4部分定义,此处不再重复定义
// ==================== 敌人动作分发函数 ====================
void enemyNormalAttack() {
if (enemyCharacterType == 0) enemyNarutoNormalAttack();
else if (enemyCharacterType == 1) enemyPainNormalAttack();
else if (enemyCharacterType == 2) enemyObitoNormalAttack();
else if (enemyCharacterType == 3) enemyBorutoNormalAttack();
else if (enemyCharacterType == 4) enemyHashiramaNormalAttack();
else if (enemyCharacterType == 5) enemySasukeNormalAttack();
else if (enemyCharacterType == 6) enemyIzunaNormalAttack();
else if (enemyCharacterType == 8) enemyWandererNormalAttack();
else if (enemyCharacterType == 9) enemyMinatoNormalAttack();
else if (enemyCharacterType == 10) enemyPainSixPathNormalAttack();
}
void enemySkill1() {
if (enemyCharacterType == 0) enemyNarutoSkill1();
else if (enemyCharacterType == 1) enemyPainSkill1();
else if (enemyCharacterType == 2) enemyObitoSkill1();
else if (enemyCharacterType == 3) enemyBorutoSkill1();
else if (enemyCharacterType == 4) enemyHashiramaSkill1();
else if (enemyCharacterType == 5) enemySasukeSkill1();
else if (enemyCharacterType == 6) enemyIzunaSkill1();
else if (enemyCharacterType == 8) enemyWandererSkill1();
else if (enemyCharacterType == 9) enemyMinatoSkill1();
else if (enemyCharacterType == 10) enemyPainSixPathSkill1();
}
void enemySkill2() {
if (enemyCharacterType == 0) enemyNarutoSkill2();
else if (enemyCharacterType == 1) enemyPainSkill2();
else if (enemyCharacterType == 2) enemyObitoSkill2();
else if (enemyCharacterType == 3) enemyBorutoSkill2();
else if (enemyCharacterType == 4) enemyHashiramaSkill2();
else if (enemyCharacterType == 5) enemySasukeSkill2();
else if (enemyCharacterType == 6) enemyIzunaSkill2();
else if (enemyCharacterType == 8) {
if (enemyWandererState == 0) enemyWandererShortSkill2();
else enemyWandererLongSkill2();
}
else if (enemyCharacterType == 9) enemyMinatoSkill2();
else if (enemyCharacterType == 10) enemyPainSixPathSkill2();
}
void enemyUltimate() {
if (enemyCharacterType == 0) enemyNarutoUltimate();
else if (enemyCharacterType == 1) enemyPainUltimate();
else if (enemyCharacterType == 2) enemyObitoUltimate();
else if (enemyCharacterType == 3) enemyBorutoUltimate();
else if (enemyCharacterType == 4) enemyHashiramaUltimate();
else if (enemyCharacterType == 5) enemySasukeUltimate();
else if (enemyCharacterType == 6) enemyIzunaUltimate();
else if (enemyCharacterType == 8) enemyWandererUltimate();
else if (enemyCharacterType == 9) enemyMinatoUltimate();
else if (enemyCharacterType == 10) enemyPainSixPathUltimate();
}
void enemySubSkill() {
if (enemyCharacterType == 5) enemySasukeSubSkill();
else if (enemyCharacterType == 10) enemyPainSixPathSubSkill();
}
// ==================== AI(增强版) ====================
void enemyAI() {
// 检查各种控制状态
if (playerRodHitting) {
auto now = chrono::steady_clock::now();
if (now < playerRodHitEnd) return;
else playerRodHitting = false;
}
if (playerBanshoTeninActive) {
auto now = chrono::steady_clock::now();
if (now < playerBanshoTeninEnd) return;
else playerBanshoTeninActive = false;
}
if (playerObitoEnemyTrapped) {
auto now = chrono::steady_clock::now();
if (now < playerObitoEnemyTrappedEnd) return;
else playerObitoEnemyTrapped = false;
}
if (playerHashiramaEnemyTrapped) {
auto now = chrono::steady_clock::now();
if (now < playerHashiramaWoodDragonTrapEnd) return;
else playerHashiramaEnemyTrapped = false;
}
if (playerSasukeAmaterasuHit) {
auto now = chrono::steady_clock::now();
if (now < playerSasukeAmaterasuEnd) return;
else playerSasukeAmaterasuHit = false;
}
if (playerIzunaCounterActive) {
auto now = chrono::steady_clock::now();
if (now < playerIzunaCounterEnd) return;
else playerIzunaCounterActive = false;
}
if (playerObitoEnemyInSpace) return;
if (enemyObitoPlayerInSpace) return;
if (enemyObitoEnemyTrapped) {
auto now = chrono::steady_clock::now();
if (now < enemyObitoEnemyTrappedEnd) return;
else enemyObitoEnemyTrapped = false;
}
if (enemyHashiramaEnemyTrapped) {
auto now = chrono::steady_clock::now();
if (now < enemyHashiramaWoodDragonTrapEnd) return;
else enemyHashiramaEnemyTrapped = false;
}
if (enemySasukeAmaterasuHit) {
auto now = chrono::steady_clock::now();
if (now < enemySasukeAmaterasuEnd) return;
else enemySasukeAmaterasuHit = false;
}
if (enemyIzunaCounterActive) {
auto now = chrono::steady_clock::now();
if (now < enemyIzunaCounterEnd) return;
else enemyIzunaCounterActive = false;
}
if (enemySkillInProgress || skillInProgress) return;
if (playerShinraTenseiActive || enemyShinraTenseiActive) return;
if (playerObitoKamuiActive && !playerObitoKamuiSpaceActive) return;
if (playerWandererSpinActive) return;
if (playerWandererShockActive) return;
if (enemyWandererSpinActive || enemyWandererShockActive) return;
if (playerPinned || enemyPinned) return;
if (playerPainSixPathEnemySealed || enemyPainSixPathPlayerSealed) return;
if (playerPainSixPathShieldActive || enemyPainSixPathShieldActive) return;
if (playerPainSixPathInvincible || enemyPainSixPathInvincible) return;
// 如果敌人自己被击飞,优先替身
if (enemyLaunched && enemySubstitutionReady && enemySkillPoints >= 1) {
enemySubstitute();
return;
}
auto now = chrono::steady_clock::now();
int d = abs(player.x – enemy.x);
double hr = (double)enemy.hp / enemy.maxHp;
if (hr > 0.7) enemyAIMood = 0;
else if (hr > 0.35) enemyAIMood = 1;
else enemyAIMood = 2;
bool s1 = (now >= enemySkill1CDEnd), s2 = (now >= enemySkill2CDEnd);
bool canUlt = canEnemyUseUltimate();
int roll = rand() % 100;
// 检查玩家是否被击飞,如果是则靠近进行追击保持击飞状态
if (playerLaunched) {
if (d > 3) {
if (enemy.x > player.x) enemy.x–;
else if (enemy.x < player.x) enemy.x++;
enemyJustMoved = true;
return;
}
if (s1 && roll < 45) { enemySkill1(); return; }
else if (s2 && roll < 35) { enemySkill2(); return; }
else if (roll < 85) { enemyNormalAttack(); return; }
return;
}
// 使用奥义
if (canUlt && roll < 20) {
enemyUltimate();
return;
}
// 根据距离决策
if (d <= 3) {
if (s1 && roll < 40) { enemySkill1(); enemyConsecutiveSkills++; }
else if (s2 && roll < 65) { enemySkill2(); enemyConsecutiveSkills++; }
else if (roll < 85) { enemyNormalAttack(); enemyConsecutiveSkills = 0; }
else {
if (enemyCharacterType == 5 && enemySasukeSusanooActive == false && enemySkillPoints >= 2 && roll < 95) {
enemySasukeSubSkill();
}
else if (enemyCharacterType == 10 && roll < 95) {
enemyPainSixPathSubSkill();
}
else if (enemyAIMood == 0 && enemy.x < MAP_WIDTH – 3) enemy.x++;
else if (enemyAIMood == 2 && enemy.x > player.x + 1) enemy.x–;
enemyConsecutiveSkills = 0;
}
}
else if (d <= 8) {
if (s1 && roll < 45) { enemySkill1(); }
else if (s2 && roll < 35) { enemySkill2(); }
else if (roll < 60) {
if (enemy.x > player.x + 2) enemy.x–;
else if (enemy.x < player.x – 2) enemy.x++;
}
else if (enemyCharacterType == 5 && enemySasukeSusanooActive == false && enemySkillPoints >= 2 && roll < 80) {
enemySasukeSubSkill();
}
else if (enemyCharacterType == 10 && roll < 80) {
enemyPainSixPathSubSkill();
}
enemyConsecutiveSkills = 0;
}
else {
if (enemy.x > player.x + 3) { enemy.x–; }
else if (enemy.x < player.x – 3) { enemy.x++; }
else if (s1 && roll < 30) { enemySkill1(); }
enemyConsecutiveSkills = 0;
}
}
// ==================== 战斗主循环 ====================
bool battleLoop() {
player.x = 10; enemy.x = MAP_WIDTH – 10;
gameRunning = true; skillInProgress = false; enemySkillInProgress = false;
// 重置所有状态
playerShinraTenseiActive = false; playerShinraTenseiStack = 0; playerBanshoTeninActive = false;
enemyShinraTenseiActive = false; enemyBanshoTeninActive = false;
playerNarutoTailActive = false; enemyNarutoTailActive = false;
playerPainRodActive = false; enemyPainRodActive = false; playerRodHitting = false; enemyRodHitting = false;
playerObitoKickActive = false; playerObitoWoodSpikeActive = false; playerObitoEnemyTrapped = false;
playerObitoKamuiActive = false; playerObitoKamuiSpaceActive = false; playerObitoEnemyInSpace = false;
playerObitoFireActive = false; playerObitoWoodStormActive = false; playerObitoUltimateActive = false;
enemyObitoKickActive = false; enemyObitoWoodSpikeActive = false; enemyObitoEnemyTrapped = false;
enemyObitoKamuiActive = false; enemyObitoKamuiSpaceActive = false; enemyObitoPlayerInSpace = false;
enemyObitoFireActive = false; enemyObitoWoodStormActive = false; enemyObitoUltimateActive = false;
playerBorutoSwordActive = false; playerBorutoRasenganActive = false; playerBorutoMarkActive = false;
playerBorutoTeleported = false; playerBorutoTeleportBack = false; playerBorutoKarmaActive = false; playerBorutoFlying = false;
playerBorutoBigRasenganHit = false; playerBorutoEnhancedAttackCount = 0;
enemyBorutoSwordActive = false; enemyBorutoRasenganActive = false; enemyBorutoMarkActive = false;
enemyBorutoTeleported = false; enemyBorutoTeleportBack = false; enemyBorutoKarmaActive = false; enemyBorutoFlying = false;
enemyBorutoEnhancedAttackCount = 0;
playerHashiramaStompActive = false; playerHashiramaWoodDragonActive = false; playerHashiramaEnemyTrapped = false;
playerHashiramaMyojinmonActive = false; playerHashiramaMyojinmonUsed = false;
playerHashiramaWoodGolemActive = false; playerHashiramaWoodGolemAttackCount = 0;
enemyHashiramaStompActive = false; enemyHashiramaWoodDragonActive = false; enemyHashiramaEnemyTrapped = false;
enemyHashiramaMyojinmonActive = false; enemyHashiramaMyojinmonUsed = false;
enemyHashiramaWoodGolemActive = false; enemyHashiramaWoodGolemAttackCount = 0;
playerSasukeSlashActive = false; playerSasukeAmaterasuActive = false; playerSasukeAmaterasuHit = false;
playerSasukeSusanooActive = false; playerSasukeSusanooSlashCount = 0; playerSasukeSusanooSlashActive = false;
enemySasukeSlashActive = false; enemySasukeAmaterasuActive = false; enemySasukeAmaterasuHit = false;
enemySasukeSusanooActive = false; enemySasukeSusanooSlashCount = 0; enemySasukeSusanooSlashActive = false;
playerIzunaSlashActive = false; playerIzunaFireballActive = false; playerIzunaCounterActive = false; playerIzunaCounterTriggered = false;
playerIzunaSwordActive = false; playerIzunaSword2ndUsed = false;
enemyIzunaSlashActive = false; enemyIzunaFireballActive = false; enemyIzunaCounterActive = false; enemyIzunaCounterTriggered = false;
enemyIzunaSwordActive = false;
playerWandererState = 0; playerWandererShortSkill2Used = false; playerWandererLongSkill2Count = 2;
playerWandererSpinActive = false; playerWandererShockActive = false;
playerWandererSpinEnemyTransferred = false; playerWandererSpinEnemySavedX = 0;
enemyWandererState = 0; enemyWandererShortSkill2Used = false; enemyWandererLongSkill2Count = 2;
enemyWandererSpinActive = false; enemyWandererShockActive = false;
enemyWandererSpinEnemyTransferred = false; enemyWandererSpinEnemySavedX = 0;
playerMinatoKunaiActive = false; playerMinatoMarkActive = false; playerMinatoCounterReady = false;
enemyMinatoKunaiActive = false; enemyMinatoMarkActive = false; enemyMinatoCounterReady = false;
// 佩恩六道重置
playerPainSixPathState = 0; enemyPainSixPathState = 0;
playerPainSixPathSkill1Used = false; playerPainSixPathSkill2Used = false;
enemyPainSixPathSkill1Used = false; enemyPainSixPathSkill2Used = false;
playerPainSixPathSkill1Count = 0; playerPainSixPathSkill2Count = 0;
enemyPainSixPathSkill1Count = 0; enemyPainSixPathSkill2Count = 0;
playerPainSixPathCycleCount = 0; enemyPainSixPathCycleCount = 0;
playerPainSixPathShieldActive = false; enemyPainSixPathShieldActive = false;
playerPainSixPathEnemySealed = false; enemyPainSixPathPlayerSealed = false;
playerPainSixPathInvincible = false; enemyPainSixPathInvincible = false;
playerPainSixPathSummonActive = false; enemyPainSixPathSummonActive = false;
playerPainSixPathSoulActive = false; enemyPainSixPathSoulActive = false;
playerPainSixPathUltimateActive = false; enemyPainSixPathUltimateActive = false;
// 技能点和击飞重置
playerSkillPoints = INITIAL_SKILL_POINTS;
enemySkillPoints = INITIAL_SKILL_POINTS;
playerLaunched = false; enemyLaunched = false;
playerPinned = false; enemyPinned = false;
playerSubstitutionReady = true; enemySubstitutionReady = true;
enemyPhase = 0; enemyNormalAttackCount = 0; enemyUltimateReady = false; enemyAIMood = 0;
enemyConsecutiveSkills = 0; enemyStuckCounter = 0; enemyLastActionType = -1; enemyJustMoved = false;
auto now = chrono::steady_clock::now();
playerSkill1CDEnd = now; playerSkill2CDEnd = now; playerSkill3CDEnd = now;
enemySkill1CDEnd = now; enemySkill2CDEnd = now; enemySkill3CDEnd = now;
playerPainSixPathSkill1CD = now; playerPainSixPathSkill2CD = now;
enemyPainSixPathSkill1CD = now; enemyPainSixPathSkill2CD = now;
lastEnemyAction = now; enemyLastSkillTime = now;
playerIzunaSlashCD = now; playerIzunaSword2ndWindow = now; playerSasukeSlashCD = now; playerSasukeSubSkillCD = now;
enemyIzunaSlashCD = now; enemySasukeSlashCD = now; enemySasukeSubSkillCD = now;
playerBlackZetsuNormalCDEnd = now;
playerWandererNormalCDEnd = now; playerWandererSkill1CDEnd = now;
playerWandererShortSubSkillCDEnd = now; playerWandererLongSkill2CDEnd = now; playerWandererLongSubSkillCDEnd = now;
enemyWandererNormalCDEnd = now; enemyWandererSkill1CDEnd = now;
enemyWandererShortSubSkillCDEnd = now; enemyWandererLongSkill2CDEnd = now; enemyWandererLongSubSkillCDEnd = now;
playerMinatoNormalCDEnd = now; playerMinatoSkill1CDEnd = now; playerMinatoSkill2CDEnd = now; playerMinatoUltimateCDEnd = now;
enemyMinatoNormalCDEnd = now; enemyMinatoSkill1CDEnd = now; enemyMinatoSkill2CDEnd = now; enemyMinatoUltimateCDEnd = now;
playerSubstitutionCD = now; enemySubstitutionCD = now;
while (gameRunning) {
drawBattleMap();
auto curTime = chrono::steady_clock::now();
// 替身CD检查
if (!playerSubstitutionReady && curTime >= playerSubstitutionCD) {
playerSubstitutionReady = true;
}
if (!enemySubstitutionReady && curTime >= enemySubstitutionCD) {
enemySubstitutionReady = true;
}
// 转刀持续伤害与结束处理
if (playerWandererSpinActive) {
if (curTime >= playerWandererSpinEnd) {
playerWandererSpinActive = false;
enemySkillInProgress = false;
if (playerWandererSpinEnemyTransferred) {
enemy.x = player.x + 3;
if (enemy.x >= MAP_WIDTH – 2) enemy.x = MAP_WIDTH – 3;
playerWandererSpinEnemyTransferred = false;
}
}
else {
static chrono::steady_clock::time_point spinTick = curTime;
if (chrono::duration_cast<chrono::milliseconds>(curTime – spinTick).count() >= 500) {
enemy.hp -= increasePlayerDamage(1); if (enemy.hp < 0) enemy.hp = 0;
spinTick = curTime;
}
}
}
if (enemyWandererSpinActive) {
if (curTime >= enemyWandererSpinEnd) {
enemyWandererSpinActive = false;
skillInProgress = false;
if (enemyWandererSpinEnemyTransferred) {
player.x = enemy.x – 3;
if (player.x < 2) player.x = 2;
enemyWandererSpinEnemyTransferred = false;
}
}
else {
static chrono::steady_clock::time_point eSpinTick = curTime;
if (chrono::duration_cast<chrono::milliseconds>(curTime – eSpinTick).count() >= 500) {
player.hp -= reducePlayerDamage(1); if (player.hp < 0) player.hp = 0;
eSpinTick = curTime;
}
}
}
// 震刀下落处理
if (playerWandererShockActive) {
if (curTime >= playerWandererShockDropTime) {
playerWandererShockDropTime = curTime + chrono::seconds(3);
if (playerWandererShockEnemyY < CHARACTER_ROW) {
playerWandererShockEnemyY++;
if (playerWandererShockEnemyY >= CHARACTER_ROW) {
playerWandererShockActive = false;
enemySkillInProgress = false;
}
}
}
}
if (enemyWandererShockActive) {
if (curTime >= enemyWandererShockDropTime) {
enemyWandererShockDropTime = curTime + chrono::seconds(3);
if (enemyWandererShockEnemyY < CHARACTER_ROW) {
enemyWandererShockEnemyY++;
if (enemyWandererShockEnemyY >= CHARACTER_ROW) {
enemyWandererShockActive = false;
skillInProgress = false;
}
}
}
}
// 神威虚化计时
if (playerObitoKamuiActive && curTime >= playerObitoKamuiEnd) playerObitoKamuiActive = false;
if (enemyObitoKamuiActive && curTime >= enemyObitoKamuiEnd) enemyObitoKamuiActive = false;
// 飞雷神标记到期
if (playerMinatoMarkActive && curTime >= playerMinatoMarkEnd) {
playerMinatoMarkActive = false;
playerMinatoCounterReady = false;
}
if (enemyMinatoMarkActive && curTime >= enemyMinatoMarkEnd) {
enemyMinatoMarkActive = false;
enemyMinatoCounterReady = false;
}
// 防反窗口检查
if (playerIzunaCounterActive && !playerIzunaCounterTriggered && curTime >= playerIzunaCounterEnd) {
playerIzunaCounterActive = false;
playerSkill3CDEnd = curTime + chrono::seconds(25);
}
if (enemyIzunaCounterActive && !enemyIzunaCounterTriggered && curTime >= enemyIzunaCounterEnd) {
enemyIzunaCounterActive = false;
enemySkill3CDEnd = curTime + chrono::seconds(25);
}
// 佩恩六道护盾
if (playerPainSixPathShieldActive && curTime >= playerPainSixPathShieldEnd) {
playerPainSixPathShieldActive = false;
gotoxy(MAP_START_X + player.x – 1, MAP_START_Y + CHARACTER_ROW); cout << " ";
gotoxy(MAP_START_X + player.x + 1, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
if (enemyPainSixPathShieldActive && curTime >= enemyPainSixPathShieldEnd) {
enemyPainSixPathShieldActive = false;
gotoxy(MAP_START_X + enemy.x – 1, MAP_START_Y + CHARACTER_ROW); cout << " ";
gotoxy(MAP_START_X + enemy.x + 1, MAP_START_Y + CHARACTER_ROW); cout << " ";
}
// 佩恩六道召唤物
if (playerPainSixPathSummonActive && curTime >= playerPainSixPathSummonEnd) {
playerPainSixPathSummonActive = false;
}
if (enemyPainSixPathSummonActive && curTime >= enemyPainSixPathSummonEnd) {
enemyPainSixPathSummonActive = false;
}
// 佩恩六道灵魂体
if (playerPainSixPathSoulActive && curTime >= playerPainSixPathSoulEnd) {
playerPainSixPathSoulActive = false;
gotoxy(MAP_START_X + playerPainSixPathSoulX, MAP_START_Y + playerPainSixPathSoulY); cout << " ";
}
if (enemyPainSixPathSoulActive && curTime >= enemyPainSixPathSoulEnd) {
enemyPainSixPathSoulActive = false;
gotoxy(MAP_START_X + enemyPainSixPathSoulX, MAP_START_Y + enemyPainSixPathSoulY); cout << " ";
}
// 佩恩六道封印
if (playerPainSixPathEnemySealed && curTime >= playerPainSixPathEnemySealedEnd) {
playerPainSixPathEnemySealed = false;
enemyPinned = false;
}
if (enemyPainSixPathPlayerSealed && curTime >= enemyPainSixPathPlayerSealedEnd) {
enemyPainSixPathPlayerSealed = false;
playerPinned = false;
}
// 佩恩六道无敌
if (playerPainSixPathInvincible && curTime >= playerPainSixPathInvincibleEnd) {
playerPainSixPathInvincible = false;
}
if (enemyPainSixPathInvincible && curTime >= enemyPainSixPathInvincibleEnd) {
enemyPainSixPathInvincible = false;
}
// 击飞计时
if (playerLaunched) {
auto elapsed = chrono::duration_cast<chrono::milliseconds>(curTime – playerLaunchTime).count();
if (elapsed >= 2500) {
playerLaunched = false;
}
}
if (enemyLaunched) {
auto elapsed = chrono::duration_cast<chrono::milliseconds>(curTime – enemyLaunchTime).count();
if (elapsed >= 2500) {
enemyLaunched = false;
}
}
if (_kbhit()) {
char key = _getch();
key = tolower(key);
// 被击飞时只能使用替身(S键)
if (playerLaunched) {
if (key == 's' && !playerPinned) {
playerSubstitute();
}
continue;
}
bool canMove = !skillInProgress && !playerShinraTenseiActive && !enemySkillInProgress && !playerIzunaCounterActive
&& !playerWandererSpinActive && !playerWandererShockActive && !enemyWandererSpinActive && !enemyWandererShockActive
&& !playerPinned && !playerPainSixPathEnemySealed;
bool canAct = (!skillInProgress && !enemySkillInProgress && !playerIzunaCounterActive && !playerPinned && !playerPainSixPathEnemySealed)
|| playerBanshoTeninActive;
if (canAct || (playerShinraTenseiActive && key == 'i') || (playerObitoKamuiActive && key == 'i')) {
switch (key) {
case 'a':
if (canMove && player.x > 2 && player.x < enemy.x) player.x–;
break;
case 'd':
if (canMove && player.x < MAP_WIDTH – 2 && player.x < enemy.x – 1) player.x++;
break;
case 'k':
if (!playerShinraTenseiActive && !playerObitoKamuiActive && !playerObitoKamuiSpaceActive && !playerLaunched) {
if (playerCharacterType == 8 && chrono::steady_clock::now() < playerWandererStateSwitchWindow) {
// playerWandererSwitchState 已在第4部分定义
playerWandererSwitchState();
}
else {
playerNormalAttack();
}
}
break;
case 'j':
if (!playerShinraTenseiActive && !playerObitoKamuiSpaceActive && !playerLaunched) playerSkill1();
break;
case 'i':
if (!playerObitoKamuiSpaceActive && !playerLaunched) playerSkill2();
break;
case 'o':
if (!playerShinraTenseiActive && !playerObitoKamuiSpaceActive && !playerLaunched) playerUltimate();
break;
case 'u':
if (!playerShinraTenseiActive && !playerObitoKamuiSpaceActive && !playerLaunched) playerSubSkill();
break;
case 's':
if (!playerPinned) playerSubstitute();
break;
}
}
if (enemy.hp <= 0) {
gameRunning = false;
clearScreen();
gotoxy(35, 10);
setColor(10);
cout << "胜利!按任意键返回…";
_getch();
return true;
}
if (player.hp <= 0) {
if (playerBlackZetsuCarrier) {
playerBlackZetsuCarrier = false;
player.name = "黑绝";
player.hp = 350;
player.maxHp = 350;
player.characterType = 7;
playerSkill1CDEnd = playerSkill2CDEnd = playerSkill3CDEnd = chrono::steady_clock::now();
playerBlackZetsuNormalCDEnd = chrono::steady_clock::now();
playerLaunched = false;
playerPinned = false;
playerSkillPoints = INITIAL_SKILL_POINTS;
continue;
}
gameRunning = false;
clearScreen();
gotoxy(35, 10);
setColor(12);
cout << "失败!按任意键返回…";
_getch();
return false;
}
}
auto ct = chrono::steady_clock::now();
if (chrono::duration_cast<chrono::milliseconds>(ct – lastEnemyAction).count() >= 1000) {
enemyAI();
lastEnemyAction = ct;
if (player.hp <= 0) {
if (playerBlackZetsuCarrier) {
playerBlackZetsuCarrier = false;
player.name = "黑绝";
player.hp = 350;
player.maxHp = 350;
player.characterType = 7;
playerLaunched = false;
playerPinned = false;
playerSkillPoints = INITIAL_SKILL_POINTS;
continue;
}
gameRunning = false;
clearScreen();
gotoxy(35, 10);
setColor(12);
cout << "失败!按任意键返回…";
_getch();
return false;
}
}
this_thread::sleep_for(chrono::milliseconds(30));
}
return false;
}
// ==================== 载体选择 ====================
void selectCarrier() {
vector<Character> chars = getAllCharacters();
int selectedIndex = 0;
bool selecting = true;
while (selecting) {
clearScreen();
hideCursor();
setColor(6);
gotoxy(35, 2);
cout << "=== 选择黑绝载体 ===";
int row = 0, col = 0;
for (int i = 0; i < chars.size(); i++) {
if (!chars[i].available || chars[i].characterType == 7) continue;
int x = 2 + col * 24;
int y = 5 + row * 3;
gotoxy(x, y);
if (i == selectedIndex) { setColor(10); cout << "> "; }
else { cout << " "; }
setColor(10);
cout << chars[i].name;
col++;
if (col >= 5) { col = 0; row++; }
}
char key = _getch();
key = tolower(key);
switch (key) {
case 'w':
if (selectedIndex >= 5) selectedIndex -= 5;
break;
case 's':
if (selectedIndex + 5 < chars.size()) selectedIndex += 5;
break;
case 'a':
if (selectedIndex > 0) selectedIndex–;
break;
case 'd':
if (selectedIndex < chars.size() – 1) selectedIndex++;
break;
case 13:
if (chars[selectedIndex].available && chars[selectedIndex].characterType != 7) {
player = chars[selectedIndex];
player.maxHp = 600;
player.hp = 600;
playerCharacterType = player.characterType;
playerBlackZetsuCarrier = true;
selecting = false;
vector<int> av;
for (int i = 0; i < chars.size(); i++) {
if (chars[i].available) av.push_back(i);
}
int ei;
do {
ei = av[rand() % av.size()];
} while (chars[ei].characterType == 7 && av.size() > 1);
enemy = chars[ei];
enemy.maxHp = 600;
enemy.hp = 600;
enemyCharacterType = enemy.characterType;
battleLoop();
}
break;
}
}
}
// ==================== 角色选择 ====================
void selectCharacter() {
vector<Character> chars = getAllCharacters();
int selectedIndex = 0;
bool selecting = true;
while (selecting) {
drawSelectScreen(selectedIndex);
char key = _getch();
key = tolower(key);
switch (key) {
case 'w':
if (selectedIndex >= 5) selectedIndex -= 5;
break;
case 's':
if (selectedIndex + 5 < chars.size()) selectedIndex += 5;
break;
case 'a':
if (selectedIndex > 0) selectedIndex–;
break;
case 'd':
if (selectedIndex < chars.size() – 1) selectedIndex++;
break;
case 13:
if (chars[selectedIndex].available) {
if (chars[selectedIndex].characterType == 7) {
selectCarrier();
return;
}
player = chars[selectedIndex];
player.maxHp = 600;
player.hp = 600;
playerCharacterType = player.characterType;
playerBlackZetsuCarrier = false;
vector<int> av;
for (int i = 0; i < chars.size(); i++) {
if (chars[i].available) av.push_back(i);
}
int ei;
do {
ei = av[rand() % av.size()];
} while (ei == selectedIndex && av.size() > 1);
enemy = chars[ei];
enemy.maxHp = 600;
enemy.hp = 600;
enemyCharacterType = enemy.characterType;
selecting = false;
battleLoop();
}
break;
}
}
}
// ==================== 启动界面 ====================
void launchScreen() {
int selectedIndex = 0;
bool launching = true;
while (launching) {
drawLaunchScreen(selectedIndex);
char key = _getch();
key = tolower(key);
switch (key) {
case 'w':
if (selectedIndex > 0) selectedIndex–;
break;
case 's':
if (selectedIndex < 3) selectedIndex++;
break;
case 13:
switch (selectedIndex) {
case 0:
launching = false;
selectCharacter();
break;
case 1:
clearScreen();
gotoxy(35, 12);
setColor(14);
cout << "该模式暂未开启!";
_getch();
break;
case 2:
system("start https://blog.csdn.net/zhaozirui8290?spm=1000.2115.3001.5343");
break;
case 3:
clearScreen();
gotoxy(40, 12);
setColor(12);
cout << "感谢游玩!";
_getch();
exit(0);
}
break;
}
}
}
// ==================== 主函数 ====================
int main() {
srand(time(nullptr));
hideCursor();
system("mode con cols=120 lines=36");
system("title 火影忍者");
while (true) {
drawStartScreen();
while (true) {
if (_kbhit()) {
char key = _getch();
if (key == 13) {
launchScreen();
break;
}
}
}
}
return 0;
}
