Skip to content

Commit

Permalink
Added Rest and Hypnosis
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysm94 committed Apr 6, 2018
1 parent 38d66cb commit cd66c1c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions PokemonKit/Sources/Pokedex.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ public class Pokedex {
}),
"Growl": .singleTarget({ $0.statStages.atk -= 1 }),
"Hyper Beam": .singleTarget({ $0.volatileStatus.insert(.mustRecharge) }),
"Hypnosis": .singleTarget({ pokemon in
guard pokemon.status == .healthy else { return }

let sleepTurns = Random.shared.between(minimum: 1, maximum: 3)

pokemon.status = .asleep(sleepTurns)
}),
"Rest": .singleTarget({ pokemon in
pokemon.currentHP = pokemon.baseStats.hp
pokemon.status = .asleep(2)
}),
"Ice Beam": .singleTarget({
let diceRoll = Random.shared.d10Roll()
if diceRoll == 1 && $0.status == .healthy {
Expand Down Expand Up @@ -116,6 +127,8 @@ public class Pokedex {
"Hyper Beam": .attacker,
"Protect": .attacker,
"Recover": .attacker,
"Hypnosis": .defender,
"Rest": .attacker,
"Solar Beam": .attacker,
"Swords Dance": .attacker,
"Topsy-Turvy": .defender,
Expand Down

0 comments on commit cd66c1c

Please sign in to comment.