Skip to content

Commit 02c0618

Browse files
committed
Add 1.0.0b (console) support, improve backwards compatibility
1 parent 3a89924 commit 02c0618

File tree

3 files changed

+45
-103
lines changed

3 files changed

+45
-103
lines changed

filters/speedrun_skipless.cl

Lines changed: 18 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -2,88 +2,26 @@
22
#include "./lib/immolate.cl"
33
long filter(instance* inst) {
44
long passedFilters = 0;
5-
/*
6-
Jokers that we want:
7-
Baseball Card xMult
8-
Bull +Chips
9-
Fibo +Mult
10-
Ramen Xmult
11-
Invisible Joker (duping)
125

13-
Combined From:
14-
First 3 shop jokers
15-
Jumbo Buffoon Pack in shop
16-
Immolate for money
17-
*/
6+
// Stuntman ante 1
7+
item jkr1 = shop_joker(inst, 1);
8+
item jkr2 = shop_joker(inst, 1);
9+
if (jkr1 == Stuntman || jkr2 == Stuntman) passedFilters++;
10+
else return passedFilters;
1811

19-
item pack1 = next_pack(inst, 1);
20-
item pack2 = next_pack(inst, 1);
21-
int speclPack = 0;
22-
if (pack1 != Mega_Buffoon_Pack && pack2 != Mega_Buffoon_Pack) return passedFilters;
23-
passedFilters++;
24-
if (pack1 == Mega_Buffoon_Pack) speclPack = 1;
25-
pack speclInfo = pack_info((speclPack == 0 ? pack1 : pack2));
26-
if (speclInfo.type != Spectral_Pack) return passedFilters;
27-
passedFilters++;
12+
// Rocket or To The Moon next shop
13+
jkr1 = shop_joker(inst, 1);
14+
jkr2 = shop_joker(inst, 1);
15+
if (jkr1 == Rocket || jkr2 == Rocket || jkr1 == To_the_Moon || jkr2 == To_the_Moon) passedFilters++;
16+
else return passedFilters;
2817

29-
bool hasImmolate = false;
30-
item spectrals[4];
31-
spectral_pack(spectrals, speclInfo.size, inst, 1);
32-
for (int i = 0; i < speclInfo.size; i++) {
33-
if (spectrals[i] == Immolate) hasImmolate = true;
34-
}
35-
if (!hasImmolate) return passedFilters;
36-
passedFilters++;
18+
// Bull ante 5
19+
shop_joker(inst, 5); //This part is after the boss, which is too early
20+
shop_joker(inst, 5);
21+
jkr1 = shop_joker(inst, 5);
22+
jkr2 = shop_joker(inst, 5);
23+
if (jkr1 == Bull || jkr2 == Bull) passedFilters++;
24+
else return passedFilters;
3725

38-
// Joker filters
39-
int hasBaseball = 0;
40-
int hasBull = 0;
41-
int hasFibo = 0;
42-
int hasRamen = 0;
43-
int hasInvis = 0;
44-
for (int i = 0; i < 4; i++) { // Ante 1 shop jokers
45-
item jkr = shop_joker(inst, 1);
46-
if (jkr == Baseball_Card) {
47-
if (i < 2) {
48-
inst->locked[jkr] = true;
49-
}
50-
hasBaseball = 1;
51-
}
52-
if (jkr == Bull) {
53-
if (i < 2) {
54-
inst->locked[jkr] = true;
55-
}
56-
hasBull = 1;
57-
}
58-
if (jkr == Fibonacci) {
59-
if (i < 2) {
60-
inst->locked[jkr] = true;
61-
}
62-
hasFibo = 1;
63-
}
64-
if (jkr == Ramen) {
65-
if (i < 2) {
66-
inst->locked[jkr] = true;
67-
}
68-
hasRamen = 1;
69-
}
70-
if (jkr == Invisible_Joker) {
71-
if (i < 2) {
72-
inst->locked[jkr] = true;
73-
}
74-
hasInvis = 1;
75-
}
76-
}
77-
if (hasBaseball + hasBull + hasFibo + hasRamen + hasInvis < 3) return passedFilters;
78-
item jokers[4];
79-
buffoon_pack(jokers, 4, inst, 1);
80-
for (int i = 0; i < 4; i++) {
81-
if (jokers[i] == Baseball_Card) hasBaseball = 1;
82-
if (jokers[i] == Ramen) hasRamen = 1;
83-
if (jokers[i] == Bull) hasBull = 1;
84-
if (jokers[i] == Fibonacci) hasFibo = 1;
85-
if (jokers[i] == Invisible_Joker) hasInvis = 1;
86-
}
87-
if (hasBaseball + hasBull + hasFibo + hasRamen + hasInvis == 5) return 999;
88-
return 900 + hasBaseball + hasBull + hasFibo + hasRamen + hasInvis;
26+
return 999;
8927
}

