Loads of work on getting data ready.
This commit is contained in:
@@ -3,6 +3,7 @@ namespace Pokemon{
|
||||
class Flinch : PkmnScript{
|
||||
void PreventAttack(ExecutingMove@ attack, bool& result) override {
|
||||
result = true;
|
||||
attack.User.RemoveVolatile("flinch");
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Scripts/Pokemon/HealEachEndOfTurn.as
Normal file
18
Scripts/Pokemon/HealEachEndOfTurn.as
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Scripts/Pokemon/PreventFoeRunning.as
Normal file
20
Scripts/Pokemon/PreventFoeRunning.as
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user