- BC20260086's blog
florr.io c++版
- 2024-10-24 14:28:39 @
搬运于洛谷
#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];
}
}
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;
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];
void save(bool cout_flag=1)
{
ofstream out1("Data.ini");
out1<<name<<' '<<add_coin<<' '<<add_exp<<' '<<coin<<' '<<now_exp<<' '<<step<<' '<<slot<<' '<<now_lv<<' '<<rng_egg<<' '<<atk<<' ';
for(int i=1;i<=slot;i++)
{
out1<<your_petal[i].id<<' '<<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]<<' ';
}
}
out1<<world_boss_i<<' '<<world_boss_health<<' ';
out1<<open_world_boss_flag<<' ';
if(open_world_boss_flag)out1<<last_time.wYear<<' '<<last_time.wMonth<<' '<<last_time.wDay<<' '<<last_time.wHour<<' '<<last_time.wMinute<<' '<<last_time.wSecond;
}
void read()
{
ifstream in1("Data.ini");
if (!in1)
{
slowout("You need to have a saving first!\n",speed);
return ;
}
flag=1;
in1>>name>>add_coin>>add_exp>>coin>>now_exp>>step>>slot>>now_lv>>rng_egg>>atk;
for(int i=1;i<=slot;i++)
{
in1>>your_petal[i].id>>your_petal[i].rar;
}
for(int i=1;i<=16;i++)
{
for(int j=1;j<=7;j++)
{
in1>>petal_number[i][j];
}
}
in1>>world_boss_i>>world_boss_health;
in1>>open_world_boss_flag;
if(open_world_boss_flag)
{
in1>>last_time.wYear>>last_time.wMonth>>last_time.wDay>>last_time.wHour>>last_time.wMinute>>last_time.wSecond;
}
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);
}
}
}
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')
{
read();
}
init();
if(!flag)
{
slowout("This is florr.io!\nWelcome to play\nWhat is ur name\n",20);
cin>>name;
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;
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';
}
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
{
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);
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);
}
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)
{
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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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])
{
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;
}
else
{
now_petal_number-=myrng()%4+1;
}
}
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;
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_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_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_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_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<=9900)
{
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_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);
}
}
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;
}