mirror of
https://github.com/pmret/papermario.git
synced 2024-11-09 12:32:38 +01:00
refactor functions according to reviews.
This commit is contained in:
parent
ecbf45bcbb
commit
15228aa8d4
@ -1725,7 +1725,7 @@ typedef struct {
|
||||
|
||||
typedef struct EffectInstanceData {
|
||||
/* 0x00 */ s32 unk_00;
|
||||
/* 0x0C */ Vec3f pos;
|
||||
/* 0x04 */ Vec3f pos;
|
||||
/* 0x10 */ Vec3f rotation;
|
||||
/* 0x1C */ Vec3f scale;
|
||||
/* 0x28 */ char unk_28[0x4];
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
void dispatch_event_partner(s8 lastEventType) {
|
||||
BattleStatus* battleStatus = &gBattleStatus;
|
||||
s32 temp_ret;
|
||||
Actor* partnerActor = battleStatus->partnerActor;
|
||||
ScriptInstance* onHitScript = partnerActor->onHitScript;
|
||||
ScriptID onHitID = partnerActor->onHitID;
|
||||
@ -37,7 +36,7 @@ void dispatch_event_partner_continue_turn(s8 lastEventType) {
|
||||
partnerActor->onHitScript = script;
|
||||
partnerActor->onHitID = script->id;
|
||||
script->owner1.actorID = ActorID_PARTNER;
|
||||
|
||||
|
||||
if (onHitScript != NULL) {
|
||||
kill_script_by_ID(onHitID);
|
||||
}
|
||||
@ -113,7 +112,7 @@ ApiStatus func_8027FC90(ScriptInstance* script, s32 isInitialCall) {
|
||||
hitResult = calc_partner_damage_enemy();
|
||||
show_damage_popup(actor->movePos.goal.x, actor->movePos.goal.y, actor->movePos.goal.z, battleStatus->lastAttackDamage);
|
||||
set_variable(script, outVar, hitResult);
|
||||
|
||||
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
#else
|
||||
@ -149,7 +148,7 @@ ApiStatus func_8028070C(ScriptInstance* script, s32 isInitialCall) {
|
||||
Actor* actor = get_actor(script->owner1.actorID);
|
||||
s32 damageAmount = get_variable(script, *args++);
|
||||
s32 event = get_variable(script, *args++);
|
||||
|
||||
|
||||
battleStatus->currentTargetID = actor->targetActorID;
|
||||
battleStatus->currentTargetPart = actor->targetPartIndex;
|
||||
|
||||
@ -162,6 +161,7 @@ ApiStatus func_8028070C(ScriptInstance* script, s32 isInitialCall) {
|
||||
|
||||
ApiStatus DeletePartner(ScriptInstance* script, s32 isInitialCall) {
|
||||
BattleStatus* battleStatus = &gBattleStatus;
|
||||
|
||||
delete_actor(battleStatus->partnerActor);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
@ -1,19 +1,33 @@
|
||||
#include "common.h"
|
||||
|
||||
typedef struct StarPower { void* dmaStart; void* dmaEnd; void* dmaDest; Bytecode* init; } StarPower;
|
||||
typedef struct StarPowerEntry {
|
||||
/* 0x04 */ void* dmaStart;
|
||||
/* 0x08 */ void* dmaEnd;
|
||||
/* 0x0C */ void* dmaDest;S
|
||||
/* 0x10 */ Bytecode* init;
|
||||
} StarPowerEntry; // size = 0x14
|
||||
|
||||
extern StarPower D_8029C7D0[13];
|
||||
extern StarPowerEntry D_8029C7D0[13];
|
||||
|
||||
typedef struct WhateverThisIs { s8 starpoints; s8 a; s8 b; s8 c; s32 w; s32 x; s32 y; s32 z; } WhateverThisIs;
|
||||
typedef struct StarPowerDesc {
|
||||
/* 0x00 */ s8 starPoints;
|
||||
/* 0x01 */ s8 a;
|
||||
/* 0x02 */ s8 b;
|
||||
/* 0x03 */ s8 c;
|
||||
/* 0x04 */ s32 w;
|
||||
/* 0x08 */ s32 x;
|
||||
/* 0x0C */ s32 y;
|
||||
/* 0x10 */ s32 z;
|
||||
} StarPowerDesc; // size = 0x14
|
||||
|
||||
extern WhateverThisIs D_8008F071[];
|
||||
extern StarPowerDesc D_8008F071[];
|
||||
|
||||
ApiStatus LoadStarPowerScript(ScriptInstance *script, s32 isInitialCall) {
|
||||
BattleStatus *battleStatus = &gBattleStatus;
|
||||
PlayerData *playerData = &gPlayerData;
|
||||
s16 selectedItemID;
|
||||
|
||||
playerData->specialBarsFilled -= D_8008F071[battleStatus->selectedMoveID].starpoints * 256;
|
||||
playerData->specialBarsFilled -= D_8008F071[battleStatus->selectedMoveID].starPoints * 256;
|
||||
selectedItemID = battleStatus->selectedItemID;
|
||||
dma_copy((&D_8029C7D0[selectedItemID])->dmaStart, (&D_8029C7D0[selectedItemID])->dmaEnd, (&D_8029C7D0[selectedItemID])->dmaDest);
|
||||
script->varTable[0] = (&D_8029C7D0[selectedItemID])->init;
|
||||
|
Loading…
Reference in New Issue
Block a user