Prodigy-Hacking / ProdigyMathGameHacking

Prodigy Hacking: Hacking for the right reasons. | Questions? Ask on our Discord. https://discord.gg/XQDfbfq
https://prodigyhacking.com
Other
17 stars 10 forks source link

Easy Mode #1

Closed JadeGrey closed 3 years ago

JadeGrey commented 4 years ago

breaks battles

hostedposted commented 3 years ago

Trying to get into my account forgot the password.

TheFinality commented 3 years ago

cant you use forgot password?

hostedposted commented 3 years ago

I'm also on vacation now

TheFinality commented 3 years ago

ohh ok

hostedposted commented 3 years ago

I just remembered my password

ArcerionDev commented 3 years ago

I think easy mode's impossible now.

I decoded the map file for prodigy.

In prodigy's code there is a DEBUG_CODE variable that is undefined. But using the Define Plugin for webpack they could set it for dev only.

They use it for lots of things in the game. But the functions that use DEBUG_CODE don't have it in the game. So the only way we would be able to do it is build the prodigy game file with the debug code.

We can get the debug code in the game status:

import prodigy
prodigy.gameStatus()["prodigyGameFlags"]["debugPassword"]

But after decoding the source map not all files are there.

This code image in 4-21-0/src/feature/mathTower/MathTower.ts does not work because 4-21-0/src/systems/injection/EProdigyInjectionIdentifiers.ts does not exist image

If we build the gamefile with DEBUG_CODE.

This code is the code executed when a question is popped up.

    /**
     * Opens a question for the player to answer
     */
    public answerQuestion(): void {
        if (DEBUG_CODE) {
            if (!GameConstants.get('GameConstants.Debug.EDUCATION_ENABLED')) {
                const wasCorrect: boolean = Math.random() < GameConstants.get('GameConstants.Debug.AUTO_ANSWER_CORRECT_PERCENT');
                this.onQuestionAnswered.dispatch(wasCorrect, 0, null);
                if (wasCorrect) {
                    this.onQuestionAnsweredCorrectly.dispatch(0, null);
                } else {
                    this.onQuestionAnsweredIncorrectly.dispatch(0, null);
                }
                return;
            }
        }

        if (!this._isOpen) {
            this._isOpen = true;
            const input: Input = App.instance.game.input;
            const inputEnabled: boolean = input.enabled;
            input.enabled = false;
            const notifications: NotificationController = App.instance.prodigy.notifications;
            notifications.pause(this);
            notifications.clearNotifications();
            App.instance.prodigy.education.question(
                (wasCorrect: boolean, responseTime?: number, nFactor?: number, awardPrize?: boolean, awardInstantWin?: boolean, skill?: SkillDataSchema) => {
                    this._isOpen = false;
                    input.enabled = inputEnabled;
                    notifications.resume(this);
                    this.onQuestionAnswered.dispatch(wasCorrect, responseTime, skill);
                    if (wasCorrect) {
                        this.onQuestionAnsweredCorrectly.dispatch(responseTime, skill);
                    } else {
                        this.onQuestionAnsweredIncorrectly.dispatch(responseTime, skill);
                    }
                },
                undefined,
                undefined,
                undefined,
                undefined,
                false
            );
        }
    }

So if we run

_.constants.constants["GameConstants.Debug.EDUCATION_ENABLED"] = true
_.constants.constants["GameConstants.Debug.AUTO_ANSWER_CORRECT_PERCENT"] = 1

it will enable easy mode but we will need to rebuild prodigy's gamefile every update with a new debug code. We probably won't even be able to build it once.

thanks for looking into this, but

We probably won't even be able to build it once

why is this

hostedposted commented 3 years ago

some of the imports import from files that don't exist

ArcerionDev commented 3 years ago

some of the imports import from files that don't exist

oh I see

hostedposted commented 3 years ago

I was able to add easy mode by making some changes in p-np which allow education enabled to be set to false without crashing the game. WCM commit: https://github.com/Prodigy-Hacking/ProdigyMathGameHacking/commit/75fdbc8f981edc465816306657d47941dafa18e5. P-NP commit: https://github.com/Prodigy-Hacking/P-NP/commit/847f0a02ec8c08f7bffc97db027509a2877513d2

LeoBadeaux commented 3 years ago

🎉🎉🎉

PatheticMustan commented 3 years ago

holy shit what the fuck what a god