lib/functions.cl

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ item standard_base(instance* inst, int ante) {
2929
return randchoice_common(inst, R_Card, S_Standard, ante, CARDS);
3030
}
3131
#if V_AT_MOST(0,9,3,14)
32-
item standard_edition(instance* inst) {
32+
item standard_edition(instance* inst, int ante) {
3333
double val = random_simple(inst, R_Standard_Edition);
3434
if (val > 0.988) return Polychrome;
3535
if (val > 0.96) return Holographic;
@@ -46,7 +46,7 @@ item standard_edition(instance* inst, int ante) {
4646
}
4747
#endif
4848
#if V_AT_MOST(1,0,0,10)
49-
item standard_seal(instance* inst) {
49+
item standard_seal(instance* inst, ante) {
5050
if (random_simple(inst, R_Standard_Has_Seal) <= 0.8) return No_Seal;
5151
double val = random_simple(inst, R_Standard_Seal);
5252
if (val > 0.75) return Red_Seal;
@@ -68,38 +68,42 @@ card standard_card(instance* inst, int ante) {
6868
card out;
6969
out.enhancement = standard_enhancement(inst, ante);
7070
out.base = standard_base(inst, ante);
71-
#if V_AT_MOST(0,9,3,14)
72-
out.edition = standard_edition(inst);
73-
#else
7471
out.edition = standard_edition(inst, ante);
75-
#endif
76-
#if V_AT_MOST(1,0,0,10)
77-
out.seal = standard_seal(inst);
78-
#else
7972
out.seal = standard_seal(inst, ante);
80-
#endif
8173
return out;
8274
}
8375

84-
#if V_AT_MOST(0,9,3,12)
85-
item next_pack(instance* inst) {
86-
return randweightedchoice(inst, (__private ntype[]){N_Type}, (__private int[]){R_Shop_Pack}, 1, PACKS);
87-
}
76+
#ifdef DEMO
77+
#if V_AT_MOST(0,9,3,12)
78+
item next_pack(instance* inst, int ante) {
79+
return randweightedchoice(inst, (__private ntype[]){N_Type}, (__private int[]){R_Shop_Pack}, 1, PACKS);
80+
}
81+
#else
82+
// Becomes ante-based in 0.9.3n
83+
item next_pack(instance* inst, int ante) {
84+
return randweightedchoice(inst, (__private ntype[]){N_Type, N_Ante}, (__private int[]){R_Shop_Pack, ante}, 2, PACKS);
85+
}
86+
#endif
8887
#else
89-
// Becomes ante-based in 0.9.3n
90-
item next_pack(instance* inst, int ante) {
91-
return randweightedchoice(inst, (__private ntype[]){N_Type, N_Ante}, (__private int[]){R_Shop_Pack, ante}, 2, PACKS);
92-
}
88+
#if V_AT_MOST(1,0,0,2)
89+
// Not ante-based in first console release (1.0.0b)
90+
item next_pack(instance* inst, int ante) {
91+
return randweightedchoice(inst, (__private ntype[]){N_Type}, (__private int[]){R_Shop_Pack}, 1, PACKS);
92+
}
93+
#else
94+
item next_pack(instance* inst, int ante) {
95+
return randweightedchoice(inst, (__private ntype[]){N_Type, N_Ante}, (__private int[]){R_Shop_Pack, ante}, 2, PACKS);
96+
}
97+
#endif
9398
#endif
94-
9599
#ifdef DEMO
96-
item next_tarot(instance* inst, rsrc src, int ante) {
100+
item next_tarot(instance* inst, rsrc src, int ante, bool soulable) {
97101
return randchoice_common(inst, R_Tarot, src, ante, TAROTS);
98102
}
99-
item next_planet(instance* inst, rsrc src, int ante) {
103+
item next_planet(instance* inst, rsrc src, int ante, bool soulable) {
100104
return randchoice_common(inst, R_Planet, src, ante, PLANETS);
101105
}
102-
item next_spectral(instance* inst, rsrc src, int ante) {
106+
item next_spectral(instance* inst, rsrc src, int ante, bool soulable) {
103107
return randchoice_common(inst, R_Spectral, src, ante, SPECTRALS);
104108
}
105109
#elif V_AT_MOST(1,0,0,10)

lib/util.cl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ text int_to_str(int x) {
201201
(VER1 < v1) || \
202202
(VER1 == v1 && ((VER2 < v2) ||\
203203
(VER2 == v2 && ((VER3 < v3) ||\
204-
(VER3 == v3 && VER4 < v4)))))
204+
(VER3 == v3 && VER4 <= v4)))))
205205

206206
// Define some constants for important game version splits
207207
#if V_AT_MOST(0,9999,9999,9999)

0 commit comments

Comments
 (0)