conforms file names to consistant standard

This commit is contained in:
2026-02-21 04:24:04 +11:00
parent 6b67dd9755
commit 5a4ad8633a
1991 changed files with 3836 additions and 7976 deletions

263
scenes/shop/scn_shop.tscn Normal file
View File

@@ -0,0 +1,263 @@
[gd_scene format=3 uid="uid://7g3jev3v6d3l"]
[ext_resource type="Script" uid="uid://colk6js4wet11" path="res://scenes/shop/scr_shop.gd" id="1_4in53"]
[ext_resource type="Script" uid="uid://dkfswql8ui0bt" path="res://scripts/interact_button.gd" id="1_x8sts"]
[ext_resource type="PackedScene" uid="uid://dsasunnk47n8o" path="res://scenes/item_cassette.tscn" id="2_qh00w"]
[ext_resource type="PackedScene" uid="uid://dixtx38u4jhd7" path="res://ui/cassette_hand.tscn" id="3_u7x2f"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_lhc2g"]
albedo_color = Color(0.313726, 0.180392, 0.00392157, 1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_tn6ej"]
albedo_color = Color(0.313726, 0.180392, 0.00392157, 1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_4tjcf"]
albedo_color = Color(0.313726, 0.180392, 0.00392157, 1)
[sub_resource type="BoxShape3D" id="BoxShape3D_3a288"]
size = Vector3(2.95542, 2.01704, 1.92446)
[sub_resource type="BoxShape3D" id="BoxShape3D_txjtg"]
size = Vector3(0.427765, 0.430664, 0.898926)
[sub_resource type="BoxShape3D" id="BoxShape3D_3r1g8"]
size = Vector3(0.69, 0.665, 0.34)
[sub_resource type="ViewportTexture" id="ViewportTexture_5mbfv"]
viewport_path = NodePath("SubViewport")
[sub_resource type="ViewportTexture" id="ViewportTexture_cfv1i"]
viewport_path = NodePath("SubViewport2")
[sub_resource type="ViewportTexture" id="ViewportTexture_1rey7"]
viewport_path = NodePath("SubViewport3")
[sub_resource type="ViewportTexture" id="ViewportTexture_rlwso"]
viewport_path = NodePath("SubViewport4")
[sub_resource type="ViewportTexture" id="ViewportTexture_a6401"]
viewport_path = NodePath("SubViewport5")
[sub_resource type="ViewportTexture" id="ViewportTexture_rnm0u"]
viewport_path = NodePath("SubViewport6")
[node name="ShopStand" type="Node3D" unique_id=1287436541 node_paths=PackedStringArray("cards", "choice_colliders", "choice_buttons", "choice_sprites", "blank_button", "blank_button_collider", "blank_models")]
script = ExtResource("1_4in53")
cards = [NodePath("SubViewport/Node2D"), NodePath("SubViewport2/Node2D"), NodePath("SubViewport3/Node2D"), NodePath("SubViewport4/Node2D"), NodePath("SubViewport5/Node2D"), NodePath("SubViewport6/Node2D")]
choice_colliders = [NodePath("InteractButton/CollisionShape3D"), NodePath("InteractButton2/CollisionShape3D2"), NodePath("InteractButton3/CollisionShape3D3"), NodePath("InteractButton6/CollisionShape3D6"), NodePath("InteractButton5/CollisionShape3D5"), NodePath("InteractButton4/CollisionShape3D4")]
choice_buttons = [NodePath("InteractButton"), NodePath("InteractButton2"), NodePath("InteractButton3"), NodePath("InteractButton6"), NodePath("InteractButton5"), NodePath("InteractButton4")]
choice_sprites = [NodePath("Sprites/Sprite3D"), NodePath("Sprites/Sprite3D2"), NodePath("Sprites/Sprite3D3"), NodePath("Sprites/Sprite3D4"), NodePath("Sprites/Sprite3D5"), NodePath("Sprites/Sprite3D6")]
item_card_scene = ExtResource("2_qh00w")
blank_button = NodePath("InteractButton7")
blank_button_collider = NodePath("InteractButton7/CollisionShape3D")
blank_models = [NodePath("CSGBox3D4"), NodePath("CSGBox3D5"), NodePath("CSGBox3D6"), NodePath("CSGBox3D7"), NodePath("CSGBox3D8")]
[node name="CSGBox3D" type="CSGBox3D" parent="." unique_id=1318214883]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.294425, 0, 0)
size = Vector3(3.54787, 1, 1)
material = SubResource("StandardMaterial3D_lhc2g")
[node name="CSGBox3D2" type="CSGBox3D" parent="." unique_id=985592437]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.453776, -0.485039)
size = Vector3(2.95902, 1, 1)
material = SubResource("StandardMaterial3D_tn6ej")
[node name="CSGBox3D3" type="CSGBox3D" parent="." unique_id=1018776620]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.491623, -0.927363)
size = Vector3(2.95902, 1.96606, 1)
material = SubResource("StandardMaterial3D_4tjcf")
[node name="StaticBody3D" type="StaticBody3D" parent="." unique_id=1128254914]
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D" unique_id=5577448]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.502094, -0.465026)
shape = SubResource("BoxShape3D_3a288")
[node name="InteractButton7" type="StaticBody3D" parent="." unique_id=1757807307]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.73285, 0.835364, 0.235621)
collision_layer = 16
collision_mask = 0
script = ExtResource("1_x8sts")
[node name="CollisionShape3D" type="CollisionShape3D" parent="InteractButton7" unique_id=823738383]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0624237, -0.101074, -0.214111)
shape = SubResource("BoxShape3D_txjtg")
disabled = true
[node name="InteractButton" type="StaticBody3D" parent="." unique_id=2043390372]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.08327, 0.835364, 0.235621)
collision_layer = 16
collision_mask = 0
script = ExtResource("1_x8sts")
[node name="CollisionShape3D" type="CollisionShape3D" parent="InteractButton" unique_id=1008844636]
shape = SubResource("BoxShape3D_3r1g8")
disabled = true
[node name="InteractButton2" type="StaticBody3D" parent="." unique_id=409716279]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0897942, 0.854733, 0.276212)
collision_layer = 16
collision_mask = 0
script = ExtResource("1_x8sts")
button_press_value = 1
[node name="CollisionShape3D2" type="CollisionShape3D" parent="InteractButton2" unique_id=2089267741]
shape = SubResource("BoxShape3D_3r1g8")
disabled = true
[node name="InteractButton3" type="StaticBody3D" parent="." unique_id=1438261967]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.982556, 0.839111, 0.270489)
collision_layer = 16
collision_mask = 0
script = ExtResource("1_x8sts")
button_press_value = 2
[node name="CollisionShape3D3" type="CollisionShape3D" parent="InteractButton3" unique_id=934010889]
shape = SubResource("BoxShape3D_3r1g8")
disabled = true
[node name="InteractButton4" type="StaticBody3D" parent="." unique_id=771110062]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.964396, 1.2947, -0.222282)
collision_layer = 16
collision_mask = 0
script = ExtResource("1_x8sts")
button_press_value = 5
[node name="CollisionShape3D4" type="CollisionShape3D" parent="InteractButton4" unique_id=87223566]
shape = SubResource("BoxShape3D_3r1g8")
disabled = true
[node name="InteractButton5" type="StaticBody3D" parent="." unique_id=1026319516]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0971891, 1.30596, -0.223896)
collision_layer = 16
collision_mask = 0
script = ExtResource("1_x8sts")
button_press_value = 4
[node name="CollisionShape3D5" type="CollisionShape3D" parent="InteractButton5" unique_id=1157590590]
shape = SubResource("BoxShape3D_3r1g8")
disabled = true
[node name="InteractButton6" type="StaticBody3D" parent="." unique_id=757111681]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.01936, 1.30134, -0.249066)
collision_layer = 16
collision_mask = 0
script = ExtResource("1_x8sts")
button_press_value = 3
[node name="CollisionShape3D6" type="CollisionShape3D" parent="InteractButton6" unique_id=224663904]
shape = SubResource("BoxShape3D_3r1g8")
disabled = true
[node name="SubViewport" type="SubViewport" parent="." unique_id=801515313]
transparent_bg = true
render_target_update_mode = 4
[node name="Node2D" parent="SubViewport" unique_id=1117068690 instance=ExtResource("3_u7x2f")]
[node name="SubViewport2" type="SubViewport" parent="." unique_id=2121876296]
transparent_bg = true
render_target_update_mode = 4
[node name="Node2D" parent="SubViewport2" unique_id=2001793470 instance=ExtResource("3_u7x2f")]
[node name="SubViewport3" type="SubViewport" parent="." unique_id=1774810803]
transparent_bg = true
render_target_update_mode = 4
[node name="Node2D" parent="SubViewport3" unique_id=1966107137 instance=ExtResource("3_u7x2f")]
[node name="SubViewport4" type="SubViewport" parent="." unique_id=1209309422]
transparent_bg = true
render_target_update_mode = 4
[node name="Node2D" parent="SubViewport4" unique_id=251514880 instance=ExtResource("3_u7x2f")]
[node name="SubViewport5" type="SubViewport" parent="." unique_id=464148156]
transparent_bg = true
render_target_update_mode = 4
[node name="Node2D" parent="SubViewport5" unique_id=744193440 instance=ExtResource("3_u7x2f")]
[node name="SubViewport6" type="SubViewport" parent="." unique_id=632925405]
transparent_bg = true
render_target_update_mode = 4
[node name="Node2D" parent="SubViewport6" unique_id=1640978035 instance=ExtResource("3_u7x2f")]
[node name="Sprites" type="Node3D" parent="." unique_id=2065838295]
[node name="Sprite3D" type="Sprite3D" parent="Sprites" unique_id=2020241299]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.05174, 0.845052, 0.31035)
visible = false
pixel_size = 0.0015
texture_filter = 0
texture = SubResource("ViewportTexture_5mbfv")
[node name="Sprite3D2" type="Sprite3D" parent="Sprites" unique_id=14769278]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0552108, 0.842029, 0.32352)
visible = false
pixel_size = 0.0015
texture_filter = 0
texture = SubResource("ViewportTexture_cfv1i")
[node name="Sprite3D3" type="Sprite3D" parent="Sprites" unique_id=519578707]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.02516, 0.816916, 0.304008)
visible = false
pixel_size = 0.0015
texture_filter = 0
texture = SubResource("ViewportTexture_1rey7")
[node name="Sprite3D4" type="Sprite3D" parent="Sprites" unique_id=2109735455]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.947595, 1.28234, -0.191499)
visible = false
pixel_size = 0.0015
texture_filter = 0
texture = SubResource("ViewportTexture_rlwso")
[node name="Sprite3D5" type="Sprite3D" parent="Sprites" unique_id=559650869]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0401761, 1.28234, -0.191499)
visible = false
pixel_size = 0.0015
texture_filter = 0
texture = SubResource("ViewportTexture_a6401")
[node name="Sprite3D6" type="Sprite3D" parent="Sprites" unique_id=312809326]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.0227, 1.28234, -0.191499)
visible = false
pixel_size = 0.0015
texture_filter = 0
texture = SubResource("ViewportTexture_rnm0u")
[node name="CSGBox3D4" type="CSGBox3D" parent="." unique_id=844039360]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.79147, 0.620414, 0.236721)
visible = false
size = Vector3(0.367981, 0.236755, 0.0673828)
[node name="CSGBox3D5" type="CSGBox3D" parent="." unique_id=2110804170]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.79147, 0.620414, 0.14049)
visible = false
size = Vector3(0.367981, 0.236755, 0.0673828)
[node name="CSGBox3D6" type="CSGBox3D" parent="." unique_id=71961612]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.79147, 0.620414, 0.0426871)
visible = false
size = Vector3(0.367981, 0.236755, 0.0673828)
[node name="CSGBox3D7" type="CSGBox3D" parent="." unique_id=1872581565]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.79147, 0.620414, -0.0568752)
visible = false
size = Vector3(0.367981, 0.236755, 0.0673828)
[node name="CSGBox3D8" type="CSGBox3D" parent="." unique_id=433292911]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.79147, 0.620414, -0.151894)
visible = false
size = Vector3(0.367981, 0.236755, 0.0673828)
[connection signal="button_interacted" from="InteractButton7" to="." method="retrieve_blank"]
[connection signal="button_interacted" from="InteractButton" to="." method="retrieve_card"]
[connection signal="button_interacted" from="InteractButton2" to="." method="retrieve_card"]
[connection signal="button_interacted" from="InteractButton3" to="." method="retrieve_card"]
[connection signal="button_interacted" from="InteractButton4" to="." method="retrieve_card"]
[connection signal="button_interacted" from="InteractButton5" to="." method="retrieve_card"]
[connection signal="button_interacted" from="InteractButton6" to="." method="retrieve_card"]

