merge radio feature

This commit is contained in:
2025-08-20 16:59:07 +10:00
20 changed files with 392 additions and 62 deletions

View File

@@ -31,7 +31,8 @@ func exit_state() -> void:
hero.hud.grow_wave_start_label()
#hero.hud.primary_duration.visible = true
#hero.hud.secondary_duration.visible = true
hero.hud.energy_label.visible = true
if hero.game_manager.card_gameplay:
hero.hud.energy_label.visible = true
func process_state(_delta: float) -> void:

View File

@@ -65,6 +65,12 @@ var currency: int = 0 :
hud.set_currency_count(value)
get:
return currency
var blank_cassettes: int = 0 :
set(value):
blank_cassettes = value
hud.set_blank_cassette_count(value)
get():
return blank_cassettes
var energy: int = 0 :
set(value):
energy = value
@@ -75,7 +81,7 @@ var selected_card: Card :
set(_value):
pass
get():
return unique_cards[hand_selected_index]
return unique_cards[hand_selected_index] if unique_cards.size() > 0 else null
func set_zoom_factor(value: float) -> void:
@@ -89,7 +95,11 @@ func _ready() -> void:
sprite.queue_free()
player_name_tag.queue_free()
for card: Card in hero_class.deck:
draw_pile.add(card)
if game_manager.card_gameplay:
draw_pile.add(card)
else:
add_card(card)
update_selected_box()
else:
camera.set_visible(false)
gun_camera.set_visible(false)
@@ -128,8 +138,15 @@ func add_selection(card: Card) -> void:
var box: CardSelectionBox = card_select_scene.instantiate()
box.set_card(card)
box.set_key(unique_cards.size() - 1)
box.set_amount(1)
selection_boxes.append(box)
$HUD/selection_boxes.add_child(box)
else:
var box: CardSelectionBox
for existing_box: CardSelectionBox in selection_boxes:
if existing_box.card == card:
box = existing_box
box.set_amount(hand.contents.count(card))
func check_removal() -> void:
@@ -346,17 +363,21 @@ func equip_weapon(slot: int = 0) -> void:
if hand.size == 0:
return
var energy_cost: int = selected_card.cost
if energy < energy_cost:
if game_manager.card_gameplay and energy < energy_cost:
return
if weapons[slot] != null:
unequip_weapon(slot)
if !game_manager.card_gameplay:
return
if hand.size > 0:
energy -= energy_cost
if game_manager.card_gameplay:
energy -= energy_cost
place_card_audio.play()
cards[slot] = hand.remove_at(hand.contents.find(selected_card))
#card_sprites[hand_selected_index].queue_free()
#card_sprites.remove_at(hand_selected_index)
discard_pile.add(cards[slot])
if game_manager.card_gameplay:
discard_pile.add(cards[slot])
#TODO: Alternate thing to do with the hand i guess
#if !inventory.contents.has(cards[slot]):
#decrement_selected()
@@ -454,6 +475,8 @@ func unequip_weapon(slot: int = 0) -> void:
hud.new_energy_bar.disable_secondary_energy()
weapons[slot].queue_free()
weapons[slot] = null
if !game_manager.card_gameplay:
add_card(cards[slot])
cards[slot] = null
place_card_audio.play()

View File

@@ -300,15 +300,15 @@ no_depth_test = true
fixed_size = true
texture = SubResource("ViewportTexture_m3ots")
[node name="DrawPile" type="Node" parent="."]
script = ExtResource("6_cf5ap")
[node name="Hand" type="Node" parent="."]
script = ExtResource("6_cf5ap")
[node name="DiscardPile" type="Node" parent="."]
script = ExtResource("6_cf5ap")
[node name="DrawPile" type="Node" parent="."]
script = ExtResource("6_cf5ap")
[node name="PlayerMovement" type="Node" parent="." node_paths=PackedStringArray("player", "head", "weapon_holder")]
script = ExtResource("20_cfhw8")
player = NodePath("..")
@@ -319,7 +319,7 @@ max_look_up_angle = 80.0
enable_jumping = true
weapon_holder = NodePath("../FirstPersonViewport/Head2/RightHand")
[node name="HUD" type="CanvasLayer" parent="." node_paths=PackedStringArray("player", "wave_count", "lives_count", "currency_count", "minimap_outline", "minimap", "minimap_cam", "minimap_viewport", "fps_label", "hover_text", "enemy_sprites", "enemy_counts", "wave_start_label", "place_icon", "swap_icon", "place_text", "swap_text", "new_energy_bar", "energy_label", "primary_duration", "secondary_duration")]
[node name="HUD" type="CanvasLayer" parent="." node_paths=PackedStringArray("player", "wave_count", "lives_count", "currency_count", "minimap_outline", "minimap", "minimap_cam", "minimap_viewport", "fps_label", "hover_text", "enemy_sprites", "enemy_counts", "wave_start_label", "place_icon", "swap_icon", "place_text", "swap_text", "new_energy_bar", "energy_label", "primary_duration", "secondary_duration", "blank_cassette_label")]
script = ExtResource("8_yl6ka")
player = NodePath("..")
wave_count = NodePath("EnemyTracker/WaveCount")
@@ -344,6 +344,7 @@ new_energy_bar = NodePath("EnergyBar")
energy_label = NodePath("Currencies/HBoxContainer/EnergyLabel")
primary_duration = NodePath("weapon_duration")
secondary_duration = NodePath("weapon_duration2")
blank_cassette_label = NodePath("Currencies/BlankCassetteLabel")
[node name="FirstPersonCam" type="TextureRect" parent="HUD"]
anchors_preset = 15
@@ -775,11 +776,13 @@ texture = SubResource("ViewportTexture_w13oc")
[node name="CurrencyCount" type="Label" parent="HUD/Currencies/CoinCounter"]
layout_mode = 2
size_flags_horizontal = 3
text = "20"
horizontal_alignment = 1
horizontal_alignment = 2
vertical_alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="HUD/Currencies"]
visible = false
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="HUD/Currencies/HBoxContainer"]
@@ -790,8 +793,14 @@ stretch_mode = 5
[node name="EnergyLabel" type="Label" parent="HUD/Currencies/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "0"
horizontal_alignment = 1
horizontal_alignment = 2
vertical_alignment = 1
[node name="BlankCassetteLabel" type="Label" parent="HUD/Currencies"]
layout_mode = 2
horizontal_alignment = 2
vertical_alignment = 1
[node name="WeaponSwapTimer" type="Timer" parent="."]

View File

@@ -25,6 +25,7 @@ extends CanvasLayer
@export var energy_label: Label
@export var primary_duration: Label
@export var secondary_duration: Label
@export var blank_cassette_label: Label
var last_lives_count: int = 120
var enemy_names: Array[String]
@@ -35,6 +36,12 @@ var cards: Array[EnemyCardUI] = []
func _ready() -> void:
$StartWaveLabel.theme_type_variation = "WaveStartLabel"
$InteractLabel.theme_type_variation = "InteractLabel"
if player.game_manager.card_gameplay:
energy_label.visible = true
func set_blank_cassette_count(value: int) -> void:
blank_cassette_label.text = str(value)
func show_wave_generation_anim(wave: Wave) -> void: