From 88bc48fe141d5fdf41c4b0d766b5f4a51498b4f7 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Sun, 16 May 2021 09:25:42 -0400 Subject: [PATCH] add a test for MoveMetaCategoryDamageRaise (#379) --- battle_move_effects_test.go | 21 +++++++++++++++++++++ battle_move_test.go | 1 + 2 files changed, 22 insertions(+) diff --git a/battle_move_effects_test.go b/battle_move_effects_test.go index 04160cb..785ed47 100644 --- a/battle_move_effects_test.go +++ b/battle_move_effects_test.go @@ -121,6 +121,27 @@ var _ = Describe("Move Effects", func() { }, )) }) + + PIt("should deal damage and modify the user's stat (MoveMetaCategoryDamageRaise)", func() { + b := New1v1Battle( + GeneratePokemon(PkmnMightyena, WithLevel(20), WithMoves(TestMoveDamageAndStatChangeSelf)), &a1, + GeneratePokemon(PkmnPonyta, WithLevel(20), WithMoves(TestMoveNoDamage)), &a1, + ) + b.rng = AlwaysRNG() + Expect(b.Start()).To(Succeed()) + t, _ := b.SimulateRound() + Expect(t).To(HaveTransactionsInOrder( + DamageTransaction{ + Target: target{1, 0}, + }, + ModifyStatTransaction{ + Target: target{0, 0}, + SelfInflicted: true, + Stat: int(b.getPokemon(target{0, 0}).Moves[0].AffectedStat()), + Stages: int(b.getPokemon(target{0, 0}).Moves[0].StatStages()), + }, + )) + }) }) var _ = Describe("Draining moves", func() { diff --git a/battle_move_test.go b/battle_move_test.go index 66ef382..8ca0d95 100644 --- a/battle_move_test.go +++ b/battle_move_test.go @@ -18,6 +18,7 @@ var TestMoveDefault = RegisterMove(MoveData{Name: "Default", Category: MoveCateg var TestMoveNoDamage = RegisterMove(MoveData{Name: "No Damage", InitialMaxPP: 100}) var TestMoveInflictBurn = RegisterMove(MoveData{Name: "Inflict Burn", Category: MoveCategoryStatus, InitialMaxPP: 100, Ailment: StatusBurn}) var TestMoveDamageAndInflictBurn = RegisterMove(MoveData{Name: "Damage and Inflict Burn", Category: MoveCategoryPhysical, InitialMaxPP: 100, AilmentChance: 100, Ailment: StatusBurn, Power: 10}) +var TestMoveDamageAndStatChangeSelf = RegisterMove(MoveData{Name: "Damage and Modify user's stat", Category: MoveCategoryPhysical, MetaCategory: MoveMetaCategoryDamageRaise, InitialMaxPP: 100, Power: 10, StatChance: 100, AffectedStat: StatAtk, StatStages: 2}) var _ = Describe("Move Status Inflict", func() { a := Agent(new(dumbAgent))