Adds more abilities
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
namespace Gen7 {
|
||||
[Ability effect=ArenaTrap]
|
||||
class ArenaTrap : PkmnScript {
|
||||
void PreventOpponentRunAway(FleeTurnChoice@ choice, bool &inout block){
|
||||
if (block) return;
|
||||
|
||||
11
Scripts/Abilities/AromaVeil.as
Normal file
11
Scripts/Abilities/AromaVeil.as
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace Gen7 {
|
||||
[Ability effect=AromaVeil]
|
||||
class AromaVeil {
|
||||
void PreventSecondaryEffects(ExecutingMove@ move, Pokemon@, uint8, bool &inout prevent){
|
||||
// TODO: This only prevents disabling moves, not other things that block move uses.
|
||||
if (move.UseMove.HasFlag("limit_move_choice")){
|
||||
prevent = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
10
Scripts/Abilities/AuraBreak.as
Normal file
10
Scripts/Abilities/AuraBreak.as
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Gen7 {
|
||||
class AuraBreakAbility : PkmnScript {
|
||||
void OnSecondaryEffect(ExecutingMove@, Pokemon@ target, uint8){
|
||||
auto battle = target.Battle;
|
||||
battle.RemoveVolatile("FairyAura");
|
||||
battle.RemoveVolatile("DarkAura");
|
||||
battle.AddVolatile("AuraBreak");
|
||||
}
|
||||
}
|
||||
}
|
||||
26
Scripts/Abilities/BadDreams.as
Normal file
26
Scripts/Abilities/BadDreams.as
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace Gen7 {
|
||||
[Ability effect=BadDreams]
|
||||
class BadDreams : PkmnScript {
|
||||
void OnEndTurn(){
|
||||
auto owner = cast<Pokemon@>(GetOwner());
|
||||
auto ownerSide = owner.BattleSide;
|
||||
auto battle = owner.Battle;
|
||||
if (battle is null) return;
|
||||
for (uint64 i = 0; i < battle.Sides.Length; i++){
|
||||
auto side = battle.Sides[i];
|
||||
if (side is ownerSide){
|
||||
continue;
|
||||
}
|
||||
for (uint64 j = 0; j < side.Pokemon.Length; j++){
|
||||
auto opponent = side.Pokemon[j];
|
||||
if (opponent is null || opponent.IsFainted){
|
||||
continue;
|
||||
}
|
||||
if (opponent.Status == "Sleep"){
|
||||
opponent.Damage(uint(opponent.MaxHealth / 8), DamageSource::Misc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Scripts/Battle/AuraBreak.as
Normal file
12
Scripts/Battle/AuraBreak.as
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace Gen7 {
|
||||
class AuraBreak : PkmnScript {
|
||||
void OverrideBasePower(ExecutingMove@ move, Pokemon@, uint8, uint8 &inout power){
|
||||
auto typeLib = move.User.Battle.Library.StaticLibrary.TypeLibrary;
|
||||
auto fairyType = typeLib.GetTypeId("fairy");
|
||||
auto darkType = typeLib.GetTypeId("dark");
|
||||
if (move.UseMove.Type == fairyType || move.UseMove.Type == darkType){
|
||||
power = uint8(power * 0.75f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
type narray<T> {
|
||||
uint64 Length { get const; };
|
||||
const T@ At(uint64 index) const;
|
||||
const T@ get_opIndex(uint64) const property;
|
||||
T@ At(uint64 index) const;
|
||||
T@ get_opIndex(uint64) const property;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user