diff --git a/src/entities/pickupeffects/ChangeFireIntensity.gd b/src/entities/pickupeffects/ChangeFireIntensity.gd new file mode 100644 index 0000000..a348437 --- /dev/null +++ b/src/entities/pickupeffects/ChangeFireIntensity.gd @@ -0,0 +1,23 @@ +extends Node + + +export var target_path: NodePath = NodePath("../../Fire") +export var amount_per_second: float = 0.2 +onready var target = get_node(target_path) +onready var pickup: Area2D = get_parent() + +var active = false + + +func _ready(): + # warning-ignore: RETURN_VALUE_DISCARDED + pickup.connect("picked_up", self, "_on_picked_up") + + +func _on_picked_up(): + active = true + + +func _process(delta): + if active: + target.intensity += delta * amount_per_second diff --git a/src/entities/pickupeffects/ChangeFireIntensity.tscn b/src/entities/pickupeffects/ChangeFireIntensity.tscn new file mode 100644 index 0000000..6af9b1a --- /dev/null +++ b/src/entities/pickupeffects/ChangeFireIntensity.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/entities/pickupeffects/ChangeFireIntensity.gd" type="Script" id=1] + +[node name="ChangeFireIntensity" type="Node"] +script = ExtResource( 1 )