735235=(114514+114514)(11*-4+51-4)+11451*4+114*5*1*4+1-1*4+5*14
hmwzd1314记录:
8.13橙名力(喜)
测,掉分力 : (
从209掉下来力 : (
诶嘿,204了
测,188了
170 极限
nnd 掉绿了 2023.12.31 首紫P4318
自己写的小游戏
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
struct node
{
string name;
int damage,fast;
};
node gun[]={{"AKM",30,300},{"98K",80,900},{"P90",10,200},{"M416",20,200}};
const int gun_size=4;
int gun_num[gun_size+9];
int pos,sum=1;
int player_cl;
void sta()
{
pos=rand()%gun_size;
gun_num[pos]++;
for(int i=0;i<gun_size;i++)if(gun_num[i]>0)cout<<"您有"<<gun_num[i]<<"把"<<gun[i].name<<",伤害为"<<gun[i].damage<<",射速为"<<gun[i].fast<<"毫秒每发\n";
}
int gcd(int a,int b){return b==0?a:gcd(b,a%b);}
int lcm(int a,int b){return a*b/gcd(a,b);}
bool fire()
{
srand(time(NULL));
int pos_em=rand()%gun_size;
int num_em=rand()%sum+1;
int cl_em=rand()%(player_cl+2)+1;
cout<<"您有"<<gun_num[pos]<<"把"<<gun[pos].name<<",伤害为"<<gun[pos].damage<<",射速为"<<gun[pos].fast<<"毫秒每发\n";
cout<<"敌人有"<<num_em<<"把"<<gun[pos_em].name<<",伤害为"<<gun[pos_em].damage<<",射速为"<<gun[pos_em].fast<<"毫秒每发,护甲值为"<<cl_em<<"是否选择与其搏斗?\n按1搏斗,否则按2";
int player_ans;
cin>>player_ans;
int player_hp=100,em_hp=100;
if(player_ans==1)
{
int g=gcd(gun[pos].fast,gun[pos_em].fast);
int tim=0;
while(player_hp>0&&em_hp>0)
{
int old_player=player_hp,old_em=em_hp;
tim+=g;
if(tim%gun[pos].fast==0)
{
if(rand()%10==0)cout<<"敌人躲开了您的一次攻击\n";
else em_hp-=max(0,gun[pos].damage*gun_num[pos]-cl_em);
}
if(tim%gun[pos_em].fast==0)
{
if(rand()%10==0)cout<<"您躲开了敌人的一次攻击\n";
else player_hp-=max(0,gun[pos_em].damage*num_em-player_cl);
}
if(old_player!=player_hp||old_em!=em_hp)cout<<"您还剩"<<player_hp<<"点血量\n"<<"敌人还剩"<<em_hp<<"点血量\n";
}
if(player_hp>=em_hp)
{
cout<<"您击败了敌人,获得了敌人的"<<gun[pos_em].name<<",并获得了敌人的护甲";
gun_num[pos_em]+=num_em;
sum+=num_em;
player_cl+=cl_em;
cout<<",当前护甲值为"<<player_cl<<"\n";
for(int i=0;i<gun_size;i++)
{
if(gun_num[i]<=0)continue;
cout<<"您有"<<gun_num[i]<<"把"<<gun[i].name<<",编号为"<<i<<"\n";
}
cout<<"请输入您要使用的枪的编号\n";
cin>>player_ans;
pos=player_ans;
return 1;
}
cout<<"您死了\n";
return 0;
}
}
int main()
{
sta();
while(1)
{
cout<<"您正缓缓的走着......\n";
cout<<"突然,一个敌人走了过来\n";
srand(time(NULL));
if(rand()%10==0)
{
int add_cl=rand()%10;
player_cl+=add_cl;
cout<<"您的运气不错,捡到了一件护甲值为"<<add_cl<<"的护甲,当前护甲值为"<<player_cl<<"\n";
}
if(fire()==0)return 0;
Sleep(500);
}
return 0;
}
/*
*
* ┏┓ ┏┓+ +
* ┏┛┻━━━┛┻┓ + +
* ┃ ┃
* ┃ ━ ┃ ++ + + +
* ████━████+
* ◥██◤ ◥██◤ +
* ┃ ┻ ┃
* ┃ ┃ + +
* ┗━┓ ┏━┛
* ┃ ┃ + + + +Code is far away from
* ┃ ┃ + bug with the animal protecting
* ┃ ┗━━━┓ 神兽保佑,代码无bug
* ┃ ┣┓
* ┃ ┏┛
* ┗┓┓┏━┳┓┏┛ + + + +
* ┃┫┫ ┃┫┫
* ┗┻┛ ┗┻┛+ + + +
*/