Implements several new move scripts.
This commit is contained in:
parent
76f62d6c2d
commit
5071f309f3
16
Moves.json
16
Moves.json
|
@ -363,7 +363,10 @@
|
||||||
"priority": 0,
|
"priority": 0,
|
||||||
"target": "AdjacentAllySelf",
|
"target": "AdjacentAllySelf",
|
||||||
"category": "status",
|
"category": "status",
|
||||||
"flags": ["snatch", "distance"]
|
"flags": ["snatch", "distance"],
|
||||||
|
"effect": {
|
||||||
|
"name": "CurePartyStatus"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "aromatic_mist",
|
"name": "aromatic_mist",
|
||||||
|
@ -374,7 +377,11 @@
|
||||||
"priority": 0,
|
"priority": 0,
|
||||||
"target": "AdjacentAlly",
|
"target": "AdjacentAlly",
|
||||||
"category": "status",
|
"category": "status",
|
||||||
"flags": ["ignore-substitute"]
|
"flags": ["ignore-substitute"],
|
||||||
|
"effect": {
|
||||||
|
"name": "ChangeTargetSpDef",
|
||||||
|
"parameters": [1]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "assist",
|
"name": "assist",
|
||||||
|
@ -385,7 +392,10 @@
|
||||||
"priority": 0,
|
"priority": 0,
|
||||||
"target": "Self",
|
"target": "Self",
|
||||||
"category": "status",
|
"category": "status",
|
||||||
"flags": []
|
"flags": [],
|
||||||
|
"effect": {
|
||||||
|
"name": "Assist"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "assurance",
|
"name": "assurance",
|
||||||
|
|
|
@ -10,4 +10,6 @@ shared interface Battle {
|
||||||
void ClearWeather(const constString &in name) const;
|
void ClearWeather(const constString &in name) const;
|
||||||
const constString& GetWeatherName() const;
|
const constString& GetWeatherName() const;
|
||||||
BattleSide@ GetBattleSide(uint8 index);
|
BattleSide@ GetBattleSide(uint8 index);
|
||||||
|
BattleParty@ GetParty(uint8 index);
|
||||||
|
BattleParty@ FindPartyForPokemon(Pokemon@ pokemon);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
shared interface BattleParty {
|
||||||
|
Party@ Party { get const; }
|
||||||
|
}
|
|
@ -3,4 +3,5 @@ shared interface ExecutingMove {
|
||||||
bool IsPokemonTarget(Pokemon@ pkmn) const;
|
bool IsPokemonTarget(Pokemon@ pkmn) const;
|
||||||
Pokemon@ User { get const; }
|
Pokemon@ User { get const; }
|
||||||
LearnedMove@ Move { get const; }
|
LearnedMove@ Move { get const; }
|
||||||
|
MoveData@ UseMove { get const; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
shared interface MoveTurnChoice {
|
shared interface MoveTurnChoice {
|
||||||
TurnChoiceKind Kind { get const; }
|
TurnChoiceKind Kind { get const; }
|
||||||
const Pokemon@ User { get const; }
|
Pokemon@ User { get const; }
|
||||||
LearnedMove@ Move { get const; }
|
LearnedMove@ Move { get const; }
|
||||||
int8 Priority { get const; }
|
int8 Priority { get const; }
|
||||||
BaseTurnChoice@ opImplCast();
|
BaseTurnChoice@ opImplCast();
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
shared interface Party {
|
||||||
|
Pokemon@ GetAtIndex(int index) const;
|
||||||
|
int Length { get const; }
|
||||||
|
}
|
|
@ -31,4 +31,7 @@ shared interface Pokemon {
|
||||||
void RemoveVolatile(const constString &in name) const;
|
void RemoveVolatile(const constString &in name) const;
|
||||||
Battle@ Battle { get const; }
|
Battle@ Battle { get const; }
|
||||||
BattleSide@ BattleSide { get const; }
|
BattleSide@ BattleSide { get const; }
|
||||||
|
const constString& Status { get const; }
|
||||||
|
void ClearStatus() const;
|
||||||
|
void SetStatus(const constString &inout name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
#include "Utilities/CopyableMoves.as"
|
||||||
|
|
||||||
|
namespace Gen7 {
|
||||||
|
[Move effect=Assist]
|
||||||
|
class Assist : PkmnScript {
|
||||||
|
void ChangeAttack(MoveTurnChoice@ move, constString &inout moveName) override {
|
||||||
|
auto user = move.User;
|
||||||
|
auto battle = user.Battle;
|
||||||
|
auto party = battle.FindPartyForPokemon(user).Party;
|
||||||
|
array<const MoveData@> possibleMoves;
|
||||||
|
for (int i = 0; i < party.Length; i++){
|
||||||
|
auto mon = party.GetAtIndex(i);
|
||||||
|
if (mon is null){ continue; }
|
||||||
|
auto moves = mon.GetMoves();
|
||||||
|
for (uint j = 0; j < moves.length; j++){
|
||||||
|
auto m = moves[j];
|
||||||
|
if (m is null){ continue; }
|
||||||
|
if (CanCopyMove(m.MoveData)){
|
||||||
|
possibleMoves.insertLast(m.MoveData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (possibleMoves.length == 0){
|
||||||
|
// TODO: Log failure.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
auto i = battle.Random.Get(possibleMoves.length);
|
||||||
|
moveName = possibleMoves[i].Name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
namespace Gen7 {
|
||||||
|
[Move effect=CurePartyStatus]
|
||||||
|
shared class CurePartyStatus : PkmnScript{
|
||||||
|
void OnSecondaryEffect(ExecutingMove@ attack, Pokemon@ target, uint8 hit) override {
|
||||||
|
auto user = attack.User;
|
||||||
|
user.ClearStatus();
|
||||||
|
|
||||||
|
auto battleParty = user.Battle.FindPartyForPokemon(user);
|
||||||
|
if (battleParty !is null){
|
||||||
|
auto party = battleParty.Party;
|
||||||
|
for (int i = 0; i < party.Length; i++){
|
||||||
|
auto m = party.GetAtIndex(i);
|
||||||
|
if (m !is null){
|
||||||
|
m.ClearStatus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
namespace Gen7 {
|
||||||
|
dictionary _nonCopyableMoves = {
|
||||||
|
{"assist", true},
|
||||||
|
{"baneful_bunker", true},
|
||||||
|
{"beak_blast", true},
|
||||||
|
{"belch", true},
|
||||||
|
{"bestow", true},
|
||||||
|
{"bounce", true},
|
||||||
|
{"celebrate", true},
|
||||||
|
{"chatter", true},
|
||||||
|
{"circle_throw", true},
|
||||||
|
{"copycat", true},
|
||||||
|
{"counter", true},
|
||||||
|
{"covet", true},
|
||||||
|
{"destiny_bond", true},
|
||||||
|
{"detect", true},
|
||||||
|
{"dig", true},
|
||||||
|
{"dive", true},
|
||||||
|
{"dragon_tail", true},
|
||||||
|
{"endure", true},
|
||||||
|
{"feint", true},
|
||||||
|
{"fly", true},
|
||||||
|
{"focus_punch", true},
|
||||||
|
{"follow_me", true},
|
||||||
|
{"helping_hand", true},
|
||||||
|
{"hold_hands", true},
|
||||||
|
{"kings_shield", true},
|
||||||
|
{"mat_block", true},
|
||||||
|
{"me_first", true},
|
||||||
|
{"metronome", true},
|
||||||
|
{"mimic", true},
|
||||||
|
{"mirror_coat", true},
|
||||||
|
{"mirror_move", true},
|
||||||
|
{"nature_power", true},
|
||||||
|
{"phantom_force", true},
|
||||||
|
{"protect", true},
|
||||||
|
{"rage_powder", true},
|
||||||
|
{"roar", true},
|
||||||
|
{"shadow_force", true},
|
||||||
|
{"shell_trap", true},
|
||||||
|
{"sketch", true},
|
||||||
|
{"sky_drop", true},
|
||||||
|
{"sleep_talk", true},
|
||||||
|
{"snatch", true},
|
||||||
|
{"spiky_shield", true},
|
||||||
|
{"spotlight", true},
|
||||||
|
{"struggle", true},
|
||||||
|
{"switcheroo", true},
|
||||||
|
{"thief", true},
|
||||||
|
{"transform", true},
|
||||||
|
{"trick", true},
|
||||||
|
{"whirlwind", true}
|
||||||
|
};
|
||||||
|
|
||||||
|
bool CanCopyMove(const MoveData@ move){
|
||||||
|
return !_nonCopyableMoves.exists(move.Name);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue