Merge branch 'RHH/upcoming' into RHH/pr/feature/formBattleChange

This commit is contained in:
Eduardo Quezada 2023-03-12 15:53:32 -03:00
commit a0feaabef1
21 changed files with 255 additions and 106 deletions

View File

@ -41,18 +41,31 @@ Debug_CheatStart::
release
end
Debug_FlagsNotSetMessage::
Debug_FlagsNotSetOverworldConfigMessage::
lockall
message Debug_FlagsNotSetMessage_Text
message Debug_FlagsNotSetOverworldConfigMessage_Text
waitmessage
waitbuttonpress
releaseall
end
Debug_FlagsNotSetMessage_Text:
Debug_FlagsNotSetOverworldConfigMessage_Text:
.string "Feature unavailable!\n"
.string "Please define a usable flag in:\l"
.string "'include/constants/overworld{UNDERSCORE}config.h'!$"
.string "'include/config/overworld.h'!$"
Debug_FlagsNotSetBattleConfigMessage::
lockall
message Debug_FlagsNotSetBattleConfigMessage_Text
waitmessage
waitbuttonpress
releaseall
end
Debug_FlagsNotSetBattleConfigMessage_Text:
.string "Feature unavailable!\n"
.string "Please define a usable flag in:\l"
.string "'include/config/battle.h'!$"
Debug_Script_1::
end

View File

@ -657,6 +657,7 @@ struct BattleStruct
u8 battleBondTransformed[NUM_BATTLE_SIDES]; // Bitfield for each party.
u8 storedHealingWish:4; // Each battler as a bit.
u8 storedLunarDance:4; // Each battler as a bit.
u16 supremeOverlordModifier[MAX_BATTLERS_COUNT];
};
#define F_DYNAMIC_TYPE_1 (1 << 6)

View File

@ -2,16 +2,11 @@
#define GUARD_CONFIG_DEBUG_H
// Overworld Debug
#define DEBUG_OVERWORLD_MENU TRUE // Enables a overworld debug menu for changing flags, variables, giving pokemon and more, accessed by holding R and pressing START while in the overworld by default.
#define DEBUG_OVERWORLD_MENU TRUE // Enables an overworld debug menu to change flags, variables, giving pokemon and more, accessed by holding R and pressing START while in the overworld by default.
#define DEBUG_OVERWORLD_HELD_KEYS (R_BUTTON) // The keys required to be held to open the debug menu.
#define DEBUG_OVERWORLD_TRIGGER_EVENT pressedStartButton // The event that opens the menu when holding the key(s) defined in DEBUG_OVERWORLD_HELD_KEYS.
#define DEBUG_OVERWORLD_IN_MENU FALSE // Replaces the overworld debug menu button combination with a start menu entry (above Pokédex).
// Debug Flags
// To use the following debug features, replace the 0s with the flag ID you're assigning it to.
// Eg: Replace with FLAG_UNUSED_0x264 so you can use that flag to toggle the feature.
#define DEBUG_FLAG_NO_COLLISION 0 // If this flag is set, the debug function in the Utility submenu to disable player collision can be used.
// Battle Debug Menu
#define DEBUG_BATTLE_MENU TRUE // If set to TRUE, enables a debug menu to use in battles by pressing the Select button.

View File

@ -9,5 +9,6 @@
// Eg: Replace with FLAG_UNUSED_0x264 so you can use that flag to toggle the feature.
#define OW_FLAG_NO_ENCOUNTER 0 // If this flag is set, wild encounters will be disabled.
#define OW_FLAG_NO_TRAINER_SEE 0 // If this flag is set, trainers will not battle the player unless they're talked to.
#define OW_FLAG_NO_COLLISION 0 // If this flag is set, the player will be able to walk over tiles with collision. Mainly intended for debugging purposes.
#endif // GUARD_CONFIG_OVERWORLD_H

View File

