Skip to content

Commit

Permalink
Anchor co-op support
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettjoecox committed Jul 12, 2023
1 parent 500a961 commit cba2019
Show file tree
Hide file tree
Showing 37 changed files with 1,712 additions and 47 deletions.
28 changes: 26 additions & 2 deletions soh/soh/Enhancements/debugger/debugSaveEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,36 @@ std::map<uint32_t, ItemMapEntry> itemMapping = {
ITEM_MAP_ENTRY(ITEM_WALLET_GIANT),
ITEM_MAP_ENTRY(ITEM_SEEDS),
ITEM_MAP_ENTRY(ITEM_FISHING_POLE),
ITEM_MAP_ENTRY(ITEM_SONG_MINUET),
ITEM_MAP_ENTRY(ITEM_SONG_BOLERO),
ITEM_MAP_ENTRY(ITEM_SONG_SERENADE),
ITEM_MAP_ENTRY(ITEM_SONG_REQUIEM),
ITEM_MAP_ENTRY(ITEM_SONG_NOCTURNE),
ITEM_MAP_ENTRY(ITEM_SONG_PRELUDE),
ITEM_MAP_ENTRY(ITEM_SONG_LULLABY),
ITEM_MAP_ENTRY(ITEM_SONG_EPONA),
ITEM_MAP_ENTRY(ITEM_SONG_SARIA),
ITEM_MAP_ENTRY(ITEM_SONG_SUN),
ITEM_MAP_ENTRY(ITEM_SONG_TIME),
ITEM_MAP_ENTRY(ITEM_SONG_STORMS),
ITEM_MAP_ENTRY(ITEM_MEDALLION_FOREST),
ITEM_MAP_ENTRY(ITEM_MEDALLION_FIRE),
ITEM_MAP_ENTRY(ITEM_MEDALLION_WATER),
ITEM_MAP_ENTRY(ITEM_MEDALLION_SPIRIT),
ITEM_MAP_ENTRY(ITEM_MEDALLION_SHADOW),
ITEM_MAP_ENTRY(ITEM_MEDALLION_LIGHT),
ITEM_MAP_ENTRY(ITEM_KOKIRI_EMERALD),
ITEM_MAP_ENTRY(ITEM_GORON_RUBY),
ITEM_MAP_ENTRY(ITEM_ZORA_SAPPHIRE),
ITEM_MAP_ENTRY(ITEM_STONE_OF_AGONY),
ITEM_MAP_ENTRY(ITEM_GERUDO_CARD),
ITEM_MAP_ENTRY(ITEM_SKULL_TOKEN),
ITEM_MAP_ENTRY(ITEM_HEART_CONTAINER),
ITEM_MAP_ENTRY(ITEM_HEART_PIECE),
ITEM_MAP_ENTRY(ITEM_KEY_BOSS),
ITEM_MAP_ENTRY(ITEM_COMPASS),
ITEM_MAP_ENTRY(ITEM_DUNGEON_MAP),
ITEM_MAP_ENTRY(ITEM_KEY_SMALL),
ITEM_MAP_ENTRY(ITEM_HEART_CONTAINER),
ITEM_MAP_ENTRY(ITEM_HEART_PIECE),
ITEM_MAP_ENTRY(ITEM_MAGIC_SMALL),
ITEM_MAP_ENTRY(ITEM_MAGIC_LARGE)
};
Expand Down
13 changes: 13 additions & 0 deletions soh/soh/Enhancements/game-interactor/GameInteractionEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,4 +639,17 @@ namespace GameInteractionEffect {
void SlipperyFloor::_Remove() {
GameInteractor::State::SlipperyFloorActive = 0;
}

// MARK: - GiveItem
GameInteractionEffectQueryResult GiveItem::CanBeApplied() {
if (!GameInteractor::IsSaveLoaded()) {
return GameInteractionEffectQueryResult::NotPossible;
}

return GameInteractionEffectQueryResult::Possible;
}

void GiveItem::_Apply() {
GameInteractor::RawAction::GiveItem(parameters[0], parameters[1]);
}
}
5 changes: 5 additions & 0 deletions soh/soh/Enhancements/game-interactor/GameInteractionEffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ namespace GameInteractionEffect {
void _Apply() override;
void _Remove() override;
};

class GiveItem: public GameInteractionEffectBase, public ParameterizedGameInteractionEffect {
GameInteractionEffectQueryResult CanBeApplied() override;
void _Apply() override;
};
}

#endif /* __cplusplus */
Expand Down
2 changes: 2 additions & 0 deletions soh/soh/Enhancements/game-interactor/GameInteractor.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
typedef enum {
GI_SCHEME_BUILT_IN,
GI_SCHEME_CROWD_CONTROL,
GI_SCHEME_ANCHOR,
} GIScheme;

typedef enum {
Expand Down Expand Up @@ -220,6 +221,7 @@ class GameInteractor {
static void SetFlag(int16_t flagType, int16_t chestNum);
static void UnsetFlag(int16_t flagType, int16_t chestNum);
static void AddOrRemoveHealthContainers(int16_t amount);
static void GiveItem(uint16_t modId, uint16_t itemId);
static void AddOrRemoveMagic(int8_t amount);
static void HealOrDamagePlayer(int16_t hearts);
static void SetPlayerHealth(int16_t hearts);
Expand Down
Loading

0 comments on commit cba2019

Please sign in to comment.