# Hurry Curry! - a game about cooking
# Copyright (C) 2026 Hurry Curry! Contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License only.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
#
extends Effect

var amount: int

@onready var points: CPUParticles3D = $Points
@onready var amount_label: Label = $SubViewport/Control/AmountLabel

func _ready():
	delete_timer(5)
	var num_string: String = str(amount)
	if amount >= 0:
		num_string = "+" + num_string
	points.color = Color(.1,.6,.1) if amount >= 0 else Color(.6,.1,.1)
	amount_label.text = num_string
	points.emitting = true
