1
2
3
4
5
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
|
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main() {
start:
int blood = 10000, tim = 0, judgei;
bool judgeb = false;
int hurt = 0;
int pretect = 0;
int gold = 0;
bool hasShield = false;
bool hasVampire = false; // 新增:是否有吸血技能
bool hasBerserk = false; // 新增:是否有狂暴技能
int poisonRounds = 0; // 新增:中毒回合数
int doubleDamageRounds = 0; // 新增:双倍伤害回合数
choose:
// 检查状态效果
if (poisonRounds > 0) {
int poisonDamage = blood / 20; // 每回合损失5%血量
cout << "【中毒效果】你损失了" << poisonDamage << "点血量!" << endl;
blood -= poisonDamage;
poisonRounds--;
Sleep(1000);
}
if (doubleDamageRounds > 0) {
cout << "【双倍伤害】剩余回合:" << doubleDamageRounds << endl;
doubleDamageRounds--;
}
cout << "\n========================================" << endl;
cout << "当前血量:" << blood << " | 攻击力:" << hurt << " | 防御:" << pretect << " | 金币:" << gold << endl;
if (hasShield) cout << "【护盾】";
if (hasVampire) cout << "【吸血】";
if (hasBerserk) cout << "【狂暴】";
cout << endl;
cout << "========================================\n" << endl;
Sleep(1500);
srand(static_cast<unsigned int>(time(0)));
int choose = rand() % 31;
cout << "命运选择了:" << choose << "号!" << endl;
Sleep(1000);
if (choose == 0) {
cout << "=========平安无事,休息一回合=========" << endl;
cout << "你的血量恢复了500点!" << endl;
blood += 500;
Sleep(2000);
tim++;
if (tim <= 15) { // 增加到15次选择
goto choose;
}
} else if (choose == 1) {
cout << "=========被陨石砸到!-8000滴血=========" << endl;
blood -= 8000;
if (blood <= 0) {
if (hasShield) {
cout << "护盾激活!抵挡了致命一击!" << endl;
blood = 1;
hasShield = false;
} else {
cout << "您死了。。。" << endl;
Sleep(3000);
return 0;
}
}
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 2) {
cout << "=========获得奇遇:1.获得3000滴血 2.获得攻击能力=========" << endl << endl;
cin >> judgei;
if (judgei == 1) {
cout << "success!" << endl;
blood += 3000;
Sleep(3000);
} else if (judgei == 2) {
cout << "success!" << endl;
judgeb = true;
hurt = 100;
Sleep(3000);
} else {
cout << "叫你不听话错过机遇!" << endl;
Sleep(3000);
}
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 3) {
cout << "=========攻击任务:我将会判定您有没有攻击能力!=========" << endl;
if (judgeb) {
cout << "拥有战斗能力开始战斗!你的对手是小恐龙" << endl;
int dblood = 3000, dhurt = 20;
for (;;) {
if (blood <= 0) {
cout << "您死了。。。" << endl;
Sleep(3000);
return 0;
} else if (dblood <= 0) {
cout << "恭喜胜利!奖励1000滴血和60攻击!" << endl;
hurt += 60;
blood += 1000;
Sleep(3000);
break;
}
// 计算伤害(考虑双倍伤害)
int currentHurt = hurt;
if (doubleDamageRounds > 0) {
currentHurt *= 2;
cout << "双倍伤害生效!" << endl;
}
cout << "应你的攻击,对方的血量-" << currentHurt << "!" << endl;
dblood -= currentHurt;
// 吸血效果
if (hasVampire) {
int heal = currentHurt / 10;
blood += heal;
cout << "吸血效果:恢复" << heal << "点血量!" << endl;
}
cout << "应对方的攻击,你的血量-" << dhurt << "!" << endl;
blood -= dhurt;
cout << "对方剩余血量:" << dblood << endl;
Sleep(1300);
cout << "你的血量:" << blood << endl;
Sleep(3000);
}
tim++;
if (tim <= 15) {
goto choose;
}
} else {
cout << "你没有攻击能力!直接-5000血量!"<< endl;
blood -= 5000;
if (blood <= 0) {
cout << "您死了。。。" << endl;
Sleep(3000);
return 0;
}
tim++;
if (tim <= 15) {
goto choose;
}
}
} else if (choose == 4) {
cout << "==========被車撞了!-3000滴血==========" << endl;
blood -= 3000;
Sleep(3000);
if (blood <= 0) {
cout << "您死了。。。" << endl;
Sleep(3000);
return 0;
}
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 5) {
cout << "获得奇遇:1.增加5000血量 2.增加4000点攻击 3.获得攻击能力 4.获得防御能力" << endl;
cin >> judgei;
if (judgei == 1) {
blood += 5000;
} else if (judgei == 2) {
hurt += 4000;
} else if (judgei == 3) {
judgeb = true;
} else if (judgei == 4) {
pretect = 500;
} else {
cout << "叫你不听话错过机遇!" << endl;
Sleep(3000);
}
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 6) {
cout << "=========攻击任务:我将会判定您有没有攻击能力!=========" << endl;
if (judgeb) {
cout << "拥有战斗能力开始战斗!你的对手是脆脆鲨" << endl;
int dblood = 10000, dhurt = 200;
for (;;) {
if (blood <= 0) {
cout << "您死了。。。" << endl;
Sleep(3000);
return 0;
} else if (dblood <= 0) {
cout << "恭喜胜利!奖励2000滴血和50攻击!" << endl;
hurt += 50;
blood += 2000;
Sleep(3000);
break;
}
int currentHurt = hurt;
if (doubleDamageRounds > 0) {
currentHurt *= 2;
cout << "双倍伤害生效!" << endl;
}
cout << "应你的攻击,对方的血量-" << currentHurt << "!" << endl;
dblood -= currentHurt;
if (hasVampire) {
int heal = currentHurt / 10;
blood += heal;
cout << "吸血效果:恢复" << heal << "点血量!" << endl;
}
cout << "应对方的攻击,你的血量-" << dhurt << "!" << endl;
blood -= dhurt;
Sleep(500);
cout << "对方剩余血量:" << dblood << endl;
Sleep(1300);
cout << "你的血量:" << blood << endl;
Sleep(3000);
}
tim++;
if (tim <= 15) {
goto choose;
}
} else {
cout << "你没有攻击能力!直接-5000血量!" << endl;
blood -= 5000;
if (blood <= 0) {
cout << "您死了。。。" << endl;
Sleep(3000);
return 0;
}
tim++;
if (tim <= 15) {
goto choose;
}
}
} else if (choose == 7) {
cout << "=========发现宝箱!=========" << endl;
cout << "1. 打开宝箱(可能有危险)" << endl;
cout << "2. 直接离开" << endl;
cin >> judgei;
if (judgei == 1) {
int luck = rand() % 10;
if (luck < 3) {
cout << "宝箱是陷阱!-2000血量!" << endl;
blood -= 2000;
if (blood <= 0) {
cout << "您死了。。。" << endl;
Sleep(3000);
return 0;
}
} else if (luck < 7) {
cout << "获得500金币!" << endl;
gold += 500;
} else {
cout << "获得神秘武器!攻击力+300!" << endl;
hurt += 300;
}
} else {
cout << "你选择了离开。" << endl;
}
Sleep(2000);
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 8) {
cout << "=========遇到神秘商人=========" << endl;
cout << "金币:" << gold << endl;
cout << "1. 生命药水(200金币,+1500血量)" << endl;
cout << "2. 力量药剂(300金币,+100攻击)" << endl;
cout << "3. 护盾(500金币,抵挡一次致命伤害)" << endl;
cout << "4. 解毒剂(100金币,解除中毒)" << endl;
cout << "5. 离开" << endl;
cin >> judgei;
if (judgei == 1 && gold >= 200) {
gold -= 200;
blood += 1500;
cout << "购买成功!血量恢复1500!" << endl;
} else if (judgei == 2 && gold >= 300) {
gold -= 300;
hurt += 100;
cout << "购买成功!攻击力+100!" << endl;
} else if (judgei == 3 && gold >= 500) {
gold -= 500;
hasShield = true;
cout << "购买成功!获得一次护盾保护!" << endl;
} else if (judgei == 4 && gold >= 100) {
gold -= 100;
poisonRounds = 0;
cout << "购买成功!解毒完成!" << endl;
} else if (judgei == 5) {
cout << "你离开了商店。" << endl;
} else {
cout << "金币不足或选择无效!" << endl;
}
Sleep(2000);
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 9) {
cout << "=========遭遇BOSS战!=========" << endl;
if (!judgeb) {
cout << "你没有战斗能力!自动逃跑,但损失3000血量!" << endl;
blood -= 3000;
} else {
cout << "迎战BOSS:暗黑巨龙!" << endl;
int bossBlood = 15000, bossHurt = 500;
int round = 1;
for (;;) {
cout << "\n===第" << round << "回合===" << endl;
// 玩家攻击
int currentHurt = hurt + rand() % 101;
if (doubleDamageRounds > 0) {
currentHurt *= 2;
cout << "双倍伤害生效!" << endl;
}
cout << "你对BOSS造成了" << currentHurt << "点伤害!" << endl;
bossBlood -= currentHurt;
// 吸血效果
if (hasVampire) {
int heal = currentHurt / 10;
blood += heal;
cout << "吸血效果:恢复" << heal << "点血量!" << endl;
}
if (bossBlood <= 0) {
cout << "\n★★★恭喜你击败了暗黑巨龙!★★★" << endl;
cout << "奖励:5000血量,800攻击,2000金币!" << endl;
blood += 5000;
hurt += 800;
gold += 2000;
break;
}
// BOSS攻击
int actualBossHurt = bossHurt + rand() % 201;
if (hasShield) {
cout << "护盾激活!抵挡了此次攻击!" << endl;
hasShield = false;
} else {
int finalDamage = max(0, actualBossHurt - pretect);
cout << "BOSS对你造成了" << finalDamage << "点伤害!" << endl;
blood -= finalDamage;
}
if (blood <= 0) {
if (hasShield) {
cout << "护盾激活!抵挡了致命一击!" << endl;
blood = 1;
hasShield = false;
} else {
cout << "您被BOSS击败了。。。" << endl;
Sleep(3000);
return 0;
}
}
cout << "BOSS剩余血量:" << bossBlood << endl;
cout << "你的剩余血量:" << blood << endl;
Sleep(2500);
round++;
}
}
Sleep(2000);
tim++;
if (tim <= 15) {
goto choose;
}
}
// ... 省略中间的事件10-15(保持原有)...
else if (choose == 16) {
cout << "=========竞技场挑战=========" << endl;
cout << "欢迎来到竞技场!选择你的对手:" << endl;
cout << "1. 新手战士(奖励较少,风险低)" << endl;
cout << "2. 精英骑士(奖励中等,风险中等)" << endl;
cout << "3. 冠军角斗士(奖励丰厚,风险高)" << endl;
cin >> judgei;
if (judgeb) {
int opponentHealth, opponentDamage, rewardGold, rewardHealth, rewardAttack;
string opponentName;
if (judgei == 1) {
opponentName = "新手战士";
opponentHealth = 2000;
opponentDamage = 100;
rewardGold = 300;
rewardHealth = 500;
rewardAttack = 50;
} else if (judgei == 2) {
opponentName = "精英骑士";
opponentHealth = 5000;
opponentDamage = 250;
rewardGold = 800;
rewardHealth = 1500;
rewardAttack = 150;
} else if (judgei == 3) {
opponentName = "冠军角斗士";
opponentHealth = 10000;
opponentDamage = 500;
rewardGold = 2000;
rewardHealth = 3000;
rewardAttack = 400;
} else {
cout << "无效选择!" << endl;
goto choose;
}
cout << "你的对手是:" << opponentName << endl;
cout << "开始战斗!" << endl;
Sleep(1500);
int round = 1;
for (;;) {
cout << "\n===第" << round << "回合===" << endl;
// 玩家攻击
int currentHurt = hurt + rand() % 51;
if (doubleDamageRounds > 0) {
currentHurt *= 2;
cout << "双倍伤害生效!" << endl;
}
cout << "你对" << opponentName << "造成了" << currentHurt << "点伤害!" << endl;
opponentHealth -= currentHurt;
if (hasVampire) {
int heal = currentHurt / 10;
blood += heal;
cout << "吸血效果:恢复" << heal << "点血量!" << endl;
}
if (opponentHealth <= 0) {
cout << "\n★★★胜利!★★★" << endl;
cout << "获得奖励:" << rewardGold << "金币," << rewardHealth << "血量," << rewardAttack << "攻击力!" << endl;
gold += rewardGold;
blood += rewardHealth;
hurt += rewardAttack;
break;
}
// 对手攻击
int finalDamage = max(0, opponentDamage - pretect);
cout << opponentName << "对你造成了" << finalDamage << "点伤害!" << endl;
blood -= finalDamage;
if (blood <= 0) {
if (hasShield) {
cout << "护盾激活!抵挡了致命一击!" << endl;
blood = 1;
hasShield = false;
} else {
cout << "你在竞技场中战败了..." << endl;
Sleep(3000);
return 0;
}
}
cout << opponentName << "剩余血量:" << opponentHealth << endl;
cout << "你的剩余血量:" << blood << endl;
Sleep(2000);
round++;
}
} else {
cout << "你没有战斗能力!无法参加竞技场!" << endl;
}
Sleep(2000);
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 17) {
cout << "=========神秘洞穴=========" << endl;
cout << "你发现了一个神秘洞穴,里面有三条通道:" << endl;
cout << "1. 左边通道(神秘气息)" << endl;
cout << "2. 中间通道(危险预感)" << endl;
cout << "3. 右边通道(宝光闪烁)" << endl;
cin >> judgei;
int luck = rand() % 100;
if (judgei == 1) {
if (luck < 30) {
cout << "遇到洞穴蝙蝠!损失800血量!" << endl;
blood -= 800;
} else if (luck < 60) {
cout << "发现古代石碑,攻击力+200!" << endl;
hurt += 200;
} else {
cout << "找到神秘泉水,血量+2000!" << endl;
blood += 2000;
}
} else if (judgei == 2) {
if (luck < 40) {
cout << "掉入陷阱!损失1500血量!" << endl;
blood -= 1500;
} else if (luck < 80) {
cout << "战胜了洞穴巨魔!获得300金币!" << endl;
gold += 300;
} else {
cout << "发现隐藏宝库!获得1000金币和500攻击!" << endl;
gold += 1000;
hurt += 500;
}
} else if (judgei == 3) {
if (luck < 20) {
cout << "宝箱是假的!爆炸损失1200血量!" << endl;
blood -= 1200;
} else if (luck < 50) {
cout << "获得普通宝箱:500金币" << endl;
gold += 500;
} else if (luck < 80) {
cout << "获得稀有宝箱:800金币和300血量" << endl;
gold += 800;
blood += 300;
} else {
cout << "获得史诗宝箱:神之祝福!全属性大幅提升!" << endl;
blood += 3000;
hurt += 400;
pretect += 200;
}
}
if (blood <= 0) {
cout << "您在洞穴中死亡..." << endl;
Sleep(3000);
return 0;
}
Sleep(2000);
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 18) {
cout << "=========魔法学院=========" << endl;
cout << "你来到了魔法学院,可以学习魔法:" << endl;
cout << "金币:" << gold << endl;
cout << "1. 火球术(1000金币,攻击时附加100点火焰伤害)" << endl;
cout << "2. 治疗术(800金币,每回合恢复200血量,持续3回合)" << endl;
cout << "3. 护盾术(600金币,获得魔法护盾,抵挡500点伤害)" << endl;
cout << "4. 毒素术(900金币,让敌人中毒3回合)" << endl;
cout << "5. 离开" << endl;
cin >> judgei;
static bool hasFireball = false; // 火球术
static bool hasHealing = false; // 治疗术
static int healingRounds = 0; // 治疗剩余回合
static bool hasMagicShield = false; // 魔法护盾
static bool hasPoisonMagic = false; // 毒素术
if (judgei == 1 && gold >= 1000) {
gold -= 1000;
hasFireball = true;
cout << "学会了火球术!" << endl;
} else if (judgei == 2 && gold >= 800) {
gold -= 800;
healingRounds = 3;
cout << "学会了治疗术!接下来3回合每回合恢复200血量!" << endl;
} else if (judgei == 3 && gold >= 600) {
gold -= 600;
hasMagicShield = true;
cout << "学会了护盾术!获得500点魔法护盾!" << endl;
} else if (judgei == 4 && gold >= 900) {
gold -= 900;
hasPoisonMagic = true;
cout << "学会了毒素术!" << endl;
} else if (judgei == 5) {
cout << "你离开了魔法学院。" << endl;
} else {
cout << "金币不足或选择无效!" << endl;
}
// 治疗术效果
if (healingRounds > 0) {
cout << "治疗术生效:恢复200血量!" << endl;
blood += 200;
healingRounds--;
}
Sleep(2000);
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 19) {
cout << "=========天降横财=========" << endl;
int fortune = rand() % 10;
if (fortune < 2) {
cout << "你捡到一个钱袋!获得500金币!" << endl;
gold += 500;
} else if (fortune < 5) {
cout << "你发现一个宝箱!获得1000金币!" << endl;
gold += 1000;
} else if (fortune < 8) {
cout << "你帮助了商人,获得酬谢800金币!" << endl;
gold += 800;
} else {
cout << "你中了大奖!获得5000金币!" << endl;
gold += 5000;
}
Sleep(2000);
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 20) {
cout << "=========灾难降临=========" << endl;
int disaster = rand() % 6;
switch(disaster) {
case 0:
cout << "洪水来袭!损失2000血量!" << endl;
blood -= 2000;
break;
case 1:
cout << "地震发生!损失1500血量!" << endl;
blood -= 1500;
break;
case 2:
cout << "火山爆发!损失3000血量!" << endl;
blood -= 3000;
break;
case 3:
cout << "瘟疫传播!中毒5回合!" << endl;
poisonRounds = 5;
break;
case 4:
cout << "遭遇抢劫!损失所有金币的一半!" << endl;
gold = gold / 2;
break;
case 5:
cout << "多重灾难!损失1000血量且中毒3回合!" << endl;
blood -= 1000;
poisonRounds = 3;
break;
}
if (blood <= 0) {
if (hasShield) {
cout << "护盾激活!抵挡了致命一击!" << endl;
blood = 1;
hasShield = false;
} else {
cout << "您在灾难中死亡..." << endl;
Sleep(3000);
return 0;
}
}
Sleep(2000);
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 21) {
cout << "=========神秘祭坛=========" << endl;
cout << "你发现了一个古老祭坛,可以选择献祭:" << endl;
cout << "1. 献祭1000血量(获得神秘力量)" << endl;
cout << "2. 献祭500金币(获得神之祝福)" << endl;
cout << "3. 献祭100攻击力(获得永生之血)" << endl;
cout << "4. 离开(不做献祭)" << endl;
cin >> judgei;
if (judgei == 1 && blood > 1000) {
blood -= 1000;
int blessing = rand() % 3;
if (blessing == 0) {
cout << "获得攻击力翻倍,持续3回合!" << endl;
doubleDamageRounds = 3;
} else if (blessing == 1) {
cout << "获得永久吸血能力!" << endl;
hasVampire = true;
} else {
cout << "获得神之眷顾,全属性提升!" << endl;
blood += 2000;
hurt += 300;
pretect += 150;
}
} else if (judgei == 2 && gold >= 500) {
gold -= 500;
cout << "神之祝福:血量+2000,攻击+200,防御+100!" << endl;
blood += 2000;
hurt += 200;
pretect += 100;
} else if (judgei == 3 && hurt >= 100) {
hurt -= 100;
cout << "获得永生之血:血量变为当前的两倍!" << endl;
blood *= 2;
} else if (judgei == 4) {
cout << "你选择了离开。" << endl;
} else {
cout << "献祭条件不满足!" << endl;
}
Sleep(2000);
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 22) {
cout << "=========时空旅者=========" << endl;
cout << "你遇到了时空旅者,他提供三个选择:" << endl;
cout << "1. 回到过去(重置为游戏开始状态,但保留经验和知识)" << endl;
cout << "2. 前往未来(跳过3次命运选择,获得额外奖励)" << endl;
cout << "3. 时间暂停(下一次命运选择可以重新选择)" << endl;
cin >> judgei;
static bool timePause = false;
if (judgei == 1) {
cout << "你回到了游戏开始的时候..." << endl;
Sleep(1500);
// 保留部分属性,重置其他
int oldHurt = hurt;
int oldGold = gold;
blood = 10000;
tim = 0;
hurt = oldHurt / 2; // 保留一半攻击力
gold = oldGold / 2; // 保留一半金币
judgeb = true; // 保留攻击能力
cout << "保留了部分能力重新开始!" << endl;
} else if (judgei == 2) {
cout << "你跳跃到了未来..." << endl;
Sleep(1500);
tim += 3;
cout << "获得未来科技:攻击力+300,血量+1500!" << endl;
hurt += 300;
blood += 1500;
} else if (judgei == 3) {
cout << "时间暂停!下次可以重新选择命运!" << endl;
timePause = true;
}
Sleep(2000);
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 23) {
cout << "=========命运赌场=========" << endl;
cout << "欢迎来到命运赌场!赌注:500金币" << endl;
cout << "1. 玩一把(50%赢1000金币,50%输掉赌注)" << endl;
cout << "2. 玩三把(赢率更低但奖励更高)" << endl;
cout << "3. 离开" << endl;
cin >> judgei;
if (judgei == 1 && gold >= 500) {
gold -= 500;
if (rand() % 2 == 0) {
cout << "恭喜!赢得1000金币!" << endl;
gold += 1000;
} else {
cout << "很遗憾,输掉了赌注!" << endl;
}
} else if (judgei == 2 && gold >= 1500) {
gold -= 1500;
int wins = 0;
for (int i = 0; i < 3; i++) {
if (rand() % 3 == 0) { // 1/3概率赢
wins++;
}
}
if (wins >= 2) {
int reward = 3000 + wins * 1000;
cout << "赢了" << wins << "把!获得" << reward << "金币!" << endl;
gold += reward;
} else {
cout << "运气不好,输了..." << endl;
}
} else if (judgei == 3) {
cout << "你离开了赌场。" << endl;
} else {
cout << "金币不足或选择无效!" << endl;
}
Sleep(2000);
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 24) {
cout << "=========元素试炼=========" << endl;
cout << "选择元素试炼:" << endl;
cout << "1. 火焰试炼(考验攻击力)" << endl;
cout << "2. 大地试炼(考验防御力)" << endl;
cout << "3. 水流试炼(考验生命力)" << endl;
cin >> judgei;
if (judgei == 1) {
cout << "火焰试炼:需要攻击力达到1000" << endl;
if (hurt >= 1000) {
cout << "通过试炼!获得火焰之魂:攻击力+500!" << endl;
hurt += 500;
} else {
cout << "试炼失败!被火焰烧伤,损失1500血量!" << endl;
blood -= 1500;
}
} else if (judgei == 2) {
cout << "大地试炼:需要防御力达到300" << endl;
if (pretect >= 300) {
cout << "通过试炼!获得大地之力:防御力+200,血量+2000!" << endl;
pretect += 200;
blood += 2000;
} else {
cout << "试炼失败!被大地挤压,损失1200血量!" << endl;
blood -= 1200;
}
} else if (judgei == 3) {
cout << "水流试炼:需要血量达到15000" << endl;
if (blood >= 15000) {
cout << "通过试炼!获得水流祝福:血量翻倍!" << endl;
blood *= 2;
} else {
cout << "试炼失败!被水流冲走,损失2000血量!" << endl;
blood -= 2000;
}
}
if (blood <= 0) {
cout << "你在试炼中死亡..." << endl;
Sleep(3000);
return 0;
}
Sleep(2000);
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 25) {
cout << "=========神器出世=========" << endl;
cout << "传说中的神器出现了!但需要战胜守护者!" << endl;
if (judgeb) {
cout << "守护者:古代巨像(血量20000,攻击800)" << endl;
Sleep(1500);
int guardianHealth = 20000, guardianDamage = 800;
int round = 1;
for (;;) {
cout << "\n===第" << round << "回合===" << endl;
// 玩家攻击
int currentHurt = hurt + rand() % 201;
if (doubleDamageRounds > 0) {
currentHurt *= 2;
cout << "双倍伤害生效!" << endl;
}
cout << "你对守护者造成了" << currentHurt << "点伤害!" << endl;
guardianHealth -= currentHurt;
if (hasVampire) {
int heal = currentHurt / 10;
blood += heal;
cout << "吸血效果:恢复" << heal << "点血量!" << endl;
}
if (guardianHealth <= 0) {
cout << "\n★★★击败守护者!获得神器!★★★" << endl;
int artifact = rand() % 3;
if (artifact == 0) {
cout << "获得【神之剑】:攻击力+1000!" << endl;
hurt += 1000;
} else if (artifact == 1) {
cout << "获得【不朽之甲】:防御力+500,血量+5000!" << endl;
pretect += 500;
blood += 5000;
} else {
cout << "获得【全能之冠】:全属性大幅提升!" << endl;
blood += 3000;
hurt += 600;
pretect += 300;
}
break;
}
// 守护者攻击
int finalDamage = max(0, guardianDamage - pretect);
cout << "守护者对你造成了" << finalDamage << "点伤害!" << endl;
blood -= finalDamage;
if (blood <= 0) {
if (hasShield) {
cout << "护盾激活!抵挡了致命一击!" << endl;
blood = 1;
hasShield = false;
} else {
cout << "你被守护者击败了..." << endl;
Sleep(3000);
return 0;
}
}
cout << "守护者剩余血量:" << guardianHealth << endl;
cout << "你的剩余血量:" << blood << endl;
Sleep(2000);
round++;
}
} else {
cout << "你没有战斗能力!无法获取神器!" << endl;
}
Sleep(2000);
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 26) {
cout << "=========梦境迷宫=========" << endl;
cout << "你陷入了梦境迷宫,选择出口:" << endl;
cout << "1. 红色门(可能有宝物)" << endl;
cout << "2. 蓝色门(可能有危险)" << endl;
cout << "3. 绿色门(可能是出口)" << endl;
cout << "4. 金色门(神秘的诱惑)" << endl;
cin >> judgei;
int mazeResult = rand() % 10;
int chosenDoor = judgei;
for (int attempt = 0; attempt < 3; attempt++) {
if (chosenDoor == 1) {
if (mazeResult < 4) {
cout << "找到宝箱!获得800金币!" << endl;
gold += 800;
break;
} else if (mazeResult < 7) {
cout << "遇到幻影怪物!损失600血量!" << endl;
blood -= 600;
break;
} else {
cout << "死胡同!继续寻找..." << endl;
mazeResult = rand() % 10;
chosenDoor = rand() % 4 + 1;
}
} else if (chosenDoor == 2) {
if (mazeResult < 3) {
cout << "逃脱陷阱!获得经验:攻击力+150!" << endl;
hurt += 150;
break;
} else if (mazeResult < 8) {
cout << "陷入陷阱!损失800血量!" << endl;
blood -= 800;
break;
} else {
cout << "迷宫变幻!重新选择..." << endl;
mazeResult = rand() % 10;
chosenDoor = rand() % 4 + 1;
}
} else if (chosenDoor == 3) {
if (mazeResult < 6) {
cout << "找到出口!安全离开迷宫!" << endl;
break;
} else if (mazeResult < 9) {
cout << "错误的出口!回到起点..." << endl;
mazeResult = rand() % 10;
chosenDoor = rand() % 4 + 1;
} else {
cout << "发现隐藏房间!获得2000金币!" << endl;
gold += 2000;
break;
}
} else if (chosenDoor == 4) {
if (mazeResult < 2) {
cout << "发现黄金宝库!获得5000金币和1000攻击!" << endl;
gold += 5000;
hurt += 1000;
break;
} else if (mazeResult < 5) {
cout << "被黄金诅咒!损失3000血量!" << endl;
blood -= 3000;
break;
} else {
cout << "金色幻影!得到提示..." << endl;
cout << "提示:选择绿色门!" << endl;
chosenDoor = 3;
mazeResult = 0; // 提高成功率
}
}
}
if (blood <= 0) {
cout << "你在迷宫中死亡..." << endl;
Sleep(3000);
return 0;
}
Sleep(2000);
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 27) {
cout << "=========星象占卜=========" << endl;
cout << "占星师为你占卜,选择星座:" << endl;
cout << "1. 狮子座(增强攻击)" << endl;
cout << "2. 金牛座(增强防御)" << endl;
cout << "3. 双鱼座(增强生命)" << endl;
cout << "4. 天蝎座(增强技能)" << endl;
cin >> judgei;
if (judgei == 1) {
cout << "狮子座祝福:攻击力提升30%,持续5回合!" << endl;
doubleDamageRounds = 5;
} else if (judgei == 2) {
cout << "金牛座祝福:防御力+300,血量+1500!" << endl;
pretect += 300;
blood += 1500;
} else if (judgei == 3) {
cout << "双鱼座祝福:血量翻倍!" << endl;
blood *= 2;
} else if (judgei == 4) {
cout << "天蝎座祝福:获得随机技能!" << endl;
int skill = rand() % 4;
if (skill == 0) {
cout << "获得【致命一击】技能!" << endl;
hasVampire = true;
} else if (skill == 1) {
cout << "获得【魔法护盾】技能!" << endl;
hasShield = true;
} else if (skill == 2) {
cout << "获得【狂暴之力】技能!" << endl;
doubleDamageRounds = 3;
} else {
cout << "获得【治疗之光】技能!" << endl;
blood += 3000;
}
}
Sleep(2000);
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 28) {
cout << "=========远古遗迹=========" << endl;
cout << "探索远古遗迹,选择探索方式:" << endl;
cout << "1. 小心翼翼(安全但收益低)" << endl;
cout << "2. 冒险前进(危险但收益高)" << endl;
cout << "3. 使用探测器(需要200金币)" << endl;
cin >> judgei;
if (judgei == 1) {
int find = rand() % 10;
if (find < 5) {
cout << "发现普通文物,获得300金币!" << endl;
gold += 300;
} else if (find < 8) {
cout << "发现古老武器,攻击力+200!" << endl;
hurt += 200;
} else {
cout << "触发古老陷阱!损失500血量!" << endl;
blood -= 500;
}
} else if (judgei == 2) {
int risk = rand() % 10;
if (risk < 3) {
cout << "发现宝藏室!获得2000金币和500攻击!" << endl;
gold += 2000;
hurt += 500;
} else if (risk < 6) {
cout << "遭遇遗迹守卫!战斗!" << endl;
// 简化战斗
blood -= 1200;
gold += 800;
hurt += 300;
cout << "战胜守卫,获得奖励!" << endl;
} else {
cout << "掉入深渊!损失2000血量!" << endl;
blood -= 2000;
}
} else if (judgei == 3 && gold >= 200) {
gold -= 200;
cout << "探测器发现隐藏宝库!" << endl;
cout << "获得:1500金币,300攻击,200防御!" << endl;
gold += 1500;
hurt += 300;
pretect += 200;
} else {
cout << "金币不足或选择无效!" << endl;
}
if (blood <= 0) {
cout << "你在遗迹中死亡..." << endl;
Sleep(3000);
return 0;
}
Sleep(2000);
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 29) {
cout << "=========命运转折点=========" << endl;
cout << "这是命运的转折点!选择你的道路:" << endl;
cout << "1. 成为战士(放弃魔法,专注物理)" << endl;
cout << "2. 成为法师(放弃物理,专注魔法)" << endl;
cout << "3. 成为平衡者(保持现状)" << endl;
cin >> judgei;
if (judgei == 1) {
cout << "你选择了战士之路!" << endl;
hurt = hurt * 2; // 攻击翻倍
pretect = pretect * 2; // 防御翻倍
gold += 2000; // 获得金币
cout << "攻击力和防御力翻倍!获得2000金币!" << endl;
} else if (judgei == 2) {
cout << "你选择了法师之路!" << endl;
blood = blood * 2; // 血量翻倍
gold += 3000; // 更多金币
hasShield = true; // 获得护盾
cout << "血量翻倍!获得3000金币和魔法护盾!" << endl;
} else if (judgei == 3) {
cout << "你选择了平衡之路!" << endl;
blood += 3000;
hurt += 300;
pretect += 150;
gold += 1000;
cout << "全属性均衡提升!" << endl;
}
Sleep(2000);
tim++;
if (tim <= 15) {
goto choose;
}
} else if (choose == 30) {
cout << "=========最终审判=========" << endl;
cout << "命运之神降临,进行最终审判!" << endl;
Sleep(1500);
// 计算综合评分
int totalScore = blood / 100 + hurt + pretect + gold / 10 + tim * 100;
cout << "你的冒险综合评分:" << totalScore << endl;
Sleep(1000);
if (totalScore > 10000) {
cout << "★★★★★ 神之境界 ★★★★★" << endl;
cout << "你成为了传奇!获得神之祝福!" << endl;
blood = 99999;
hurt = 9999;
pretect = 5000;
gold = 99999;
cout << "所有属性达到极限!" << endl;
} else if (totalScore > 5000) {
cout << "★★★★ 英雄归来 ★★★★" << endl;
cout << "你的传说将被传颂!" << endl;
blood += 10000;
hurt += 2000;
pretect += 1000;
gold += 10000;
} else if (totalScore > 2000) {
cout << "★★★ 勇敢冒险者 ★★★" << endl;
cout << "你完成了伟大的冒险!" << endl;
blood += 5000;
hurt += 1000;
gold += 5000;
} else {
cout << "★★ 旅程结束 ★★" << endl;
cout << "你的冒险告一段落。" << endl;
blood += 2000;
hurt += 500;
gold += 2000;
}
cout << "\n==========游戏结束==========" << endl;
cout << "最终属性:" << endl;
cout << "血量:" << blood << endl;
cout << "攻击力:" << hurt << endl;
cout << "防御力:" << pretect << endl;
cout << "金币:" << gold << endl;
cout << "经历命运次数:" << tim << endl;
cout << "综合评分:" << totalScore << endl;
cout << "\n感谢游玩!再见!" << endl;
Sleep(5000);
return 0;
} else {
// 其他数字,触发随机小事件
cout << "=========随机事件=========" << endl;
int randomEvent = rand() % 10; // 增加随机事件种类
switch(randomEvent) {
case 0:
cout << "发现草药,恢复500血量!" << endl;
blood += 500;
break;
case 1:
cout << "遇到小怪物,损失300血量!" << endl;
blood -= 300;
break;
case 2:
cout << "捡到钱袋,获得100金币!" << endl;
gold += 100;
break;
case 3:
cout << "锻炼身体,攻击力+10!" << endl;
hurt += 10;
break;
case 4:
cout << "找到防护装备,防御力+20!" << endl;
pretect += 20;
break;
case 5:
cout << "迷路了,浪费了一些时间。" << endl;
break;
case 6:
cout << "遇到友好NPC,获得200金币!" << endl;
gold += 200;
break;
case 7:
cout << "天气突变,损失100血量!" << endl;
blood -= 100;
break;
case 8:
cout << "发现训练场,攻击力+50!" << endl;
hurt += 50;
break;
case 9:
cout << "幸运日!全属性小幅提升!" << endl;
blood += 300;
hurt += 30;
pretect += 15;
break;
}
if (blood <= 0) {
cout << "您死了。。。" << endl;
Sleep(3000);
return 0;
}
Sleep(1500);
tim++;
if (tim <= 15) {
goto choose;
}
}
// 如果tim超过15,游戏结束
if (tim > 15) {
cout << "==========游戏结束==========" << endl;
cout << "你已经经历了15次命运选择!" << endl;
cout << "最终状态:" << endl;
cout << "血量:" << blood << endl;
cout << "攻击力:" << hurt << endl;
cout << "防御力:" << pretect << endl;
cout << "金币:" << gold << endl;
cout << "感谢游玩!" << endl;
Sleep(5000);
}
return 0;
}
|