-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add createmon Script Cmd, Support for 2v1Wild Battles #4688
Conversation
…mons at given player or enemy slots and setting up 2v1 battles
@@ -987,7 +987,9 @@ | |||
@ Gives the player a Pokémon of the specified species and level, and allows to customize extra parameters. | |||
@ VAR_RESULT will be set to MON_GIVEN_TO_PARTY, MON_GIVEN_TO_PC, or MON_CANT_GIVE depending on the outcome. | |||
.macro givemon species:req, level:req, item, ball, nature, abilityNum, gender, hpEv, atkEv, defEv, speedEv, spAtkEv, spDefEv, hpIv, atkIv, defIv, speedIv, spAtkIv, spDefIv, move1, move2, move3, move4, isShiny, ggMaxFactor, teraType | |||
callnative ScrCmd_givemon | |||
callnative ScrCmd_createmon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it correct that both script commands are named ScrCmd_createmon
?
Also is there a way to combine both scripts since most of it is the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both just call the same function which I edited to handle the addition inputs.
As far as using the same macros.. I don't think so since most are optional, but I could be wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both just call the same function which I edited to handle the addition inputs.
Right.
Though for some reason the CI fails for tests without having run any tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both just call the same function which I edited to handle the addition inputs.
Right.
Though for some reason the CI fails for tests without having run any tests
yeah I don't get that... its saying PARTY_SIZE
is undefined, but global.h is included which includes constants/global.h where that is defined...
I've tried including and redefining PARTY_SIZE in a few places with no luck - I'm thinking of just changing .byte PARTY_SIZE to .byte 6 with a comment about PARTY_SIZE next to it to resolve the issue if that is acceptable |
I would do that unless someone has an idea what's going on. |
ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The givemon
macro now replaces the first slot mon in the party when you receive it.
Test to verify it:
TEST("givemon twice [simple]")
{
ZeroPlayerPartyMons();
RUN_OVERWORLD_SCRIPT(
givemon SPECIES_WOBBUFFET, 100;
givemon SPECIES_WYNAUT, 1;
);
EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_SPECIES), SPECIES_WOBBUFFET);
EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_LEVEL), 100);
EXPECT_EQ(GetMonData(&gPlayerParty[1], MON_DATA_SPECIES), SPECIES_WYNAUT);
EXPECT_EQ(GetMonData(&gPlayerParty[1], MON_DATA_LEVEL), 10);
}
Could you also add it to the PR once fixed? Also could you make tests for createmon the same way they are done for givemon?
You can just check the enemy party. Here is the simple one:
TEST("createmon [simple]")
{
ZeroPlayerPartyMons();
RUN_OVERWORLD_SCRIPT(
createmon 1, 0, SPECIES_WOBBUFFET, 100;
createmon 1, 1, SPECIES_WYNAUT, 10;
);
EXPECT_EQ(GetMonData(&gEnemyParty[0], MON_DATA_SPECIES), SPECIES_WOBBUFFET);
EXPECT_EQ(GetMonData(&gEnemyParty[0], MON_DATA_LEVEL), 100);
EXPECT_EQ(GetMonData(&gEnemyParty[1], MON_DATA_SPECIES), SPECIES_WYNAUT);
EXPECT_EQ(GetMonData(&gEnemyParty[1], MON_DATA_LEVEL), 10);
}
The tests are in test/pokemon.c
It looks like your test fails because your giving a level 1 Wynaut but checking that its level 10
Sure, just added |
That's weird. It doesn't work for me ingame. That's how I found it out.
createmon.mp4 |
Also just realized this supersedes |
weird... this is what I've tried and it worked
You might have to make clean if you haven't previously? |
@ghoulslash what you think about this? We've retired the old givemon macro as well. |
make clean worked but it is very odd. could you mentioned it in the description? |
not sure. On the one hand setwildbattle would not be needed, but I don't like the idea of current users needing to go back and update old scripts to handle the change. Because setwildbattle can set a single or double battle I don't think there's a way to make setwildbattle just call createmon, either. So I'm leaning towards keeping setwildbattle. |
that's fair |
NOTE this requires a clean make to update all instances of
givemon
Adds support for setting up 2v1 wild battles. It does this by adding 2 new script commands:
ScriptGiveMonParameterized
has also been updated to handle a given slot/side. If slot = PARTY_SIZE, it will give the mon as normalExample script:
But we could also create multiple enemy mons to set up a more advanced 2v2 wild battle