Updated future testing logic.
This commit is contained in:
parent
da9f947788
commit
49a8913c14
3 changed files with 11 additions and 2 deletions
|
|
@ -130,7 +130,6 @@ debug_color = Color(1, 0.5058824, 0.21960784, 0.41960785)
|
||||||
|
|
||||||
[node name="HelpBoxArea" type="Area2D" parent="." unique_id=938667427]
|
[node name="HelpBoxArea" type="Area2D" parent="." unique_id=938667427]
|
||||||
collision_layer = 2
|
collision_layer = 2
|
||||||
collision_mask = 1
|
|
||||||
|
|
||||||
[node name="HelpBoxShape" type="CollisionShape2D" parent="HelpBoxArea" unique_id=938667428]
|
[node name="HelpBoxShape" type="CollisionShape2D" parent="HelpBoxArea" unique_id=938667428]
|
||||||
position = Vector2(0, 3)
|
position = Vector2(0, 3)
|
||||||
|
|
@ -170,6 +169,7 @@ script = ExtResource("7_d2wvv")
|
||||||
weapon_data = ExtResource("8_stock")
|
weapon_data = ExtResource("8_stock")
|
||||||
available_weapons = Array[ExtResource("10_d2wvv")]([ExtResource("8_stock"), ExtResource("11_3v2ag"), ExtResource("13_f1ej7"), ExtResource("9_ur7pv"), ExtResource("14_oprun")])
|
available_weapons = Array[ExtResource("10_d2wvv")]([ExtResource("8_stock"), ExtResource("11_3v2ag"), ExtResource("13_f1ej7"), ExtResource("9_ur7pv"), ExtResource("14_oprun")])
|
||||||
weapon_change_flash = SubResource("Resource_jej6c")
|
weapon_change_flash = SubResource("Resource_jej6c")
|
||||||
|
test_mode = true
|
||||||
metadata/_custom_type_script = "uid://ylmao2ndp22y"
|
metadata/_custom_type_script = "uid://ylmao2ndp22y"
|
||||||
|
|
||||||
[node name="EffectsComponent" type="Node" parent="." unique_id=1393438576 node_paths=PackedStringArray("target_node")]
|
[node name="EffectsComponent" type="Node" parent="." unique_id=1393438576 node_paths=PackedStringArray("target_node")]
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,13 @@ func _spawn_test_pickups() -> void:
|
||||||
|
|
||||||
func pickup_collected() -> void:
|
func pickup_collected() -> void:
|
||||||
# Called by the player when a pickup is collected.
|
# Called by the player when a pickup is collected.
|
||||||
|
# Sync WeaponComponent's test_mode so tab cycling stays independent of
|
||||||
|
# pickups when in test mode, and normal behavior is restored otherwise.
|
||||||
|
var level: Node2D = get_parent() as Node2D
|
||||||
|
if level != null:
|
||||||
|
var wc: WeaponComponent = level.get_node_or_null("WeaponComponent")
|
||||||
|
if wc != null:
|
||||||
|
wc.test_mode = test_mode
|
||||||
# Decrement counter; resume timer once all pickups are gone.
|
# Decrement counter; resume timer once all pickups are gone.
|
||||||
_pickups_remaining = max(0, _pickups_remaining - 1)
|
_pickups_remaining = max(0, _pickups_remaining - 1)
|
||||||
if _pickups_remaining <= 0:
|
if _pickups_remaining <= 0:
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ class_name WeaponComponent extends Node
|
||||||
@export var available_weapons: Array[WeaponShot] = []
|
@export var available_weapons: Array[WeaponShot] = []
|
||||||
@export var weapon_change_flash: BaseEffect = null
|
@export var weapon_change_flash: BaseEffect = null
|
||||||
|
|
||||||
|
@export var test_mode: bool = false
|
||||||
|
|
||||||
var _current_weapon_index = 0
|
var _current_weapon_index = 0
|
||||||
var _current_power_level = 0
|
var _current_power_level = 0
|
||||||
var _cycled_weapon: WeaponShot = null
|
var _cycled_weapon: WeaponShot = null
|
||||||
|
|
@ -90,7 +92,7 @@ func collect_weapon(new_weapon: WeaponShot) -> void:
|
||||||
#
|
#
|
||||||
# Clear any active cycle — collecting a weapon during cycling restores
|
# Clear any active cycle — collecting a weapon during cycling restores
|
||||||
# normal additive behavior.
|
# normal additive behavior.
|
||||||
if _cycled_weapon != null:
|
if _cycled_weapon != null and not test_mode:
|
||||||
reset_weapon_cycle()
|
reset_weapon_cycle()
|
||||||
# Rule 1: Force replace — discard everything, keep only this weapon
|
# Rule 1: Force replace — discard everything, keep only this weapon
|
||||||
if new_weapon.force_replace_all:
|
if new_weapon.force_replace_all:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue