跳到正文

个人记录

华强2.0

_TwilightSnow_约 40 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2026年4月8日
篇幅
约 40 分钟

版本

  1. v2当前
  2. v1
C++
/*华强模拟器 制作是间:2023 6 16
制作人:摇摆刚.铁汁
*/
#include<cmath>
#include<time.h>
#include<cstdio>
#include<iostream>
#include<cstring>
#include<windows.h>
#include<conio.h>
#include<string>
#include<cstdlib>
#include<bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<stdio.h>
#include<string>
#include<cstring>
#include<istream>
#include<ostream>
#include<map>
#include<vector>
#include<queue>
#include<cmath>
#include<windows.h>
#include<algorithm>
#include<time.h>
#include<ctime>
#include<stdlib.h>
#include<cstdlib>
#include<stddef.h>
#include<stdint.h>
#include<stdbool.h>
#include<math.h>
using namespace std;
int x=7,y=19;
char qwq;
struct ren {
    string name;
    int hp=100,maxhp=100;
    int ji=100,ke=100;
    int htk=20,def=5;
    int xingtime=1,h=0,min=0,day=1,month=1,year=0;
    int lv=0,exp=0,maxesp=100;
    int sleep=100,sleepday=0;
    int twin=0;
    int money=100;
    double tiwen=36.5;
    int huo=1;
    int yan=100;
    int where=0;
    int w[5]={0};//武器
    int f[5]={0};//防具
    int laji[6]={0};
    int cai[5]={0};
    int shi=0,fei=0;
} play;
bool run(int n) {
    if(n%100==0)
        if(n%400==0) return 1;
        else return 0;
    else if(n%4==0) return 1;
         else return 0;
}
void print(string a,int x) {
    for(int i=0;i<=a.length();i++) {
        cout<<a[i];
        Sleep(50);
    }
    Sleep(200);
    if(x) cout<<endl;
    return;
}
int ill[6][3]={{0,3,3},{0,3,3},{0,4,5},{0,5,5},{0,5,5},{0,5,4}};
//第2维为0是否患病,1是 每分钟所扣血量,2是行动增加时间。
string sill[6]={"【中暑】","【发烧】","【打伤】","【失眠】","【饥饿】","【口渴】"};
string mapname[5]={"【WC】","【贫民窟】","【警察局】","【水果街】","【篮球场】"};
                      //01234567890123456789
