Loads of work on getting data ready.

This commit is contained in:
2021-03-28 20:22:46 +02:00
parent d3262e924d
commit 82ac1061fa
27 changed files with 19683 additions and 12390 deletions

View File

@@ -3,6 +3,7 @@ namespace Pokemon{
class Flinch : PkmnScript{
void PreventAttack(ExecutingMove@ attack, bool& result) override {
result = true;
attack.User.RemoveVolatile("flinch");
}
}
}

View File

@@ -0,0 +1,18 @@
namespace Gen7 {
[Pokemon effect=HealEachEndOfTurn]
shared class HealEachEndOfTurnEffect : PkmnScript {
float _factor;
void OnEndTurn(Pokemon@ pokemon) override {
auto healAmount = pokemon.MaxHealth * _factor;
if (pokemon.HasHeldItem("big_root")){
healAmount *= 1.3;
}
pokemon.Heal(uint(healAmount));
}
void SetBaseHealAmount(float factor){
_factor = factor;
}
}
}

View File

@@ -0,0 +1,20 @@
namespace Gen7 {
[Pokemon effect=PreventFoeRunning]
shared class PreventFoeRunningEffect : PkmnScript {
Pokemon@[] _trappedOpponents;
void PreventOpponentRunAway(FleeTurnChoice@ choice, bool &inout o) override {
for(uint i = 0; i < _trappedOpponents.length; i++)
{
if (_trappedOpponents[i] is choice.User){
o = true;
break;
}
}
}
void SetLockedOpponent(Pokemon@ opponent){
_trappedOpponents.insertLast(opponent);
}
}
}