Add final progression to tiny sword, fixes and tweeks required

This commit is contained in:
2026-05-15 00:47:38 +02:00
parent 66666defcb
commit 738381a16b
43 changed files with 1127 additions and 339 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cx11iodvbcfb1"
path="res://.godot/imported/Barracks.png-6c10bd8efd919b8eb03e40d568e18cf1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_sword/buildings/barracks/Barracks.png"
dest_files=["res://.godot/imported/Barracks.png-6c10bd8efd919b8eb03e40d568e18cf1.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -0,0 +1,25 @@
extends Node2D
const UNLOCK_GOAL_ID: StringName = &"gold_50M_food_5M_wood_5M"
@onready var _sprite: Sprite2D = $Sprite2D
@onready var _area: Area2D = $Area2D
@onready var _game_state: LevelGameState = find_parent("LevelGameState")
func _ready() -> void:
_sprite.visible = false
_area.monitoring = false
_game_state.goal_completed.connect(_on_goal_completed)
if _game_state.is_goal_completed(UNLOCK_GOAL_ID):
_unlock()
func _on_goal_completed(goal_id: StringName) -> void:
if goal_id == UNLOCK_GOAL_ID:
_unlock()
func _unlock() -> void:
_sprite.visible = true
_area.monitoring = true

View File

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

View File

@@ -0,0 +1,40 @@
[gd_scene format=3 uid="uid://cyvijgwj6l8vg"]
[ext_resource type="PackedScene" uid="uid://jeoiinukrrsp" path="res://core/generator/currency_generator.tscn" id="1_gen"]
[ext_resource type="Script" uid="uid://xk7d3maod6uc" path="res://docs/gyms/tiny_sword/buildings/barracks/barracks.gd" id="1_script"]
[ext_resource type="Resource" path="res://docs/gyms/tiny_sword/currencies/unit.tres" id="2_unit"]
[ext_resource type="Resource" path="res://docs/gyms/tiny_sword/buildings/barracks/barracks_generator.tres" id="3_data"]
[ext_resource type="Texture2D" uid="uid://cx11iodvbcfb1" path="res://docs/gyms/tiny_sword/buildings/barracks/Barracks.png" id="4_ud3ae"]
[ext_resource type="PackedScene" uid="uid://ckos7f22pnmyh" path="res://core/generator/generator_container.tscn" id="5_panel"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_barracks"]
size = Vector2(160, 175)
[node name="Barracks" type="Node2D" unique_id=1061432510]
script = ExtResource("1_script")
[node name="CurrencyGenerator" parent="." unique_id=427948318 node_paths=PackedStringArray("info_generator_container") instance=ExtResource("1_gen")]
currency = ExtResource("2_unit")
data = ExtResource("3_data")
press_buys_generator = false
info_generator_container = NodePath("../GeneratorContainer")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1503773416]
texture = ExtResource("4_ud3ae")
[node name="Area2D" type="Area2D" parent="." unique_id=1808028142]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=614030143]
position = Vector2(1, 19.5)
shape = SubResource("RectangleShape2D_barracks")
[node name="GeneratorContainer" parent="." unique_id=1905754561 node_paths=PackedStringArray("_generator") instance=ExtResource("5_panel")]
visible = false
offset_left = 138.0
offset_top = -100.0
offset_right = 402.0
offset_bottom = 110.0
_generator = NodePath("../CurrencyGenerator")
[connection signal="mouse_entered" from="Area2D" to="CurrencyGenerator" method="_on_area_2d_mouse_entered"]
[connection signal="mouse_exited" from="Area2D" to="CurrencyGenerator" method="_on_area_2d_mouse_exited"]

View File

@@ -0,0 +1,18 @@
[gd_resource type="Resource" script_class="CurrencyGeneratorData" format=3]
[ext_resource type="Script" path="res://core/generator/currency_generator_data.gd" id="1_data"]
[ext_resource type="Resource" path="res://docs/gyms/tiny_sword/currencies/worker.tres" id="2_worker"]
[ext_resource type="Resource" path="res://docs/gyms/tiny_sword/goals/gold_50M_food_5M_wood_5M_goal.tres" id="3_goal"]
[resource]
script = ExtResource("1_data")
id = &"barracks"
name = "Barracks"
starts_unlocked = false
starts_available = false
initial_owned = 1
purchase_currency = ExtResource("2_worker")
unlock_goal = ExtResource("3_goal")
initial_cost = 1.0
coefficient = 1.0
initial_productivity = 1.0