mirror of
https://github.com/pret/pmd-red.git
synced 2026-10-01 13:28:04 -05:00
merge master
This commit is contained in:
1713
asm/ground_script.s
1713
asm/ground_script.s
File diff suppressed because it is too large
Load Diff
@@ -32,7 +32,7 @@ s16 sub_80A26B8(s16);
|
||||
s16 sub_80A26CC(s16);
|
||||
u8 sub_80A270C(s16 index);
|
||||
u8 sub_80A2728(s16 index);
|
||||
u8 sub_80A2740(s32 index);
|
||||
u8 sub_80A2740(s16 index);
|
||||
s16 sub_80A2750(s16);
|
||||
bool8 sub_80A27CC(s16);
|
||||
bool8 sub_80A2824(u8 index);
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
#ifndef GUARD_GROUND_LIVES_H
|
||||
#define GUARD_GROUND_LIVES_H
|
||||
|
||||
// ground_lives.s
|
||||
s16 sub_80A7AE8(s32);
|
||||
#include "structs/str_position.h"
|
||||
|
||||
#endif // GUARD_GROUND_LIVES_H
|
||||
// ground_lives.s
|
||||
s16 sub_80A7AE8(s16);
|
||||
s16 sub_80A8FD8(s32, PixelPos*);
|
||||
|
||||
#endif // GUARD_GROUND_LIVES_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
void GroundMap_ExecuteEnter(s16);
|
||||
void GroundMap_ExecuteEvent(s16 scriptIndex, u32);
|
||||
void GroundMap_ExecuteStation(s16, s16, s8, u32);
|
||||
void GroundMap_ExecuteStation(s32 _map, s32 _group, s32 _sector, bool32 _setScriptState);
|
||||
|
||||
bool8 GroundMapNotifyAll(s16);
|
||||
bool8 sub_80A4D48(s16 index);
|
||||
@@ -11,4 +11,4 @@ bool8 sub_80A4D48(s16 index);
|
||||
// ground_map_1.s
|
||||
extern s16 sub_80A5728(void);
|
||||
|
||||
#endif // GUARD_GROUND_MAP_1_H
|
||||
#endif // GUARD_GROUND_MAP_1_H
|
||||
|
||||
@@ -107,6 +107,7 @@ const u8* DecompressMoveID(const u8* a1, u16* moveID);
|
||||
bool8 sub_808DA44(s32, u32);
|
||||
void sub_808D144(PokemonStruct1 *pokemon, struct unkStruct_808D144 *r1);
|
||||
void sub_808CE74(s16 _species, bool32 _isLeader, u8* name);
|
||||
PokemonStruct1 *sub_808D278(s32 species);
|
||||
|
||||
static inline bool8 PokemonFlag1(PokemonStruct1 *mon)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ s32 GetPtsToNextRank(void);
|
||||
void SetTeamRankPoints(s32 newPts);
|
||||
void AddToTeamRankPts(s32 newPts);
|
||||
u8 GetRescueTeamRank(void);
|
||||
const u8 *GetTeamRankString(u8 index);
|
||||
const u8 *GetTeamRankString(u32 index);
|
||||
u8 GetIsTeamRenamed(void);
|
||||
u32 SaveRescueTeamInfo(u8 *param_1,u32 param_2);
|
||||
u32 ReadRescueTeamInfo(u8 *param_1, u32 param_2);
|
||||
|
||||
@@ -80,7 +80,7 @@ typedef struct BurnClassStatus
|
||||
/* 0x0 */ u8 status;
|
||||
/* 0x1 */ u8 turns;
|
||||
/* 0x2 */ u8 damageCountdown;
|
||||
/* 0x3 */ u8 unk4;
|
||||
/* 0x3 */ u8 badlyPoisonedDamageCount;
|
||||
} BurnClassStatus;
|
||||
|
||||
// Useful when checking if a mon is poisoned without having to check for Poison and Bad Poison every time.
|
||||
|
||||
@@ -314,8 +314,6 @@ SECTIONS {
|
||||
asm/code_809C5C4.o(.text);
|
||||
src/code_809D148.o(.text);
|
||||
src/ground_script.o(.text);
|
||||
asm/ground_script.o(.text);
|
||||
src/ground_script_2.o(.text);
|
||||
src/code_80A26CC.o(.text);
|
||||
asm/code_80A26CC_1.o(.text);
|
||||
src/ground_map.o(.text);
|
||||
|
||||
@@ -867,7 +867,7 @@ void ResetMonEntityData(EntityInfo *entInfo, bool8 setStatsToOne)
|
||||
entInfo->burnClassStatus.status = 0;
|
||||
entInfo->burnClassStatus.turns = 0;
|
||||
entInfo->burnClassStatus.damageCountdown = 0;
|
||||
entInfo->burnClassStatus.unk4 = 0;
|
||||
entInfo->burnClassStatus.badlyPoisonedDamageCount = 0;
|
||||
entInfo->frozenClassStatus.status = 0;
|
||||
entInfo->frozenClassStatus.turns = 0;
|
||||
entInfo->frozenClassStatus.damageCountdown = 0;
|
||||
|
||||
@@ -239,9 +239,9 @@ void sub_8074094(Entity *entity)
|
||||
}
|
||||
else if (entityInfo->burnClassStatus.status == STATUS_BADLY_POISONED) {
|
||||
if (entityInfo->burnClassStatus.damageCountdown == 0 || --entityInfo->burnClassStatus.damageCountdown == 0) {
|
||||
s32 turns = entityInfo->burnClassStatus.unk4;
|
||||
if (entityInfo->burnClassStatus.unk4 < BAD_POISON_DMG_TURN_VALUES_COUNT - 1)
|
||||
entityInfo->burnClassStatus.unk4++;
|
||||
s32 turns = entityInfo->burnClassStatus.badlyPoisonedDamageCount;
|
||||
if (entityInfo->burnClassStatus.badlyPoisonedDamageCount < BAD_POISON_DMG_TURN_VALUES_COUNT - 1)
|
||||
entityInfo->burnClassStatus.badlyPoisonedDamageCount++;
|
||||
entityInfo->burnClassStatus.damageCountdown = gBadPoisonDmgCountdown;
|
||||
if (turns >= BAD_POISON_DMG_TURN_VALUES_COUNT - 1)
|
||||
turns = BAD_POISON_DMG_TURN_VALUES_COUNT - 1;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "felicity_bank.h"
|
||||
#include "flash.h"
|
||||
#include "friend_list_menu.h"
|
||||
#include "ground_lives.h"
|
||||
#include "ground_main.h"
|
||||
#include "ground_script.h"
|
||||
#include "gulpin_shop_801FB50.h"
|
||||
@@ -55,7 +56,6 @@ PokemonStruct1 *sub_808D3F8(void);
|
||||
PokemonStruct1 *sub_80A8D54(s16);
|
||||
void sub_80A7DDC(s16 *, s16*);
|
||||
u8 sub_80A8CF0(s16);
|
||||
s16 sub_80A7AE8(s16);
|
||||
s16 sub_80A8BFC(s32);
|
||||
|
||||
struct Unk8116040Struct
|
||||
|
||||
@@ -179,11 +179,14 @@ u8 sub_80A2728(s16 index)
|
||||
return temp->dungeonIndex;
|
||||
}
|
||||
|
||||
u8 sub_80A2740(s32 index)
|
||||
u8 sub_80A2740(s16 index)
|
||||
{
|
||||
const DungeonInfo *temp;
|
||||
s32 index_s32;
|
||||
|
||||
temp = GetDungeonInfo_80A2608((s16) index);
|
||||
index_s32 = index;
|
||||
|
||||
temp = GetDungeonInfo_80A2608(index_s32);
|
||||
return temp->dungeonIndex;
|
||||
}
|
||||
|
||||
|
||||
@@ -579,7 +579,7 @@ static void WriteBurnClassStatus(DataSerializer *seri, BurnClassStatus *src)
|
||||
WriteBytes(seri, &src->status, 1);
|
||||
WriteU8(seri, src->turns);
|
||||
WriteU8(seri, src->damageCountdown);
|
||||
WriteU8(seri, src->unk4);
|
||||
WriteU8(seri, src->badlyPoisonedDamageCount);
|
||||
}
|
||||
|
||||
static void WriteFrozenClassStatus(DataSerializer *seri, FrozenClassStatus *src)
|
||||
@@ -1370,7 +1370,7 @@ static void ReadBurnClassStatus(DataSerializer *seri, BurnClassStatus *dst)
|
||||
ReadBytes(seri, &dst->status, 1);
|
||||
dst->turns = ReadU8(seri);
|
||||
dst->damageCountdown = ReadU8(seri);
|
||||
dst->unk4 = ReadU8(seri);
|
||||
dst->badlyPoisonedDamageCount = ReadU8(seri);
|
||||
}
|
||||
|
||||
static void ReadFrozenClassStatus(DataSerializer *seri, FrozenClassStatus *dst)
|
||||
|
||||
@@ -129,22 +129,22 @@ void GroundMap_ExecuteEvent(s16 scriptIndex, u32 param_2)
|
||||
GroundScript_ExecutePP(&gGroundMapAction->action, 0, &script, &gUnknown_81175E0);
|
||||
}
|
||||
|
||||
void GroundMap_ExecuteStation(s16 param_1, s16 param_2, s8 param_3, u32 param_4)
|
||||
void GroundMap_ExecuteStation(s32 _map, s32 _group, s32 _sector, bool32 _setScriptState)
|
||||
{
|
||||
ScriptInfoSmall script;
|
||||
s32 iVar1;
|
||||
s32 iVar2;
|
||||
s32 iVar3;
|
||||
u8 iVar4;
|
||||
s32 map;
|
||||
s32 group;
|
||||
s32 sector;
|
||||
bool8 setScriptState;
|
||||
|
||||
iVar1 = param_1;
|
||||
iVar2 = param_2;
|
||||
iVar3 = param_3;
|
||||
iVar4 = param_4;
|
||||
map = (s16)_map;
|
||||
group = (s16)_group;
|
||||
sector = (s8)_sector;
|
||||
setScriptState = (bool8)_setScriptState;
|
||||
|
||||
Log(0, gUnknown_81175EC, iVar1, iVar2, iVar3, iVar4); // GroundMap ExecuteStation %3d %3d %3d %d
|
||||
GroundMap_GetStationScript(&script, iVar1, iVar2, iVar3);
|
||||
if (iVar4 != 0)
|
||||
Log(0, gUnknown_81175EC, map, group, sector, setScriptState); // GroundMap ExecuteStation %3d %3d %3d %d
|
||||
GroundMap_GetStationScript(&script, map, group, sector);
|
||||
if (setScriptState != 0)
|
||||
script.state = 5;
|
||||
|
||||
GroundScript_ExecutePP(&gGroundMapAction->action, 0, &script, &gUnknown_8117644);
|
||||
|
||||
1005
src/ground_script.c
1005
src/ground_script.c
File diff suppressed because it is too large
Load Diff
@@ -1,103 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "debug.h"
|
||||
#include "event_flag.h"
|
||||
#include "ground_map_1.h"
|
||||
#include "ground_script.h"
|
||||
|
||||
extern u8 gAnyScriptLocked;
|
||||
extern u8 gScriptLocks[];
|
||||
extern u8 gScriptLockConds[];
|
||||
extern u8 gUnknown_8116848[];
|
||||
|
||||
bool8 GroundLivesNotifyAll(s16);
|
||||
bool8 GroundObjectsNotifyAll(s16);
|
||||
bool8 GroundEffectsNotifyAll(s16);
|
||||
|
||||
void GroundScript_Unlock(void)
|
||||
{
|
||||
s32 index;
|
||||
bool8 cond;
|
||||
|
||||
if(gAnyScriptLocked == 0) return;
|
||||
|
||||
gAnyScriptLocked = 0;
|
||||
index = 0;
|
||||
for (index = 0; index <= 0x80; index++) {
|
||||
if(gScriptLocks[index] != 0) {
|
||||
Log(1, gUnknown_8116848, index);
|
||||
cond = GroundMapNotifyAll(index);
|
||||
cond |= GroundLivesNotifyAll(index);
|
||||
cond |= GroundObjectsNotifyAll(index);
|
||||
cond |= GroundEffectsNotifyAll(index);
|
||||
|
||||
if(gScriptLockConds[index] != 0) {
|
||||
if (cond) {
|
||||
GroundMapNotifyAll(index | 0x80);
|
||||
GroundLivesNotifyAll(index | 0x80);
|
||||
GroundObjectsNotifyAll(index | 0x80);
|
||||
GroundEffectsNotifyAll(index | 0x80);
|
||||
gScriptLocks[index] = gScriptLockConds[index] = 0;
|
||||
}
|
||||
} else {
|
||||
gScriptLocks[index] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const ScriptCommand *FindLabel(Action *action, s32 r1)
|
||||
{
|
||||
ScriptCommand script;
|
||||
const ScriptCommand *scriptPtr2;
|
||||
const ScriptCommand *scriptPtr;
|
||||
|
||||
scriptPtr2 = action->scriptData.script.ptr2;
|
||||
scriptPtr = scriptPtr2 + 1;
|
||||
|
||||
while(1) {
|
||||
script = *scriptPtr;
|
||||
scriptPtr++;
|
||||
|
||||
if(script.op == 0xF4 && r1 == script.argShort) break;
|
||||
|
||||
// DS: Assert(script.op != 0, "script search label error %d", label)
|
||||
// DS: Assert(script.op != 0xF6, "script search label error %d", label)
|
||||
}
|
||||
return scriptPtr;
|
||||
}
|
||||
|
||||
const ScriptCommand *ResolveJump(Action *action, s32 r1)
|
||||
{
|
||||
ScriptCommand script;
|
||||
const ScriptCommand *scriptPtr;
|
||||
s32 temp;
|
||||
|
||||
scriptPtr = action->scriptData.script.ptr;
|
||||
|
||||
while(1) {
|
||||
script = *scriptPtr;
|
||||
|
||||
if (script.op == 0xCC)
|
||||
{
|
||||
if(FlagJudge(r1, script.arg1, JUDGE_EQ))
|
||||
return FindLabel(action, script.argShort);
|
||||
}
|
||||
else if (script.op == 0xCD)
|
||||
{
|
||||
if(FlagJudge(r1, script.arg1, script.argByte))
|
||||
return FindLabel(action, script.argShort);
|
||||
}
|
||||
else if (script.op == 0xCE)
|
||||
{
|
||||
temp = GetScriptVarValue(action->scriptData.localVars.buf, (s16)script.arg1);
|
||||
if(FlagJudge(r1, temp, script.argByte))
|
||||
return FindLabel(action, script.argShort);
|
||||
}
|
||||
else
|
||||
{
|
||||
return scriptPtr;
|
||||
}
|
||||
scriptPtr++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -412,7 +412,7 @@ void BurnedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, bool8 dis
|
||||
entityInfo->burnClassStatus.status = STATUS_BURN;
|
||||
entityInfo->burnClassStatus.turns = CalculateStatusTurns(target,gBurnTurnRange,TRUE) + 1;
|
||||
entityInfo->burnClassStatus.damageCountdown = 0;
|
||||
entityInfo->burnClassStatus.unk4 = 0;
|
||||
entityInfo->burnClassStatus.badlyPoisonedDamageCount = 0;
|
||||
isNotBurned = FALSE;
|
||||
if (param_3 != 0) {
|
||||
sub_8041C34(target);
|
||||
@@ -501,7 +501,7 @@ void PoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag
|
||||
entityInfo->burnClassStatus.status = STATUS_POISONED;
|
||||
entityInfo->burnClassStatus.turns = CalculateStatusTurns(target,gPoisonTurnRange,TRUE) + 1;
|
||||
entityInfo->burnClassStatus.damageCountdown = 0;
|
||||
entityInfo->burnClassStatus.unk4 = 0;
|
||||
entityInfo->burnClassStatus.badlyPoisonedDamageCount = 0;
|
||||
isNotPoisoned = FALSE;
|
||||
sub_8041C6C(target);
|
||||
TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB598);
|
||||
@@ -588,7 +588,7 @@ void BadlyPoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayM
|
||||
entityInfo->burnClassStatus.status = STATUS_BADLY_POISONED;
|
||||
entityInfo->burnClassStatus.turns = CalculateStatusTurns(target,gBadPoisonTurnRange,TRUE) + 1;
|
||||
entityInfo->burnClassStatus.damageCountdown = 0;
|
||||
entityInfo->burnClassStatus.unk4 = 0;
|
||||
entityInfo->burnClassStatus.badlyPoisonedDamageCount = 0;
|
||||
isNotBadlyPoisoned = FALSE;
|
||||
sub_8041C7C(target);
|
||||
TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB5B4);
|
||||
@@ -1341,7 +1341,7 @@ void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag
|
||||
entityInfo->burnClassStatus.status = STATUS_PARALYSIS;
|
||||
entityInfo->burnClassStatus.turns = CalculateStatusTurns(target,gParalysisTurnRange,TRUE) + 1;
|
||||
entityInfo->burnClassStatus.damageCountdown = 0;
|
||||
entityInfo->burnClassStatus.unk4 = 0;
|
||||
entityInfo->burnClassStatus.badlyPoisonedDamageCount = 0;
|
||||
bVar6 = FALSE;
|
||||
TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB2AC);
|
||||
sub_8041C1C(target);
|
||||
|
||||
@@ -280,12 +280,14 @@ PokemonStruct1 *sub_808D1DC(PokemonStruct1 *pokemon)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PokemonStruct1 *sub_808D278(s16 species, PokemonStruct1 *pokemon)
|
||||
PokemonStruct1 *sub_808D278(s32 species)
|
||||
{
|
||||
u32 friendArea;
|
||||
s32 i;
|
||||
|
||||
friendArea = gMonsterParameters[species].friendArea;
|
||||
s16 species_s16 = (s16)species;
|
||||
|
||||
friendArea = gMonsterParameters[species_s16].friendArea;
|
||||
|
||||
if(!gFriendAreas[friendArea]) return NULL;
|
||||
for (i = 0; i < NUM_MONSTERS; i++) {
|
||||
|
||||
@@ -98,9 +98,10 @@ u8 GetRescueTeamRank(void)
|
||||
return LUCARIO_RANK;
|
||||
}
|
||||
|
||||
const u8 *GetTeamRankString(u8 index)
|
||||
const u8 *GetTeamRankString(u32 index)
|
||||
{
|
||||
return gRescueTeamRanks[index];
|
||||
u8 index_u8 = (u8)index;
|
||||
return gRescueTeamRanks[index_u8];
|
||||
}
|
||||
|
||||
// Unused
|
||||
|
||||
1111
src/text_1.c
1111
src/text_1.c
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user