mirror of
https://gitlab.com/cable-mc/cobblemon.git
synced 2026-11-21 07:38:54 -05:00
Changes to Shuckle giving berry juice
This commit is contained in:
1 parent
e16ae2544c
commit
4734c0a3cb
2 files changed
+4
-52
No files matched your search
@@ -1045,12 +1045,12 @@ open class PokemonEntity(
|
||||
return InteractionResult.sidedSuccess(level().isClientSide)
|
||||
}
|
||||
}
|
||||
//Shuckle uses its Berry Juice meter to dispense Berry Juice if a player uses Wooden Bowl on it
|
||||
else if (pokemon.species.name == "Shuckle" && pokemon.berryJuiceMeter > 0) {
|
||||
//Shuckle uses it's fullness to dispense Berry Juice if a player uses Wooden Bowl on it
|
||||
else if (pokemon.species.name == "Shuckle" && pokemon.currentFullness > 0) {
|
||||
player.playSound(SoundEvents.MOOSHROOM_MILK, 1.0f, 1.0f)
|
||||
val berryJuice = ItemUtils.createFilledResult(itemStack, player, CobblemonItems.BERRY_JUICE.defaultInstance)
|
||||
player.setItemInHand(hand, berryJuice)
|
||||
pokemon.getBerryJuice()
|
||||
pokemon.currentFullness--
|
||||
return InteractionResult.sidedSuccess(level().isClientSide)
|
||||
}
|
||||
} else if (itemStack.`is`(Items.GLASS_BOTTLE)) {
|
||||
|
||||
@@ -892,15 +892,6 @@ open class Pokemon : ShowdownIdentifiable {
|
||||
|
||||
// Fullness / Milking mechanics
|
||||
|
||||
// code for Shuckle Berry Juice farming
|
||||
var berryJuiceMeter = 0
|
||||
|
||||
fun getBerryJuice() {
|
||||
if (this.berryJuiceMeter != 0) {
|
||||
this.berryJuiceMeter -= 1
|
||||
}
|
||||
}
|
||||
|
||||
//last time this pokemon was milked (this will increase overtime)
|
||||
var lastMilked = 0
|
||||
|
||||
@@ -916,6 +907,7 @@ open class Pokemon : ShowdownIdentifiable {
|
||||
pokemon.species.name == "Camerupt" ||
|
||||
pokemon.species.name == "Vespiqueen" ||
|
||||
pokemon.species.name == "Combee" ||
|
||||
pokemon.species.name == "Shuckle" ||
|
||||
(pokemon.species.name == "Gogoat" && pokemon.gender.name == "Female") ||
|
||||
(pokemon.species.name == "Bouffalant" && pokemon.gender.name == "Female")
|
||||
) {
|
||||
@@ -926,11 +918,6 @@ open class Pokemon : ShowdownIdentifiable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// DEPRECATED
|
||||
//base Hunger value for all pokemon
|
||||
var baseFullness = 5
|
||||
|
||||
// function to return the max hunger for the pokemon
|
||||
fun getMaxFullness(): Int {
|
||||
// get base HP stat of the referenced Pokemon
|
||||
@@ -981,43 +968,8 @@ open class Pokemon : ShowdownIdentifiable {
|
||||
if (this.currentFullness < 0) {
|
||||
this.currentFullness = 0
|
||||
}
|
||||
|
||||
// if that pokemon is Shuckle and the berry juice meter if not full then increase the berry juice meter
|
||||
if (this.species.name == "Shuckle" && this.berryJuiceMeter < 12){
|
||||
this.berryJuiceMeter += 1
|
||||
}
|
||||
}
|
||||
|
||||
// DEPRECATED FOR NOW
|
||||
// function to scale Hunger based off of the base HP stat of a Pokemon
|
||||
fun scaleFullnessRates(stat: Int): Int {
|
||||
// lowest base HP stat of a pokemon before adding more hunger
|
||||
var lowerThreshold = 25
|
||||
|
||||
// highest base HP stat of a pokemon to be at max extra hunger
|
||||
var upperThreshold = 150
|
||||
|
||||
// Value of the highest additional hunger allowed to be given
|
||||
var maxAdditionalHunger = 15
|
||||
|
||||
// To adjust the curvature of the hunger scale increase as base HP gets larger
|
||||
var hungerScaleExponent = 2.0
|
||||
|
||||
return when {
|
||||
stat <= lowerThreshold -> 0
|
||||
stat > upperThreshold -> maxAdditionalHunger
|
||||
else -> {
|
||||
// Scale the thresholds for hunger to be 0-1
|
||||
val scaledStat = (stat - lowerThreshold) / (upperThreshold - lowerThreshold).toDouble()
|
||||
// Apply exponential function for non-linear growth of the hunger increase
|
||||
val result = maxAdditionalHunger * Math.pow(scaledStat, hungerScaleExponent)
|
||||
// Ensure the result is within the bounds of the min and max thresholds
|
||||
result.toInt().coerceIn(0, maxAdditionalHunger)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Amount of seconds that need to pass for the pokemon to lose 1 fullness value
|
||||
fun getMetabolismRate(): Int {
|
||||
|
||||
|
||||
Reference in new issue
Block a user