forked from HarbourMasters/2ship2harkinian
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Enhancement] Blast Mask with Powder Keg (HarbourMasters#642)
* Blast Mask adds Powder Keg explosive property. * Alphabetical Menu Listing + clang * Apply suggestions from code review --------- Co-authored-by: Garrett Cox <[email protected]>
- Loading branch information
1 parent
5de6a9a
commit 2d8bc17
Showing
5 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include <libultraship/bridge.h> | ||
#include "Enhancements/GameInteractor/GameInteractor.h" | ||
#include "global.h" | ||
|
||
static uint32_t bombType; | ||
|
||
extern "C" { | ||
#include "overlays/actors/ovl_En_Bom/z_en_bom.h" | ||
EquipSlot func_8082FDC4(void); | ||
} | ||
|
||
void RegisterBlastMaskKeg() { | ||
GameInteractor::Instance->RegisterGameHookForID<GameInteractor::ShouldActorInit>( | ||
ACTOR_EN_BOM, [](Actor* actor, bool* should) { | ||
Player* player = GET_PLAYER(gPlayState); | ||
if (CVarGetInteger("gEnhancements.Masks.BlastMaskKeg", 0)) { | ||
ItemId item; | ||
EquipSlot i = func_8082FDC4(); | ||
|
||
i = ((i >= EQUIP_SLOT_A) && (player->transformation == PLAYER_FORM_FIERCE_DEITY) && | ||
(player->heldItemAction != PLAYER_IA_SWORD_TWO_HANDED)) | ||
? EQUIP_SLOT_B | ||
: i; | ||
|
||
item = Player_GetItemOnButton(gPlayState, player, i); | ||
if (item == ITEM_F0) { | ||
actor->shape.rot.x = BOMB_EXPLOSIVE_TYPE_POWDER_KEG; | ||
} | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef EQUIPMENT_BLAST_MASK_KEG_H | ||
#define EQUIPMENT_BLAST_MASK_KEG_H | ||
|
||
void RegisterBlastMaskKeg(); | ||
|
||
#endif // EQUIPMENT_BLAST_MASK_KEG_H |