f.io

· · 休闲·娱乐

florr.io c++版,大坑,待填......

本版本更新于:2024/11/2 11:22

#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
#include<ctime>
#include<stdio.h>
#include<time.h>
#define int long long
#define debug() cout<<"come here\n"
#define INF 0x3f3f3f3f3f3f3f3f
#define pii pair<int,int>
#define pb push_back
using namespace std;
int qpow(int a,int b,int p)
{
    int ret=1;
    while(b)
    {
        if(b&1)ret=(ret*a)%p;
        a=(a*a)%p;
        b>>=1;
    }
    return ret;
}
void slowout(string s,int x)
{
    for(int i=0;i<s.size();i++)
    {
        Sleep(x);
        cout<<s[i];
    }
}
const int MOD=1145141923;
string password;
int speed=50;
string name;
string petal[11]={"air","basic","coin","exp","rock","jelly","wing","egg"};
string mob[11]={"air","soldier ant","queen ant","rock","slime","chest","jellyfish"};
int petal_exp[21]={0,1,5,50,500,10000,500000,50000000,5000000000};
int mob_petal[11]={0,6,7,4,3,2,5};
int mob_health[11]={0,5,20,10,5,5,5};
int world_boss_mob_health[11]={0,10,30,15,8,8,10};
int rar_health[21]={0,1,2,5,10,20,50,100,200,1000,2000,5000,10000,20000,50000,100000,500000};
int mob_def[17][7]={0,0,0,0,0,0,0,//unknown
                   0,5,6,5,4,4,5,//common
                   0,12,14,12,10,10,11,//unusual
                   0,21,24,21,18,18,19,//rare
                   0,32,36,32,28,28,30,//epic
                   0,45,50,45,40,40,42,//legendary
                   0,60,66,60,54,54,57,//mythic
                   0,70,77,70,63,63,66,//ultra
                   0,88,99,88,77,77,82,//super
                   0,108,120,108,96,96,102,//omega
                   0,120,132,120,108,108,114,//fabled
                   0,143,156,143,130,130,136,//ultimate
                   0,156,169,156,143,143,149,//supreme
                   0,182,196,182,168,168,175,//rare-supreme
                   0,196,210,196,182,182,189,//legendary-supreme
                   0,225,240,225,210,210,217,//mythic-supreme
                   0,240,255,240,225,225,232};//super-supreme
