mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-28 03:27:39 +01:00
Rebalanced Herbalism hunger bonuses.
This commit is contained in:
parent
e997c32c6c
commit
cca04468de
@ -49,4 +49,4 @@ public class AcrobaticsCommand implements CommandExecutor {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -252,32 +252,83 @@ public class mcEntityListener implements Listener
|
|||||||
int currentFoodLevel = player.getFoodLevel();
|
int currentFoodLevel = player.getFoodLevel();
|
||||||
int newFoodLevel = event.getFoodLevel();
|
int newFoodLevel = event.getFoodLevel();
|
||||||
|
|
||||||
|
//Some foods have 3 ranks
|
||||||
|
//Some foods have 5 ranks
|
||||||
|
//The number of ranks is based on how 'common' the item is
|
||||||
|
//We can adjust this quite easily if we find something is giving too much of a bonus
|
||||||
|
|
||||||
if(newFoodLevel > currentFoodLevel)
|
if(newFoodLevel > currentFoodLevel)
|
||||||
{
|
{
|
||||||
int food = player.getItemInHand().getTypeId();
|
int food = player.getItemInHand().getTypeId();
|
||||||
|
int herbLevel = PP.getSkillLevel(SkillType.HERBALISM);
|
||||||
if(food == 297 || food == 357 || food == 360 || food == 282)
|
int foodChange = newFoodLevel - currentFoodLevel;
|
||||||
|
|
||||||
|
switch(food)
|
||||||
{
|
{
|
||||||
int foodChange = newFoodLevel - currentFoodLevel;
|
case 297:
|
||||||
int herbLevel = PP.getSkillLevel(SkillType.HERBALISM);
|
{
|
||||||
|
//BREAD (297) RESTORES 2 1/2 HUNGER
|
||||||
if(herbLevel >= 200 && herbLevel < 400)
|
//Restores 5 HUNGER @ 1000
|
||||||
foodChange = foodChange + 2;
|
if(herbLevel >= 200 && herbLevel < 400)
|
||||||
if(herbLevel >= 400 && herbLevel < 600)
|
foodChange = foodChange + 1;
|
||||||
foodChange = foodChange + 4;
|
else if(herbLevel >= 400 && herbLevel < 600)
|
||||||
if(herbLevel >= 600 && herbLevel < 800)
|
foodChange = foodChange + 2;
|
||||||
foodChange = foodChange + 6;
|
else if(herbLevel >= 600 && herbLevel < 800)
|
||||||
if(herbLevel >= 800 && herbLevel < 1000)
|
foodChange = foodChange + 3;
|
||||||
foodChange = foodChange + 8;
|
else if(herbLevel >= 800 && herbLevel < 1000)
|
||||||
if(herbLevel >= 1000)
|
foodChange = foodChange + 4;
|
||||||
foodChange = foodChange + 10;
|
else if(herbLevel >= 1000)
|
||||||
|
foodChange = foodChange + 5;
|
||||||
newFoodLevel = currentFoodLevel + foodChange;
|
break;
|
||||||
if(newFoodLevel > 20)
|
|
||||||
event.setFoodLevel(20);
|
|
||||||
if(newFoodLevel <= 20)
|
|
||||||
event.setFoodLevel(newFoodLevel);
|
|
||||||
}
|
}
|
||||||
|
case 357:
|
||||||
|
{
|
||||||
|
//COOKIE (357) RESTORES 1/2 HUNGER
|
||||||
|
//RESTORES 2 HUNGER @ 1000
|
||||||
|
if(herbLevel >= 200 && herbLevel < 600)
|
||||||
|
foodChange = foodChange + 1;
|
||||||
|
else if(herbLevel >= 600 && herbLevel < 1000)
|
||||||
|
foodChange = foodChange + 2;
|
||||||
|
else if(herbLevel >= 1000)
|
||||||
|
foodChange = foodChange + 3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 360:
|
||||||
|
{
|
||||||
|
//MELON (360) RESTORES 1 HUNGER
|
||||||
|
//RESTORES 2 1/2 HUNGER @ 1000
|
||||||
|
if(herbLevel >= 200 && herbLevel < 600)
|
||||||
|
foodChange = foodChange + 1;
|
||||||
|
else if(herbLevel >= 600 && herbLevel < 1000)
|
||||||
|
foodChange = foodChange + 2;
|
||||||
|
else if(herbLevel >= 1000)
|
||||||
|
foodChange = foodChange + 3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 282:
|
||||||
|
{
|
||||||
|
//STEW (282) RESTORES 4 HUNGER
|
||||||
|
//RESTORES 6 1/2 HUNGER @ 1000
|
||||||
|
if(herbLevel >= 200 && herbLevel < 400)
|
||||||
|
foodChange = foodChange + 1;
|
||||||
|
else if(herbLevel >= 400 && herbLevel < 600)
|
||||||
|
foodChange = foodChange + 2;
|
||||||
|
else if(herbLevel >= 600 && herbLevel < 800)
|
||||||
|
foodChange = foodChange + 3;
|
||||||
|
else if(herbLevel >= 800 && herbLevel < 1000)
|
||||||
|
foodChange = foodChange + 4;
|
||||||
|
else if(herbLevel >= 1000)
|
||||||
|
foodChange = foodChange + 5;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Make sure we don't go over the max value
|
||||||
|
newFoodLevel = currentFoodLevel + foodChange;
|
||||||
|
if(newFoodLevel > 20)
|
||||||
|
event.setFoodLevel(20);
|
||||||
|
if(newFoodLevel <= 20)
|
||||||
|
event.setFoodLevel(newFoodLevel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user