Adds Arena Trap ability
This commit is contained in:
parent
f19c60c4c1
commit
baae9377ef
|
@ -0,0 +1,15 @@
|
|||
namespace Gen7 {
|
||||
class ArenaTrap : PkmnScript {
|
||||
void PreventOpponentRunAway(FleeTurnChoice@ choice, bool &inout block){
|
||||
if (block) return;
|
||||
if (SpecialStates::IsRaised(choice.User)) return;
|
||||
block = true;
|
||||
}
|
||||
|
||||
void PreventOpponentSwitch(SwitchTurnChoice@ choice, bool &inout block){
|
||||
if (block) return;
|
||||
if (SpecialStates::IsRaised(choice.User)) return;
|
||||
block = true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -26,6 +26,7 @@ type Pokemon {
|
|||
void SetHeldItem(const Item@ item);
|
||||
string Nickname { get const; };
|
||||
bool HasType(uint8 type) const;
|
||||
bool HasType(const constString &in type) const;
|
||||
void Damage(uint type, DamageSource source);
|
||||
void Heal(uint type);
|
||||
void OverrideActiveAbility(const string &in ability);
|
||||
|
@ -34,7 +35,7 @@ type Pokemon {
|
|||
uint GetBoostedStat(Statistic stat) const;
|
||||
uint GetBaseStat(Statistic stat) const;
|
||||
int8 GetStatBoost(Statistic stat) const;
|
||||
bool HasVolatile(const constString &in name);
|
||||
bool HasVolatile(const constString &in name) const;
|
||||
ref@ AddVolatile(const constString &in name);
|
||||
void RemoveVolatile(const constString &in name) const;
|
||||
void ClearStatus() const;
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
namespace Gen7 {
|
||||
// Empty class to tag the Pokemon as raised up.
|
||||
[Pokemon effect=RaisedUp]
|
||||
class RaisedUp : PkmnScript {}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
namespace Gen7 {
|
||||
namespace SpecialStates {
|
||||
bool IsRaised(const Pokemon@ pokemon){
|
||||
if (pokemon.HasType("flying")){
|
||||
return true;
|
||||
}
|
||||
if (pokemon.HasVolatile("RaisedUp")){
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue