Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document D_802946E0 #1176

Merged
merged 4 commits into from
Feb 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/battle/1A5830.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#include "hud_element.h"
#include "sprite.h"

s32 D_802946E0[] = { 100, 100, 100, 110, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130 };

s32 has_enchanted_part(Actor* actor) {
ActorPart* partIt = actor->partsTable;
s32 ret = FALSE;
Expand Down Expand Up @@ -2702,6 +2700,15 @@ API_CALLABLE(RemoveActor) {
}

API_CALLABLE(DropStarPoints) {
/// Star Point multiplier, indexed by actor count.
/// +10% multiplier for two actors
bates64 marked this conversation as resolved.
Show resolved Hide resolved
/// +30% multiplier for three or more actors
static s32 multiplier[] = {
bates64 marked this conversation as resolved.
Show resolved Hide resolved
100, 100, 100,
110,
130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
};

BattleStatus* battleStatus = &gBattleStatus;
PlayerData* playerData = &gPlayerData;
Bytecode* args = script->ptrReadPos;
Expand Down Expand Up @@ -2730,7 +2737,7 @@ API_CALLABLE(DropStarPoints) {

ntd = 0.0f;
if (!(enemyLevel < playerLevel)) {
ntd = ((enemyLevel - playerLevel) * 0.5f) * D_802946E0[battleStatus->initialEnemyCount];
ntd = ((enemyLevel - playerLevel) * 0.5f) * multiplier[battleStatus->initialEnemyCount];
ntd = (ntd + 50.0f) / 100.0f;
}
numToDrop = ntd;
Expand Down
Loading