mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 09:55:35 +00:00
Alarm trigger enhancements
This commit is contained in:
parent
9f89246425
commit
d0baa87bba
9 changed files with 80 additions and 20 deletions
Binary file not shown.
Binary file not shown.
|
|
@ -814,7 +814,7 @@ tracks/13/keys = {
|
|||
}
|
||||
tracks/14/type = "audio"
|
||||
tracks/14/imported = false
|
||||
tracks/14/enabled = true
|
||||
tracks/14/enabled = false
|
||||
tracks/14/path = NodePath("AudioStreamPlayer2D2")
|
||||
tracks/14/interp = 1
|
||||
tracks/14/loop_wrap = true
|
||||
|
|
@ -1258,7 +1258,6 @@ texture = ExtResource("31_mqbwl")
|
|||
stretch_mode = 5
|
||||
|
||||
[node name="Intro7" type="TextureRect" parent="MarginContainer/ImagesContainer"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("35_gbvvb")
|
||||
stretch_mode = 5
|
||||
|
|
@ -1282,7 +1281,6 @@ offset_bottom = 40.0
|
|||
texture = ExtResource("38_kkn1r")
|
||||
|
||||
[node name="Intro8" type="TextureRect" parent="MarginContainer/ImagesContainer"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("39_4d10p")
|
||||
stretch_mode = 5
|
||||
|
|
@ -1300,7 +1298,6 @@ offset_bottom = 40.0
|
|||
texture = ExtResource("41_bsyaq")
|
||||
|
||||
[node name="Intro9" type="TextureRect" parent="MarginContainer/ImagesContainer"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
clip_contents = true
|
||||
layout_mode = 2
|
||||
texture = ExtResource("42_oui7j")
|
||||
|
|
@ -1326,7 +1323,6 @@ offset_bottom = 100.0
|
|||
texture = ExtResource("45_8f1jm")
|
||||
|
||||
[node name="Intro10" type="TextureRect" parent="MarginContainer/ImagesContainer"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
clip_contents = true
|
||||
layout_mode = 2
|
||||
texture = ExtResource("42_oui7j")
|
||||
|
|
@ -1361,7 +1357,7 @@ texture = ExtResource("35_lrnvt")
|
|||
process_material = SubResource("ParticleProcessMaterial_6n1fx")
|
||||
|
||||
[node name="Intro11" type="TextureRect" parent="MarginContainer/ImagesContainer"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
modulate = Color(1, 1, 1, 0.870762)
|
||||
clip_contents = true
|
||||
layout_mode = 2
|
||||
texture = ExtResource("50_kkn1r")
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
[node name="ScriptableEnabledAlarmTrigger" type="Node2D"]
|
||||
script = ExtResource("1_kxf32")
|
||||
Events = Array[Object]([])
|
||||
|
||||
[node name="AlarmTrigger" type="Node2D" parent="." node_paths=PackedStringArray("Target")]
|
||||
script = ExtResource("2_kl708")
|
||||
|
|
|
|||
|
|
@ -404,8 +404,9 @@ Targets = [NodePath("../VerticalDoor")]
|
|||
[node name="VerticalDoor2" parent="Tilemaps/Actors" instance=ExtResource("20_qudbj")]
|
||||
position = Vector2(28, 520)
|
||||
|
||||
[node name="Camera" parent="Tilemaps/Actors" instance=ExtResource("17_s23f3")]
|
||||
[node name="Camera" parent="Tilemaps/Actors" node_paths=PackedStringArray("AlarmActivationTargets") instance=ExtResource("17_s23f3")]
|
||||
position = Vector2(135, 459)
|
||||
AlarmActivationTargets = []
|
||||
|
||||
[node name="ControlPad2" parent="Tilemaps/Actors" node_paths=PackedStringArray("Targets") instance=ExtResource("24_fdi4d")]
|
||||
position = Vector2(40, 518)
|
||||
|
|
@ -557,11 +558,13 @@ position = Vector2(-103, 505)
|
|||
[node name="Fairy5" parent="Tilemaps/Actors" instance=ExtResource("37_sb7g3")]
|
||||
position = Vector2(287, 515)
|
||||
|
||||
[node name="Camera2" parent="Tilemaps/Actors" instance=ExtResource("17_s23f3")]
|
||||
[node name="Camera2" parent="Tilemaps/Actors" node_paths=PackedStringArray("AlarmActivationTargets") instance=ExtResource("17_s23f3")]
|
||||
position = Vector2(-56, 251)
|
||||
AlarmActivationTargets = []
|
||||
|
||||
[node name="Camera3" parent="Tilemaps/Actors" instance=ExtResource("17_s23f3")]
|
||||
[node name="Camera3" parent="Tilemaps/Actors" node_paths=PackedStringArray("AlarmActivationTargets") instance=ExtResource("17_s23f3")]
|
||||
position = Vector2(-121, 476)
|
||||
AlarmActivationTargets = []
|
||||
|
||||
[node name="VerticalDoor3" parent="Tilemaps/Actors" instance=ExtResource("20_qudbj")]
|
||||
position = Vector2(-324, 696)
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -811,11 +811,13 @@ position = Vector2(-1159, 213)
|
|||
[node name="AlarmBox7" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("36_rd6f6")]
|
||||
position = Vector2(-1016, 152)
|
||||
|
||||
[node name="Camera" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("16_clqjt")]
|
||||
[node name="Camera" parent="Parallax2D/Factory Tilemaps/LevelProps" node_paths=PackedStringArray("AlarmActivationTargets") instance=ExtResource("16_clqjt")]
|
||||
position = Vector2(-1207, -58)
|
||||
AlarmActivationTargets = []
|
||||
|
||||
[node name="Camera2" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("16_clqjt")]
|
||||
[node name="Camera2" parent="Parallax2D/Factory Tilemaps/LevelProps" node_paths=PackedStringArray("AlarmActivationTargets") instance=ExtResource("16_clqjt")]
|
||||
position = Vector2(-1912, 12)
|
||||
AlarmActivationTargets = []
|
||||
|
||||
[node name="ControlPad6" parent="Parallax2D/Factory Tilemaps/LevelProps" node_paths=PackedStringArray("Target") instance=ExtResource("12_hfkf1")]
|
||||
position = Vector2(-1462, -60)
|
||||
|
|
@ -1082,7 +1084,7 @@ position = Vector2(-2000, -736)
|
|||
[node name="ControlPad8" parent="Parallax2D/Factory Tilemaps/LevelProps" node_paths=PackedStringArray("Targets") instance=ExtResource("12_hfkf1")]
|
||||
position = Vector2(-2027, -735)
|
||||
Targets = [NodePath("../HorizontalForceField")]
|
||||
Requirements = Array[ExtResource("6_8tdlb")]([ExtResource("84_ma1ta")])
|
||||
Requirements = [ExtResource("84_ma1ta")]
|
||||
|
||||
[node name="Ammo6" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("34_17pjh")]
|
||||
position = Vector2(-872, -220)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using Godot;
|
||||
using System;
|
||||
using Cirno.Scripts;
|
||||
using Godot.Collections;
|
||||
|
||||
public partial class Camera : Enemy
|
||||
{
|
||||
|
|
@ -8,6 +9,8 @@ public partial class Camera : Enemy
|
|||
|
||||
private AlarmManager _alarmManager;
|
||||
|
||||
[Export] public Array<Node2D> AlarmActivationTargets { get; private set; }
|
||||
|
||||
///private AlarmManager _alarmManager;
|
||||
|
||||
public override void _Ready()
|
||||
|
|
|
|||
|
|
@ -8,9 +8,13 @@ public partial class AlarmTrigger : Node2D
|
|||
|
||||
[Export]
|
||||
public AlarmTriggerType TriggerType { get; private set; }
|
||||
|
||||
[Export] public float ActivationRange { get; private set; } = 200f;
|
||||
|
||||
[Export]
|
||||
public Node2D Target { get; private set; }
|
||||
|
||||
[Export] public ActivationType ActivationType { get; private set; }
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
|
|
@ -32,14 +36,17 @@ public partial class AlarmTrigger : Node2D
|
|||
|
||||
private void AlarmManagerOnAlarmEnabled(Vector2 location)
|
||||
{
|
||||
Activate();
|
||||
if (this.GlobalPosition.DistanceTo(location) <= ActivationRange)
|
||||
{
|
||||
Activate();
|
||||
}
|
||||
}
|
||||
|
||||
private void Activate()
|
||||
{
|
||||
if (Target is IActivable activatable)
|
||||
{
|
||||
activatable.Activate();
|
||||
activatable.Activate(ActivationType);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue