Skip to content

Commit

Permalink
add a test for MoveMetaCategoryDamageRaise (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyc3 committed May 16, 2021
1 parent 8936a9c commit 88bc48f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions battle_move_effects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
1 change: 1 addition & 0 deletions battle_move_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 88bc48f

Please sign in to comment.