better narration of fruit trees

master
shoaib11120 2022-01-13 12:52:20 +05:30
parent 1631002da9
commit a9e015f11f
1 changed files with 23 additions and 4 deletions

View File

@ -169,10 +169,7 @@ namespace stardew_access.Game
}
else if (terrain.Get() is FruitTree)
{
FruitTree fruitTree = (FruitTree)terrain.Get();
int stage = fruitTree.growthStage.Value;
int fruitType = fruitTree.indexOfFruit.Get();
toReturn = $"{Game1.objectInformation[fruitType].Split('/')[0]} tree";
toReturn = getFruitTree((FruitTree)terrain.Get());
}
else if (terrain.Get() is Grass)
{
@ -194,6 +191,27 @@ namespace stardew_access.Game
return toReturn;
}
public static string getFruitTree(FruitTree fruitTree)
{
int stage = fruitTree.growthStage.Value;
int fruitIndex = fruitTree.indexOfFruit.Get();
string toReturn = Game1.objectInformation[fruitIndex].Split('/')[0];
if (stage == 0)
toReturn = $"{toReturn} seed";
else if(stage == 1)
toReturn = $"{toReturn} sprout";
else if(stage == 2)
toReturn = $"{toReturn} sapling";
else if(stage == 3)
toReturn = $"{toReturn} bush";
else if(stage >= 4)
toReturn = $"{toReturn} tree";
return toReturn;
}
public static string getTree(Tree tree)
{
int treeType = tree.treeType.Value;
@ -213,6 +231,7 @@ namespace stardew_access.Game
return "Mushroom Tree";
}
if (treeType <= 3)
seedName = Game1.objectInformation[308 + treeType].Split('/')[0];
else if (treeType == 8)