原神抽卡祈愿模拟器(想象中的钟离池子)

 

小白的第一篇博客!

暑假无聊自己写了个原神抽卡模拟hhh,果然无论在游戏里还是模拟中我都很非呢()

#include<bits/stdc++.h> 
using namespace std;
int chou(int cishu,bool wai){
	int p,fa;
	if(cishu<=73)
	p=5;
	else if(cishu==90)
	p=999;
	else
	p=(cishu-73)*60+5;
	fa=rand()%1000;
	if(fa>p)
	return 2;
	if(wai==1)
	return 0;
	return rand()%2;
}
int wuqi(int cishu2,int dinggui){
	int p,fa;
	if(cishu2<=62)
	p=6;
	else if(cishu2==80)
	p=999;
	else
	p=(cishu2-62)*70+6;
	fa=rand()%1000;
	if(fa>p)
	return 2;
	if(dinggui==2)
	return 0;
	return rand()%2;
}
int sixing(int shu,bool wai2){
	int p,fa,r;
	if(shu<9)
	p=50;
	else if(shu==9)
	p=560;
	else
	p=999;
	fa=rand()%1000;
	if(fa>p)
	return 2;
	if(wai2==1)
	return 0;
	r=rand()%4;
	if(r<1)
	return 1;
	return 0;
}

int main(){
	long long cishu=1,cishu2=1;
	bool wai=0;bool wai2=0;
	int a,jieguo,end,b,m;
	int shu=1,dinggui=0;
	string renwu; 
	char k;
	int nuo=0,wu=0,zao=0,zhong=0,ke=0,mo=0,qi=0,qin=0,di=0,ti=0; 
    cout<<"输入j抽up角色池,输入w抽up武器池"<<endl;
	cin>>k; 
	if(k=='w'){
		cout<<"输入0定轨阿莫斯之弓,输入1定轨贯虹之槊"<<endl;
		cin>>m;
	} 			

	cout<<"输入1抽一发,输入10抽十连(实际上输入数字几就抽几发)"<<endl;
		cout<<"             累计"<<endl;
	
	while(1){
		srand((unsigned int) time(NULL));
		cin>>a;
		if(k=='j')
		for(int i=0;i<a;i++){
		
	    jieguo=chou(cishu,wai);
	    if(jieguo==2){
	    	end=sixing(shu,wai2);
	    	if(end==2)
	    	cout<<"非"<<"\t\t"<<cishu<<endl;
			else if(end==0) {
				
				b=rand()%4;
				if(b==0) {
				++nuo;
				if(nuo>=6) cout<<"诺艾尔  满命\t"<<cishu<<endl;
				else
				cout<<"诺艾尔  "<<nuo<<"命"<<"\t"<<cishu<<endl;
				}
				else if(b==1) {
					++wu;
				if(wu>=6) cout<<"五郎    满命\t"<<cishu<<endl;
				else
				cout<<"五郎    "<<wu<<"命"<<"\t"<<cishu<<endl;
				}
				else if(b==2) {
					++zao;
				if(zao>=6) cout<<"早柚    满命\t"<<cishu<<endl;
				else
				cout<<"早柚    "<<zao<<"命"<<"\t"<<cishu<<endl; 
				}
				else cout<<"四星武器"<<"\t"<<cishu<<endl;
				wai2=0;
				shu=0;
			}
			else{
				cout<<"其他四星角色\t"<<cishu<<endl;
				wai2=1;
				shu=0;
			}
		}
	    else if(jieguo==0) {
		    ++zhong;
		    if(zhong>=6) cout<<"钟离    满命\t"<<cishu<<"    恭喜恭喜!"<<endl;
		    else
		    cout<<"钟离    "<<zhong<<"命"<<"\t"<<cishu<<"    恭喜恭喜!"<<endl;
		    
		    wai=0;
		    cishu=0;
		}
		else {
			
			b=rand()%6;
			switch(b){
				case 0: ++qi;if(qi>=6) cout<<"七七    满命\t";
				else cout<<"七七\t"<<qi<<"命"; break;
				case 1: ++mo;if(mo>=6) cout<<"莫娜    满命\t";
				else cout<<"莫娜\t"<<mo<<"命"; break;
				case 2: ++ke;if(ke>=6) cout<<"刻晴    满命\t";
				else cout<<"刻晴\t"<<ke<<"命"; break;
				case 3: ++qin;if(qin>=6) cout<<"琴      满命\t";
				else cout<<"琴\t"<<qin<<"命"; break;
			    case 4: ++di;if(di>=6) cout<<"迪卢克  满命\t";
				else cout<<"迪卢克\t"<<di<<"命"; break;
				case 5: ++ti;if(ti>=6) cout<<"提纳里  满命\t";
				else cout<<"提纳里\t"<<ti<<"命"; break; 
			} 
			cout<<"\t"<<cishu<<"    哎呀,小保底歪了啊!(*…^ …*)"<<endl; 
			
			wai=1;
			cishu=0;
		}
		cishu++;
		shu++; 
		}
		else{
		    
			for(int i=0;i<a;i++){
				jieguo=wuqi(cishu2,dinggui);
				if(jieguo==2){
					end=sixing(shu,wai2);
					if(end==2)
					cout<<"非"<<"\t\t"<<cishu2<<endl;
					else if(end==0){
					cout<<"本期四星\t"<<cishu2<<endl;	
					wai2=0;
					shu=0;
					}
					else{
						cout<<"其他四星物品\t"<<cishu2<<endl;
						wai2=1;
						shu=0; 
					}
					
				}
				else if(jieguo==0){
					if(m==0)
					cout<<"阿莫斯之弓\t"<<cishu2;
					else if(m==1)
					cout<<"贯虹之槊\t"<<cishu2;
					cout<<"  恭喜恭喜!"<<endl;
					dinggui=0;
					cishu2=0;
				}
				else{
					if(m==0)
					cout<<"贯虹之槊\t"<<cishu2;
					else if(m==1) 
					cout<<"阿莫斯之弓\t"<<cishu2;
					dinggui++;
					cout<<"  定轨:"<<dinggui<<endl;
					cishu2=0;
				}
				cishu2++;
				shu++;
			}
		}
	}
	return 0;
}

