Add missing check to prevents water grinding
This commit is contained in:
parent
6173f9b81d
commit
1e0b895ecb
3 changed files with 10 additions and 0 deletions
|
@ -216,6 +216,8 @@ BerryTree_EventScript_WantToWater::
|
||||||
.endif
|
.endif
|
||||||
checkitem ITEM_WAILMER_PAIL
|
checkitem ITEM_WAILMER_PAIL
|
||||||
goto_if_eq VAR_RESULT, FALSE, BerryTree_EventScript_DontWater
|
goto_if_eq VAR_RESULT, FALSE, BerryTree_EventScript_DontWater
|
||||||
|
specialvar VAR_RESULT, CanWaterBerryPlot
|
||||||
|
goto_if_eq VAR_RESULT, FALSE, BerryTree_EventScript_DontWater
|
||||||
special ObjectEventInteractionGetBerryName
|
special ObjectEventInteractionGetBerryName
|
||||||
msgbox BerryTree_Text_WantToWater, MSGBOX_YESNO
|
msgbox BerryTree_Text_WantToWater, MSGBOX_YESNO
|
||||||
goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_WaterBerry
|
goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_WaterBerry
|
||||||
|
|
|
@ -549,3 +549,4 @@ gSpecials::
|
||||||
def_special ObjectEventInteractionClearBerryPests
|
def_special ObjectEventInteractionClearBerryPests
|
||||||
def_special ObjectEventInteractionBerryHasWeed
|
def_special ObjectEventInteractionBerryHasWeed
|
||||||
def_special ObjectEventInteractionBerryHasPests
|
def_special ObjectEventInteractionBerryHasPests
|
||||||
|
def_special CanWaterBerryPlot
|
||||||
|
|
|
@ -2229,6 +2229,13 @@ static u8 GetPestsBonusByBerryType(u8 berry)
|
||||||
return (bonus == 0) ? 2 : bonus * 5;
|
return (bonus == 0) ? 2 : bonus * 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool8 CanWaterBerryPlot(void)
|
||||||
|
{
|
||||||
|
if (!OW_BERRY_MOISTURE || OW_BERRY_ALWAYS_WATERABLE)
|
||||||
|
return TRUE;
|
||||||
|
return (gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(gSelectedObjectEvent)].moistureLevel == 0);
|
||||||
|
}
|
||||||
|
|
||||||
void ObjectEventInteractionGetBerryTreeData(void)
|
void ObjectEventInteractionGetBerryTreeData(void)
|
||||||
{
|
{
|
||||||
u8 id;
|
u8 id;
|
||||||
|
|
Loading…
Reference in a new issue