string maps[5][20]= {{{"#真#################"},// 0
                      {"#香#   #           #"},// 1
                      {"#饭|   # *      ####"},// 2
                      {"#店#   # |      #拉#"},// 3
                      {"####   #        |圾#"},// 4
                      {"#防#   # *      #桶#"},// 5
                      {"#具|   # |      ##=="},// 6
                      {"#店#   #           @"},// 7
                      {"####   # *      ##=="},// 8
                      {"#武#   # |      |粪#"},// 9
                      {"#器|   #        #坑#"},// 4
                      {"#店#   #        ####"},// 0
                      {"####   # *         #"},// 1
                      {"####   # |      ####"},// 2
                      {"#菜#   #   #    #火#"},// 3
                      {"#石|   #   #    |炉#"},// 5
                      {"#场#   ####| |######"},// 6
                      {"####            |盆#"},// 7
                      {"#               #子#"},// 8
                      {"####################"}},// 9
                      //01234567890123456789
                     {{" |##################"},// 0
                      {" |##粪|      #收|小#"},// 1
                      {" |##肥#      |破|卡#"},// 2
                      {" |# ##       #烂|拉#"},// 3
                      {" |#          ####咪#"},// 4
                      {" |#              #-#"},// 5
                      {"=====##            #"},// 6
                      {"@                  #"},// 7
                      {"=====##            #"},// 8
                      {" |#丐 #            #"},// 9
                      {" |#帮 #            #"},// 0
                      {" |##-##     U   U  #"},// 1
                      {" |#  ##     ########"},// 2
                      {" |#  ###    |垃圾桶#"},// 3
                      {" |#         ########"},// 4
                      {" |####             #"},// 5
                      {" |#道#             #"},// 6
                      {" |#具|             #"},// 7
                      {" |#店#         U U #"},// 8
                      {" |#############U U##"}},// 9
                      //01234567890123456789
                     {{"###_###########U@U##"},// 0
                      {"# AAA          U U #"},// 1
                      {"#|=O=|           ###"},// 2
                      {"# VUV           |盆#"},// 3
                      {"#  U             ###"},// 4
                      {"#  U               #"},// 5
                      {"##                 #"},// 6
                      {"         E===D     #"},// 7
                      {"##       N 警V     #"},// 8
                      {"#  _     | 察|     #"},// 9
                      {"# AAA    N 局A     #"},// 0
                      {"#|=O=|   E===D     #"},// 1
                      {"# VUV  _           #"},// 2
                      {"#  U  AAA _    _   #"},// 3
                      {"# _U |=O=AAA  AAA  #"},// 4
                      {"#AAA  VU|=O=||=O=| #"},// 5
                      {"|=O=|  U VUV  VUV  #"},// 6
                      {"#VUV   U  U    U   #"},// 7
                      {"# U       U    U   #"},// 8
                      {"##U#################"}},// 9
                      //01234567890123456789
                     {{"# AAA####N山A#######"},//0
                      {"#|=O=|   E竹D      #"},//1
                      {"# VUV  _ A摊A      #"},//2
                      {"#  U  AAA#--#      #"},//3
                      {"#  U              ##"},//4
                      {"#                  @"},//5
                      {"#                 ##"},//6
                      {"#     #______#     #"},//7
                      {"#  B  B香蕉摊A  A# #"},//8
                      {"###B  B######A  A###"},//9
                      {"###B  B######A  A###"},//0
                      {"#  B  B   盆#A  A#  "},//1
                      {"#                  #"},//2
                      {"#    D===E===D   ###"},//3
                      {"#    V榴 N 西V     #"},//4
                      {"#    |莲 N 瓜|     #"},//5
                      {"#    A摊 N 摊A     #"},//6
                      {"#    D===E===D     #"},//7
                      {"#            B  B  #"},//8
                      {"#############A  A###"}},//9
                      //01234567890123456789
                     {{"###_###########A@A##"},// 0
                      {"# AAA          A A #"},// 1
                      {"#|=O=|             #"},// 2
                      {"# VUV              #"},// 3
                      {"#  U               #"},// 4
                      {"#  U               #"},// 5
                      {"#                  #"},// 6
                      {"#        E=_=D     #"},// 7
                      {"#        N坤 V     #"},// 8
                      {"#  _     |666|     #"},// 9
                      {"# AAA    N坤 A     #"},// 0
                      {"#|=O=|   E=_=D     #"},// 1
                      {"# VUV  _           #"},// 2
                      {"#  U  AAA _    _   #"},// 3
                      {"# _U |=O=AAA  AAA  #"},// 4
                      {"#AAA  VU|=O=||=O=| #"},// 5
                      {"|=O=|  U VUV  VUV  #"},// 6
                      {"#VUV   U  U    U   #"},// 7
                      {"# U       U    U   #"},// 8
                      {"##U#################"}},// 9
};
void wuqishop() {
    system("cls");
    print("这位骚年,我看你唱跳rep,来买几把好武器吧!",1);
    system("cls");
    print("1.施宇飞的坤疤····················200金币每把",1);
    print("2.赵老师的试卷····················500金币每把",1);
    print("3.光辉之刃·····················800金币每把",1);
    print("4.信仰中指····················1000金币每把",1);
    print("5.老痰栓菜牛粪便····················2000金币每把",1);
    print("请问这位要买那把,多少把呢?",1);
    char a;
    int x;
    cin>>a>>x;
    switch(a) {
        case '1':
            if(play.money>=x*200) play.w[1]+=x,play.money-=200*x;
            else print("钱不够!穷乞丐滚远点!!!",1);
            break;
        case '2':
            if(play.money>=x*500) play.w[2]+=x,play.money-=x*500;
            else print("钱不够!穷乞丐滚远点!!!",1);
            break;
        case '3':
            if(play.money>=x*800) play.w[3]+=x,play.money-=x*800;
            else print("钱不够!穷乞丐滚远点!!!",1);
            break;
        case '4':
            if(play.money>=x*1000) play.w[4]+=x,play.money-=x*1000;
            else print("钱不够!穷乞丐滚远点!!!",1);
            break;
        case '5':
            if(play.money>=x*2000) play.w[5]+=x,play.money-=x*2000;
            else print("钱不够!穷乞丐滚远点!!!",1);
            break;
    }
    print("拜拜~~~~~~~~~~~~~~~",1);
    system("cls");
}
void fangjiushop() {
    system("cls");
    print("衰哥,来我这防具店康康吗???",1);
    system("cls");
    print("1.护心镜····················100金币每个",1);
    print("2.铁锁甲····················200金币每个",1);
    print("3.陨铁神盾···················500金币每个",1);
    print("4.坦克皮····················1250金币每个",1);
    print("5.风王结界···················1750金币每个",1);
    char f;
    int x;
    cin>>f>>x;
    switch(f) {
        case '1':
            if(play.money>=x*100) play.f[1]+=x,play.money-=100*x;
            else {
                printf("没前就别来,滚出去!!!\n");
                print("你被痛打了一顿,赶了出去",1);
                print("你失去了1/20的生命值!!!",1);
                play.hp-=(0.05*play.maxhp);
                if(play.hp<=0) {print("你被打死了!!!",1);play.huo=0;system("cls");return;}
            }
            break;
        case '2':
            if(play.money>=x*200) play.f[2]+=x,play.money-=200*x;
            else {
                printf("没前就别来,滚出去!!!\n");
                print("你被痛打了一顿,赶了出去",1);
                print("你失去了1/20的生命值!!!",1);
                play.hp-=(0.05*play.maxhp);
                if(play.hp<=0) {print("你被打死了!!!",1);play.huo=0;system("cls");return;}
            }
            break;
        case '3':
            if(play.money>=x*500) play.f[3]+=x,play.money-=500*x;
            else {
                printf("没前就别来,滚出去!!!\n");
                print("你被痛打了一顿,赶了出去",1);
                print("你失去了1/20的生命值!!!",1);
                play.hp-=(0.05*play.maxhp);
                if(play.hp<=0) {print("你被打死了!!!",1);play.huo=0;system("cls");return;}
            }
            break;
        case '4':
            if(play.money>=x*1250) play.f[4]+=x,play.money-=1250*x;
            else {
                printf("没前就别来,滚出去!!!\n");
                print("你被痛打了一顿,赶了出去",1);
                print("你失去了1/20的生命值!!!",1);
                play.hp-=(0.05*play.maxhp);
                if(play.hp<=0) {print("你被打死了!!!",1);play.huo=0;system("cls");return;}
            }
            break;
        case '5':
            if(play.money>=x*1750) play.f[5]+=x,play.money-=1750*x;
            else {
                printf("没前就别来,滚出去!!!\n");
                print("你被痛打了一顿,赶了出去",1);
                print("你失去了1/20的生命值!!!",1);
                play.hp-=(0.05*play.maxhp);
                if(play.hp<=0) {print("你被打死了!!!",1);play.huo=0;system("cls");return;}
            }
            break;
    }
    print("拜拜~~~~~~~~~~~~~~~",1);
    system("cls");
    return;
}
void lajitong() {
    system("cls");
    print("你在翻垃圾桶~~~~~~~~~",1);
    srand(time(0));
    int n=rand()%100+1,x=rand()%10+1;
    if(n<10) {print("垃圾桶里空空如也~~~~~",1);system("cls");return;}
    if(n>=10&&n<50) {play.laji[0]+=x;print("你翻到了旧报纸",0);cout<<x<<"斤!!!";Sleep(500);}
    if(n>=50&&n<76) {play.laji[1]+=x;print("你翻到了电路板",0);cout<<x<<"斤!!!";Sleep(500);}
    if(n>=76&&n<89) {play.laji[2]+=x;print("你翻到了废铁",0);cout<<x<<"斤!!!";Sleep(500);}
    if(n>=89&&n<95) {play.laji[3]+=x;print("你翻到了木板",0);cout<<x<<"斤!!!";Sleep(500);}
    if(n>=95&&n<=98) {play.laji[4]+=x;print("你翻到了旧手机",0);cout<<x<<"台!!!";Sleep(500);}
    if(n>98) {play.laji[5]+=x;print("你翻到了旧冰箱",0);cout<<x<<"台!!!";Sleep(500);}
    play.twin+=10;
    system("cls");
}
void fenkeng() {
    system("cls");
    print("你来到了粪坑旁~~~~~~",1);
    print("你要干神马???",1);
    print("1.进入粪坑,搜寻物品。2.干翔。",1);
    qwq=_getch();
    switch(qwq) {
        case '1':{
            int n=rand()%10+1,x=rand()%100+1;
            print("奥力给,干了奥!!!",1);
            if(n<=3) print("你什么也没有找到!!!",1);
            else {
                print("你找到了",0);
                cout<<x;
                play.fei+=x;
                print("斤粪肥!!!",1);
            }
            play.twin+=40;
            break;
        }
        case '2':{
            if(play.shi<50) print("你什么也没有拉出来!!!",1);
            else {
                print("你的身心感到是分舒畅~~~~",1);
                print("你拉了出来!!!",1);
            }
            break;
        }
    }
    Sleep(500);
    system("cls");
}
void pengzi() {
    system("cls");
    int n=rand()%100+1,x=rand()%30+1;
    if(n<50) print("你的运气很不好,没有人施舍你!!!",1);
    else {
        print("你的运气很好,你获得了",0);
        cout<<x<<"元!!!"<<endl;
        play.money+=x;
    }
    play.min+=10;
    Sleep(500);
    system("cls");
}
string cainame[5]={"生牛排","坤","鸡中翅","猪肉","伟德肝"};
int caiq[5]={40,60,15,20,200};
void caishichang() {
    system("cls");
    print("这位靓仔,请问要来买亿点菜吗???!!!",1);
    print("1.生牛排····················40金币每个",1);
    print("2.坤····················60金币每个",1);
    print("3.鸡中翅·····················15金币每个",1);
    print("4.猪肉····················20金币每个",1);
    print("5.伟德肝····················200金币每个",1);
    char x;
    cin>>qwq>>x;
    qwq-='1';x-='0';
    if(caiq[qwq]*x<=play.money) {
        play.cai[qwq]++;
        play.money-=caiq[qwq]*x;
        print("拜拜~~~~~~~~~",1);
    }else print("滚滚滚!!!",1);
}
void feiliao() {
    system("cls");
    print("回收答辩:2两元一斤!!!",1);
    print("卖几斤???",1);
    int qwq=0;
    cin>>qwq;
    if(play.fei>=qwq) {
        play.fei-=qwq;
        play.money+=qwq*2;
        print("你卖了",1);
        cout<<qwq*2<<"元!!!";
        Sleep(700);
    }else print("你有吗?!?!?!?!?!",1);
    system("cls");
}
string foodname[5]={"红烧肉盖饭","咖喱拌饭","酸菜鱼","烤全羊","满汉全席"};
int foods[5]={30,15,100,250,450};
int foodq[5]={40,20,100,300,500};
void foodshop() {
    system("cls");
    print("大叔,我看你如此饥饿,不如来我饭店吃点什么?",1);
    print("1.红烧肉盖饭····················40金币每份",1);
    print("2.咖喱拌饭····················20金币每份",1);
    print("3.酸菜鱼·····················100金币每份",1);
    print("4.烤全羊····················300金币每份",1);
    print("5.满汉全席····················500金币每份",1);
    int a,b;
    cin>>a>>b;
    a--;
    if(play.money>=foodq[a]*b) {
        print("你吃下了"+foodname[a],1);
        print("你感到你又恢复了体力!!!",1);
        play.ji+=foods[a]*b;
    } else print("要饭的吧?!?!?!?!",1);
    system("cls");
}
void huolu() {
    if(play.yan!=0) {
		while(1) {
			printf("火已经熄灭了!!!",1);
			printf("你要放几斤报纸(一斤10燃烧值)",1);

		}
    }
}
int main(){
    srand(time(0));
    printf("\n\n\n\n\n\n\n\n\n\n\n\n                                          ");
    print("华强模拟器",1);
    Sleep(2000);
    system("cls");
    print("你的名字是...",0);
    cin>>play.name;
    print("你叫",0);
    print(play.name,0);
    print("。是华强集团的一员,为了组织,你决定去拜访在篮球场深处的坤坤,",1);
    print("学习坤坤秘籍,最终成为一个唱跳rep全能手,加油",0);
    print(play.name,1);
    cout<<"!!!"<<endl;
    system("cls");
    print("【W】【A】【S】【D】移动!!【E】查看状态!",1);
    Sleep(500);
    print("入口(|)处点击【F】进行交互!!【B】使用道具!",1);
    Sleep(500);
    print("切换地图请在门口最深处点击【F】!",1);
    Sleep(2000);
    system("cls");
    while(1) {
        if(play.min>=60){
            play.h+=play.min/60;
            play.sleep-=0.5*play.min/60;
            play.min%=60;
        }
        if(play.h>24){
            play.day+=play.h/24;
            play.h%=24;
        }
        switch(play.month) {
            case 1:{
                if(play.day>31){
                    play.month+=play.day/31;
                    play.day%=31;
                }
            }
            case 2:{
                if(run(play.year)){
                    if(play.day>29){
                        play.month+=play.day/29;
                        play.day%=29;
                    }
                }
                else{
                    play.month+=play.day/28;
                    play.day%=28;
                }
            }
            case 3:{
                if(play.day>31){
                    play.month+=play.day/31;
                    play.day%=31;
                }
            }
            case 4:{
                if(play.day>30){
                    play.month+=play.day/30;
                    play.day%=30;
                }
            }
            case 5:{
                if(play.day>31){
                    play.month+=play.day/31;
                    play.day%=31;
                }
            }
            case 6:{
                if(play.day>30){
                    play.month+=play.day/30;
                    play.day%=30;
                }
            }
            case 7:{
                if(play.day>31){
                    play.month+=play.day/31;
                    play.day%=31;
                }
            }
            case 8:{
                if(play.day>31){
                    play.month+=play.day/31;
                    play.day%=31;
                }
            }
            case 9:{
                if(play.day>30){
                    play.month+=play.day/30;
                    play.day%=30;
                }
            }
            case 10:{
                if(play.day>31){
                    play.month+=play.day/31;
                    play.day%=31;
                }
            }
            case 11:{
                if(play.day>30){
                    play.month+=play.day/30;
                    play.day%=30;
                }
            }
            case 12:{
                if(play.day>31){
                    play.month+=play.day/31;
                    play.day%=31;
                    if(play.month>12){
                        play.month%=12;
                    }
                }
            }
            cout<<mapname[play.where]<<'\t'<<"名字:"<<play.name<<'\n';
            cout<<play.year<<'/'<<play.month<<'/'<<play.day<<endl;
            printf("现在时间:%d:%02d\t",play.h,play.min);
            cout<<"Money:"<<play.money<<endl;
            cout<<"LV:"<<play.lv<<endl;
            for(int i=0;i<20;i++) cout<<maps[play.where][i]<<endl;
            printf("HP: %d/%d",play.hp,play.maxhp);
            qwq=_getch();
            system("cls");
            switch(qwq) {
                case 'w':
                    if(maps[play.where][x-1][y]==' '){
						swap(maps[play.where][x-1][y],maps[play.where][x][y]);
						x-=1;
						play.min+=play.xingtime;
						play.shi++;
						play.yan>0?play.yan--:play.yan;
						play.ji>0?play.ji--:play.ji;
					};break;
                case 'a':
                    if(maps[play.where][x][y-1]==' '){
						swap(maps[play.where][x][y-1],maps[play.where][x][y]);y-=1;play.min+=play.xingtime;
						play.shi++;
						play.yan>0?play.yan--:play.yan;
						play.ji>0?play.ji--:play.ji;};break;
                case 's':
                    if(maps[play.where][x+1][y]==' '){swap(maps[play.where][x+1][y],maps[play.where][x][y]);x+=1;play.min+=play.xingtime;play.shi++;};break;
                case 'd':
                    if(maps[play.where][x][y+1]==' '){swap(maps[play.where][x][y+1],maps[play.where][x][y]);y+=1;play.min+=play.xingtime;play.shi++;};break;
                case 'f':
                    switch(play.where) {
                        case 0: {
                            if(x==4&&y==15) lajitong();
                            if(x==9&&y==15) fenkeng();
                            if(x==10&&y==4) wuqishop();
                            if(x==6&&y==4) fangjiushop();
                            if(x==17&&y==15) pengzi();
                            if(x==14&&y==4) caishichang();
                            if(x==7&&y==19) {
                                play.where++;
                                x=7;y=0;
                                play.min+=10;
                                play.shi+=5;
                            }
                            if(x==2&&y==4) foodshop();
                            break;
                        }
                        case 1:{
                            if(x==7&&y==0) {
                                play.where--;
                                x=7;y=19;
                                play.min+=10;
                                play.shi+=5;
                            }
                            if(x==1&&y==7) feiliao();
                            if(x==13&&y==10) lajitong();
                            break;
                        }
                    }
            }
        }
    }
    system("pause");
    return 0;
}
原文