不知道有没有bug,欢迎大家讨论!

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
要使用Electron获取原神祈愿记录,你可以考虑以下步骤: 1. 在Electron项目安装`node-fetch`或其他HTTP请求库,用于发送HTTP请求。 ``` npm install node-fetch ``` 2. 通过发送HTTP请求到原神的API来获取祈愿记录。你可以使用原神的开放API或模拟登录获取到用户的祈愿记录。 3. 在Electron的主进程或渲染进程编写代码来发送HTTP请求,并处理返回的数据。 在主进程(main process),你可以使用Node.js的`http`或`https`模块来发送请求。例如: ```javascript const https = require('https'); const options = { hostname: 'api.mihoyo.com', path: '/gacha/api/getGachaLog', method: 'GET', }; const req = https.request(options, (res) => { let data = ''; res.on('data', (chunk) => { data += chunk; }); res.on('end', () => { // 在这里处理返回的数据 console.log(data); }); }); req.on('error', (error) => { console.error(error); }); req.end(); ``` 在渲染进程(renderer process),你可以使用`fetch`方法发送请求。例如: ```javascript fetch('https://api.mihoyo.com/gacha/api/getGachaLog') .then((response) => response.json()) .then((data) => { // 在这里处理返回的数据 console.log(data); }) .catch((error) => { console.error(error); }); ``` 请注意,这只是一个示例,具体的API和请求参数需要根据原神的API文档进行调整。 4. 根据返回的数据进行解析和处理,提取出你需要的祈愿记录信息。 请记住,根据原神的API使用规则和限制,以及用户隐私保护的考虑,你需要遵循相关的法律法规和服务条款来获取和使用用户的祈愿记录。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值