generated from krampus/template-godot4
32 lines
769 B
GDScript
32 lines
769 B
GDScript
class_name PostOffice extends Building
|
|
|
|
@onready var preview_node: Node2D = %Preview
|
|
@onready var board_node: Node2D = %Board
|
|
|
|
|
|
func place() -> void:
|
|
preview_node.hide()
|
|
board_node.show()
|
|
|
|
|
|
func can_citizen_enter(_coord: Vector2i, _direction: Board.Direction) -> bool:
|
|
return true
|
|
|
|
|
|
func get_tile_coords() -> Array[Vector2i]:
|
|
return [starting_coord]
|
|
|
|
|
|
func get_direction_queue(_citizen: Citizen) -> Array[Board.Direction]:
|
|
return []
|
|
|
|
|
|
func activate(citizen: Citizen) -> void:
|
|
if citizen.get_status_count(Citizen.Status.PACKAGED) > 0:
|
|
citizen.remove_all_statuses(Citizen.Status.PACKAGED)
|
|
citizen.money += ceili(citizen.package_distance / 2.0)
|
|
citizen.play_money_animation()
|
|
citizen.package_distance = 0
|
|
else:
|
|
citizen.add_status(Citizen.Status.PACKAGED)
|