diff --git a/Abilities.json b/Abilities.json index 0b1af62..de39ade 100644 --- a/Abilities.json +++ b/Abilities.json @@ -18,11 +18,21 @@ "anger_point": { "effect": "AngerPoint" }, - "anticipation": {}, - "arena_trap": {}, - "aroma_veil": {}, - "aura_break": {}, - "bad_dreams": {}, + "anticipation": { + "effect": "Anticipation" + }, + "arena_trap": { + "effect": "ArenaTrap" + }, + "aroma_veil": { + "effect": "AromaVeil" + }, + "aura_break": { + "effect": "AuraBreal" + }, + "bad_dreams": { + "effect": "BadDreams" + }, "battery": {}, "battle_armor": {}, "battle_bond": {}, diff --git a/Moves.json b/Moves.json index 7c24165..d12c890 100644 --- a/Moves.json +++ b/Moves.json @@ -2052,7 +2052,8 @@ "protect", "reflectable", "mirror", - "ignore-substitute" + "ignore-substitute", + "limit_move_choice" ] }, { @@ -2635,7 +2636,8 @@ "reflectable", "mirror", "ignore-substitute", - "mental" + "mental", + "limit_move_choice" ] }, { @@ -4068,7 +4070,8 @@ "flags": [ "protect", "reflectable", - "mirror" + "mirror", + "limit_move_choice" ] }, { @@ -9309,7 +9312,8 @@ "reflectable", "mirror", "ignore-substitute", - "mental" + "mental", + "limit_move_choice" ] }, { @@ -9612,7 +9616,8 @@ "reflectable", "mirror", "ignore-substitute", - "mental" + "mental", + "limit_move_choice" ] }, { diff --git a/Scripts/Abilities/ArenaTrap.as b/Scripts/Abilities/ArenaTrap.as index 16adbcb..5c689ef 100644 --- a/Scripts/Abilities/ArenaTrap.as +++ b/Scripts/Abilities/ArenaTrap.as @@ -1,4 +1,5 @@ namespace Gen7 { + [Ability effect=ArenaTrap] class ArenaTrap : PkmnScript { void PreventOpponentRunAway(FleeTurnChoice@ choice, bool &inout block){ if (block) return; diff --git a/Scripts/Abilities/AromaVeil.as b/Scripts/Abilities/AromaVeil.as new file mode 100644 index 0000000..4a85159 --- /dev/null +++ b/Scripts/Abilities/AromaVeil.as @@ -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; + } + } + } +} \ No newline at end of file diff --git a/Scripts/Abilities/AuraBreak.as b/Scripts/Abilities/AuraBreak.as new file mode 100644 index 0000000..b3d64e2 --- /dev/null +++ b/Scripts/Abilities/AuraBreak.as @@ -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"); + } + } +} \ No newline at end of file diff --git a/Scripts/Abilities/BadDreams.as b/Scripts/Abilities/BadDreams.as new file mode 100644 index 0000000..675b7dc --- /dev/null +++ b/Scripts/Abilities/BadDreams.as @@ -0,0 +1,26 @@ +namespace Gen7 { + [Ability effect=BadDreams] + class BadDreams : PkmnScript { + void OnEndTurn(){ + auto owner = cast(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); + } + } + } + } + } +} \ No newline at end of file diff --git a/Scripts/Battle/AuraBreak.as b/Scripts/Battle/AuraBreak.as new file mode 100644 index 0000000..a7f80af --- /dev/null +++ b/Scripts/Battle/AuraBreak.as @@ -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); + } + } + } +} \ No newline at end of file diff --git a/Scripts/Interfaces/narray.astypedef b/Scripts/Interfaces/narray.astypedef index 451d23c..a993cfd 100644 --- a/Scripts/Interfaces/narray.astypedef +++ b/Scripts/Interfaces/narray.astypedef @@ -1,5 +1,5 @@ type narray { 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; }