summaryrefslogtreecommitdiff
path: root/Scenes/PlateKey.gd
blob: aa3bb8b46bbfd77113d94e2325349fd5a2d3ca3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
extends Plate

export(NodePath) var crystal_path
export(Color) var active_color

onready var crystal : Crystal = get_node(crystal_path) setget set_crystal
onready var mesh : MeshInstance = $Mesh

func activate(entity : Entity, dungeon):
	if crystal == null or crystal.is_active:
		return

	var material = mesh.get_active_material(0)
	material.albedo_color = active_color

	crystal.add_action("cor_activate", [0.2])

func set_crystal(value : Crystal):
	crystal = value
	crystal_path = value.get_path()