引诱吃真是够了
__Allen_123__ · · 休闲·娱乐
规则:按 F 或 J 打击从两侧落下的音符。
计分&判定:同 Arcaea 判定与计分方法。
回忆收集条:目前实现了普通&困难条,普通条略改可以改为简单条。可留存回忆率并获得额外奖励(目前没有残片系统)。
存档:请在与该程序同一目录下新建一文件 cundang.txt,内含两行:
hard_memory: 100
hard_lunshu: 0
之后程序会持续自动更新每次游玩的最佳成绩等信息。
含有特定随机种子会触发的愚人节效果和一首异象曲(只能使用异象游玩)。
编译命令:-std=c++14
#include <bits/stdc++.h>
#include <windows.h>
#define KEY_DOWN(vKey) ((GetAsyncKeyState(vKey) & 0x8000) ? 1:0)
#define KEY_UP(vKey) ((GetAsyncKeyState(vKey) & 0x8000) ? 0:1)
//#define int long long
#define pii pair<int, int>
#define rep(x, y, z) for(int x = (y);x <= (int)(z);x++)
#define per(x, y, z) for(int x = (y);x >= (int)(z);x--)
#define ask(x) while(x--)
#define ask1(x) for(scanf("%d", &x);x--;)
#define fvec(x, y) for(auto x : y)
#define all(x) x.begin(), x.end()
#define pb push_back
#define fi first
#define se second
typedef long long ll;
using namespace std;
void gmax(auto &x, auto y){
x = max(x, y);
}
void gmin(auto &x, auto y){
x = min(x, y);
}
const int inf = 0x3f3f3f3f, mod = 998244353;
// 70, 74
void add(auto &x, auto y){
if((x += (y %= mod)) - mod >= 0) x -= mod;
}
int N, n, m, pre = 3000, bp, sp, f, fe, fl, l, sc, expsc = 10000000, comb = 0, lgt = 5, ls, tmpls, seed = -1;
double num, val, flowspeed = 3.5, tmpval, normal_mode;
bool kuf = 0, kdf = 0, kuj = 0, kdj = 0, flg = 0, dif = 0, kpflg = 0, ap = 0, hlp = 0;
string x = "○", y = "●", z = "■", w = "□", q = "〓";
vector<int> chart, vec, p;
map<int, pii> mp;
void print(int num, bool type){
string s = "";
rep(i, 1, (type ? 6 : 8)){
s += num % 10 + '0';
num /= 10;
if(i % 3 == 0 && i != (type ? 6 : 8)) s += '\'';
}
per(i, s.size() - 1, 0) printf("%c", s[i]);
}
void render(string s){
COORD coord;
coord.X = 41;
coord.Y = 0;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hConsole, coord);
if(seed == 616 && vec.size() <= 140) printf(" ");
else if(!f && !l) printf("P");
else if(dif && val < 30) printf("!");
else printf("|");
coord.X = 41;
coord.Y = 2;
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hConsole, coord);
if(seed == 616 && vec.size() <= 140) printf(" ");
else if(!l) printf("F");
else if(dif && val < 30) printf("!");
else printf("|");
coord.X = 1; // 列位置
coord.Y = 1; // 行位置
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hConsole, coord);
cout << s << "\n";
}
void render2(int type){
if(seed == 616) return;
COORD coord;
coord.X = 38;
coord.Y = 4;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hConsole, coord);
if(!type) printf("LOST ");
else if(type < 0){
printf("FAR ");
if(type == -1) printf("(LATE) ");
else printf("(EARLY)");
}
else{
// if(type == 1) printf("Pure(Late) ");
// else if(type == 2) printf("Pure(Early) ");
printf("·PURE· ");
}
}
void render3(){
COORD coord;
coord.X = 45;
coord.Y = 0;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hConsole, coord);
if(seed == 616 && vec.size() <= 120){
printf(" ");
return;
}
double s = 10000000.0 / N;
int nwsc = floor(s * (bp + sp) + s * f / 2.0) + bp;
sc = min(sc + rand() % (150000 / N), nwsc);
print(sc, 0); printf(" ");
if(seed == 616) return;
if(bp + sp + f + l == 0) nwsc = 10000000;
else if(f + l == 0){
nwsc = 10000000 + bp;
}
else nwsc = floor(s * (bp + sp) + s * f / 2.0 + (N - bp - sp - f - l) * (1.0 * (sc - bp) / (bp + sp + f + l))) + bp;
if(nwsc >= expsc){
expsc = min(expsc + rand() % 1000, nwsc);
}
else{
expsc = max(expsc - rand() % 1000, nwsc);
}
gmax(expsc, 7600001);
if(expsc >= 10000000){
int x = expsc - 10000000;
printf("+");
print(x, 1);
printf(" PM");
}
else if(expsc >= 9850000){
int x = expsc - 9900000;
if(x >= 0) printf("+");
else printf("-");
x = abs(x);
print(x, 1);
printf(" EX+");
}
else if(expsc >= 9650000){
int x = expsc - 9800000;
if(x >= 0) printf("+");
else printf("-");
x = abs(x);
print(x, 1);
printf(" EX ");
}
else if(expsc >= 9350000){
int x = expsc - 9500000;
if(x >= 0) printf("+");
else printf("-");
x = abs(x);
print(x, 1);
printf(" AA ");
}
else if(expsc >= 9050000){
int x = expsc - 9200000;
if(x >= 0) printf("+");
else printf("-");
x = abs(x);
print(x, 1);
printf(" A ");
}
else if(expsc >= 8750000){
int x = expsc - 8900000;
if(x >= 0) printf("+");
else printf("-");
x = abs(x);
print(x, 1);
printf(" B ");
}
else{
int x = expsc - 8600000;
if(x >= 0) printf("+");
else printf("-");
x = abs(x);
print(x, 1);
printf(" C ");
}
coord.X = 15;
coord.Y = 0;
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hConsole, coord);
if(ap) coord.X = 8, printf("[AUTO] ");
if(comb) printf("%d", comb);
else printf(" ");
}
void render4(int type){
if(type == -1){
COORD coord;
coord.X = 0;
coord.Y = 0;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hConsole, coord);
string str = "";
rep(i, 0, 20){
if(floor(val) > min(i * 5, 99)) str += z;
else str += w;
}
str += ' ' + to_string((int)floor(val));
cout << str << " \n";
return;
}
COORD coord;
coord.X = 0;
coord.Y = 3;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hConsole, coord);
if(type == -2);
else if(!type) val += num;
else if(type == 1) val += 0.5 * num;
else if(dif){
if(floor(val) >= 39) val -= 9;
else if(floor(val) >= 30) val -= 9 + (val - 30) / 2;
else val -= 5;
if(floor(val) <= 0) flg = 1;
}
else{
val -= 2;
}
gmin(val, 100.0);
gmax(val, 0.0);
string str = "";
if(seed == 616 && vec.size() <= 100){
printf(" ");
return;
}
rep(i, 0, 20){
if(floor(val) > min(i * 5, 99)) str += z;
else if(seed != 616) str += w;
}
if(seed != 616) str += ' ' + to_string((int)floor(val));
cout << str << " \n";
}
void hide_cursor()//隐藏光标
{
HANDLE h_GAME =GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO cursor_info;
GetConsoleCursorInfo(h_GAME,&cursor_info);
cursor_info.bVisible=false;
SetConsoleCursorInfo(h_GAME,&cursor_info);
}
signed main(){
hide_cursor();
freopen("cundang.txt", "r", stdin);
scanf("hard_memory: %lf\nhard_lunshu: %d", &val, &ls);
for(int x, y, z;cin >> x >> y >> z;){
mp[x] = {y, z};
}
tmpval = val;
tmpls = ls;
fclose(stdin);
printf("D: 每日一谱 R: 随机谱面 N: 输入编号/查看记录\n");
while(1){
if(KEY_DOWN(68)){
std::time_t now = std::time(nullptr);
std::tm* local_time = std::localtime(&now);
int year = local_time->tm_year + 1900;
int month = local_time->tm_mon + 1;
int day = local_time->tm_mday;
seed = year * 10000 + month * 100 + day;
break;
}
if(KEY_DOWN(78)){
printf("排序方式 - D: 默认 / S: 分数\n");
bool d = 0;
while(1){
if(KEY_DOWN(68)){
d = 1;
break;
}
if(KEY_DOWN(83)) break;
Sleep(100);
}
printf("游玩记录: \n");
if(d){
fvec(i, mp){
printf("%d: ", i.fi);
print(i.se.fi, 0);
printf(" ");
if(i.se.fi >= 9900000) printf("EX+");
else if(i.se.fi >= 9800000) printf("EX");
else if(i.se.fi >= 9500000) printf("AA");
else if(i.se.fi >= 9200000) printf("A");
else if(i.se.fi >= 8900000) printf("B");
else if(i.se.fi >= 8600000) printf("C");
else printf("D");
printf(" ");
if(i.se.se == 0) printf("TL");
else if(i.se.se == -1) printf("HC");
else if(i.se.se == -2) printf("NC");
else if(i.se.se == 2) printf("PM");
else printf("FR");
printf("\n");
}
}
else{
set<pair<int, pii>> st;
fvec(i, mp) st.insert({-i.se.fi, {i.fi, i.se.se}});
fvec(i, st){
printf("%d: ", i.se.fi);
print(-i.fi, 0);
printf(" ");
if(-i.fi >= 9900000) printf("EX+");
else if(-i.fi >= 9800000) printf("EX");
else if(-i.fi >= 9500000) printf("AA");
else if(-i.fi >= 9200000) printf("A");
else if(-i.fi >= 8900000) printf("B");
else if(-i.fi >= 8600000) printf("C");
else printf("D");
printf(" ");
if(i.se.se == 0) printf("TL");
else if(i.se.se == -1) printf("HC");
else if(i.se.se == -2) printf("NC");
else if(i.se.se == 2) printf("PM");
else printf("FR");
printf("\n");
}
}
int id = 0, pre = -1;
while(1){
if(pre != -1 && KEY_UP(pre + '0')) pre = -1;
rep(i, 0, 9){
if(i != pre && KEY_DOWN(i + '0')){
id = id * 10 + i;
printf("%d", i);
pre = i;
break;
}
}
if(KEY_DOWN(13)){
printf("\n");
break;
}
Sleep(50);
}
seed = id;
break;
}
if(KEY_DOWN(82)){
seed = time(0);
break;
}
Sleep(100);
}
if(seed == 616){
printf("谱面[616]为异象曲。\nautoplay 开关: [Y] 开 [N] 关 [A] 无异象+自动播放");
while(1){
if(KEY_DOWN(65)){
normal_mode = 1;
ap = 1;
seed = 615;
printf("\n");
break;
}
if(KEY_DOWN(89)){
ap = 1;
break;
}
if(KEY_DOWN(78)) break;
Sleep(100);
}
if(!normal_mode){
system("cls");
printf("ARE YOU SURE??\n");
Sleep(3000);
printf("[Y]Yes [Y]Yes\n");
while(!KEY_DOWN(89)) Sleep(100);
}
}
srand(seed);
if(seed != 616 && !normal_mode) N = rand() % 250 + 50;
else N = 300;
// N = 27;
// if(seed != 616 && !normal_mode) printf("总物量: %d", N);
// else printf(normal_mode ? "总物量:300" : "Total Notes: 2ys097#xjva"), N = 300, Sleep(1500);
if(N < 400){
num = 80.0 / N + 0.2;
}
else if(num < 600){
num = 32.0 / N + 0.2;
}
else{
num = 96.0 / N + 0.08;
}
// printf(" Debug: num = %.5lf", num);
Sleep(500);
system("cls");
if(seed == 616) printf("F: aoliz J: x6cv9 H: 832h1 A: tliou B: zsd7f C: g098 ?: ?!!?!!?\n"), Sleep(2000);
else printf("F: 普通条 J: 困难条 H: 困难+回忆率留存 A: 自动播放(已游玩后) B: 自动播放+读谱辅助(1速+单面下落,已游玩后)");
if(seed != 616 && !normal_mode) while(1){
if(KEY_DOWN(66) && mp.count(seed)){
ap = 1;
val = 0;
dif = 0;
hlp = 1;
flowspeed = 1;
break;
}
if(KEY_DOWN(65) && mp.count(seed)){
ap = 1;
val = 0;
dif = 0;
break;
}
if(KEY_DOWN(70)){
val = 0;
dif = 0;
break;
}
if(KEY_DOWN(74)){
val = 100;
dif = 1;
break;
}
if(KEY_DOWN(72)){
dif = 1;
kpflg = 1;
break;
}
Sleep(100);
}
else{
val = 0;
dif = 0;
}
// if(kpflg){
// freopen("cundang.txt", "w", stdout);
// printf("hard_memory: 100.0\nhard_lunshu: 0\n");
// fclose(stdout);
// }
system("cls");
if(normal_mode) seed = 616;
rep(i, 1, N){
// pre += 80;
pre += (rand() % 4 + 1) * 100;
int val = rand() % 2 ? 1 : -1;
if(hlp) val = 1;
chart.pb(pre);
p.pb(val);
// if(i <= 10){
// printf("pos = %d\n", pre);
// }
}
if(normal_mode) seed = 615;
per(i, chart.size() - 1, 0) vec.pb(chart[i]);
auto stt = chrono::high_resolution_clock::now();
render3();
render4(-2);
auto pre = chrono::high_resolution_clock::now();
while(!vec.empty()){
render3();
auto nwt = chrono::high_resolution_clock::now();
auto du = chrono::duration_cast<chrono::microseconds>(nwt - stt);
auto tmp = chrono::duration_cast<chrono::microseconds>(nwt - pre);
int d = du.count() / 1000;
int e = d - vec.back();
if(seed % 1000 == 401) flowspeed = (double)sin(tmp.count() / 150000.0) + 2;
if(KEY_UP(70)) kuf = 1;
else if(KEY_DOWN(70) && kuf) kdf = 1, kuf = 0;
if(KEY_UP(74)) kuj = 1;
else if(KEY_DOWN(74) && kuj) kdj = 1, kuj = 0;
if(ap) kdj = kuj = kdf = kuf = 0;
if(!ap && (kdf || kdj)) lgt = 40;
if(ap && e >= 0){
lgt = 40;
bp++; render2(3); render4(0); comb++; vec.pop_back(); p.pop_back();
}
else if((kdf || kdj || e > 100) && !flg){
// if(kdf) printf("[F] ");
// if(kdj) printf("[J] ");
if(kdf) kdf = 0;
else if(kdj) kdj = 0;
if(e < -120);
else if((e <= -100 && e > -120) || e > 100){
render2(0);
l++;
render4(2);
comb = 0;
}
else if(abs(e) > 50){
f++;
if(e >= 0) render2(-1), fl++;
else render2(-2), fe++;
render4(1);
comb++;
}
else if(abs(e) > 25){
sp++;
if(e >= 0) render2(1);
else render2(2);
render4(0);
comb++;
}
else bp++, render2(3), render4(0), comb++;
if(e >= -120) vec.pop_back(), p.pop_back();
if(flg) break;
}
string s = "";
set<int> st;
per(i, vec.size() - 1, 0){
if(vec[i] - d <= 2000.0 / flowspeed){
st.insert(1.0 * p[i] * (vec[i] - d) / 50 * flowspeed + 40);
}
else{
break;
}
}
du = chrono::duration_cast<chrono::microseconds>(nwt - pre);
d = du.count() / 1000;
/*if((d < 200 ? 1 : (pre = nwt, 0)));
else */if(seed == 616 && vec.size() <= 80) rep(i, 0, 83){
if(i <= 19 + (0.25 * (80 - vec.size())) || i >= 60 - (0.25 * (80 - vec.size()))) s += ' ';
else if(st.count(i)) s += '=';
else if(i == 40){
s += y;
}
else if(vec.empty() && !l){
if(i & 1) s += x, s += x;
}
else s += y;
}
else if(seed == 616) rep(i, 0, 80){
if(i < int((val - 50) / 2.5) || i > 80 - int((val - 50) / 2.5)) s += ' ';
else if(st.count(i)) s += y;
else if(i == 40){
if(lgt) s += y;
else s += x;
}
else if(vec.empty() && !l){
if(i & 1) s += q;
}
else s += '=';
}
else rep(i, 0, 80){
if(st.count(i)) s += y;
else if(i == 40){
if(lgt) s += y;
else s += x;
}
else if(vec.empty() && !l){
if(i & 1) s += q;
}
else s += '=';
}
render(s);
// if(kdf) printf("[F] ");
// if(kdj) printf("[J] ");
lgt = max(lgt - 1, 0);
}
if(seed == 616) Sleep(5000);
double s = 10000000.0 / N;
int sc = floor(s * (bp + sp) + s * f / 2.0) + bp;
printf("\n\n");
if(bp + sp == N) printf("PURE MEMORY");
else if(bp + sp + f == N) printf("FULL RECALL");
else if(!flg && (dif || floor(val) >= 70)) printf("TRACK COMPLETE");
else printf("TRACK LOST");
int d = 0;
stt = chrono::high_resolution_clock::now();
while(d <= 5000){
render3();
auto nwt = chrono::high_resolution_clock::now();
auto du = chrono::duration_cast<chrono::microseconds>(nwt - stt);
d = du.count() / 1000;
}
if(normal_mode) seed = 616;
system("cls");
printf("假装这里有转场\n");
Sleep(1250);
system("cls");
printf("\n");
render4(-1);
if(ap) printf("[AUTO] ");
if(bp + sp == N) printf("PURE MEMORY"), ls++;
else if(bp + sp + f == N) printf("FULL RECALL"), ls++;
else if(!flg && (dif || floor(val) >= 70)) printf("TRACK COMPLETE"), ls++;
else printf("TRACK LOST"), val = 100, ls = 0;
printf("\n");
if(sc >= 9900000) printf("EX+");
else if(sc >= 9800000) printf("EX");
else if(sc >= 9500000) printf("AA");
else if(sc >= 9200000) printf("A");
else if(sc >= 8900000) printf("B");
else if(sc >= 8600000) printf("C");
else printf("D");
printf("\n");
print(sc, 0);
printf("\nHIGH SCORE ");
print(mp[seed].fi, 0); printf(" ");
int chge = sc - mp[seed].fi;
if(chge >= 0) printf("+");
else printf("-"), chge = -chge;
print(chge, 0);
printf("\n\nPURE %d(+%d)\nFAR %d(E%dL%d)\nLOST %d\n", bp + sp, bp, f, fe, fl, l);
if(!kpflg) val = tmpval, ls = tmpls;
if(!ap){
int type = 0;
if(bp + sp == N) type = 2;
else if(bp + sp + f == N) type = 1;
else if(!flg && (dif || floor(val) >= 70)){
if(dif) type = -1;
else type = -2;
}
if(mp[seed].fi < sc) mp[seed].fi = sc;
if((mp[seed].se == 0 || type > mp[seed].se) && type != 0) mp[seed].se = type;
}
if(kpflg) printf("\nFragments Extra Award (Rounds in a row): %d\n", ls);
freopen("cundang.txt", "w", stdout);
printf("hard_memory: %lf\nhard_lunshu: %d\n", val, ls);
fvec(i, mp) printf("%d %d %d\n", i.fi, i.se.fi, i.se.se);
return 0;
}