129
scenes/shop/scr_shop.gd Normal file
View File

@@ -0,0 +1,129 @@
class_name ShopStand extends Node3D
@export var cassettes: Array[CassetteInHand]
@export var choice_colliders: Array[CollisionShape3D]
@export var choice_buttons: Array[InteractButton]
@export var choice_sprites: Array[Sprite3D]
@export var item_card_scene: PackedScene
@export var blank_button: InteractButton
@export var blank_button_collider: CollisionShape3D
@export var blank_models: Array[CSGBox3D]
var price_dict: Dictionary = {
Data.Rarity.UNCOMMON : 25,
Data.Rarity.RARE : 40,
Data.Rarity.EPIC : 60,
Data.Rarity.LEGENDARY : 85,
}
var cards_generated: int = 0
var blanks_available: int = 5
var blank_cost: int = 20
var buy_blank_prompt: String = "PROMPT_BUY_BLANK"
var buy_card_prompt: String = "PROMPT_BUY_CARD"
var shops_generated: int = 0
func close() -> void:
for x: CollisionShape3D in choice_colliders:
x.disabled = true
for x: Sprite3D in choice_sprites:
x.visible = false
for x: CSGBox3D in blank_models:
x.visible = false
blank_button_collider.disabled = true
func randomize_cards() -> void:
blanks_available = 5
var unlocked_classes: Array[HeroClass] = Data.save_data.get_unlocked_classes()
var faction_choices: Array[Cassette.Role]
for hero: HeroClass in unlocked_classes:
if !faction_choices.has(hero.role):
faction_choices.append(hero.role)
var random_faction: int = NoiseRandom.randi_in_range(shops_generated, 0, faction_choices.size() - 1)
shops_generated += 1
var cheap_cards: Array[Cassette] = []
var medium_cards: Array[Cassette] = []
var pricey_cards: Array[Cassette] = []
for cassette: Cassette in Data.cassettes:
if cassette.role != random_faction:
continue
if cassette.rarity == Data.Rarity.UNCOMMON or cassette.rarity == Data.Rarity.RARE:
cheap_cards.append(cassette)
if cassette.rarity == Data.Rarity.RARE or cassette.rarity == Data.Rarity.EPIC:
medium_cards.append(cassette)
if cassette.rarity == Data.Rarity.EPIC or cassette.rarity == Data.Rarity.LEGENDARY:
pricey_cards.append(cassette)
var chosen_card: Cassette = null
for x: int in 3:
if cheap_cards.size() > 0:
chosen_card = cheap_cards[NoiseRandom.randi_in_range(12 * cards_generated, 0, cheap_cards.size() - 1)]
cards_generated += 1
if chosen_card != null:
cassettes[x].set_card(chosen_card)
cassettes[x].view_tower()
choice_buttons[x].press_cost = price_dict[chosen_card.rarity]
choice_buttons[x].hover_text = tr(buy_card_prompt).format({Card_Name = tr(chosen_card.display_name), Card_Cost = str(price_dict[chosen_card.rarity])})
if chosen_card.role == Cassette.Role.MAGE:
Data.save_data.saw_mage_card_in_shop()
for x: int in 2:
if medium_cards.size() > 0:
chosen_card = medium_cards[NoiseRandom.randi_in_range(9 * cards_generated, 0, medium_cards.size() - 1)]
elif cheap_cards.size() > 0:
chosen_card = cheap_cards[NoiseRandom.randi_in_range(9 * cards_generated, 0, cheap_cards.size() - 1)]
cards_generated += 1
if chosen_card != null:
cassettes[x+3].set_card(chosen_card)
cassettes[x+3].view_tower()
choice_buttons[x+3].press_cost = price_dict[chosen_card.rarity]
choice_buttons[x+3].hover_text = tr(buy_card_prompt).format({Card_Name = tr(chosen_card.display_name), Card_Cost = str(price_dict[chosen_card.rarity])})
if chosen_card.role == Cassette.Role.MAGE:
Data.save_data.saw_mage_card_in_shop()
for x: int in 1:
if pricey_cards.size() > 0:
chosen_card = pricey_cards[NoiseRandom.randi_in_range(50 * cards_generated, 0, pricey_cards.size() - 1)]
elif medium_cards.size() > 0:
chosen_card = medium_cards[NoiseRandom.randi_in_range(50 * cards_generated, 0, medium_cards.size() - 1)]
elif cheap_cards.size() > 0:
chosen_card = cheap_cards[NoiseRandom.randi_in_range(50 * cards_generated, 0, cheap_cards.size() - 1)]
cards_generated += 1
if chosen_card != null:
cassettes[x+5].set_card(chosen_card)
cassettes[x+5].view_tower()
choice_buttons[x+5].press_cost = price_dict[chosen_card.rarity]
choice_buttons[x+5].hover_text = tr(buy_card_prompt).format({Card_Name = tr(chosen_card.display_name), Card_Cost = str(price_dict[chosen_card.rarity])})
if chosen_card.role == Cassette.Role.MAGE:
Data.save_data.saw_mage_card_in_shop()
for x: CollisionShape3D in choice_colliders:
x.set_deferred("disabled", false)
for x: Sprite3D in choice_sprites:
x.visible = true
for x: CSGBox3D in blank_models:
x.visible = true
blank_button_collider.set_deferred("disabled", false)
blank_button.hover_text = tr(buy_blank_prompt).format({Blank_Cost = str(blank_cost)})
func retrieve_card(i: int, callback: Hero) -> void:
if callback.currency >= price_dict[cassettes[i].stats.rarity]:
choice_colliders[i].disabled = true
choice_sprites[i].set_visible(false)
var cassette: Cassette = cassettes[i].stats
if cassette.role == Cassette.Role.ENGINEER:
Data.save_data.bought_engineer_card()
if cassette.role == Cassette.Role.MAGE:
Data.save_data.bought_mage_card()
callback.currency -= price_dict[cassettes[i].stats.rarity]
callback.add_card(cassette)
func retrieve_blank(_i: int, callback: Hero) -> void:
if callback.currency >= blank_cost:
blank_models[5 - blanks_available].visible = false
blanks_available -= 1
callback.currency -= blank_cost
callback.blank_cassettes += 1
if blanks_available == 0:
blank_button_collider.disabled = true

View File

@@ -0,0 +1 @@
uid://colk6js4wet11