版本比较
浣熊市-生化危机
正文
增加 14 行删除 14 行
122 行未改动全部展开12312412512612712712812913013144 行未改动17617717817918018018118218318436 行未改动2212222232242252252262272282294 行未改动23423523623723823823924024124224224324424524622 行未改动26927027127227327327427527627725 行未改动303304305306307307308309310311182 行未改动全部展开494495496497498498499500501502252 行未改动全部展开75575675775875975976076176276376476576676776776876977077110 行未改动782783784785786786787788789790791792793794795795796797798799174 行未改动全部展开97497597697797897897998098198298298398498598698 行未改动122 行未改动全部展开 while(scanf("%d", &choice) != 1 || choice < 1 || choice > 3) { printf("\n\t选择无效!请输入1-3:"); while(getchar() != '\n'); // 清空输入缓冲区 }
switch(choice) { case 1: create_character(); break;44 行未改动 while(scanf("%d", &choice) != 1 || choice < 1 || choice > 5) { printf("\n\t选择无效!请输入1-5:"); while(getchar() != '\n'); }
switch(choice) { case 1: display_status(); break;36 行未改动 printf("\n\t请输入你的名字(不超过19个字符):"); scanf("%s", player.name); // 截断过长名字,避免溢出 player.name[MAX_NAME_LEN-1] = '\0';
// 初始化玩家属性 player.max_hp = 150; player.hp = 150; player.attack = 20;4 行未改动 player.key_count = 0; player.virus_sample = 0; player.gem_count = 0; player.game_progress = 10;
// 初始道具 add_item(ITEM_HERB, 2); add_item(ITEM_BULLET, 30);
printf("\n\t角色创建成功!%s,欢迎来到浣熊市!", player.name); printf("\n\t你发现自己被困在警局大厅,周围充满了丧尸的嘶吼..."); press_any_key(); main_menu();22 行未改动 printf("\n\t特殊道具:%s(病毒样本) | %s(散弹枪) | %d个(隐藏宝石)", player.virus_sample ? "?" : "?", player.has_shotgun ? "?" : "?", player.gem_count);
press_any_key();}
// 显示背包25 行未改动 while(scanf("%d", &choice) != 1 || choice < 1 || choice > 2) { printf("\n\t选择无效!请输入1或2:"); while(getchar() != '\n'); }
if(choice == 1 && player.inventory_count > 0) { printf("\n\t请选择要使用的道具编号(1-%d):", player.inventory_count); while(scanf("%d", &index) != 1 || index < 1 || index > player.inventory_count) { printf("\n\t编号无效!请输入1-%d:", player.inventory_count);182 行未改动全部展开 while(scanf("%d", &choice) != 1) { printf("\n\t输入无效!请输入数字:"); while(getchar() != '\n'); }
switch(player.location) { case 1: switch(choice) { case 1:252 行未改动全部展开void battle_system(void) { int choice; int has_shotgun_ammo = 0; battle_win = 0;
// 检查散弹枪弹药 for(int i=0; i<player.inventory_count; i++) { if(player.inventory[i].type == ITEM_SHOTGUN_AMMO && player.inventory[i].count > 0) { has_shotgun_ammo = 1; break; } }
while(current_enemy.hp > 0 && player.hp > 0) { clear_screen(); print_title(); printf("\n\n【战斗中】");10 行未改动 while(scanf("%d", &choice) != 1) { printf("\n\t输入无效!请输入数字:"); while(getchar() != '\n'); }
// 刷新弹药状态 has_shotgun_ammo = 0; for(int i=0; i<player.inventory_count; i++) { if(player.inventory[i].type == ITEM_SHOTGUN_AMMO && player.inventory[i].count > 0) { has_shotgun_ammo = 1; break; } }
switch(choice) { case 1: { int has_bullet = 0;174 行未改动全部展开 current_enemy.speed = 30; current_enemy.drop_rate = 100; current_enemy.drop_item.type = ITEM_GEM; current_enemy.drop_item.count = 1;
printf("\n\tG病毒突变体咆哮着向你冲来!最终决战开始!"); press_any_key(); battle_system();
if(battle_win) { player.game_progress = 100; game_over = 1; }98 行未改动