2022-05-10 04:21:20 +00:00
|
|
|
#include "AmTeapotServer.h"
|
|
|
|
#include "InventoryComponent.h"
|
|
|
|
#include "GameMessages.h"
|
|
|
|
|
|
|
|
|
|
|
|
void AmTeapotServer::OnUse(Entity* self, Entity* user) {
|
|
|
|
auto* inventoryComponent = user->GetComponent<InventoryComponent>();
|
|
|
|
if (!inventoryComponent) return;
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
if (inventoryComponent->GetLotCount(BLUE_FLOWER_LEAVES) >= 10) {
|
2022-05-10 04:21:20 +00:00
|
|
|
inventoryComponent->RemoveItem(BLUE_FLOWER_LEAVES, 10);
|
|
|
|
inventoryComponent->AddItem(WU_S_IMAGINATION_TEA, 1);
|
|
|
|
}
|
|
|
|
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
|
|
|
}
|