mirror of
https://gitlab.com/cable-mc/cobblemon.git
synced 2026-12-01 04:28:53 -05:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
380b6d6cee |
No files matched your search
+13
-11
@@ -92,7 +92,7 @@ open class PlayerPartyStore(
|
|||||||
val random = Random.Default
|
val random = Random.Default
|
||||||
for (pokemon in this) {
|
for (pokemon in this) {
|
||||||
// Awake from fainted
|
// Awake from fainted
|
||||||
if (pokemon.isFainted()) {
|
if (pokemon.isFainted() && Cobblemon.config.faintAwakenHealthPercent > 0 && Cobblemon.config.defaultFaintTimer > 0) {
|
||||||
pokemon.faintedTimer -= 1
|
pokemon.faintedTimer -= 1
|
||||||
if (pokemon.faintedTimer <= -1) {
|
if (pokemon.faintedTimer <= -1) {
|
||||||
val php = ceil(pokemon.hp * Cobblemon.config.faintAwakenHealthPercent)
|
val php = ceil(pokemon.hp * Cobblemon.config.faintAwakenHealthPercent)
|
||||||
@@ -101,24 +101,26 @@ open class PlayerPartyStore(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Passive healing while less than full health
|
// Passive healing while less than full health
|
||||||
else if (pokemon.currentHealth < pokemon.hp) {
|
else if (pokemon.currentHealth < pokemon.hp && Cobblemon.config.healTimer > 0 && Cobblemon.config.healPercent > 0) {
|
||||||
pokemon.healTimer--
|
pokemon.healTimer--
|
||||||
if (pokemon.healTimer <= -1) {
|
if (pokemon.healTimer <= -1) {
|
||||||
pokemon.healTimer = Cobblemon.config.healTimer
|
pokemon.healTimer = Cobblemon.config.healTimer
|
||||||
val healAmount = 1.0.coerceAtLeast(pokemon.hp.toDouble() * Cobblemon.config.healPercent)
|
val healAmount = 1.0.coerceAtLeast(pokemon.hp.toDouble() * Cobblemon.config.healPercent)
|
||||||
pokemon.currentHealth = pokemon.currentHealth + round(healAmount).toInt()
|
pokemon.currentHealth += round(healAmount).toInt()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Statuses
|
// Statuses
|
||||||
val status = pokemon.status
|
if (Cobblemon.config.healPassiveStatuses) {
|
||||||
if (status != null && !player.isSleeping) {
|
val status = pokemon.status
|
||||||
if (status.isExpired()) {
|
if (status != null && !player.isSleeping) {
|
||||||
status.status.onStatusExpire(player, pokemon, random)
|
if (status.isExpired()) {
|
||||||
pokemon.status = null
|
status.status.onStatusExpire(player, pokemon, random)
|
||||||
} else {
|
pokemon.status = null
|
||||||
status.status.onSecondPassed(player, pokemon, random)
|
} else {
|
||||||
status.tickTimer()
|
status.status.onSecondPassed(player, pokemon, random)
|
||||||
|
status.tickTimer()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -147,6 +147,9 @@ class CobblemonConfig {
|
|||||||
Statuses.BURN.configEntry()
|
Statuses.BURN.configEntry()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@NodeCategory(Category.PassiveStatus)
|
||||||
|
var healPassiveStatuses = true
|
||||||
|
|
||||||
@NodeCategory(Category.Healing)
|
@NodeCategory(Category.Healing)
|
||||||
var infiniteHealerCharge = false
|
var infiniteHealerCharge = false
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user