#include <iostream>
#include <string>
#include <windows.h>
#include <conio.h>
#include <fstream>
#include <ctime>
#include <time.h>
#include <stdio.h>
using namespace std;
int D_Of_C, OK, ane, xy, D_Of_C1, OK1, ane1, xy1, nowM, MoralValue;
int ict = 0, nowlevel = 0;
int bag[44] = { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0};
//0抽奖券 1经验石R 2经验石SR 3经验石SSR 4经验石SSS 5经验石X
//6技能书快快复苏 7技能书铁甲咒 8技能书昏昏倒地 9技能书神锋无影 10技能书咒立停 11技能书石化咒 12技能书恢复咒 13技能书召唤咒 14技能书遗忘咒 15技能书万弹齐发 16技能书钻心咒 17技能书夺魂咒 18技能书死亡咒
//19生命药水 20防御药水 21攻击药水 22经验药水 23全幅药水
//24猫狸子胡须 25媚娃头发 26马形水怪的鬃毛 27龙心腱 28雷鸟尾羽 29凤凰羽毛 30独角兽尾毛 31龙神经 32夜骐的尾羽
//33桦木 34紫衫木 35冬青木 36山楂木柳条 37橡木 38械木 39山毛榉木 40栗木 41樱桃木 42桃花心木
//43速度药水
string Material1name[9] = { "猫狸子胡须","媚娃头发","马形水怪的鬃毛","龙心腱","雷鸟尾羽","凤凰羽毛","独角兽尾毛","龙神经","夜骐的尾羽" };
string Material2name[10] = { "桦木","紫衫木","冬青木","山楂木柳条","橡木","械木","山毛榉木","栗木","樱桃木","桃花心木" };
int health = 1000, maxhealth = 1000, money=0, attack = 250, defense = 10, experience = 0, camp, level = 1, amm = 0, f = 0, speed = 0;
string Nwand = "空手";
int LE1 = 1, LE2 = 1, Sl[13];
bool dead = false;
string wandname[100] = { "柳条魔杖","胡桃魔杖","鹅耳枥木魔杖","柳条魔杖","花心木魔杖","冬青木魔杖","紫杉木魔杖","老魔杖" };
int wandpower[100] = { 200,500,1100,1300,2400,5000,9000,20000 }, wand[100], wandi = 8, wandnamei = 8, wandpoweri = 8;
string name, password;
int choose()
{
system("cls");
cout << "请选择您的阵营。" << endl;
cout << "0, 哈利.HarryPotter" << endl;
cout << "1, 伏地魔 LordVoldemort" << endl;
cin >> camp;
if (camp != 0 && camp != 1) {
cout << "输入错误。";
Sleep(250);
choose();
}
else {
if (MessageBox(0, TEXT("你确定?"), TEXT("请选择"), MB_OKCANCEL | MB_ICONINFORMATION) == IDOK) return 0;
choose();
}
return 0;
}
int login()
{
string DN, DPW;
bool isn = false;
cout << "请输入账号和密码" << endl;
cout << "账号:";
cin >> name;
cout << "密码:";
cin >> password;
ifstream fin("data2.txt");
while(fin >> DN) {
if (DN == name) {
fin >> DPW;
if (DPW != password) {
cout << "密码错误!" << endl; isn = true;
system("cls"); login();
}
else {
fin >> money >> attack >> defense >> health >> level >> experience >> LE1 >> LE2 >> camp >> maxhealth;
fin >> D_Of_C >> OK >> ane >> xy >> D_Of_C1 >> OK1 >> ane1 >> xy1 >> nowM;
fin >> bag[0] >> bag[1] >> bag[2] >> bag[3] >> bag[4] >> bag[5] >> bag[6] >> bag[7];
fin >> bag[8] >> bag[9] >> bag[10] >> bag[11] >> bag[12] >> bag[13] >> bag[14] >> bag[15];
fin >> bag[16] >> bag[17] >> bag[18] >> bag[19] >> bag[20] >> bag[21] >> bag[22] >> bag[23];
fin >> bag[24] >> bag[25] >> bag[26] >> bag[27] >> bag[28] >> bag[29] >> bag[30] >> bag[31];
fin >> bag[32] >> bag[33] >> bag[34] >> bag[35] >> bag[36] >> bag[37] >> bag[38] >> bag[39];
fin >> bag[40] >> bag[41] >> bag[42] >> bag[43];
fin >> Sl[0] >> Sl[1] >> Sl[2] >> Sl[3] >> Sl[4] >> Sl[5] >> Sl[6] >> Sl[7] >> Sl[8] >> Sl[9] >> Sl[10] >> Sl[11] >> Sl[12];
for (int i = 0; i < 100; i++) {
fin >> wandname[i];
fin >> wandpower[i];
fin >> wand[i];
}
fin >> Nwand >> amm >> f >> wandi >> wandnamei >> wandpoweri >> ict >> speed >> nowlevel;
isn = true;
}
}
}
if (!isn) {
cout << "无此用户!" << endl;
login();
}
cout << "登入成功!" << endl;
Sleep(1000);
return 0;
}
int save()
{
ofstream outfile("data2.txt", ios::binary | ios::app | ios::in | ios::out);
outfile << name << " " << password << " " << money << " " << attack << " " << defense << " " << health << " " << level << " " << experience << " " << LE1 << " " << LE2 << " " << camp << " " << maxhealth << " ";
outfile << D_Of_C << " " << OK << " " << ane << " " << xy << " " << D_Of_C1 << " " << OK1 << " " << ane1 << " " << xy1 << " " << nowM << " ";
outfile << bag[0] << " " << bag[1] << " " << bag[2] << " " << bag[3] << " " << bag[4] << " " << bag[5] << " " << bag[6] << " " << bag[7] << " ";
outfile << bag[8] << " " << bag[9] << " " << bag[10] << " " << bag[11] << " " << bag[12] << " " << bag[13] << " " << bag[14] << " " << bag[15] << " ";
outfile << bag[16] << " " << bag[17] << " " << bag[18] << " " << bag[19] << " " << bag[20] << " " << bag[21] << " " << bag[22] << " " << bag[23] << " ";
outfile << bag[24] << " " << bag[25] << " " << bag[26] << " " << bag[27] << " " << bag[28] << " " << bag[29] << " " << bag[30] << " " << bag[31] << " ";
outfile << bag[32] << " " << bag[33] << " " << bag[34] << " " << bag[35] << " " << bag[36] << " " << bag[37] << " " << bag[38] << " " << bag[39] << " ";
outfile << bag[40] << " " << bag[41] << " " << bag[42] << " " << bag[43] << " ";
outfile << Sl[0] << " " << Sl[1] << " " << Sl[2] << " " << Sl[3] << " " << Sl[4] << " " << Sl[5] << " " << Sl[6] << " " << Sl[7] << " " << Sl[8] << " " << Sl[9] << " " << Sl[10] << " " << Sl[11] << " " << Sl[12] << " ";
for (int i = 0; i < 100; i++) {
outfile << wandname[i] << " ";
outfile << wandpower[i] << " ";
outfile << wand[i] << " ";
}
outfile << Nwand << " " << amm << " " << f << " " << wandi << " " << wandnamei << " " << wandpoweri << " " << ict << " " << speed << " " << nowlevel << endl;
outfile.close();
return 0;
}
int Reg()
{
string DN, DPW;
cout << "请输入账号和密码 " << endl;
cout << "账号:";
cin >> name;
cout << endl << "密码:";
cin >> password;
ifstream fin("data2.txt");
while(fin >> DN) {
if (DN == name) {
cout << "用户名已被使用=====请重新起名";
Reg();
}
}
choose();
return 0;
}
int monsterfight(string Hname, int hisH, int hisA, int hisD, int hisS, int hisSP)
{
int mhealth = 10000, mdefense = 1000, mattack = 10000, mspeed = 500;
int hfaint = 0;
int mfaint = 0;
dead = false;
int ha = hisA;
while (1) {
if (hfaint > 0) hfaint -= 1;
if (mfaint > 0) {
if (rand() % 3 == 0)
{
mfaint = 0;
cout << "石怪使用技能咒立停,停止了魔咒!" << endl;
}
else mfaint -= 1;
}
if (mfaint <= 0) {
if (rand() % 3) {
cout << "石怪使用技能快快复苏 生命增加200" << endl;
mhealth += 200;
}
if (rand() % 3) {
cout << "石怪使用技能铁甲护身 生命增加100 防御增加50" << endl;
mhealth += 100;
mdefense += 50;
}
if (rand() % 3) {
cout << "石怪使用技能神锋无影 攻击增加200 对方扣血200滴" << endl;
hisH -= 200;
mattack += 200;
}
Sleep(1000);
int ran = rand() % 40 - 20;
if (rand() % 10000 > hisSP) {
if (attack + ran > hisD) {
cout << "石怪发起进攻 " << Hname << "扣血" << mattack - hisD + ran << "滴 剩余" << hisH - (mattack - hisD + ran) << "滴" << endl;
hisH -= mattack - hisD + ran;
}
else cout << "石怪发起进攻 " << Hname << "扣血0滴 剩余" << hisH << "滴" << endl;
}
else {
if (rand() % 2) cout << "石怪一�
没有合适的资源?快使用搜索试试~ 我知道了~
YUTUc++小游戏整理版,免费下载
共22个文件
cpp:18个
h:3个
exe:1个
需积分: 0 2 下载量 174 浏览量
2023-01-03
10:53:54
上传
评论
收藏 499KB ZIP 举报
温馨提示
有很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很
资源推荐
资源详情
资源评论
收起资源包目录
YUTUc++小游戏.zip (22个子文件)
YUTUc++小游戏
文字游戏
狼人杀.cpp 18KB
猜数游戏.cpp 614B
文字游戏.cpp 6KB
哈利菠菜.cpp 157KB
狼人杀.exe 1.85MB
c++game.cpp 5KB
字符游戏
走迷宫.cpp 2KB
扫雷.cpp 6KB
打飞机.cpp 12KB
贪吃蛇.cpp 3KB
mc加载.cpp 673B
走迷宫2.cpp 2KB
画画.cpp 1KB
跳楼游戏.cpp 15KB
c++纸上谈兵.cpp 24KB
扫雷game.cpp 5KB
flappy bird.cpp 29KB
paper wars.cpp 26KB
沙盒一代
sh.h 2KB
运行
fj.h 1KB
沙盒.cpp 36B
game.h 8KB
共 22 条
- 1
资源评论
YUTUc++game
- 粉丝: 18
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功