void Gamedown(int row,int col)
{
int flag = 0;
int fall;
int ID;//攻击次数与角色损失血量,弹框返回值,商店购买增加的血量
char con;
hwnd = GetHWnd(); //弹窗前置
switch (map[level][row + 1][col])
{
case 0://墙
map[level][row][col] = 23;
break;
case 1://地板
map[level][row + 1][col] = 23;
map[level][row][col] = 1;
break;
case 2://艾伦
h_Alan = SetWindowsHookEx(WH_CBT, (HOOKPROC)Alan, NULL, GetCurrentThreadId());
ID = MessageBox(hwnd, "艾伦:我是谁??", "碰到艾伦", MB_YESNO);
if (ID == IDYES)
{
break;
}
else
{
MessageBox(hwnd, "真的吗,那我为什么在这里,啊啊啊啊,我头好痛!(艾伦逃跑)", "触发隐藏任务,打败变异艾伦", MB_OK);
map[level][row + 1][col] = 23;
map[level][row][col] = 1;
map[level + 1][3][6] = 3;
flag = 1;
}
break;
case 3://变异艾伦
h_bAlan = SetWindowsHookEx(WH_CBT, (HOOKPROC)bAlan, NULL, GetCurrentThreadId());
ID = MessageBox(hwnd, "我要把你们都撕碎!!", "碰到变异艾伦", MB_YESNO);
if (ID == IDYES)
{
break;
}
else
{
if (PK(var_Ailun) == true)
{
map[level][row + 1][col] = 16;
Ailun.bkey++;
if (var_Ailun.fall >= 0 && var_Ailun.fall < 10)
{
fall = var_Ailun.fall;
var_Ailun.att += fall * 20;
MessageBox(hwnd, "你获得了30金币,70经验和随机等级的生命药水,已使用", "战斗胜利", MB_OK);
}
else if (var_Ailun.fall >= 10 && var_Ailun.fall < 20)
{
fall = var_Ailun.fall - 10;
var_Ailun.att += fall * 2;
MessageBox(hwnd, "你获得了30金币,70经验和随机等级的力量药水,已使用", "战斗胜利", MB_OK);
}
else if (var_Ailun.fall >= 20 && var_Ailun.fall < 30)
{
fall = var_Ailun.fall - 20;
var_Ailun.def += fall * 2;
MessageBox(hwnd, "你获得了30金币,70经验和随机等级的宝石,已使用", "战斗胜利", MB_OK);
}
}
else
{
MessageBox(hwnd, "打不过!", "", MB_OK);
}
}
break;
case 4://三笠
h_mikasa = SetWindowsHookEx(WH_CBT, (HOOKPROC)mikasa, NULL, GetCurrentThreadId());
MessageBox(hwnd, "艾伦,你在哪啊!", "三笠", MB_OK);
MessageBox(hwnd, "艾伦是谁!", "你", MB_OK);
ID = MessageBox(hwnd, "他是一个很要强的傻瓜,但我会一直守护他。\n你能帮我找到他吗?", "三笠", MB_YESNO);
if (ID == IDYES)
{
break;
}
else
{
MessageBox(hwnd, "你能说说你们怎么分开的吗?", "你", MB_OK);
MessageBox(hwnd, "因为一场外敌入侵,艾伦为了救我,服用了能变异的药剂,后来我醒了之后艾伦就不见了。但那药剂对他肯定会有副作用,不知道艾伦现在好不好。", "三笠", MB_OK);
MessageBox(hwnd, "他长什么样?", "你", MB_OK);
MessageBox(hwnd, "棕色中分短发,穿着和我一样的衣服,和我一样高。", "三笠", MB_OK);
MessageBox(hwnd, "我之前好像见过这样一个人。", "你", MB_OK);
MessageBox(hwnd, "真的吗?他在哪里!!", "三笠", MB_OK);
MessageBox(hwnd, " 你别急,我去找他。", "你", MB_OK);
}
break;
case 5://梅梅
map[level][row][col] = 23;
if (Ailun.experience == 16030)
{
Ailun.bkey++;
map[level][row + 1][col] = 1;
}
else
{
MessageBox(hwnd, "想进入终极关卡吗?那就去打败所有妖怪吧,打败所有妖怪我给你终极关卡的钥匙。", "梅梅", MB_OK);
}
break;
case 6://小胖
map[level][row][col] = 23;
MessageBox(hwnd, "我这里有很多食物,只要998就可以随便吃喔", "小胖", MB_OK);
ID = MessageBox(hwnd, "你要购买吗?", "小胖", MB_YESNO);
if (ID == IDYES)
{
if (Ailun.money >= 998)
{
Ailun.HP += 2000;
Ailun.money -= 998;
}
else
{
MessageBox(hwnd, "你钱都没有,买什么东西!", "小胖", MB_OK);
}
}
else
{
MessageBox(hwnd, "切,穷鬼,去吃奥里给吧!", "小胖", MB_OK);
}
break;
case 7://黑门
if (Ailun.bkey > 0)
{
Ailun.bkey--;
map[level][row + 1][col] = 23;
map[level][row][col] = 17;
}
else
{
MessageBox(hwnd, "你没有黑钥匙欸", "系统提示", MB_OK);
map[level][row][col] = 23;
}
break;
case 8://商人吕不韦
map[level][row][col] = 23;
ID = MessageBox(hwnd, "少年,我看你骨骼精奇,是万中无一的武学奇才,维护世界和平就靠你了,我这有什么可以帮助到你的物品。", "商人吕不韦", MB_YESNO);
if (ID == IDYES)
{
solidrectangle(GAP + 180, GAP + 240, GAP + 380, GAP + 385);
rectangle(GAP + 180, GAP + 240, GAP + 380, GAP + 385);
outtextxy(GAP + 185, GAP + 245, "1.力量药水(+8攻击力)400金币");
outtextxy(GAP + 185, GAP + 265, "2.小宝剑(+13攻击力)600金币");
outtextxy(GAP + 185, GAP + 285, "3.小血瓶(+400血)300金币");
outtextxy(GAP + 185, GAP + 305, "4.宝石(+8防御值)400金币");
outtextxy(GAP + 185, GAP + 325, "5.无限宝石(+13防御值)600金币");
outtextxy(GAP + 185, GAP + 345, "6.离开");
while (1)
{
con = _getch();
switch (con)
{
case '1':
if (Ailun.money >= 400)
{
Ailun.experience -= 400;
Ailun.att += 8;
}
else
{
MessageBox(hwnd, "穷逼,你金币不足!", "商人吕不韦", MB_OK);
}
return;
case '2':
if (Ailun.money >= 600)
{
Ailun.money -= 600;
Ailun.att+= 13;
}
else
{
MessageBox(hwnd, "穷逼,你金币不足!", "商人吕不韦", MB_OK);
}
return;
case '3':
if (Ailun.money >= 300)
{
Ailun.money -= 300;
Ailun.HP += 400;
}
else
{
MessageBox(hwnd, "穷逼,你金币不足!", "商人吕不韦", MB_OK);
}
return;
case '4':
if (Ailun.money >= 400)
{
Ailun.experience -= 400;
Ailun.def += 8;
}
else
{
MessageBox(hwnd, "穷逼,你金币不足!", "商人吕不韦", MB_OK);
}
return;
case '5':
if (Ailun.money >= 600)
{
Ailun.experience -= 600;
Ailun.def += 13;
}
else
{
MessageBox(hwnd, "穷逼,你金币不足!", "商人吕不韦", MB_OK);
}
return;
case '6':
return;
}
}
break;
}
else
{
MessageBox(hwnd, "好吧,祝你好运", "商人吕不韦", MB_OK);
}
break;
case 9://妙蛙种子
ID = MessageBox(hwnd, "遇到妙蛙种子,是否攻击?", "", MB_YESNO);
map[level][row][col] = 23;
if (ID == IDYES)
{
if (PK(Frog_seed) == true)
{
map[level][row + 1][col] = 1;
if (Frog_seed.fall >= 0 && Frog_seed.fall < 10)
{
fall = Frog_seed.fall;
Frog_seed.att += fall * 20;
MessageBox(hwnd, "你获得了70金币,320经验和随机等级的生命药水,已使用", "战斗胜利", MB_OK);
}
else if (Frog_seed.fall >= 10 && Frog_seed.fall < 20)
{
fall = Frog_seed.fall - 10;
Frog_seed.att += fall * 2;
MessageBox(hwnd, "你获得了70金币,320经验和随机等级的力量药水,已使用", "战斗胜利", MB_OK);
}
else if (Frog_seed.fall >= 20 && Frog_seed.fall < 30)
{
fall = Frog_seed.fall - 20;
Frog_seed.def += fall * 2;
MessageBox(hwnd, "你获得了70金币,320经验和随机等级的宝石,已使用", "战斗胜利", MB_OK);
}
}
else
{
MessageBox(hwnd, "打不过!", "", MB_OK);
}
}
break;
case 10://海姣
ID = MessageBox(hwnd, "遇到海姣,是否攻击?", "", MB_YESNO);
map[level][row][col] = 23;
if (ID == IDYES)
{
if (PK(Haijiao) == true)
{
map[level][row + 1][col] = 1;
if (Haijiao.fall >= 0 && Haijiao.fall < 10)
{
fall = Haijiao.fall;
Haijiao.att += fall * 20;
MessageBox(hwnd, "你获得了60金币,90经验和随机等级的生命药水,已使用", "战斗胜利", MB_OK);
}
else if (Haijiao.fall >= 10 && Haijiao.fall < 20)
{
fall = Haijiao.fall - 10;
Haijiao.att += fall * 2;
MessageBox(hwnd, "你获得了60金币,90经验和随机等级的力量药水,已使用", "战斗胜利", MB_OK);
}
else if (Haijiao.fall >= 20 && Haijiao.fall < 30)
{
fall = Haijiao.fall - 20;
Haijiao.def += fall * 2;
MessageBox(hwnd, "你获得了60金币,90经验和随机等级的宝石,已使用", "战斗胜利", MB_OK);
}
}
else
{
MessageBox(hwnd, "打不过!", "", MB_OK);
}
}
break;
case 11://火箭怪
ID = MessageBox(hwnd, "遇到火箭怪,是否攻击?", "", MB_YESNO);
map[level][row][col] = 23;
if (ID == IDYES)
{
if (PK(Rocket) == true)
{
map[level][row + 1][col] = 1;
if (Rocket.fall >= 0 && Rocket.fall < 10)
{
fall = Rocket.fall;
Rocket.att += fall * 20;
MessageBox(hwnd, "你获得了70金币,130经验和随机等级的生命药水,已使用", "战斗胜利", MB_OK);
}
else if (Rocket.fall >= 10 && Rocket.fall < 20)
{
fall = Rocket.fall - 10;
Rocket.att += fall * 2;
MessageBox(hwnd, "你获得了70金币,130经验和随机等级的力量药水,已使用", "战斗胜利", MB_OK);
}
else if (Rocket.fall >= 20 && Rocket.fall < 30)
{
fall = Rocket.fall - 20;
Rocket.def += fall * 2;
MessageBox(hwnd, "你获得了70金币,130经验和随机等级的宝石,已使用", "战斗胜利", MB_OK);
}
}
else
{
MessageBox(hwnd, "打不过!", "", MB_OK);
}
}
break;
case 12://小动物
ID = MessageBox(hwnd, "遇到小动物,是否攻击?", "", MB_YESNO);
map[level][row][col] = 23;
if (ID == IDYES)
{
if (PK(Lit_animal) == true)
{
map[level][row + 1][col] = 1;
if (Lit_animal.fall >= 0 && Lit_animal.fall < 10)
{
fall = Lit_animal.fall;
Lit_animal.att += fall * 20;
MessageBox(hwnd, "你获得了20金币,30经验和随机等级的生命药水,已使用", "战斗胜利", MB_OK);
}
else if (Lit_animal.fall >= 10 && Lit_animal.fall < 20)
{
fall = Lit_animal.fall - 10;
Lit_animal.att += fall * 2;
MessageBox(hwnd, "你获得了20金币,30经验和随机等级的力量药水,已使用", "战斗胜利", MB_OK);
}
else if (Lit_animal.fall >= 20 && Lit_animal.fall < 30)
{
fall = Lit_animal.fall - 20;
Lit_animal.def += fall * 2;
MessageBox(hwnd, "你获得了20金币,30经验和随机等级的宝石,已使用", "战斗胜利", MB_OK);
}
}
else
{
MessageBox(hwnd, "打不过!", "", MB_OK);
}
}
break;
case 13://虚空海豹
ID = MessageBox(hwnd, "遇到虚空海豹,是否攻击?", "", MB_YESNO);
map[level][row][col] = 23;
if (ID == IDYES)
{
if (PK(Void_seal) == true)
{
map[level][row + 1][col] = 1;
if (Void_seal.fall >= 0 && Void_seal.fall < 10)
{
fall = Void_seal.fall;
Void_seal.att += fall * 20;
MessageBox(hwnd, "你获得了60金币,400经验和随机等级的生命药水,已使用", "战斗胜利", MB_OK);
}
else if (Void_seal.fall >= 10 && Void_seal.fall < 20)
{
fall = Void_seal.fall - 10;
Void_seal.att += fall * 2;
MessageBox(hwnd, "你获得了60金币,400经验和随机等级的力量药水,已使用", "战斗胜利", MB_OK);
}
else if (Void_seal.fall >= 20 && Void_seal.fall < 30)
{
fall = Void_seal.fall - 20;
Void_seal.def += fall * 2;
MessageBox(hwnd, "你获得了60金币,400经验和随机等级的宝石,已使用", "战斗胜利", MB_OK);
}
}
else
{
MessageBox(hwnd, "打不过!", "", MB_OK);
}
}
break;
case 14://白眉须龙
ID = MessageBox(hwnd, "遇到白眉须龙,是否攻击?", "", MB_YESNO);
map[level][row][col] = 23;
if (ID == IDYES)
{
if (PK(White_dragon) == true)
{
map[level][row + 1][col] = 1;
if (White_dragon.fall >= 0 && White_dragon.fall < 10)
{
fall = White_dragon.fall;
White_dragon.att += fall * 20;
MessageBox(hwnd, "你获得了70金币,540经验和随机等级的生命药水,已使用", "战斗胜利", MB_OK);
}
else if (White_dragon.fall >= 10 && White_dragon.fall < 20)
{
fall = White_dragon.fall - 10;
White_dragon.att += fall * 2;
MessageBox(hwnd, "你获得了70金币,540经验和随机等级的力量药水,已使用", "战斗胜利", MB_OK);
}
else if (White_dragon.fall >= 20 && White_dragon.fall < 30)
{
fall = White_dragon.fall - 20;
White_dragon.def += fall * 2;
MessageBox(hwnd, "你获得了70金币,540经验和随机等级的宝石,已使用", "战斗胜利", MB_OK);
}
}
else
{
MessageBox(hwnd, "打不过!", "", MB_OK);
}
}
break;
case 15://工程怪
ID = MessageBox(hwnd, "遇到工程怪,是否攻击?", "", MB_YESNO);
map[level][row][col] = 23;
if (ID == IDYES)
{
if (PK(Engineer_geek) == true)
{
map[level][row + 1][col] = 1;
if (Engineer_geek.fall >= 0 && Engineer_geek.fall < 10)
{
fall = Engineer_geek.fall;
Engineer_geek.att += fall * 20;
MessageBox(hwnd, "你获得了70金币,200经验和随机等级的生命药水,已使用", "战斗胜利", MB_OK);
}
else if (Engineer_geek.fall >= 10 && Engineer_geek.fall < 20)
{
fall = Engineer_geek.fall - 10;
Engineer_geek.att += fall * 2;
MessageBox(hwnd, "你获得了70金币,200经验和随机等级的力量药水,已使用", "战斗胜利", MB_OK);
}
else if (Engineer_geek.fall >= 20 && Engineer_geek.fall < 30)
{
fall = Engineer_geek.fall - 20;
Engineer_geek.def += fall * 2;
MessageBox(hwnd, "你获得了70金币,200经验和随机等级的宝石,已使用", "战斗胜利", MB_OK);
}
}
else
{
MessageBox(hwnd, "打不过!", "", MB_OK);
}
}
break;
case 16://被打败后的艾伦
MessageBox(hwnd, "谢谢你让我恢复了正常", "艾伦", MB_OK);
break;
case 17://白门
level++;
break;
case 18://黄门
level--;
break;
case 19://引导者
if (flag == 0)
{
MessageBox(hwnd, "这个门的钥匙似乎被艾伦拿走了", "路人", MB_OK);
}
else
{
MessageBox(hwnd, "就是他,打败他就可以拿到大门钥匙", "路人", MB_OK);
}
break;
}
}
一键复制
编辑
Web IDE
原始数据
按行查看
历史