generated from krampus/template-godot4
37 lines
795 B
GDScript3
37 lines
795 B
GDScript3
|
|
class_name HQ extends Building
|
||
|
|
|
||
|
|
@onready var border: PanelContainer = %Border
|
||
|
|
|
||
|
|
|
||
|
|
func _ready() -> void:
|
||
|
|
_set_border_color()
|
||
|
|
|
||
|
|
|
||
|
|
func activate(_citizen: Citizen) -> void:
|
||
|
|
player.votes += 1
|
||
|
|
Globals.board_game.update_player_votes(player, player.votes)
|
||
|
|
|
||
|
|
|
||
|
|
func can_citizen_enter(_coord: Vector2i, _direction: Board.Direction) -> bool:
|
||
|
|
return true
|
||
|
|
|
||
|
|
|
||
|
|
func get_direction_queue(_citizen: Citizen) -> Array[Board.Direction]:
|
||
|
|
return [Board.Direction.NONE]
|
||
|
|
|
||
|
|
|
||
|
|
func get_tile_coords() -> Array[Vector2i]:
|
||
|
|
return [starting_coord]
|
||
|
|
|
||
|
|
|
||
|
|
func _set_player(new_player: Player) -> void:
|
||
|
|
super(new_player)
|
||
|
|
_set_border_color()
|
||
|
|
|
||
|
|
|
||
|
|
func _set_border_color() -> void:
|
||
|
|
if !is_node_ready() or player == null:
|
||
|
|
return
|
||
|
|
var style_box: StyleBoxFlat = border.get_theme_stylebox("panel")
|
||
|
|
style_box.border_color = player.color
|