@ -1117,10 +1117,9 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
break;
case EFFECT_GROWTH:
case EFFECT_ATTACK_SPATK_UP: // work up
if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL))
if ((!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) && !BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK))
|| (!HasDamagingMove(battlerAtk)))
score -= 10;
else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL))
score -= 8;
break;
case EFFECT_ROTOTILLER:
if (isDoubleBattle)
@ -2447,7 +2446,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
}
break;
case EFFECT_ELECTRIFY:
if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER
if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER
//|| GetMoveTypeSpecial(battlerDef, predictedMove) == TYPE_ELECTRIC // Move will already be electric type
|| PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove))
score -= 10;
@ -4633,7 +4632,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
score += 2; // Give target more weaknesses
break;
case EFFECT_ELECTRIFY:
if (predictedMove != MOVE_NONE && gBattleMoves[predictedMove].type == TYPE_NORMAL
if (predictedMove != MOVE_NONE
&& (AI_DATA->abilities[battlerAtk] == ABILITY_VOLT_ABSORB
|| AI_DATA->abilities[battlerAtk] == ABILITY_MOTOR_DRIVE
|| AI_DATA->abilities[battlerAtk] == ABILITY_LIGHTNING_ROD))

View File

@ -607,7 +607,7 @@ static const struct WindowTemplate sHealthboxWindowTemplate = {
.baseBlock = 0
};
static const u8 sMegaTriggerGfx[] = INCBIN_U8("graphics/battle_interface/mega_trigger.4bpp");
static const u8 ALIGNED(4) sMegaTriggerGfx[] = INCBIN_U8("graphics/battle_interface/mega_trigger.4bpp");
static const u16 sMegaTriggerPal[] = INCBIN_U16("graphics/battle_interface/mega_trigger.gbapal");
static const struct SpriteSheet sSpriteSheet_MegaTrigger =
@ -1435,10 +1435,10 @@ enum
INDICATOR_COUNT,
};
static const u8 sMegaIndicatorGfx[] = INCBIN_U8("graphics/battle_interface/mega_indicator.4bpp");
static const u8 ALIGNED(4) sMegaIndicatorGfx[] = INCBIN_U8("graphics/battle_interface/mega_indicator.4bpp");
static const u16 sMegaIndicatorPal[] = INCBIN_U16("graphics/battle_interface/mega_indicator.gbapal");
static const u8 sAlphaIndicatorGfx[] = INCBIN_U8("graphics/battle_interface/alpha_indicator.4bpp");
static const u8 sOmegaIndicatorGfx[] = INCBIN_U8("graphics/battle_interface/omega_indicator.4bpp");
static const u8 ALIGNED(4) sAlphaIndicatorGfx[] = INCBIN_U8("graphics/battle_interface/alpha_indicator.4bpp");
static const u8 ALIGNED(4) sOmegaIndicatorGfx[] = INCBIN_U8("graphics/battle_interface/omega_indicator.4bpp");
static const u16 sAlphaOmegaIndicatorPal[] = INCBIN_U16("graphics/battle_interface/alpha_indicator.gbapal");
static const struct SpriteSheet sMegaIndicator_SpriteSheets[] =
@ -2768,7 +2768,7 @@ static void SafariTextIntoHealthboxObject(void *dest, u8 *windowTileData, u32 wi
#define tSpriteId1 data[6]
#define tSpriteId2 data[7]
static const u8 sAbilityPopUpGfx[] = INCBIN_U8("graphics/battle_interface/ability_pop_up.4bpp");
static const u8 ALIGNED(4) sAbilityPopUpGfx[] = INCBIN_U8("graphics/battle_interface/ability_pop_up.4bpp");
static const u16 sAbilityPopUpPalette[] = INCBIN_U16("graphics/battle_interface/ability_pop_up.gbapal");
static const struct SpriteSheet sSpriteSheet_AbilityPopUp =
@ -3227,9 +3227,9 @@ static const struct SpriteTemplate sSpriteTemplate_LastUsedBallWindow =
};
#if B_LAST_USED_BALL_BUTTON == R_BUTTON
static const u8 sLastUsedBallWindowGfx[] = INCBIN_U8("graphics/battle_interface/last_used_ball_r.4bpp");
static const u8 ALIGNED(4) sLastUsedBallWindowGfx[] = INCBIN_U8("graphics/battle_interface/last_used_ball_r.4bpp");
#else
static const u8 sLastUsedBallWindowGfx[] = INCBIN_U8("graphics/battle_interface/last_used_ball_l.4bpp");
static const u8 ALIGNED(4) sLastUsedBallWindowGfx[] = INCBIN_U8("graphics/battle_interface/last_used_ball_l.4bpp");
#endif
static const struct SpriteSheet sSpriteSheet_LastUsedBallWindow =
{

View File

@ -284,7 +284,7 @@ static const u8 sText_PkmnPreventsPoisoningWith[] = _("{B_EFF_NAME_WITH_PREFIX}'
static const u8 sText_PkmnPreventsConfusionWith[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_DEF_ABILITY}\nprevents confusion!");
static const u8 sText_PkmnRaisedFirePowerWith[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_DEF_ABILITY}\nraised its FIRE power!");
static const u8 sText_PkmnAnchorsItselfWith[] = _("{B_DEF_NAME_WITH_PREFIX} anchors\nitself with {B_DEF_ABILITY}!");
static const u8 sText_PkmnCutsAttackWith[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\ncuts {B_DEF_NAME_WITH_PREFIX}'s ATTACK!");
static const u8 sText_PkmnCutsAttackWith[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\ncuts {B_DEF_NAME_WITH_PREFIX}'s attack!");
static const u8 sText_PkmnPreventsStatLossWith[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\nprevents stat loss!");
static const u8 sText_PkmnHurtsWith[] = _("{B_ATK_NAME_WITH_PREFIX} was hurt by\n{B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1}!");
static const u8 sText_PkmnTraced[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} TRACED\n{B_BUFF1}'s {B_BUFF2}!");

View File

@ -62,6 +62,7 @@ static u8 GetFlingPowerFromItemId(u16 itemId);
static void SetRandomMultiHitCounter();
static u32 GetBattlerItemHoldEffectParam(u8 battlerId, u16 item);
static u16 GetInverseTypeMultiplier(u16 multiplier);
static u16 GetSupremeOverlordModifier(u8 battlerId);
extern const u8 *const gBattleScriptsForMoveEffects[];
extern const u8 *const gBattlescriptsForRunningByItem[];
@ -4274,6 +4275,28 @@ bool8 ChangeTypeBasedOnTerrain(u8 battlerId)
return TRUE;
}
// Supreme Overlord adds a damage boost for each fainted ally.
// The first ally adds a x1.2 boost, and subsequent allies add an extra x0.1 boost each.
static u16 GetSupremeOverlordModifier(u8 battlerId)
{
u32 i;
u8 side = GetBattlerSide(battlerId);
struct Pokemon *party = (side == B_SIDE_PLAYER) ? gPlayerParty : gEnemyParty;
u16 modifier = UQ_4_12(1.0);
bool8 appliedFirstBoost = FALSE;
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE
&& !GetMonData(&party[i], MON_DATA_IS_EGG)
&& GetMonData(&party[i], MON_DATA_HP) == 0)
modifier += (!appliedFirstBoost) ? UQ_4_12(0.2) : UQ_4_12(0.1);
appliedFirstBoost = TRUE;
}
return modifier;
}
u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 moveArg)
{
u8 effect = 0;
@ -4824,6 +4847,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!gSpecialStatuses[battler].switchInAbilityDone && CountUsablePartyMons(battler) < PARTY_SIZE)
{
gSpecialStatuses[battler].switchInAbilityDone = TRUE;
gBattleStruct->supremeOverlordModifier[battler] = GetSupremeOverlordModifier(battler);
BattleScriptPushCursorAndCallback(BattleScript_SupremeOverlordActivates);
effect++;
}
@ -8702,28 +8726,6 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef)
return basePower;
}
// Supreme Overlord adds a damage boost for each fainted ally.
// The first ally adds a x1.2 boost, and subsequent allies add an extra x0.1 boost each.
static u16 GetSupremeOverlordModifier(u8 battlerId)
{
u32 i;
u8 side = GetBattlerSide(battlerId);
struct Pokemon *party = (side == B_SIDE_PLAYER) ? gPlayerParty : gEnemyParty;
u16 modifier = UQ_4_12(1.0);
bool8 appliedFirstBoost = FALSE;
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE
&& !GetMonData(&party[i], MON_DATA_IS_EGG)
&& GetMonData(&party[i], MON_DATA_HP) == 0)
modifier += (!appliedFirstBoost) ? UQ_4_12(0.2) : UQ_4_12(0.1);
appliedFirstBoost = TRUE;
}
return modifier;
}
static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, bool32 updateFlags)
{
u32 i;
@ -8873,7 +8875,7 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe
MulModifier(&modifier, UQ_4_12(1.5));
break;
case ABILITY_SUPREME_OVERLORD:
MulModifier(&modifier, GetSupremeOverlordModifier(battlerAtk));
MulModifier(&modifier, gBattleStruct->supremeOverlordModifier[battlerAtk]);
break;
}

View File

@ -30118,11 +30118,67 @@ static const u16 sZeraoraTeachableLearnset[] = {
};
static const u16 sMeltanTeachableLearnset[] = {
MOVE_HEADBUTT,
MOVE_REST,
MOVE_PROTECT,
MOVE_SUBSTITUTE,
MOVE_THUNDER_WAVE,
MOVE_TOXIC,
MOVE_THUNDERBOLT,
MOVE_FLASH_CANNON,
MOVE_SNORE,
MOVE_FACADE,
MOVE_ROUND,
MOVE_ENDURE,
MOVE_SLEEP_TALK,
MOVE_IRON_DEFENSE,
MOVE_GYRO_BALL,
MOVE_STEEL_BEAM,
MOVE_HIDDEN_POWER,
MOVE_UNAVAILABLE,
};
static const u16 sMelmetalTeachableLearnset[] = {
MOVE_HEADBUTT,
MOVE_REST,
MOVE_PROTECT,
MOVE_SUBSTITUTE,
MOVE_FACADE,
MOVE_BRICK_BREAK,
MOVE_THUNDER_WAVE,
MOVE_ROCK_SLIDE,
MOVE_THUNDER_PUNCH,
MOVE_TOXIC,
MOVE_ICE_PUNCH,
MOVE_THUNDERBOLT,
MOVE_THUNDER,
MOVE_EARTHQUAKE,
MOVE_SELF_DESTRUCT,
MOVE_SOLAR_BEAM,
MOVE_HYPER_BEAM,
MOVE_SUPERPOWER,
MOVE_FLASH_CANNON,
MOVE_ICE_BEAM,
MOVE_MEGA_PUNCH,
MOVE_MEGA_KICK,
MOVE_GIGA_IMPACT,
MOVE_SNORE,
MOVE_ROCK_TOMB,
MOVE_ROUND,
MOVE_ELECTRIC_TERRAIN,
MOVE_BRUTAL_SWING,
MOVE_BODY_SLAM,
MOVE_ENDURE,
MOVE_SLEEP_TALK,
MOVE_IRON_DEFENSE,
MOVE_GYRO_BALL,
MOVE_IRON_HEAD,
MOVE_HEAVY_SLAM,
MOVE_DARKEST_LARIAT,
MOVE_HIGH_HORSEPOWER,
MOVE_BODY_PRESS,
MOVE_STEEL_BEAM,
MOVE_STEEL_ROLLER,
MOVE_HIDDEN_POWER,
MOVE_UNAVAILABLE,
};

View File

