-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TODO] 护符的获取以及相关物品调整 #1466
Comments
代码模拟平均需要抽取5.3次得到一个护符
源代码: #include <bits/stdc++.h>
using namespace std;
const char nl = '\n';
using ll = long long;
using tmii = map<int, int>;
#define nano (chrono::system_clock::now().time_since_epoch().count())
#define init_rng mt19937_64 rng(nano ^ 19980731)
init_rng;
double nextDouble(){
return rng()*5.4210108624275221700372640043497e-20;
}
bool chance(double p){
return nextDouble() <= p;
}
int main(){
int TEST = 100000000;
double p0 = 0.05;
double delta_p = 0.05;
double p_max = 0.5;
tmii count;
for(int i=0;i<TEST;i++){
int roll=0;
double p = p0;
while(true){
roll++;
if(chance(p)) break;
p=min(p_max, p+delta_p);
}
count[roll]++;
}
ll total_roll=0;
int acc_freq=0;
for(auto [roll, freq]:count) {
total_roll+=(ll)roll*freq;
acc_freq+=freq;
cout<<"roll: "<<roll<<" prob: "<<freq / (double)TEST<<
" acc_prob: "<<acc_freq/(double)TEST<<" rem_prob: "<<(TEST-acc_freq)/ (double)TEST<<nl;
}
double avg_roll=total_roll/(double)TEST;
cout<<"avg_roll: "<<avg_roll;
} |
Matters to be added to TODO - 将要加入TODO的事项
护符的获取以及相关物品调整
Describe what this TODO will do - 描述这个TODO要做的事情
护符盒为不可堆叠,各种护符均为不可堆叠
(主手或副手)持有护符盒受到致命伤害时,自动消耗背包中的不死图腾免死(跟不死图腾一样虚空伤害和kill不触发)
如果背包中没有不死图腾,护符盒本身被消耗且发动不死图腾的免死能力
每消耗一个不死图腾或护符盒,尝试一次护符抽取,根据致命伤害的类型决定产生的护符
成功率:
消耗不死图腾时为5%,消耗护符盒时为20%,但背包中已经有同种护符时恒为0%
类型——致命伤害来源:
绿宝石护符——铁傀儡、灾厄村民
黄玉护符——闪电、特斯拉塔
红宝石护符——火焰、熔岩、岩浆块等烫脚方块、激光
蓝宝石护符——水中缺氧窒息、守卫者、远古守卫者
铁砧护符——铁砧砸、巨型铁砧撼地、铁砧锤攻击、飞行头戴铁砧锤撞击
齿轮护符——来自机械动力的伤害(仅在与机械动力同装时存在)
战友护符——其他玩家(无小队或同小队,不同队伍的玩家伤害不触发)
羽毛护符——摔落伤害
猫护符——苦力怕、幻翼
狗护符——骷髅、流浪者、凋零骷髅、沼骇
寂静护符——监守者
抽取失败时,增加该玩家对应的5%概率(加算),最高提高到50%,直到抽取成功后复位概率(背包中已经有同种护符时恒为0%,不增加)
The text was updated successfully, but these errors were encountered: