Add tyny sword gym to docs

This commit is contained in:
2026-04-08 08:27:37 +02:00
parent 6c031aa381
commit 87fc839d26
912 changed files with 17242 additions and 7 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://4m7wrd6ueprq"
path="res://.godot/imported/Archery.png-ec7a6b90c2b95a324e33330c18e45c0f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_swords/Buildings/Black Buildings/Archery.png"
dest_files=["res://.godot/imported/Archery.png-ec7a6b90c2b95a324e33330c18e45c0f.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

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-d38acab65e3666e89c4c891dad580956.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_swords/Buildings/Black Buildings/Barracks.png"
dest_files=["res://.godot/imported/Barracks.png-d38acab65e3666e89c4c891dad580956.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cry4arn00kgrt"
path="res://.godot/imported/Castle.png-d349eb86cbe4fbe19ba45b6416acf2ce.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_swords/Buildings/Black Buildings/Castle.png"
dest_files=["res://.godot/imported/Castle.png-d349eb86cbe4fbe19ba45b6416acf2ce.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dfdh8r03sj7qv"
path="res://.godot/imported/House1.png-8c0255fdaf2f2d5cb91986b1c4b5cbdb.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_swords/Buildings/Black Buildings/House1.png"
dest_files=["res://.godot/imported/House1.png-8c0255fdaf2f2d5cb91986b1c4b5cbdb.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cwnqvq2cleqq3"
path="res://.godot/imported/House2.png-b7aeea1983738c5205992d8a7ace91cc.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_swords/Buildings/Black Buildings/House2.png"
dest_files=["res://.godot/imported/House2.png-b7aeea1983738c5205992d8a7ace91cc.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://doxauaa3vn3lm"
path="res://.godot/imported/House3.png-c9947b7f96b4091eb169836a42fc78fb.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_swords/Buildings/Black Buildings/House3.png"
dest_files=["res://.godot/imported/House3.png-c9947b7f96b4091eb169836a42fc78fb.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dlmjd2berkb6v"
path="res://.godot/imported/Monastery.png-355c9d40a1947ef9044319fb2c86d11a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_swords/Buildings/Black Buildings/Monastery.png"
dest_files=["res://.godot/imported/Monastery.png-355c9d40a1947ef9044319fb2c86d11a.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cieg8i3c8hca6"
path="res://.godot/imported/Tower.png-dad042b592473dbdc5d257adcaf7dc60.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_swords/Buildings/Black Buildings/Tower.png"
dest_files=["res://.godot/imported/Tower.png-dad042b592473dbdc5d257adcaf7dc60.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,18 @@
extends Node2D
@onready var _prestige_panel: PrestigePanel = $PrestigePanel
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_area_2d_mouse_entered() -> void:
_prestige_panel.visible = true
func _on_area_2d_mouse_exited() -> void:
_prestige_panel.visible = false

View File

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

View File

@@ -0,0 +1,50 @@
[gd_scene format=3 uid="uid://cl05bdri38mxf"]
[ext_resource type="Script" uid="uid://cjc0l13b07802" path="res://docs/gyms/tiny_swords/Buildings/Black Buildings/castle.gd" id="1_cjtps"]
[ext_resource type="Texture2D" uid="uid://cry4arn00kgrt" path="res://docs/gyms/tiny_swords/Buildings/Black Buildings/Castle.png" id="1_tgvch"]
[ext_resource type="PackedScene" uid="uid://dlidx2x0otpjg" path="res://core/prestige/prestige_panel.tscn" id="3_l7gct"]
[ext_resource type="Script" uid="uid://cpfmctd4xsfho" path="res://docs/gyms/tiny_swords/Buildings/Black Buildings/test_buff.gd" id="4_l7gct"]
[ext_resource type="Resource" uid="uid://bjc6qmvr7pe12" path="res://docs/gyms/buffs/spawn_worker.tres" id="5_s3a5k"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_tgvch"]
size = Vector2(312, 198)
[node name="Castle" type="Node2D" unique_id=1966557957]
script = ExtResource("1_cjtps")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1365573096]
texture = ExtResource("1_tgvch")
[node name="Area2D" type="Area2D" parent="." unique_id=66203052]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=1342657556]
position = Vector2(1, 22)
shape = SubResource("RectangleShape2D_tgvch")
[node name="PrestigePanel" parent="." unique_id=245519778 instance=ExtResource("3_l7gct")]
offset_left = 155.0
offset_top = -80.0
offset_right = 575.0
offset_bottom = 126.0
[node name="TestBuff" type="PanelContainer" parent="." unique_id=2112401476]
offset_left = 155.0
offset_top = 157.0
offset_right = 263.0
offset_bottom = 197.0
script = ExtResource("4_l7gct")
buff_data = ExtResource("5_s3a5k")
[node name="HBoxContainer" type="HBoxContainer" parent="TestBuff" unique_id=1293262110]
layout_mode = 2
[node name="Label" type="Label" parent="TestBuff/HBoxContainer" unique_id=1519392687]
layout_mode = 2
text = "Label"
[node name="Button" type="Button" parent="TestBuff/HBoxContainer" unique_id=1254643833]
layout_mode = 2
text = "Button"
[connection signal="mouse_entered" from="Area2D" to="." method="_on_area_2d_mouse_entered"]
[connection signal="mouse_exited" from="Area2D" to="." method="_on_area_2d_mouse_exited"]

View File

@@ -0,0 +1,38 @@
[gd_scene format=3 uid="uid://djedqovgngrx5"]
[ext_resource type="PackedScene" uid="uid://jeoiinukrrsp" path="res://core/generator/currency_generator.tscn" id="1_rvsna"]
[ext_resource type="Resource" uid="uid://bxg2au0ijp242" path="res://docs/gyms/currencies/food.tres" id="2_djlc5"]
[ext_resource type="Resource" uid="uid://d08h51y0pnsnf" path="res://docs/gyms/generators/farm.tres" id="3_82rmq"]
[ext_resource type="Texture2D" uid="uid://dfdh8r03sj7qv" path="res://docs/gyms/tiny_swords/Buildings/Black Buildings/House1.png" id="4_djlc5"]
[ext_resource type="PackedScene" uid="uid://ckos7f22pnmyh" path="res://core/generator/generator_container.tscn" id="5_82rmq"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_82rmq"]
size = Vector2(106, 157)
[node name="Farm" type="Node2D" unique_id=283335851]
[node name="CurrencyGenerator" parent="." unique_id=967969064 node_paths=PackedStringArray("info_generator_container") instance=ExtResource("1_rvsna")]
currency = ExtResource("2_djlc5")
data = ExtResource("3_82rmq")
press_buys_generator = false
info_generator_container = NodePath("../GeneratorContainer")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1103280443]
texture = ExtResource("4_djlc5")
[node name="Area2D" type="Area2D" parent="." unique_id=529600485]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=204675694]
position = Vector2(0, -2.5)
shape = SubResource("RectangleShape2D_82rmq")
[node name="GeneratorContainer" parent="." unique_id=1451609580 node_paths=PackedStringArray("_generator") instance=ExtResource("5_82rmq")]
visible = false
offset_left = 48.0
offset_top = -100.0
offset_right = 312.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,35 @@
[gd_scene format=3 uid="uid://cf01wvy3f17i"]
[ext_resource type="PackedScene" uid="uid://jeoiinukrrsp" path="res://core/generator/currency_generator.tscn" id="1_7j1xc"]
[ext_resource type="Resource" uid="uid://bgsk8h4w80h45" path="res://docs/gyms/currencies/wood.tres" id="2_23x2t"]
[ext_resource type="Resource" uid="uid://v6hjoa2vky5k" path="res://docs/gyms/generators/forestry.tres" id="3_pby1g"]
[ext_resource type="Texture2D" uid="uid://doxauaa3vn3lm" path="res://docs/gyms/tiny_swords/Buildings/Black Buildings/House3.png" id="4_5yp33"]
[ext_resource type="PackedScene" uid="uid://ckos7f22pnmyh" path="res://core/generator/generator_container.tscn" id="5_rh3m6"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_v4aq3"]
size = Vector2(123, 157)
[node name="Forestry" type="Node2D" unique_id=726284577]
[node name="CurrencyGenerator" parent="." unique_id=967969064 node_paths=PackedStringArray("info_generator_container") instance=ExtResource("1_7j1xc")]
currency = ExtResource("2_23x2t")
data = ExtResource("3_pby1g")
press_buys_generator = false
info_generator_container = NodePath("../GeneratorContainer")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1575721003]
texture = ExtResource("4_5yp33")
[node name="Area2D" type="Area2D" parent="." unique_id=987240531]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=849105822]
position = Vector2(0.5, -2.5)
shape = SubResource("RectangleShape2D_v4aq3")
[node name="GeneratorContainer" parent="." unique_id=1451609580 node_paths=PackedStringArray("_generator") instance=ExtResource("5_rh3m6")]
visible = false
offset_left = 48.0
offset_top = -100.0
offset_right = 312.0
offset_bottom = 110.0
_generator = NodePath("../CurrencyGenerator")

View File

@@ -0,0 +1,112 @@
extends PanelContainer
@export var buff_data: GeneratorBuffData
@onready var _label: Label = $HBoxContainer/Label
@onready var _button: Button = $HBoxContainer/Button
var _current_level: int = 0
func _ready() -> void:
if buff_data != null:
_label.text = buff_data.text if not buff_data.text.is_empty() else str(buff_data.id)
_button.text = "Buy"
_button.disabled = true
else:
_label.text = "No Buff"
_button.text = "Disabled"
_button.disabled = true
_button.pressed.connect(_on_button_pressed)
GameState.buff_level_changed.connect(_on_buff_level_changed)
GameState.buff_unlocked_changed.connect(_on_buff_unlocked_changed)
GameState.currency_changed.connect(_on_currency_changed)
_update_ui()
func _on_button_pressed() -> void:
if buff_data == null:
return
var cost_currency_id: StringName = _resolve_buff_cost_currency_id(buff_data)
if cost_currency_id == &"":
push_warning("test_buff: Invalid cost currency")
return
var cost: BigNumber = buff_data.get_cost_for_level(_current_level)
if GameState.spend_currency_by_id(cost_currency_id, cost):
var next_level: int = _current_level + 1
GameState.set_buff_level(buff_data.id, next_level)
_apply_buff_effect(buff_data, next_level)
_current_level = next_level
_update_ui()
else:
push_warning("test_buff: Not enough currency to buy buff")
func _apply_buff_effect(buff: GeneratorBuffData, level: int) -> void:
if buff.kind != GeneratorBuffData.BuffKind.RESOURCE_PURCHASE:
return
var target_currency_id: StringName = _resolve_buff_target_currency_id(buff)
if target_currency_id == &"":
return
var purchased_amount: BigNumber = buff.get_resource_purchase_amount_for_level(level)
if purchased_amount.mantissa > 0.0:
GameState.add_currency_by_id(target_currency_id, purchased_amount)
func _resolve_buff_target_currency_id(buff: GeneratorBuffData) -> StringName:
if buff.resource_target_currency == null:
return &""
return CurrencyDatabase.get_currency_id(buff.resource_target_currency)
func _on_buff_level_changed(buff_id: StringName, new_level: int) -> void:
if buff_data != null and buff_id == buff_data.id:
_current_level = new_level
_update_ui()
func _on_buff_unlocked_changed(buff_id: StringName, unlocked: bool) -> void:
if buff_data != null and buff_id == buff_data.id:
_update_ui()
func _on_currency_changed(_changed_currency_id: StringName, _new_value: BigNumber) -> void:
_update_ui()
func _update_ui() -> void:
if buff_data == null:
return
if not GameState.is_buff_unlocked(buff_data.id):
_button.disabled = true
_button.text = "Locked"
return
var is_maxed: bool = _current_level >= buff_data.max_level if buff_data.max_level >= 0 else false
var can_buy: bool = not is_maxed
var cost_currency_id: StringName = _resolve_buff_cost_currency_id(buff_data)
if cost_currency_id != &"":
var cost: BigNumber = buff_data.get_cost_for_level(_current_level)
var current_amount: BigNumber = GameState.get_currency_amount_by_id(cost_currency_id)
can_buy = can_buy and (current_amount.is_greater_than(cost) or current_amount.is_equal_to(cost))
_button.disabled = not can_buy
if is_maxed:
_button.text = "Maxed"
else:
var cost: BigNumber = buff_data.get_cost_for_level(_current_level)
_button.text = "Buy (%s)" % cost.to_string_suffix(2)
func _resolve_buff_cost_currency_id(buff: GeneratorBuffData) -> StringName:
if buff.cost_currency == null:
return &""
return CurrencyDatabase.get_currency_id(buff.cost_currency)

View File

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