@ -85,6 +85,7 @@ enum { // Util
DEBUG_UTIL_MENU_ITEM_TRAINER_NAME,
DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER,
DEBUG_UTIL_MENU_ITEM_TRAINER_ID,
DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES,
};
enum { // Scripts
DEBUG_UTIL_MENU_ITEM_SCRIPT_1,
@ -147,7 +148,7 @@ enum { //Sound
#define DEBUG_NUMBER_DIGITS_VARIABLES 5
#define DEBUG_NUMBER_DIGITS_VARIABLE_VALUE 5
#define DEBUG_NUMBER_DIGITS_ITEMS 4
#define DEBUG_NUMBER_DIGITS_ITEM_QUANTITY 2
#define DEBUG_NUMBER_DIGITS_ITEM_QUANTITY 3
#define DEBUG_NUMBER_ICON_X 210
#define DEBUG_NUMBER_ICON_Y 50
@ -224,6 +225,7 @@ static void DebugAction_Util_WatchCredits(u8 taskId);
static void DebugAction_Util_Trainer_Name(u8 taskId);
static void DebugAction_Util_Trainer_Gender(u8 taskId);
static void DebugAction_Util_Trainer_Id(u8 taskId);
static void DebugAction_Util_Clear_Boxes(u8 taskId);
static void DebugAction_Flags_Flags(u8 taskId);
static void DebugAction_Flags_FlagsSelect(u8 taskId);
@ -275,7 +277,8 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId);
static void DebugTask_HandleMenuInput(u8 taskId, void (*HandleInput)(u8));
static void DebugAction_OpenSubMenu(u8 taskId, struct ListMenuTemplate LMtemplate);
extern u8 Debug_FlagsNotSetMessage[];
extern u8 Debug_FlagsNotSetOverworldConfigMessage[];
extern u8 Debug_FlagsNotSetBattleConfigMessage[];
extern u8 Debug_Script_1[];
extern u8 Debug_Script_2[];
extern u8 Debug_Script_3[];
@ -329,6 +332,7 @@ static const u8 sDebugText_Util_WatchCredits[] = _("Watch Credits");
static const u8 sDebugText_Util_Trainer_Name[] = _("Trainer name");
static const u8 sDebugText_Util_Trainer_Gender[] = _("Toggle T. Gender");
static const u8 sDebugText_Util_Trainer_Id[] = _("New Trainer Id");
static const u8 sDebugText_Util_Clear_Boxes[] = _("Clear Storage Boxes");
// Flags Menu
static const u8 sDebugText_Flags_Flags[] = _("Set Flag XXXX");
static const u8 sDebugText_Flags_SetPokedexFlags[] = _("All Pokédex Flags");
@ -450,6 +454,7 @@ static const struct ListMenuItem sDebugMenu_Items_Utilities[] =
[DEBUG_UTIL_MENU_ITEM_TRAINER_NAME] = {sDebugText_Util_Trainer_Name, DEBUG_UTIL_MENU_ITEM_TRAINER_NAME},
[DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = {sDebugText_Util_Trainer_Gender, DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER},
[DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = {sDebugText_Util_Trainer_Id, DEBUG_UTIL_MENU_ITEM_TRAINER_ID},
[DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES] = {sDebugText_Util_Clear_Boxes, DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES},
};
static const struct ListMenuItem sDebugMenu_Items_Scripts[] =
{
@ -529,6 +534,7 @@ static void (*const sDebugMenu_Actions_Utilities[])(u8) =
[DEBUG_UTIL_MENU_ITEM_TRAINER_NAME] = DebugAction_Util_Trainer_Name,
[DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = DebugAction_Util_Trainer_Gender,
[DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = DebugAction_Util_Trainer_Id,
[DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES] = DebugAction_Util_Clear_Boxes,
};
static void (*const sDebugMenu_Actions_Scripts[])(u8) =
{
@ -1015,8 +1021,8 @@ static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId)
gTasks[taskId].data[3] = 0;
gTasks[taskId].data[4] = 0;
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2);
ConvertIntToDecimalStringN(gStringVar2, MAP_GROUP_COUNT[gTasks[taskId].data[5]] - 1, STR_CONV_MODE_LEADING_ZEROS, 2);
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, (MAP_GROUP_COUNT[gTasks[taskId].data[5]] - 1 >= 100) ? 3 : 2);
ConvertIntToDecimalStringN(gStringVar2, MAP_GROUP_COUNT[gTasks[taskId].data[5]] - 1, STR_CONV_MODE_LEADING_ZEROS, (MAP_GROUP_COUNT[gTasks[taskId].data[5]] - 1 >= 100) ? 3 : 2);
StringExpandPlaceholders(gStringVar1, sDebugText_Util_WarpToMap_SelMax);
GetMapName(gStringVar2, Overworld_GetMapHeaderByGroupAndId(gTasks[taskId].data[5], gTasks[taskId].data[3])->regionMapSectionId, 0);
StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]);
@ -1061,8 +1067,8 @@ static void DebugAction_Util_Warp_SelectMap(u8 taskId)
gTasks[taskId].data[4] += 1;
}
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2);
ConvertIntToDecimalStringN(gStringVar2, MAP_GROUP_COUNT[gTasks[taskId].data[5]] - 1, STR_CONV_MODE_LEADING_ZEROS, 2);
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, (max_value >= 100) ? 3 : 2);
ConvertIntToDecimalStringN(gStringVar2, MAP_GROUP_COUNT[gTasks[taskId].data[5]] - 1, STR_CONV_MODE_LEADING_ZEROS, (max_value >= 100) ? 3 : 2);
StringExpandPlaceholders(gStringVar1, sDebugText_Util_WarpToMap_SelMax);
GetMapName(gStringVar2, Overworld_GetMapHeaderByGroupAndId(gTasks[taskId].data[5], gTasks[taskId].data[3])->regionMapSectionId, 0);
StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]);
@ -1315,6 +1321,12 @@ static void DebugAction_Util_Trainer_Id(u8 taskId)
Debug_DestroyMenu_Full(taskId);
ScriptContext_Enable();
}
static void DebugAction_Util_Clear_Boxes(u8 taskId)
{
ResetPokemonStorageSystem();
Debug_DestroyMenu_Full(taskId);
ScriptContext_Enable();
}
// *******************************
// Actions Scripts
@ -1556,16 +1568,16 @@ static void DebugAction_Flags_ToggleFrontierPass(u8 taskId)
}
static void DebugAction_Flags_CollisionOnOff(u8 taskId)
{
#if DEBUG_FLAG_NO_COLLISION == 0
#if OW_FLAG_NO_COLLISION == 0
Debug_DestroyMenu_Full(taskId);
LockPlayerFieldControls();
ScriptContext_SetupScript(Debug_FlagsNotSetMessage);
ScriptContext_SetupScript(Debug_FlagsNotSetOverworldConfigMessage);
#else
if (FlagGet(DEBUG_FLAG_NO_COLLISION))
if (FlagGet(OW_FLAG_NO_COLLISION))
PlaySE(SE_PC_OFF);
else
PlaySE(SE_PC_LOGIN);
FlagToggle(DEBUG_FLAG_NO_COLLISION);
FlagToggle(OW_FLAG_NO_COLLISION);
#endif
}
static void DebugAction_Flags_EncounterOnOff(u8 taskId)
@ -1573,7 +1585,7 @@ static void DebugAction_Flags_EncounterOnOff(u8 taskId)
#if OW_FLAG_NO_ENCOUNTER == 0
Debug_DestroyMenu_Full(taskId);
LockPlayerFieldControls();
ScriptContext_SetupScript(Debug_FlagsNotSetMessage);
ScriptContext_SetupScript(Debug_FlagsNotSetOverworldConfigMessage);
#else
if (FlagGet(OW_FLAG_NO_ENCOUNTER))
PlaySE(SE_PC_OFF);
@ -1587,7 +1599,7 @@ static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId)
#if OW_FLAG_NO_TRAINER_SEE == 0
Debug_DestroyMenu_Full(taskId);
LockPlayerFieldControls();
ScriptContext_SetupScript(Debug_FlagsNotSetMessage);
ScriptContext_SetupScript(Debug_FlagsNotSetOverworldConfigMessage);
#else
if (FlagGet(OW_FLAG_NO_TRAINER_SEE))
PlaySE(SE_PC_OFF);
@ -1601,7 +1613,7 @@ static void DebugAction_Flags_BagUseOnOff(u8 taskId)
#if B_FLAG_NO_BAG_USE == 0
Debug_DestroyMenu_Full(taskId);
LockPlayerFieldControls();
ScriptContext_SetupScript(Debug_FlagsNotSetMessage);
ScriptContext_SetupScript(Debug_FlagsNotSetBattleConfigMessage);
#else
if (FlagGet(B_FLAG_NO_BAG_USE))
PlaySE(SE_PC_OFF);
@ -1612,10 +1624,10 @@ static void DebugAction_Flags_BagUseOnOff(u8 taskId)
}
static void DebugAction_Flags_CatchingOnOff(u8 taskId)
{
#if B_FLAG_NO_CATCHING_USE == 0
#if B_FLAG_NO_CATCHING == 0
Debug_DestroyMenu_Full(taskId);
LockPlayerFieldControls();
ScriptContext_SetupScript(Debug_FlagsNotSetMessage);
ScriptContext_SetupScript(Debug_FlagsNotSetBattleConfigMessage);
#else
if (FlagGet(B_FLAG_NO_CATCHING))
PlaySE(SE_PC_OFF);
@ -1905,15 +1917,18 @@ static void DebugAction_Give_Item_SelectId(u8 taskId)
}
static void DebugAction_Give_Item_SelectQuantity(u8 taskId)
{
u32 itemId = gTasks[taskId].data[5];
if (JOY_NEW(DPAD_ANY))
{
PlaySE(SE_SELECT);
if (JOY_NEW(DPAD_UP))
{
u32 maxCapacity = (ItemId_GetPocket(itemId) - 1 == BERRIES_POCKET) ? MAX_BERRY_CAPACITY : MAX_BAG_ITEM_CAPACITY;
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
if (gTasks[taskId].data[3] >= 100)
gTasks[taskId].data[3] = 99;
if (gTasks[taskId].data[3] > maxCapacity)
gTasks[taskId].data[3] = maxCapacity;
}
if (JOY_NEW(DPAD_DOWN))
{
@ -1947,7 +1962,7 @@ static void DebugAction_Give_Item_SelectQuantity(u8 taskId)
DestroySprite(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon
PlaySE(MUS_OBTAIN_ITEM);
AddBagItem(gTasks[taskId].data[5], gTasks[taskId].data[3]);
AddBagItem(itemId, gTasks[taskId].data[3]);
DebugAction_DestroyExtraWindow(taskId);
}
else if (JOY_NEW(B_BUTTON))
@ -2178,7 +2193,7 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId)
{
PlaySE(MUS_LEVEL_UP);
ScriptGiveMon(sDebugMonData->mon_speciesId, gTasks[taskId].data[3], ITEM_NONE, 0,0,0);
//Set flag for user convenience
// Set flag for user convenience
FlagSet(FLAG_SYS_POKEMON_GET);
Free(sDebugMonData); //Frees EWRAM of MonData Struct
DebugAction_DestroyExtraWindow(taskId);
@ -2734,7 +2749,7 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu
break;
}
//Set flag for user convenience
// Set flag for user convenience
FlagSet(FLAG_SYS_POKEMON_GET);
Free(sDebugMonData); //Frees EWRAM of MonData Struct
@ -2766,11 +2781,12 @@ static void DebugAction_Give_FillPC(u8 taskId) //Credit: Sierraffinity
int boxId, boxPosition;
u32 personality;
struct BoxPokemon boxMon;
u16 species = SPECIES_BULBASAUR;
personality = Random32();
CreateBoxMon(&boxMon,
SPECIES_DEOXYS,
species,
100,
32,
personality,
@ -2785,9 +2801,16 @@ static void DebugAction_Give_FillPC(u8 taskId) //Credit: Sierraffinity
if (!GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SANITY_HAS_SPECIES))
{
gPokemonStoragePtr->boxes[boxId][boxPosition] = boxMon;
SetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SPECIES, &species);
GetSetPokedexFlag(species, FLAG_SET_SEEN);
GetSetPokedexFlag(species, FLAG_SET_CAUGHT);
species++;
}
}
}
// Set flag for user convenience
FlagSet(FLAG_SYS_POKEMON_GET);
}
static void DebugAction_Give_CHEAT(u8 taskId)

View File

@ -4654,8 +4654,8 @@ u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir)
{
u8 direction = dir;
#if DEBUG_FLAG_NO_COLLISION != 0
if (FlagGet(DEBUG_FLAG_NO_COLLISION))
#if OW_FLAG_NO_COLLISION != 0
if (FlagGet(OW_FLAG_NO_COLLISION))
return COLLISION_NONE;
#endif

View File

@ -10,11 +10,11 @@ SINGLE_BATTLE_TEST("Intimidate (opponent) lowers player's attack after switch ou
{
u32 ability;
PARAMETRIZE { ability = ABILITY_INTIMIDATE; }
PARAMETRIZE { ability = ABILITY_RECKLESS; }
PARAMETRIZE { ability = ABILITY_SHED_SKIN; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_STARAPTOR) { Ability(ability); };
OPPONENT(SPECIES_ARBOK) { Ability(ability); };
} WHEN {
TURN { SWITCH(opponent, 1); }
TURN { MOVE(player, MOVE_TACKLE); }
@ -23,7 +23,7 @@ SINGLE_BATTLE_TEST("Intimidate (opponent) lowers player's attack after switch ou
{
ABILITY_POPUP(opponent, ABILITY_INTIMIDATE);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Foe Staraptor's Intimidate cuts Wobbuffet's ATTACK!");
MESSAGE("Foe Arbok's Intimidate cuts Wobbuffet's attack!");
}
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
@ -35,11 +35,11 @@ SINGLE_BATTLE_TEST("Intimidate (opponent) lowers player's attack after KO", s16
{
u32 ability;
PARAMETRIZE { ability = ABILITY_INTIMIDATE; }
PARAMETRIZE { ability = ABILITY_RECKLESS; }
PARAMETRIZE { ability = ABILITY_SHED_SKIN; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Speed(2); };
OPPONENT(SPECIES_WOBBUFFET) { HP(1); Speed(1); };
OPPONENT(SPECIES_STARAPTOR) { Ability(ability); Speed(1); };
OPPONENT(SPECIES_ARBOK) { Ability(ability); Speed(1); };
} WHEN {
TURN { MOVE(player, MOVE_TACKLE); SEND_OUT(opponent, 1); }
TURN { MOVE(player, MOVE_TACKLE); }
@ -49,7 +49,7 @@ SINGLE_BATTLE_TEST("Intimidate (opponent) lowers player's attack after KO", s16
{
ABILITY_POPUP(opponent, ABILITY_INTIMIDATE);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Foe Staraptor's Intimidate cuts Wobbuffet's ATTACK!");
MESSAGE("Foe Arbok's Intimidate cuts Wobbuffet's attack!");
}
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
@ -63,11 +63,11 @@ DOUBLE_BATTLE_TEST("Intimidate doesn't activate on an empty field in a double ba
ASSUME(gBattleMoves[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION);
PLAYER(SPECIES_WOBBUFFET) { };
PLAYER(SPECIES_WOBBUFFET) { HP(1); };
PLAYER(SPECIES_STARAVIA) { Ability(ABILITY_INTIMIDATE); };
PLAYER(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); };
PLAYER(SPECIES_ABRA);
OPPONENT(SPECIES_WOBBUFFET) { HP(1); };
OPPONENT(SPECIES_WOBBUFFET) { HP(1); };
OPPONENT(SPECIES_STARAPTOR) { Ability(ABILITY_INTIMIDATE); };
OPPONENT(SPECIES_ARBOK) { Ability(ABILITY_INTIMIDATE); };
OPPONENT(SPECIES_WYNAUT);
} WHEN {
TURN { MOVE(playerLeft, MOVE_EXPLOSION); SEND_OUT(playerLeft, 2); SEND_OUT(opponentLeft, 2); SEND_OUT(playerRight, 3); SEND_OUT(opponentRight, 3); }
@ -77,21 +77,21 @@ DOUBLE_BATTLE_TEST("Intimidate doesn't activate on an empty field in a double ba
ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, playerLeft);
// Everyone faints.
MESSAGE("Go! Staravia!");
MESSAGE("2 sent out Staraptor!");
MESSAGE("Go! Ekans!");
MESSAGE("2 sent out Arbok!");
MESSAGE("Go! Abra!");
MESSAGE("2 sent out Wynaut!");
ABILITY_POPUP(playerLeft, ABILITY_INTIMIDATE);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentLeft);
MESSAGE("Staravia's Intimidate cuts Foe Staraptor's ATTACK!");
MESSAGE("Ekans's Intimidate cuts Foe Arbok's attack!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentRight);
MESSAGE("Staravia's Intimidate cuts Foe Wynaut's ATTACK!");
MESSAGE("Ekans's Intimidate cuts Foe Wynaut's attack!");
ABILITY_POPUP(opponentLeft, ABILITY_INTIMIDATE);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft);
MESSAGE("Foe Staraptor's Intimidate cuts Staravia's ATTACK!");
MESSAGE("Foe Arbok's Intimidate cuts Ekans's attack!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight);
MESSAGE("Foe Staraptor's Intimidate cuts Abra's ATTACK!");
MESSAGE("Foe Arbok's Intimidate cuts Abra's attack!");
}
}

View File

@ -35,7 +35,7 @@ SINGLE_BATTLE_TEST("Pastel Veil immediately cures Mold Breaker poison")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_TOXIC].effect == EFFECT_TOXIC);
PLAYER(SPECIES_DRILBUR) { Ability(ABILITY_MOLD_BREAKER); }
PLAYER(SPECIES_PINSIR) { Ability(ABILITY_MOLD_BREAKER); }
OPPONENT(SPECIES_PONYTA_GALARIAN) { Ability(ABILITY_PASTEL_VEIL); }
} WHEN {
TURN { MOVE(player, MOVE_TOXIC); }
@ -52,7 +52,7 @@ DOUBLE_BATTLE_TEST("Pastel Veil does not cure Mold Breaker poison on partner")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_TOXIC].effect == EFFECT_TOXIC);
PLAYER(SPECIES_DRILBUR) { Ability(ABILITY_MOLD_BREAKER); }
PLAYER(SPECIES_PINSIR) { Ability(ABILITY_MOLD_BREAKER); }
PLAYER(SPECIES_WYNAUT);
OPPONENT(SPECIES_PONYTA_GALARIAN) { Ability(ABILITY_PASTEL_VEIL); }
OPPONENT(SPECIES_WYNAUT);

View File

@ -6,7 +6,7 @@ SINGLE_BATTLE_TEST("Stench has a 10% chance to flinch")
PASSES_RANDOMLY(1,10);
GIVEN {
ASSUME(gBattleMoves[MOVE_TACKLE].power > 0);
PLAYER(SPECIES_STUNKY) { Ability(ABILITY_STENCH); };
PLAYER(SPECIES_GRIMER) { Ability(ABILITY_STENCH); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_TACKLE); MOVE(opponent, MOVE_CELEBRATE); }
@ -22,7 +22,7 @@ SINGLE_BATTLE_TEST("Stench does not stack with King's Rock")
ASSUME(gItems[ITEM_KINGS_ROCK].holdEffect == HOLD_EFFECT_FLINCH);
ASSUME(gBattleMoves[MOVE_TACKLE].power > 0);
PLAYER(SPECIES_STUNKY) { Ability(ABILITY_STENCH); Item(ITEM_KINGS_ROCK); };
PLAYER(SPECIES_GRIMER) { Ability(ABILITY_STENCH); Item(ITEM_KINGS_ROCK); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_TACKLE); MOVE(opponent, MOVE_CELEBRATE); }

View File

@ -184,6 +184,7 @@ SINGLE_BATTLE_TEST("Red Card does not activate if stolen by Magician")
PARAMETRIZE { item = ITEM_POTION; activate = TRUE; }
GIVEN {
ASSUME(P_GEN_6_POKEMON == TRUE);
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); }
OPPONENT(SPECIES_FENNEKIN) { Ability(ABILITY_MAGICIAN); Item(item); }
OPPONENT(SPECIES_WYNAUT);
@ -360,6 +361,7 @@ SINGLE_BATTLE_TEST("Red Card does not activate if attacker's Sheer Force applied
SINGLE_BATTLE_TEST("Red Card activates before Emergency Exit")
{
GIVEN {
ASSUME(P_GEN_7_POKEMON == TRUE);
PLAYER(SPECIES_GOLISOPOD) { MaxHP(100); HP(51); Item(ITEM_RED_CARD); }
PLAYER(SPECIES_WIMPOD);
OPPONENT(SPECIES_WOBBUFFET);

View File

@ -37,15 +37,15 @@ SINGLE_BATTLE_TEST("Mega Evolution affects turn order")
{
GIVEN {
ASSUME(B_MEGA_EVO_TURN_ORDER);
PLAYER(SPECIES_DIANCIE) { Item(ITEM_DIANCITE); Speed(105); }
PLAYER(SPECIES_GARDEVOIR) { Item(ITEM_GARDEVOIRITE); Speed(105); }
OPPONENT(SPECIES_WOBBUFFET) { Speed(106); }
} WHEN {
TURN { MOVE(player, MOVE_CELEBRATE, megaEvolve: TRUE); }
} SCENE {
MESSAGE("Diancie used Celebrate!");
MESSAGE("Gardevoir used Celebrate!");
MESSAGE("Foe Wobbuffet used Celebrate!");
} THEN {
ASSUME(player->speed == 225);
ASSUME(player->speed == 205);
}
}

View File

@ -65,6 +65,7 @@ SINGLE_BATTLE_TEST("U-turn does not switch the user out if replacements fainted"
SINGLE_BATTLE_TEST("U-turn does not switch the user out if Wimp Out activates")
{
GIVEN {
ASSUME(P_GEN_7_POKEMON == TRUE);
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_WYNAUT);
OPPONENT(SPECIES_WIMPOD) { MaxHP(100); HP(51); Ability(ABILITY_WIMP_OUT); }
@ -82,6 +83,7 @@ SINGLE_BATTLE_TEST("U-turn does not switch the user out if Wimp Out activates")
SINGLE_BATTLE_TEST("U-turn switches the user out if Wimp Out fails to activate")
{
GIVEN {
ASSUME(P_GEN_7_POKEMON == TRUE);
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_WYNAUT);
OPPONENT(SPECIES_WIMPOD) { MaxHP(100); HP(51); Ability(ABILITY_WIMP_OUT); }

View File

@ -9,7 +9,7 @@ enum TestResult
{
TEST_RESULT_FAIL,
TEST_RESULT_PASS,
TEST_RESULT_SKIP,
TEST_RESULT_ASSUMPTION_FAIL,
TEST_RESULT_INVALID,
TEST_RESULT_ERROR,
TEST_RESULT_TIMEOUT,
@ -77,7 +77,7 @@ s32 MgbaPrintf_(const char *fmt, ...);
do \
{ \
if (!(c)) \
Test_ExitWithResult(TEST_RESULT_SKIP, "%s:%d: ASSUME failed", gTestRunnerState.test->filename, __LINE__); \
Test_ExitWithResult(TEST_RESULT_ASSUMPTION_FAIL, "%s:%d: ASSUME failed", gTestRunnerState.test->filename, __LINE__); \
} while (0)
#define EXPECT(c) \

View File

@ -121,7 +121,7 @@ void CB2_TestRunner(void)
// NOTE: Assumes that the compiler interns __FILE__.
if (gTestRunnerState.skipFilename == gTestRunnerState.test->filename)
{
gTestRunnerState.result = TEST_RESULT_SKIP;
gTestRunnerState.result = TEST_RESULT_ASSUMPTION_FAIL;
}
else
{
@ -157,7 +157,7 @@ void CB2_TestRunner(void)
color = "\e[32m";
MgbaPrintf_(":N%s", gTestRunnerState.test->name);
}
else if (gTestRunnerState.result != TEST_RESULT_SKIP || gTestRunnerSkipIsFail)
else if (gTestRunnerState.result != TEST_RESULT_ASSUMPTION_FAIL || gTestRunnerSkipIsFail)
{
gTestRunnerState.exitCode = 1;
color = "\e[31m";
@ -186,16 +186,33 @@ void CB2_TestRunner(void)
result = "FAIL";
}
break;
case TEST_RESULT_PASS: result = "PASS"; break;
case TEST_RESULT_SKIP: result = "SKIP"; break;
case TEST_RESULT_INVALID: result = "INVALID"; break;
case TEST_RESULT_ERROR: result = "ERROR"; break;
case TEST_RESULT_TIMEOUT: result = "TIMEOUT"; break;
default: result = "UNKNOWN"; break;
case TEST_RESULT_PASS:
result = "PASS";
break;
case TEST_RESULT_ASSUMPTION_FAIL:
result = "ASSUMPTION_FAIL";
color = "\e[33m";
break;
case TEST_RESULT_INVALID:
result = "INVALID";
break;
case TEST_RESULT_ERROR:
result = "ERROR";
break;
case TEST_RESULT_TIMEOUT:
result = "TIMEOUT";
break;
default:
result = "UNKNOWN";
break;
}
if (gTestRunnerState.expectedResult == gTestRunnerState.result)
if (gTestRunnerState.result == TEST_RESULT_PASS)
MgbaPrintf_(":P%s%s\e[0m", color, result);
else if (gTestRunnerState.result == TEST_RESULT_ASSUMPTION_FAIL)
MgbaPrintf_(":A%s%s\e[0m", color, result);
else if (gTestRunnerState.expectedResult == gTestRunnerState.result)
MgbaPrintf_(":K%s%s\e[0m", color, result);
else
MgbaPrintf_(":F%s%s\e[0m", color, result);
}

View File

@ -720,7 +720,7 @@ static void CB2_BattleTest_NextTrial(void)
case TEST_RESULT_PASS:
STATE->observedPasses++;
break;
case TEST_RESULT_SKIP:
case TEST_RESULT_ASSUMPTION_FAIL:
STATE->skippedTrials++;
if (STATE->skippedTrials > STATE->trials / 4)
Test_ExitWithResult(TEST_RESULT_INVALID, "25%% of the trials were SKIPed");

View File

@ -9,7 +9,11 @@
* COMMANDS
* N: Sets the test name to the remainder of the line.
* R: Sets the result to the remainder of the line, and flushes any
* output buffered since the previous R. */
* output buffered since the previous R.
* P/K/F/A: Sets the result to the remaining of the line, flushes any
* output since the previous P/K/F/A and increment the number of
* passes/known fails/assumption fails/fails.
*/
#include <fcntl.h>
#include <poll.h>
#include <signal.h>
@ -39,6 +43,9 @@ struct Runner
size_t output_buffer_capacity;
char *output_buffer;
int passes;
int knownFails;
int assumptionFails;
int fails;
int results;
};
@ -75,9 +82,17 @@ static void handle_read(struct Runner *runner)
break;
case 'P':
runner->passes++;
goto add_to_results;
case 'K':
runner->knownFails++;
goto add_to_results;
case 'A':
runner->assumptionFails++;
goto add_to_results;
case 'F':
if (soc[1] == 'P')
runner->passes++;
runner->fails++;
add_to_results:
runner->results++;
soc += 2;
fprintf(stdout, "%s: ", runner->test_name);
@ -411,6 +426,9 @@ int main(int argc, char *argv[])
// Reap test runners and collate exit codes.
int exit_code = 0;
int passes = 0;
int knownFails = 0;
int assumptionFails = 0;
int fails = 0;
int results = 0;
for (int i = 0; i < nrunners; i++)
{
@ -425,9 +443,29 @@ int main(int argc, char *argv[])
if (WIFEXITED(wstatus) && WEXITSTATUS(wstatus) > exit_code)
exit_code = WEXITSTATUS(wstatus);
passes += runners[i].passes;
knownFails += runners[i].knownFails;
assumptionFails += runners[i].assumptionFails;
fails += runners[i].fails;
results += runners[i].results;
}
fprintf(stdout, "%d/%d \e[32mPASS\e[0med\n", passes, results);
if (results == 0)
{
fprintf(stdout, "\nNo tests found.\n");
}
else
{
fprintf(stdout, "\n- Tests TOTAL: %d\n", results);
fprintf(stdout, "- Tests \e[32mPASSED\e[0m: %d\n", passes);
if (knownFails > 0)
fprintf(stdout, "- Tests \e[33mKNOWN_FAILING\e[0m: %d\n", knownFails);
if (fails > 0)
fprintf(stdout, "- Tests \e[31mFAILED\e[0m : %d\n", fails);
if (assumptionFails > 0)
fprintf(stdout, "- \e[33mASSUMPTIONS_FAILED\e[0m: %d\n", assumptionFails);
}
fprintf(stdout, "\n");
fflush(stdout);
return exit_code;
}