int crafting_rate[21]={0,64000,32000,16000,8000,4000,2000,1000,500,250,125,62,31,15,7,3,1};
int egg[21]={0,1,2,3,4,8,15,30,60,150,250,500,1000,1500,2000,2500,3500};
double petal_atk[11]={0,0,0,0,0.5,0.2,0.3,0};
string drop[11]={"0","1","2","3","4","5","6","7","8","9","10"};
map<string,int> petal_id,mob_id;
string rarity[21]={"unknown","common","unusual","rare","epic","legendary","mythic","ultra","super","omega","fabled","ultimate","supreme","rare-supreme","legendary-supreme","mythic-supreme","super-supreme"};
map<string,int> rarity_id;
int petal_number[21][11];
int expp[251];
int max_lv=0;
void init()
{
    for(int i=0;i<=7;i++)
    {
        petal_id[petal[i]]=i;
    }
    for(int i=1;i<=6;i++)
    {
        mob_id[mob[i]]=i;
    }
    for(int i=0;i<=16;i++)
    {
        rarity_id[rarity[i]]=i;
    }
    expp[1]=10;
    for(int i=2;i<=250;i++)
    {
        if(i<=30)expp[i]=expp[i-1]*1.2;
        else if(i<=50) expp[i]=expp[i-1]*1.15;
        else expp[i]=expp[i-1]*1.1;
    }
    petal_number[0][0]=10;
}
int add_coin=1,add_exp,coin,now_exp,step,slot=5,now_lv=1,rng_egg,world_boss_i;
int mob_defeted[17];
int petal_get_num[17];
int petal_lost_num[17];
double world_boss_health;
bool open_world_boss_flag;
SYSTEMTIME last_time;
bool flag=0;
double atk;
struct node{
    int id;
    int rar;
};
node your_petal[21];
int hsh(int x,int y)
{
    while(y)
    {
        x=(131*x+y%10)%MOD;
        y/=10;
    }
    return x;
}
void save(bool cout_flag=1)
{
    ofstream out1("Data.ini");
    int hash=0,password_hash=0;
    for(int i=0;i<password.size();i++)
    {
        password_hash=hsh(password_hash,password[i]);
    }
    out1<<name<<' '<<password_hash<<' '<<add_coin<<' '<<add_exp<<' '<<coin<<' '<<now_exp<<' '<<step<<' '<<slot<<' '<<now_lv<<' '<<rng_egg<<' '<<atk<<' ';
    hash=hsh(hash,add_coin);
    hash=hsh(hash,add_exp);
    hash=hsh(hash,coin);
    hash=hsh(hash,now_exp);
    hash=hsh(hash,step);
    hash=hsh(hash,slot);
    hash=hsh(hash,now_lv);
    hash=hsh(hash,rng_egg);
    hash=hsh(hash,atk);
    for(int i=1;i<=slot;i++)
    {
        out1<<your_petal[i].id<<' '<<your_petal[i].rar<<' ';
        hash=hsh(hash,your_petal[i].id);
        hash=hsh(hash,your_petal[i].rar);
    }
    if(cout_flag)slowout("Saving successfully!\n",speed);
    for(int i=1;i<=16;i++)
    {
        for(int j=1;j<=7;j++)
        {
            out1<<petal_number[i][j]<<' ';
            hash=hsh(hash,petal_number[i][j]);
        }
    }
    out1<<world_boss_i<<' '<<world_boss_health<<' ';
    hash=hsh(hash,world_boss_i);
    hash=hsh(hash,world_boss_health);
    out1<<open_world_boss_flag<<' ';
    hash=hsh(hash,open_world_boss_flag);
    if(open_world_boss_flag)
    {
        out1<<last_time.wYear<<' '<<last_time.wMonth<<' '<<last_time.wDay<<' ';
        hash=hsh(hash,last_time.wYear);
        hash=hsh(hash,last_time.wMonth);
        hash=hsh(hash,last_time.wDay);
    }
    for(int i=1;i<=16;i++)
    {
        out1<<mob_defeted[i]<<' ';
        hash=hsh(hash,mob_defeted[i]);
    }
    for(int i=1;i<=16;i++)
    {
        out1<<petal_lost_num[i]<<' ';
        hash=hsh(hash,petal_lost_num[i]);
    }
    for(int i=1;i<=16;i++)
    {
        out1<<petal_get_num[i]<<' ';
        hash=hsh(hash,petal_get_num[i]);
    }
    out1<<hash<<' ';
}
int read_acc()
{
    ifstream in1("Data.ini");
    if (!in1)
    {
        slowout("You need to have a saving first!\n",speed);
        return 1;                   
    }
    slowout("Password:",speed);
    cin>>password;
    int hash=0,now_password_hash=0,password_hash=0;
    for(int i=0;i<password.size();i++)
    {
        now_password_hash=hsh(now_password_hash,password[i]);
    }
    flag=1;
    in1>>name>>password_hash>>add_coin>>add_exp>>coin>>now_exp>>step>>slot>>now_lv>>rng_egg>>atk;
    if(now_password_hash!=password_hash)return 2;
    hash=hsh(hash,add_coin);
    hash=hsh(hash,add_exp);
    hash=hsh(hash,coin);
    hash=hsh(hash,now_exp);
    hash=hsh(hash,step);
    hash=hsh(hash,slot);
    hash=hsh(hash,now_lv);
    hash=hsh(hash,rng_egg);
    hash=hsh(hash,atk);
    for(int i=1;i<=slot;i++)
    {
        in1>>your_petal[i].id>>your_petal[i].rar;
        hash=hsh(hash,your_petal[i].id);
        hash=hsh(hash,your_petal[i].rar);
    }
    for(int i=1;i<=16;i++)
    {
        for(int j=1;j<=7;j++)
        {
            in1>>petal_number[i][j];
            hash=hsh(hash,petal_number[i][j]);
        }
    }
    in1>>world_boss_i>>world_boss_health;
    hash=hsh(hash,world_boss_i);
    hash=hsh(hash,world_boss_health);
    in1>>open_world_boss_flag;
    hash=hsh(hash,open_world_boss_flag);
    if(open_world_boss_flag)
    {
        in1>>last_time.wYear>>last_time.wMonth>>last_time.wDay;
        hash=hsh(hash,last_time.wYear);
        hash=hsh(hash,last_time.wMonth);
        hash=hsh(hash,last_time.wDay);
    }
    for(int i=1;i<=16;i++)
    {
        in1>>mob_defeted[i];
        hash=hsh(hash,mob_defeted[i]);
    }
    for(int i=1;i<=16;i++)
    {
        in1>>petal_lost_num[i];
        hash=hsh(hash,petal_lost_num[i]);
    }
    for(int i=1;i<=16;i++)
    {
        in1>>petal_get_num[i];
        hash=hsh(hash,petal_get_num[i]);
    }
    int acc_hash=0;
    in1>>acc_hash;
    if(hash!=acc_hash)return 3;
    slowout("Loading...\n",300);
    //system("pause");
    system("cls");
    slowout("Read successfully!\n",speed);
    for(int i=0;i<=7;i++)
    {
        for(int j=0;j<=16;j++)
        {
            if(petal_number[j][i])max_lv=max(max_lv,j);
        }
    }
    for(int i=1;i<=slot;i++)
    {
        max_lv=max(max_lv,your_petal[i].rar);
    }
    return 0;
}
signed main()
{
//  ios::sync_with_stdio(0);
//  cin.tie(0);
//  cout.tie(0);
    mt19937 myrng(time(0));
    slowout("Loading...\n",300);
    slowout("Do you want read ur account?(Y.yes other.no)\n",20);
    char loadacc;
    loadacc=_getch();
    if(loadacc=='Y'||loadacc=='y')
    {
        int ret=read_acc();
        if(ret==2)
        {
            slowout("Password wrong!\n",speed);
            return 0;
        }
        if(ret==3)
        {
            slowout("D O N ' T  C H A N G E  T H E  A C C O U N T \n",300);
            return 0;
        }
    }
    init();
    if(!flag)
    {
        slowout("This is florr.io!\nWelcome to play\nWhat is ur name\n",20);
        cin>>name;
        while(1)
        {
            slowout("Please type your password\n",20);
            string str;
            cin>>password;
            system("cls");
            slowout("Please type it again\n",20);
            cin>>str;
            if(str!=password)
            {
                slowout("Wrong password!\n",20);
            }
            else break;
        }
        system("cls");
        slowout("Welcome ",20);
        slowout(name,20);
        slowout(" to play this game\n",20);
    }
    else
    {
        slowout("This is florr.io!\n",20);
        slowout("Welcome ",20);
        slowout(name,20);
        slowout(" to play this game\n",20);
    }
    slowout("In this game,we have petal:air,basic,coin,exp,rock,jelly,wing,egg\n",20);
    char sped;
    while(1)
    {
        slowout("What cout speed will you choose:1.fast 2.medium 3.slow\n",20);
        sped=_getch();
        if(sped=='1')
        {
            speed=0;
        }
        if(sped=='2')
        {
            speed=10;
        }
        if(sped=='3')
        {
            speed=50;
        }
        slowout("Is this speed ok?(press y to continue)\n",speed);
        char xddd;
        xddd=_getch();
        if(xddd=='y'||xddd=='Y')
        {
            break;
        }
        system("pause");
        system("cls");
    }
    bool auto_save_flag=0;
    slowout("Do you need auto saving?If yes press Y.\n",speed);
    char auto_save_getch=_getch();
    if(auto_save_getch=='y'||auto_save_getch=='Y')
    {
        auto_save_flag=1;
    }
    system("cls");
    cout<<"so.";
    Sleep(500);
    system("cls");
    cout<<"so..";
    Sleep(500);
    system("cls");
    cout<<"so...";
    Sleep(500);
    system("cls");
    slowout("F U C K Y O U N E R D",100);
    Sleep(500);
    system("cls");
    if(!flag)
    {
        slowout("You have 5 common basic\n",speed);
        petal_number[1][1]+=5;
        petal_get_num[1]+=5;
        system("pause");
        system("cls");
    }
    int iiiii=0;
    while(1)
    {
        slowout(name+" what r u going to do now? G.keep going E.equip petals F.find mobs W.world boss I.check ur coin and lv C.craft A.absorb S.saving ur account\n",speed);
        char c;
        c=_getch();
        system("cls");
//      if(c=='D'||c=='d')
//      {
//          for(int i=1;i<=7;i++)
//          {
//              for(int j=1;j<=16;j++)
//              {
//                  petal_number[j][i]+=114514;
//              }
//          }
//          coin+=INF;
//          now_lv=250;
//          atk=1000000;
//      }
        if(c=='S'||c=='s')
        {
            save();
        }
        else if(c=='G'||c=='g')
        {
            if(step==100)
            {
                slowout("You cant keep going! Do sth else!\n",speed);
                system("pause");
                system("cls");
                continue;
            }
            coin+=add_coin;
            now_exp+=add_exp;
            if(myrng()%100<=39)
            {
                int egg_rng=myrng()%1000+1;
                if(egg_rng<=400)
                {
                    if(myrng()%2==1)coin+=rng_egg;
                    else now_exp+=rng_egg;
                }
                else if(egg_rng<=900)
                {
                    if(myrng()%2==1)coin+=rng_egg*3;
                    else now_exp+=rng_egg*3;
                }
                else if(egg_rng<=990)
                {
                    if(myrng()%2==1)coin+=rng_egg*10;
                    else now_exp+=rng_egg*10;
                }
                else
                {
                    if(myrng()%2==1)coin+=rng_egg*30;
                    else now_exp+=rng_egg*30;
                }
            }
            step++;
            slowout("You keep going...\n",speed);
        }
        else if(c=='E'||c=='e')
        {
            for(int i=0;i<=7;i++)
            {
                bool flag=0;
                for(int j=0;j<=16;j++)
                {
                    if(petal_number[j][i])
                    {
                        slowout("You have ",0); 
                        cout<<petal_number[j][i];
                        slowout(" "+rarity[j]+" "+petal[i]+"\n",0);
                        flag=1;
                    }
                }
                if(flag)cout<<"\n";
            }
            slowout("You have ",speed);
            cout<<slot;
            slowout(" slots\n",speed);
            slowout("They r :\n",speed);
            for(int i=1;i<=slot;i++)
            {
                slowout("| "+rarity[your_petal[i].rar]+" "+petal[your_petal[i].id]+" ",min(speed,(int)10));
            }
            cout<<"|\n";
            slowout("What do u want to choose?(use number to choose,like common basic change to first slot=common basic 1,unusual basic to second slot=unusual basic 2,common coin to first slot=common coin 1)\n",min(speed,(int)10));
            string r,p;
            int num;
            cin>>r>>p>>num;
            if(petal_number[rarity_id[r]][petal_id[p]]==0)
            {
                slowout("You dh any this petal!\n",speed);
                system("pause");
                system("cls");
                continue;
            }
            if(num>slot||num<1)
            {
                slowout("Error!\n",speed);
                system("pause");
                system("cls");
                continue;
            }
            petal_number[rarity_id[r]][petal_id[p]]--;
            petal_number[your_petal[num].rar][your_petal[num].id]++;
            if(your_petal[num].id==2)add_coin-=your_petal[num].rar;
            if(your_petal[num].id==3)add_exp-=your_petal[num].rar;
            if(your_petal[num].id==7)rng_egg-=egg[your_petal[num].rar];
            if(petal_id[p]==2)add_coin+=rarity_id[r];
            if(petal_id[p]==3)add_exp+=rarity_id[r];
            if(petal_id[p]==7)rng_egg+=egg[rarity_id[r]];
            atk+=rarity_id[r]+petal_atk[petal_id[p]]-your_petal[num].rar-petal_atk[your_petal[num].id];
            your_petal[num].rar=rarity_id[r];
            your_petal[num].id=petal_id[p];
            slowout("Change successfully!\n",speed);
        }
        else if(c=='I'||c=='i')
        {
            slowout("You have ",speed);
            cout<<coin;
            slowout(" coin and ",speed);
            cout<<now_exp;
            slowout(" exp and ur lv is ",speed);
            cout<<now_lv<<'\n';
            slowout("You have ",speed);
            cout<<slot;
            slowout(" slots\n",speed);
            slowout("They r :\n",speed);
            for(int i=1;i<=slot;i++)
            {
                slowout("| "+rarity[your_petal[i].rar]+" "+petal[your_petal[i].id]+" ",min(speed,(int)10));
            }
            cout<<"|\n";
            slowout("Your atk is ",speed);
            cout<<atk<<'\n';
            slowout("    mob defeted        petal got        petal lost\n",speed);
            for(int i=1;i<=16;i++)
            {
                cout<<setw(15)<<mob_defeted[i]<<"    ";
                cout<<setw(13)<<petal_get_num[i]<<"    ";
                cout<<setw(14)<<petal_lost_num[i]<<"    ("<<rarity[i]<<")\n";
            }
        }
        else if(c=='F'||c=='f')
        {
            step=0;
            int mob_r=myrng()%(min(max_lv+3,(int)16))+1,mob_i=myrng()%6+1,chance=0,extra_drop=1,bomb=0;
            double now_health;
            now_health=mob_health[mob_i]*rar_health[mob_r];
            slowout("You found a "+rarity[mob_r]+" "+mob[mob_i]+"!\n",speed);
            slowout("You have ",speed);
            if(atk<mob_def[mob_r][mob_i]-15)
            {
                chance=0;
            }
            else if(atk<mob_def[mob_r][mob_i]-10)
            {
                chance=5;
            }
            else if(atk<mob_def[mob_r][mob_i]-7)
            {
                chance=15;
            }
            else if(atk<mob_def[mob_r][mob_i]-4)
            {
                chance=30;
            }
            else if(atk<mob_def[mob_r][mob_i]-2)
            {
                chance=50;
            }
            else if(atk<=mob_def[mob_r][mob_i]+1)
            {
                chance=80;
            }
            else
            {
                chance=100;
            }
            if(atk>=mob_def[mob_r][mob_i]+6)bomb=1;
            if(atk>=mob_def[mob_r][mob_i]+12)extra_drop=2;
            cout<<chance;
            slowout("% chance to hit this mob!\n",speed);
            if(bomb==1)
            {
                slowout("And u may get extra drop from the mob!\n",speed);
            }
            if(extra_drop>1)
            {
                slowout("And u have the extra drop!\n",speed);
            }
            char ke;
            slowout("Do you need auto attack?If yes,press T ,if u want run away,press a key that is not T and not A.\n",speed);
            ke=_getch();
            if(ke=='t'||ke=='T')
            {
                if(chance==0)
                {
                    slowout("You can't auto attack a mob that have 0% chance to get hit!It only waste your coin\n",speed);
                }
                else
                {
                    system("cls");
                    int hit_time=0;
                    while(1)
                    {
                        hit_time++;
                        if(now_health<=0)
                        {
                            slowout("You win!\n",speed);
                            break;
                        }
                        if(hit_time%100==0)
                        {
                            slowout("Your atk is ",speed);
                            cout<<atk;
                            slowout(", and the mob have ",speed);
                            cout<<now_health;
                            slowout(" health, and you have ",speed);
                            cout<<coin;
                            slowout(" coin now\n",speed);
                        }
                        if(coin<mob_r*5)
                        {
                            slowout("You dh enough coin!\n",speed);
                            break;
                        }
                        int rng=myrng()%100+1;
                        if(rng<=chance)
                        {
                            now_health-=atk;
                            if(hit_time%500==0)slowout("Attack successfully!\n",speed);
                        }
                        else
                        {
                            coin-=mob_r*5;
                            if(hit_time%500==0)slowout("You lost coin!\n",speed);
                        }
                        if(hit_time%100==0)
                        {
                            Sleep(500);
                            system("cls");
                        }
                    }
                }
            }
            else if(ke!='A'&&ke!='a')
            {
                slowout("You run away...\n",speed);
            }
            else
            {
                bool flag=1;
                while(1)
                {
                    if(now_health<=0)
                    {
                        slowout("You win!\n",speed);
                        break;
                    }
                    slowout("Your atk is ",speed);
                    cout<<atk;
                    slowout(", and the mob have ",speed);
                    cout<<now_health;
                    slowout(" health, and you have ",speed);
                    cout<<coin;
                    slowout(" coin now\n",speed);
                    slowout("Press r to run away,other key to attack\n",speed);
                    if(flag!=1)ke=_getch();
                    flag=0;
                    if(ke!='R'&&ke!='r')
                    {
                        if(coin<mob_r*5)
                        {
                            slowout("You dh enough coin!\n",speed);
                            break;
                        }
                        int rng=myrng()%100+1;
                        if(rng<=chance)
                        {
                            now_health-=atk;
                            slowout("Attack successfully!\n",speed);
                        }
                        else
                        {
                            coin-=mob_r*5;
                            slowout("You lost coin!\n",speed);
                        }
                    }
                    else
                    {
                        slowout("You run away...\n",speed);
                        break;
                    }
                    system("pause");
                    system("cls");
                }
            }
            if(now_health<=0)
            {
                mob_defeted[mob_r]++;
                int rng=myrng()%1000+1,bomb_rng=myrng()%16;
                if(bomb==0)bomb_rng=17;
                if(bomb_rng<4)
                {
                    if(bomb_rng==0)extra_drop*=5;
                    else extra_drop*=3;
                }
                if(mob_r==9)
                {
                    if(rng==1000)
                    {
                        petal_get_num[8]+=extra_drop;
                        petal_number[8][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[8]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else
                    {
                        petal_get_num[7]+=extra_drop;
                        petal_number[7][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[7]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                }
                else if(mob_r==8)
                {
                    if(rng<=200)
                    {
                        petal_get_num[7]+=extra_drop;
                        petal_number[7][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[7]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else
                    {
                        petal_get_num[6]+=extra_drop;
                        petal_number[6][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[6]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                }
                else if(mob_r==7)
                {
                    if(rng==1)
                    {
                        petal_get_num[7]+=extra_drop;
                        petal_number[7][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[7]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else if(rng<=100)
                    {
                        petal_get_num[6]+=extra_drop;
                        petal_number[6][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[6]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else
                    {
                        petal_get_num[5]+=extra_drop;
                        petal_number[5][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[5]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                }
                else if(mob_r==6)
                {
                    if(rng<=4)
                    {
                        petal_get_num[6]+=extra_drop;
                        petal_number[6][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[6]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else if(rng<=850)
                    {
                        petal_get_num[5]+=extra_drop;
                        petal_number[5][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[5]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else
                    {
                        petal_get_num[4]+=extra_drop;
                        petal_number[4][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[4]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                }
                else if(mob_r==5)
                {
                    if(rng<=15)
                    {
                        petal_get_num[5]+=extra_drop;
                        petal_number[5][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[5]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else if(rng<=950)
                    {
                        petal_get_num[4]+=extra_drop;
                        petal_number[4][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[4]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else
                    {
                        petal_get_num[3]+=extra_drop;
                        petal_number[3][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[3]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                }
                else if(mob_r==4)
                {
                    if(rng<=50)
                    {
                        petal_get_num[4]+=extra_drop;
                        petal_number[4][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[4]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else if(rng<=990)
                    {
                        petal_get_num[3]+=extra_drop;
                        petal_number[3][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[3]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else
                    {
                        petal_get_num[2]+=extra_drop;
                        petal_number[2][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[2]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                }
                else if(mob_r==3)
                {
                    if(rng<=200)
                    {
                        petal_get_num[3]+=extra_drop;
                        petal_number[3][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[3]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else
                    {
                        petal_get_num[2]+=extra_drop;
                        petal_number[2][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[2]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                }
                else if(mob_r==2)
                {
                    if(rng<=400)
                    {
                        petal_get_num[2]+=extra_drop;
                        petal_number[2][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[2]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else
                    {
                        petal_get_num[1]+=extra_drop;
                        petal_number[1][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[1]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                }
                else if(mob_r==1)
                {
                    if(rng<=900)
                    {
                        petal_get_num[1]+=extra_drop;
                        petal_number[1][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[1]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else
                    {
                        slowout("You got nothing!\n",speed);
                    }
                }
                else if(mob_r==10)
                {
                    if(rng<=20)
                    {
                        petal_get_num[8]+=extra_drop;
                        petal_number[8][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[8]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else
                    {
                        petal_get_num[7]+=extra_drop;
                        petal_number[7][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[7]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                }
                else if(mob_r==11)
                {
                    if(rng<=500)
                    {
                        petal_get_num[8]+=extra_drop;
                        petal_number[8][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[8]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else
                    {
                        petal_get_num[7]+=extra_drop;
                        petal_number[7][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[7]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                }
                else if(mob_r==12)
                {
                    if(rng==1000)
                    {
                        petal_get_num[9]+=extra_drop;
                        petal_number[9][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[9]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else if(rng>=100)
                    {
                        petal_get_num[8]+=extra_drop;
                        petal_number[8][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[8]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else
                    {
                        petal_get_num[7]+=extra_drop;
                        petal_number[7][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[7]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                }
                else if(mob_r==13)
                {
                    if(rng<=50)
                    {
                        petal_get_num[9]+=extra_drop;
                        petal_number[9][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[9]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else if(rng)
                    {
                        petal_get_num[8]+=extra_drop;
                        petal_number[8][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[8]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                }
                else if(mob_r==14)
                {
                    if(rng<=400)
                    {
                        petal_get_num[9]+=extra_drop;
                        petal_number[9][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[9]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else
                    {
                        petal_get_num[8]+=extra_drop;
                        petal_number[8][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[8]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                }
                else if(mob_r==15)
                {
                    if(rng==1000)
                    {
                        petal_get_num[10]+=extra_drop;
                        petal_number[10][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[10]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else if(rng<=800)
                    {
                        petal_get_num[9]+=extra_drop;
                        petal_number[9][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[9]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else
                    {
                        petal_get_num[8]+=extra_drop;
                        petal_number[8][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[8]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                }
                else if(mob_r==16)
                {
                    if(rng==1)
                    {
                        petal_get_num[11]+=extra_drop;
                        petal_number[11][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[11]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else if(rng<=100)
                    {
                        petal_get_num[10]+=extra_drop;
                        petal_number[10][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[10]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                    else
                    {
                        petal_get_num[9]+=extra_drop;
                        petal_number[9][mob_petal[mob_i]]+=extra_drop;
                        slowout("You got:"+drop[extra_drop]+" "+rarity[9]+" "+petal[mob_petal[mob_i]]+".\n",speed);
                    }
                }
            }
        }
        else if(c=='C'||c=='c')
        {
            for(int i=0;i<=7;i++)
            {
                bool flag=0;
                for(int j=0;j<=16;j++)
                {
                    if(petal_number[j][i]>=5)
                    {
                        slowout("You have ",0); 
                        cout<<petal_number[j][i];
                        slowout(" "+rarity[j]+" "+petal[i]+"\n",0);
                        flag=1;
                    }
                }
                if(flag)cout<<"\n";
            }
            slowout("What petal will you want craft?(like craft 5 common basic=common basic 5,at least craft 5 petals)\n",speed);
            string r,p;
            int num;
            cin>>r>>p>>num;
            if(num<5||petal_number[rarity_id[r]][petal_id[p]]<num)
            {
                slowout("Error!\n",speed);
            }
            else
            {
                int craft_num=0,now_petal_number=num;
                while(now_petal_number>=5)
                {
                    int rng=myrng()%100000+1;
                    if(rng<=crafting_rate[rarity_id[r]])
                    {
                        craft_num++;
                        now_petal_number-=5;
                        petal_lost_num[rarity_id[r]]+=5;
                        petal_get_num[rarity_id[r]+1]+=1;
                    }
                    else
                    {
                        int losttt=myrng()%4+1;
                        petal_lost_num[rarity_id[r]]+=losttt;
                        now_petal_number-=losttt;
                    }
                }
                slowout("You crafted ",speed);
                cout<<craft_num;
                slowout(" "+rarity[rarity_id[r]+1]+" "+p+", and you lost ",speed);
                cout<<num-now_petal_number;
                slowout(" "+r+" "+p+".\n",speed);
                petal_number[rarity_id[r]][petal_id[p]]-=num-now_petal_number;
                petal_number[rarity_id[r]+1][petal_id[p]]+=craft_num;
            }
        }
        else if(c=='A'||c=='a')
        {
            for(int i=0;i<=7;i++)
            {
                bool flag=0;
                for(int j=0;j<=16;j++)
                {
                    if(petal_number[j][i])
                    {
                        slowout("You have ",0); 
                        cout<<petal_number[j][i];
                        slowout(" "+rarity[j]+" "+petal[i]+"\n",0);
                        flag=1;
                    }
                }
                if(flag)cout<<"\n";
            }
            slowout("What petal will you absorb?(like absorb 1 common basic=common basic 1)\n",speed);
            string p,r;
            int num;
            cin>>r>>p>>num;
            if(petal_number[rarity_id[r]][petal_id[p]]<num||num<0)
            {
                slowout("Error!\n",speed);
            }
            else
            {
                petal_number[rarity_id[r]][petal_id[p]]-=num;
                petal_lost_num[rarity_id[r]]+=num;
                now_exp+=num*petal_exp[rarity_id[r]];
                slowout("You got: ",speed);
                cout<<num*petal_exp[rarity_id[r]];
                slowout(" exp.\n",speed);
                while(now_lv<250&&now_exp>=expp[now_lv])
                {
                    now_exp-=expp[now_lv];
                    slowout("Lv up! Now u r ",speed);
                    now_lv++;
                    cout<<now_lv;
                    slowout(" lv now\n",speed);
                }
            }
        }
        else if(c=='W'||c=='w')
        {
            if(atk<=220)
            {
                slowout("Your atk too low!Go play more and then come kill world boss.\n",speed);
            }
            else
            {
                SYSTEMTIME time;
                GetLocalTime(&time);
                if((!open_world_boss_flag)||time.wDay>last_time.wDay||time.wMonth>last_time.wMonth||time.wYear>last_time.wYear)
                {
                    world_boss_i=myrng()%6+1;
                    world_boss_health=world_boss_mob_health[world_boss_i]*10000000;
                    last_time=time;
                    save(0);
                }
                if(world_boss_health<=0)
                {
                    slowout("Today world mob is already died!Come next day!\n",speed);
                }
                else
                {
                    open_world_boss_flag=1;
                    int chance=(atk-220)*10;
                    while(1)
                    {
                        if(world_boss_health<=0)
                        {
                            break;
                        }
                        slowout("Now world boss: "+mob[world_boss_i]+"\n",speed);
                        slowout("Your atk is ",speed);
                        cout<<atk;
                        slowout(", and the world boss have ",speed);
                        cout<<world_boss_health;
                        slowout(" health, and you have ",speed);
                        cout<<coin;
                        slowout(" coin now\n",speed);
                        slowout("You have ",speed);
                        cout<<chance*1.0/100;
                        slowout("% chance to hit the world boss\n",speed);
                        slowout("Press r to run away,other key to attack\n",speed);
                        char ke=_getch();
                        if(ke!='R'&&ke!='r')
                        {
                            if(coin<100)
                            {
                                slowout("You dh enough coin!\n",speed);
                                break;
                            }
                            int rng=myrng()%10000+1;
                            if(rng<=chance)
                            {
                                world_boss_health-=atk;
                                slowout("Attack successfully!\n",speed);
                            }
                            else
                            {
                                coin-=100;
                                slowout("You lost coin!\n",speed);
                            }
                        }
                        else
                        {
                            slowout("You run away...\n",speed);
                            break;
                        }
                        system("pause");
                        system("cls");
                    }
                    if(world_boss_health<=0)
                    {
                        int rng=myrng()%10000;
                        slowout("A boss "+mob[world_boss_i]+" has been defeted by "+name+"!\n",50);
                        Sleep(1000);
                        if(rng==0)
                        {
                            petal_get_num[15]+=1;
                            petal_number[15][mob_petal[world_boss_i]]+=1;
                            slowout("You got:1 "+rarity[15]+" "+petal[mob_petal[world_boss_i]]+".\n",speed);
                        }
                        else if(rng<=10)
                        {
                            petal_get_num[14]+=1;
                            petal_number[14][mob_petal[world_boss_i]]+=1;
                            slowout("You got:1 "+rarity[14]+" "+petal[mob_petal[world_boss_i]]+".\n",speed);
                        }
                        else if(rng<=200)
                        {
                            petal_get_num[13]+=1;
                            petal_number[13][mob_petal[world_boss_i]]+=1;
                            slowout("You got:1 "+rarity[13]+" "+petal[mob_petal[world_boss_i]]+".\n",speed);
                        }
                        else if(rng<=2000)
                        {
                            petal_get_num[12]+=1;
                            petal_number[12][mob_petal[world_boss_i]]+=1;
                            slowout("You got:1 "+rarity[12]+" "+petal[mob_petal[world_boss_i]]+".\n",speed);
                        }
                        else if(rng<=9800)
                        {
                            petal_get_num[11]+=1;
                            petal_number[11][mob_petal[world_boss_i]]+=1;
                            slowout("You got:1 "+rarity[11]+" "+petal[mob_petal[world_boss_i]]+".\n",speed);
                        }
                        else
                        {
                            petal_get_num[10]+=1;
                            petal_number[10][mob_petal[world_boss_i]]+=1;
                            slowout("You got:1 "+rarity[10]+" "+petal[mob_petal[world_boss_i]]+".\n",speed);
                        }
                    }
                }
            }
        }
        else
        {
            cout<<"Wrong key!\n"; 
        }
        while(now_lv<250&&now_exp>=expp[now_lv])
        {
            now_exp-=expp[now_lv];
            slowout("Lv up! Now u r ",speed);
            now_lv++;
            cout<<now_lv;
            slowout(" lv now\n",speed);
        }
        for(int i=0;i<=7;i++)
        {
            for(int j=0;j<=16;j++)
            {
                if(petal_number[j][i])max_lv=max(max_lv,j);
            }
        }
        for(int i=1;i<=slot;i++)
        {
            max_lv=max(max_lv,your_petal[i].rar);
        }
        slot=min((int)10,max((int)0,(now_lv-50)/20))+min(now_lv/10,(int)5)+5;
        iiiii++;
        iiiii%=10;
        if(iiiii==0&&auto_save_flag)
        {
            save();
            slowout("(auto saving)\n",speed);
        }
        system("pause");
        system("cls");
    }
    return 0;
}

更新中代码:

#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
#include<ctime>
#include<stdio.h>
#include<time.h>
#define int long long
#define debug() cout<<"come here\n"
#define INF 0x3f3f3f3f3f3f3f3f
#define pii pair<int,int>
#define pb push_back
using namespace std;
int qpow(int a,int b,int p)
{
    int ret=1;
    while(b)
    {
        if(b&1)ret=(ret*a)%p;
        a=(a*a)%p;
        b>>=1;
    }
    return ret;
}
void slowout(string s,int x)
{
    for(int i=0;i<s.size();i++)
    {
        Sleep(x);
        cout<<s[i];
    }
}
const int MOD=1145141923;
string password;
int speed=50;
string name;
int rar_health[21]={0,10,};
int crafting_rate[21]={0,64000,32000,16000,8000,4000,2000,1000};
string drop[11]={"0","1","2","3","4","5","6","7","8","9","10"};
map<string,int> petal_id,mob_id;
string rarity[21]={"unknown","common","unusual","rare","epic","legendary","mythic","ultra","super","unique"};
int cnt_rar=9;
map<string,int> rarity_id;
vector<int> petal_number[21];
double expp[5001];
int init()
{
    ifstream in1("Game_Data.ini");
    if (!in1)
    {
        slowout("You need to have the game data first!Name it Game_Data.ini qwq!\n",speed);
        return 1;                   
    }
    for(int i=0;i<=cnt_rar;i++)
    {
        rarity_id[rarity[i]]=i;
    }
    expp[1]=10;
    for(int i=2;i<=5000;i++)
    {
        if(i<=30)expp[i]=expp[i-1]*1.2;
        else if(i<=50) expp[i]=expp[i-1]*1.15;
        else expp[i]=expp[i-1]*1.1;
    }
    petal_number[0][0]=10;
}
int coin,now_exp,step,slot=5,now_lv=1;
int mob_defeted[17];
int petal_get_num[17];
int petal_lost_num[17];
bool flag=0;
double atk;
struct node{
    int id;
    int rar;
};
node your_petal[21];
int hsh(int x,int y)
{
    while(y)
    {
        x=(131*x+y%10)%MOD;
        y/=10;
    }
    return x;
}
void save(bool cout_flag=1)
{
    ofstream out1("Data.ini");
    int hash=0,password_hash=0;
    for(int i=0;i<password.size();i++)
    {
        password_hash=hsh(password_hash,password[i]);
    }
    out1<<name<<' '<<password_hash<<' '<<coin<<' '<<now_exp<<' '<<step<<' '<<slot<<' '<<now_lv<<' '<<atk<<' ';
    hash=hsh(hash,coin);
    hash=hsh(hash,now_exp);
    hash=hsh(hash,step);
    hash=hsh(hash,slot);
    hash=hsh(hash,now_lv);
    hash=hsh(hash,atk);
    for(int i=1;i<=slot;i++)
    {
        out1<<your_petal[i].id<<' '<<your_petal[i].rar<<' ';
        hash=hsh(hash,your_petal[i].id);
        hash=hsh(hash,your_petal[i].rar);
    }
    if(cout_flag)slowout("Saving successfully!\n",speed);
    for(int i=1;i<=cnt_rar;i++)
    {
        for(auto pn:petal_number[i])
        {
            out1<<pn<<' ';
            hash=hsh(hash,pn[i][j]);
        }
    }
    for(int i=1;i<=cnt_rar;i++)
    {
        out1<<mob_defeted[i]<<' ';
        hash=hsh(hash,mob_defeted[i]);
    }
    for(int i=1;i<=cnt_rar;i++)
    {
        out1<<petal_lost_num[i]<<' ';
        hash=hsh(hash,petal_lost_num[i]);
    }
    for(int i=1;i<=cnt_rar;i++)
    {
        out1<<petal_get_num[i]<<' ';
        hash=hsh(hash,petal_get_num[i]);
    }
    out1<<hash<<' ';
}
int read_acc()
{
    ifstream in1("Data.ini");
    if (!in1)
    {
        slowout("You need to have a saving first!\n",speed);
        return 1;                   
    }
    slowout("Password:",speed);
    cin>>password;
    int hash=0,now_password_hash=0,password_hash=0;
    for(int i=0;i<password.size();i++)
    {
        now_password_hash=hsh(now_password_hash,password[i]);
    }
    flag=1;
    in1>>name>>password_hash>>coin>>now_exp>>step>>slot>>now_lv>>atk;
    if(now_password_hash!=password_hash)return 2;
    hash=hsh(hash,coin);
    hash=hsh(hash,now_exp);
    hash=hsh(hash,step);
    hash=hsh(hash,slot);
    hash=hsh(hash,now_lv);
    hash=hsh(hash,atk);
    for(int i=1;i<=slot;i++)
    {
        in1>>your_petal[i].id>>your_petal[i].rar;
        hash=hsh(hash,your_petal[i].id);
        hash=hsh(hash,your_petal[i].rar);
    }
    for(int i=1;i<=cnt_rar;i++)
    {
        for(int j=0;j<petal_numbet[i].size();j++)
        {
            in1>>petal_number[i][j];
            hash=hsh(hash,petal_number[i][j]);
        }
    }
    for(int i=1;i<=cnt_rar;i++)
    {
        in1>>mob_defeted[i];
        hash=hsh(hash,mob_defeted[i]);
    }
    for(int i=1;i<=cnt_rar;i++)
    {
        in1>>petal_lost_num[i];
        hash=hsh(hash,petal_lost_num[i]);
    }
    for(int i=1;i<=cnt_rar;i++)
    {
        in1>>petal_get_num[i];
        hash=hsh(hash,petal_get_num[i]);
    }
    int acc_hash=0;
    in1>>acc_hash;
    if(hash!=acc_hash)return 3;
    slowout("Loading...\n",300);
    system("cls");
    slowout("Read successfully!\n",speed);
    return 0;
}
signed main()
{
//  ios::sync_with_stdio(0);
//  cin.tie(0);
//  cout.tie(0);
    init();
    mt19937 myrng(time(0));
    slowout("Loading...\n",300);
    slowout("Do you want read ur account?(Y.yes other.no)\n",20);
    char loadacc;
    loadacc=_getch();
    if(loadacc=='Y'||loadacc=='y')
    {
        int ret=read_acc();
        if(ret==2)
        {
            slowout("Password wrong!\n",speed);
            return 0;
        }
        if(ret==3)
        {
            slowout("D O N ' T  C H A N G E  T H E  A C C O U N T \n",300);
            return 0;
        }
    }
    if(!flag)
    {
        slowout("This is florr.io!\nWelcome to play\nWhat is ur name\n",20);
        cin>>name;
        while(1)
        {
            slowout("Please type your password\n",20);
            string str;
            cin>>password;
            system("cls");
            slowout("Please type it again\n",20);
            cin>>str;
            if(str!=password)
            {
                slowout("Wrong password!\n",20);
            }
            else break;
        }
        system("cls");
        slowout("Welcome ",20);
        slowout(name,20);
        slowout(" to play this game\n",20);
    }
    else
    {
        slowout("This is florr.io!\n",20);
        slowout("Welcome ",20);
        slowout(name,20);
        slowout(" to play this game\n",20);
    }
    char sped;
    while(1)
    {
        slowout("What cout speed will you choose:1.fast 2.medium 3.slow\n",20);
        sped=_getch();
        if(sped=='1')
        {
            speed=0;
        }
        if(sped=='2')
        {
            speed=10;
        }
        if(sped=='3')
        {
            speed=50;
        }
        slowout("Is this speed ok?(press y to continue)\n",speed);
        char xddd;
        xddd=_getch();
        if(xddd=='y'||xddd=='Y')
        {
            break;
        }
        system("pause");
        system("cls");
    }
    bool auto_save_flag=0;
    slowout("Do you need auto saving?If yes press Y.\n",speed);
    char auto_save_getch=_getch();
    if(auto_save_getch=='y'||auto_save_getch=='Y')
    {
        auto_save_flag=1;
    }
    system("cls");
    if(!flag)
    {
        slowout("You have 5 common basic\n",speed);
        petal_number[1][1]+=5;
        petal_get_num[1]+=5;
        system("pause");
        system("cls");
    }
    int iiiii=0;
    while(1)
    {
        slowout(name+" what r u going to do now? G.get coins E.equip petals F.world I.check ur coin and lv C.craft S.saving ur account\n",speed);
        char c;
        c=_getch();
        system("cls");
//      if(c=='D'||c=='d')
//      {
//          for(int i=1;i<=7;i++)
//          {
//              for(int j=1;j<=cnt_rar;j++)
//              {
//                  petal_number[j][i]+=114514;
//              }
//          }
//          coin+=INF;
//          now_lv=250;
//          atk=1000000;
//      }
        if(c=='S'||c=='s')
        {
            save();
        }
        else if(c=='G'||c=='g')
        {
            int add_coin=1,add_exp=1;

            coin+=add_coin;
            now_exp+=add_exp;
            step++;
            slowout("You keep going...\n",speed);
        }
        else if(c=='E'||c=='e')
        {
            for(int i=0;i<petal_number[0].size();i++)
            {
                bool flag=0;
                for(int j=0;j<=cnt_rar;j++)
                {
                    if(petal_number[j][i])
                    {
                        slowout("You have ",0); 
                        cout<<petal_number[j][i];
                        slowout(" "+rarity[j]+" "+petal[i]+"\n",0);
                        flag=1;
                    }
                }
                if(flag)cout<<"\n";
            }
            slowout("You have ",speed);
            cout<<slot;
            slowout(" slots\n",speed);
            slowout("They r :\n",speed);
            for(int i=1;i<=slot;i++)
            {
                slowout("| "+rarity[your_petal[i].rar]+" "+petal[your_petal[i].id]+" ",min(speed,(int)10));
            }
            cout<<"|\n";
            slowout("What do u want to choose?(use number to choose,like common basic change to first slot=common basic 1,unusual basic to second slot=unusual basic 2,common coin to first slot=common coin 1)\n",min(speed,(int)10));
            string r,p;
            int num;
            cin>>r>>p>>num;
            if(petal_number[rarity_id[r]][petal_id[p]]<=0)
            {
                slowout("You dh any this petal!\n",speed);
                system("pause");
                system("cls");
                continue;
            }
            if(num>slot||num<1)
            {
                slowout("Error!\n",speed);
                system("pause");
                system("cls");
                continue;
            }
            petal_number[rarity_id[r]][petal_id[p]]--;
            petal_number[your_petal[num].rar][your_petal[num].id]++;
            atk+=rarity_id[r]+petal_atk[petal_id[p]]-your_petal[num].rar-petal_atk[your_petal[num].id];
            your_petal[num].rar=rarity_id[r];
            your_petal[num].id=petal_id[p];
            slowout("Change successfully!\n",speed);
        }
        else if(c=='I'||c=='i')
        {
            slowout("You have ",speed);
            cout<<coin;
            slowout(" coin and ",speed);
            cout<<now_exp;
            slowout(" exp and ur lv is ",speed);
            cout<<now_lv<<'\n';
            slowout("You have ",speed);
            cout<<slot;
            slowout(" slots\n",speed);
            slowout("They r :\n",speed);
            for(int i=1;i<=slot;i++)
            {
                slowout("| "+rarity[your_petal[i].rar]+" "+petal[your_petal[i].id]+" ",min(speed,(int)10));
            }
            cout<<"|\n";
            slowout("Your atk is ",speed);
            cout<<atk<<'\n';
            slowout("    mob defeted        petal got        petal lost\n",speed);
            for(int i=1;i<=cnt_rar;i++)
            {
                cout<<setw(15)<<mob_defeted[i]<<"    ";
                cout<<setw(13)<<petal_get_num[i]<<"    ";
                cout<<setw(14)<<petal_lost_num[i]<<"    ("<<rarity[i]<<")\n";
            }
        }
        else if(c=='F'||c=='f')
        {
            //fighting
        }
        else if(c=='C'||c=='c')
        {
            for(int i=0;i<petal_number[0].size();i++)
            {
                bool flag=0;
                for(int j=0;j<=cnt_rar;j++)
                {
                    if(petal_number[j][i]>=5)
                    {
                        slowout("You have ",0); 
                        cout<<petal_number[j][i];
                        slowout(" "+rarity[j]+" "+petal[i]+"\n",0);
                        flag=1;
                    }
                }
                if(flag)cout<<"\n";
            }
            slowout("What petal will you want craft?(like craft 5 common basic=common basic 5,at least craft 5 petals)\n",speed);
            string r,p;
            int num;
            cin>>r>>p>>num;
            if(num<5||petal_number[rarity_id[r]][petal_id[p]]<num)
            {
                slowout("Error!\n",speed);
            }
            else
            {
                int craft_num=0,now_petal_number=num;
                while(now_petal_number>=5)
                {
                    int rng=myrng()%100000+1;
                    if(rng<=crafting_rate[rarity_id[r]])
                    {
                        craft_num++;
                        now_petal_number-=5;
                        petal_lost_num[rarity_id[r]]+=5;
                        petal_get_num[rarity_id[r]+1]+=1;
                    }
                    else
                    {
                        int losttt=myrng()%4+1;
                        petal_lost_num[rarity_id[r]]+=losttt;
                        now_petal_number-=losttt;
                    }
                }
                slowout("You crafted ",speed);
                cout<<craft_num;
                slowout(" "+rarity[rarity_id[r]+1]+" "+p+", and you lost ",speed);
                cout<<num-now_petal_number;
                slowout(" "+r+" "+p+".\n",speed);
                petal_number[rarity_id[r]][petal_id[p]]-=num-now_petal_number;
                petal_number[rarity_id[r]+1][petal_id[p]]+=craft_num;
            }
        }
        else
        {
            cout<<"Wrong key!\n"; 
        }
        while(now_lv<5000&&now_exp>=expp[now_lv])
        {
            now_exp-=expp[now_lv];
            slowout("Lv up! Now u r ",speed);
            now_lv++;
            cout<<now_lv;
            slowout(" lv now\n",speed);
        }
        iiiii++;
        iiiii%=10;
        if(iiiii==0&&auto_save_flag)
        {
            save();
            slowout("(auto saving)\n",speed);
        }
        system("pause");
        system("cls");
    }
    return 0;
}