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 8, 2023
1 parent 500a961 commit 856b396
Show file tree
Hide file tree
Showing 33 changed files with 1,053 additions and 22 deletions.
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 856b396

Please sign in to comment.