Skip to content

Commit 9cde06d

Browse files
committed
soam challange
1 parent 49b29aa commit 9cde06d

14 files changed

Lines changed: 375 additions & 167 deletions

File tree

mod.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,23 @@
233233
"big-arrow-step": 20
234234
}
235235
},
236+
"spam-chance": {
237+
"type": "int",
238+
"name": "Spam Challenge Chance",
239+
"description": "<cj>Spam Challenge!</c> - Chance of the spam challenge appearing.",
240+
"default": 50,
241+
"min": 0,
242+
"max": 100,
243+
"control": {
244+
"input": true,
245+
"slider": true,
246+
"slider-step": 1,
247+
"arrows": true,
248+
"arrow-step": 10,
249+
"big-arrows": true,
250+
"big-arrow-step": 20
251+
}
252+
},
236253
"achieve-chance": {
237254
"type": "int",
238255
"name": "Achievement Sound Chance",

src/Keybinds.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1+
#if !defined(GEODE_IS_IOS)
12
#include <Utils.hpp>
23

34
#include <Geode/Geode.hpp>
45

5-
using namespace geode::prelude;
6-
using namespace horrible;
7-
8-
#if !defined(GEODE_IS_IOS)
96
#include <geode.custom-keybinds/include/Keybinds.hpp>
107

8+
using namespace geode::prelude;
9+
using namespace horrible;
1110
using namespace keybinds;
1211

1312
$execute{

src/Utils.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
#include <classes/Randng.hpp>
1313

1414
#include <classes/ui/MathQuiz.hpp>
15-
#include <classes/ui/RandomAdPopup.hpp>
16-
#include <classes/ui/SpamJumps.hpp>
15+
#include <classes/ui/RandomAd.hpp>
16+
#include <classes/ui/SpamChallenge.hpp>
1717

1818
using namespace geode::prelude;
1919

@@ -72,7 +72,7 @@ namespace horrible {
7272
SillyTier::High},
7373
{"math_quiz",
7474
"Richard's Math Quiz!",
75-
"When playing a level in practice mode, there's a chance Richard will pop out and give you a quick math quiz. Answer correctly to continue, or restart the level from the beginning.\n<cy>Credit: CyanBoi</c>",
75+
"When playing a level in Practice mode, there's a chance Richard will pop out and give you a quick math quiz. Answer correctly to continue, or restart the level from the beginning.\n<cy>Credit: CyanBoi</c>",
7676
category::obstructive,
7777
SillyTier::High},
7878
{"mock",
@@ -89,8 +89,8 @@ namespace horrible {
8989
category::randoms,
9090
SillyTier::Medium},
9191
{"spam",
92-
"Spam Jumps!",
93-
"Forces you to spam an input sometimes while playing a level.\n<cy>Credit: Cheeseworks</c>",
92+
"Spam Challenge!",
93+
"Sometimes forces a challenge on you to mercilessly spam an input sometimes while playing a level in Normal mode.\n<cy>Credit: Cheeseworks</c>",
9494
category::obstructive,
9595
SillyTier::High},
9696
{"achieve",

src/classes/ui/MathQuiz.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ namespace horrible {
3636
public:
3737
static MathQuiz* create();
3838

39-
void setCallback(std::function<void(bool)> cb);
40-
void setWasCorrectFlag(bool v);
39+
void setCallback(std::function<void(bool)> const& cb);
40+
void setCorrect(bool v);
4141

4242
void closePopup();
4343
};
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ using namespace geode::prelude;
66

77
namespace horrible {
88
// Popup that displays a random level thumbnail
9-
class RandomAdPopup : public Popup<> {
9+
class RandomAd : public Popup<> {
1010
protected:
1111
void onPlayBtn(CCObject*);
1212

1313
bool setup() override;
1414

1515
public:
16-
static RandomAdPopup* create();
16+
static RandomAd* create();
1717
};
1818
};

src/classes/ui/SpamChallenge.hpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#pragma once
2+
3+
#include <Geode/Geode.hpp>
4+
5+
using namespace geode::prelude;
6+
7+
namespace horrible {
8+
class SpamChallenge : public CCBlockLayer, public FLAlertLayerProtocol {
9+
private:
10+
class Impl;
11+
std::unique_ptr<Impl> m_impl;
12+
13+
protected:
14+
SpamChallenge();
15+
virtual ~SpamChallenge();
16+
17+
void closeAfterFeedback(float);
18+
void setSuccess(bool v);
19+
20+
void keyBackClicked() override;
21+
void update(float dt) override;
22+
23+
bool init() override;
24+
25+
public:
26+
static SpamChallenge* create();
27+
28+
bool ccTouchBegan(CCTouch* touch, CCEvent* event) override;
29+
30+
void setCallback(std::function<void(bool)> const& cb);
31+
};
32+
};

src/classes/ui/SpamJumps.hpp

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)