mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
* add linux clang format script * first shot at powershell * whoops * webrequest is slow, try webclient * just get the one file * simplify and maybe make it work? * whoops again * try a different suggestion * why is it always windows * again * try again * bit of path stuff * chmod +x * add action to check * fix workflow name * run clang format
39 lines
1.5 KiB
C++
39 lines
1.5 KiB
C++
#include "Infinite.h"
|
|
#include <libultraship/bridge.h>
|
|
#include "Enhancements/GameInteractor/GameInteractor.h"
|
|
#include "variables.h"
|
|
|
|
void RegisterInfiniteCheats() {
|
|
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameStateUpdate>([]() {
|
|
if (gPlayState == nullptr)
|
|
return;
|
|
|
|
if (CVarGetInteger("gCheats.InfiniteHealth", 0)) {
|
|
gSaveContext.save.saveInfo.playerData.health = gSaveContext.save.saveInfo.playerData.healthCapacity;
|
|
}
|
|
|
|
if (CVarGetInteger("gCheats.InfiniteMagic", 0)) {
|
|
uint8_t magicLevel = gSaveContext.save.saveInfo.playerData.magicLevel;
|
|
if (magicLevel == 1) {
|
|
gSaveContext.save.saveInfo.playerData.magic = MAGIC_NORMAL_METER;
|
|
} else if (magicLevel == 2) {
|
|
gSaveContext.save.saveInfo.playerData.magic = MAGIC_DOUBLE_METER;
|
|
}
|
|
}
|
|
|
|
if (CVarGetInteger("gCheats.InfiniteRupees", 0)) {
|
|
gSaveContext.save.saveInfo.playerData.rupees = CUR_CAPACITY(UPG_WALLET);
|
|
}
|
|
|
|
if (CVarGetInteger("gCheats.InfiniteConsumables", 0)) {
|
|
AMMO(ITEM_BOW) = CUR_CAPACITY(UPG_QUIVER);
|
|
AMMO(ITEM_BOMB) = CUR_CAPACITY(UPG_BOMB_BAG);
|
|
AMMO(ITEM_BOMBCHU) = CUR_CAPACITY(UPG_BOMB_BAG);
|
|
AMMO(ITEM_DEKU_STICK) = CUR_CAPACITY(UPG_DEKU_STICKS);
|
|
AMMO(ITEM_DEKU_NUT) = CUR_CAPACITY(UPG_DEKU_NUTS);
|
|
AMMO(ITEM_MAGIC_BEANS) = 20;
|
|
AMMO(ITEM_POWDER_KEG) = 1;
|
|
}
|
|
});
|
|
}
|