Added the ability for statuses to have data (like duration) and the sleep and toxic status effects
This commit is contained in:
@@ -58,7 +58,7 @@ abstract class Move extends MoveTurn {
|
||||
val target: Target
|
||||
val boosts: Map[Stat, Int]
|
||||
val crit: Int
|
||||
val status: Status
|
||||
val status: StatusTemplate
|
||||
val drain: Fraction
|
||||
val selfEffect: Secondary
|
||||
val secondary: Secondary
|
||||
@@ -152,17 +152,18 @@ abstract class Move extends MoveTurn {
|
||||
}
|
||||
}
|
||||
|
||||
def applyEffect(target: Monster, effect: Secondary) {
|
||||
def applyEffect(target: Monster, effect: Secondary)(implicit rng: Random) {
|
||||
applyBoosts(target, effect.boosts)
|
||||
applyStatus(target, effect.status)
|
||||
}
|
||||
|
||||
def applyStatus(target: Monster, status: Status) {
|
||||
def applyStatus(target: Monster, status: StatusTemplate)(implicit rng: Random) {
|
||||
if (target.isAlive && status != null) {
|
||||
if (target.status == None) {
|
||||
// apply status
|
||||
target.status = Some(status)
|
||||
status.onStart(target)
|
||||
val s = status.build
|
||||
target.status = Some(s)
|
||||
s.onStart(target)
|
||||
} else {
|
||||
println("But it failed!")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user