extends NPC


func _init() -> void:
	npc_name = "Bloobert"
	preferred_categories = Item.Category.CATEGORY_FOOD
	desired = [
		preload("res://data/items/olive.tres"),
	]
	inventory = [
		preload("res://data/items/olive.tres").duplicate(),
		preload("res://data/items/scented_hammer.tres").duplicate(),
	]
	inventory[0].amount = 2


func dialogue_beginning() -> DialogueResult:
	if _items_have_any_categories(Item.Category.CATEGORY_FOOD):
		return _response("I smell some vicious delicious [color=yellow]olives[/color] in that rickety backpack of yours.")
	else:
		return _response("None of your business, buddyboy!")


func dialogue_offer(_item: Item) -> DialogueResult:
	if _items_have_any_categories(Item.Category.CATEGORY_FOOD):
		return _response("I'll give you anything you want for them!")
	else:
		return _response("Eh...")


func dialogue_judge(items: Array[Item]) -> DialogueResult:
	if items.any(func(item: Item) -> bool: return item.categories & Item.Category.CATEGORY_FOOD):
		return _response("Ho-ho, yes!")
	else:
		return _response("You [shake rate=20.0 level=5]suck[/shake]. Gimme olives next time.")
