systems rework: buffs, prestige graph, research, modular architecture

Decouples core systems from centralized globals in favor of catalogue-based architecture and data-driven content.

   Key changes:
   - Prestige: node-based buff tech tree, graph panel, progress bar
   - Research: multi-worker system, per-generator research, xp generation
   - Ascension: meta-currency layer via multi-currency prestige resets
   - Buffs: refactored as generator-independent via catalogues
   - UI: currency panel, edge-scrolling camera + zoom, current-goal panel
   - Alchemy Tower: crafting building with recipe/cost system
   - Testing: 7 test suites (ascension, prestige, research, goals)
   - Content: migrated from hardcoded idles/ to gym format (tiny_sword)
This commit was merged in pull request #1.
This commit is contained in:
2026-05-07 20:36:21 +00:00
parent 2743fd314a
commit 81a4058b04
242 changed files with 11226 additions and 2242 deletions

View File

@@ -0,0 +1,19 @@
[gd_resource type="Resource" script_class="GeneratorBuffData" format=3 uid="uid://cg7os1rfknw05"]
[ext_resource type="Resource" uid="uid://bxg2au0ijp242" path="res://docs/gyms/tiny_sword/currencies/food.tres" id="1_qy8mo"]
[ext_resource type="Resource" uid="uid://w4u1hddplb4e" path="res://docs/gyms/tiny_sword/currencies/gold.tres" id="2_pac24"]
[ext_resource type="Script" uid="uid://dnhocfsuvmeyb" path="res://core/generator/generator_buff_data.gd" id="3_t5xb7"]
[ext_resource type="Resource" uid="uid://bo463s6jt0ep7" path="res://docs/gyms/tiny_sword/goals/gold_total_13k_goal.tres" id="4_r8eth"]
[resource]
script = ExtResource("3_t5xb7")
id = &"farm_auto_flux"
target_ids = Array[StringName]([&"farm"])
text = "Farm Dynamo"
max_level = 10
unlock_goal = ExtResource("4_r8eth")
effect_increment = 1.0
cost_currency = ExtResource("1_qy8mo")
base_cost_mantissa = 100.0
cost_multiplier = 1.7
resource_target_currency = ExtResource("2_pac24")

View File

@@ -0,0 +1,20 @@
[gd_resource type="Resource" script_class="GeneratorBuffData" format=3 uid="uid://kamgujbqqhg3"]
[ext_resource type="Resource" uid="uid://bxg2au0ijp242" path="res://docs/gyms/tiny_sword/currencies/food.tres" id="1_pdm0x"]
[ext_resource type="Resource" uid="uid://w4u1hddplb4e" path="res://docs/gyms/tiny_sword/currencies/gold.tres" id="2_rnlmu"]
[ext_resource type="Script" uid="uid://dnhocfsuvmeyb" path="res://core/generator/generator_buff_data.gd" id="3_y6252"]
[ext_resource type="Resource" uid="uid://bo463s6jt0ep7" path="res://docs/gyms/tiny_sword/goals/gold_total_13k_goal.tres" id="4_y6252"]
[resource]
script = ExtResource("3_y6252")
id = &"forestry_auto_flux"
target_ids = Array[StringName]([&"forestry"])
text = "Forest Dynamo
"
max_level = 10
unlock_goal = ExtResource("4_y6252")
effect_increment = 1.0
cost_currency = ExtResource("1_pdm0x")
base_cost_mantissa = 250.0
cost_multiplier = 1.7
resource_target_currency = ExtResource("2_rnlmu")

View File

@@ -0,0 +1,19 @@
[gd_resource type="Resource" script_class="GeneratorBuffData" format=3 uid="uid://c3op2mqy02sow"]
[ext_resource type="Resource" uid="uid://bxg2au0ijp242" path="res://docs/gyms/tiny_sword/currencies/food.tres" id="1_j3saa"]
[ext_resource type="Resource" uid="uid://w4u1hddplb4e" path="res://docs/gyms/tiny_sword/currencies/gold.tres" id="2_hvfo8"]
[ext_resource type="Script" uid="uid://dnhocfsuvmeyb" path="res://core/generator/generator_buff_data.gd" id="3_bwcdh"]
[ext_resource type="Resource" uid="uid://ik7t0r3su633" path="res://docs/gyms/tiny_sword/goals/gold_total_30_goal.tres" id="4_f52il"]
[resource]
script = ExtResource("3_bwcdh")
id = &"gold_auto_flux"
target_ids = Array[StringName]([&"goldmine"])
text = "Gold Dynamo"
max_level = 10
unlock_goal = ExtResource("4_f52il")
effect_increment = 1.0
cost_currency = ExtResource("1_j3saa")
base_cost_mantissa = 25.0
cost_multiplier = 1.7
resource_target_currency = ExtResource("2_hvfo8")

View File

@@ -0,0 +1,20 @@
[gd_resource type="Resource" script_class="GeneratorBuffData" format=3 uid="uid://dlq2ke6i2pfob"]
[ext_resource type="Resource" uid="uid://w4u1hddplb4e" path="res://docs/gyms/tiny_sword/currencies/gold.tres" id="1_8h747"]
[ext_resource type="Script" uid="uid://dnhocfsuvmeyb" path="res://core/generator/generator_buff_data.gd" id="2_aejsu"]
[ext_resource type="Resource" uid="uid://ik7t0r3su633" path="res://docs/gyms/tiny_sword/goals/gold_total_30_goal.tres" id="3_aejsu"]
[resource]
script = ExtResource("2_aejsu")
id = &"gold_click_focus"
target_ids = Array[StringName]([&"goldmine"])
kind = 1
text = "Gold Clicker!"
max_level = 4
unlock_goal = ExtResource("3_aejsu")
effect_increment = 1.0
cost_currency = ExtResource("1_8h747")
base_cost_mantissa = 2.5
base_cost_exponent = 1
cost_multiplier = 2.0
resource_target_currency = ExtResource("1_8h747")

View File

@@ -0,0 +1,21 @@
[gd_resource type="Resource" script_class="GeneratorBuffData" format=3 uid="uid://bjc6qmvr7pe12"]
[ext_resource type="Resource" uid="uid://w4u1hddplb4e" path="res://docs/gyms/tiny_sword/currencies/gold.tres" id="1_we7j4"]
[ext_resource type="Resource" uid="uid://dfxk30o34qe2s" path="res://docs/gyms/tiny_sword/currencies/worker.tres" id="2_s45cj"]
[ext_resource type="Script" uid="uid://dnhocfsuvmeyb" path="res://core/generator/generator_buff_data.gd" id="3_tgtcn"]
[ext_resource type="Resource" uid="uid://ik7t0r3su633" path="res://docs/gyms/tiny_sword/goals/gold_total_30_goal.tres" id="4_kqmci"]
[resource]
script = ExtResource("3_tgtcn")
id = &"summon_worker"
kind = 2
text = "Summon Worker
"
unlock_goal = ExtResource("4_kqmci")
effect_increment = 1.0
cost_currency = ExtResource("1_we7j4")
base_cost_mantissa = 200.0
cost_multiplier = 1.15
resource_target_currency = ExtResource("2_s45cj")
resource_purchase_base_mantissa = 1.0
resource_purchase_increment_multiplier = 1.0

View File

@@ -0,0 +1,14 @@
[gd_resource type="Resource" script_class="BuffCatalogue" format=3 uid="uid://bgmj3lep0wmtf"]
[ext_resource type="Script" uid="uid://dnhocfsuvmeyb" path="res://core/generator/generator_buff_data.gd" id="1_up80l"]
[ext_resource type="Resource" uid="uid://dlq2ke6i2pfob" path="res://docs/gyms/tiny_sword/buffs/gold_click_buff.tres" id="2_dtvfl"]
[ext_resource type="Script" uid="uid://ctc5yjlnvi0ok" path="res://core/buff_catalogue.gd" id="2_iuxc1"]
[ext_resource type="Resource" uid="uid://c3op2mqy02sow" path="res://docs/gyms/tiny_sword/buffs/gold_auto_flux_buff.tres" id="3_0bb41"]
[ext_resource type="Resource" uid="uid://bjc6qmvr7pe12" path="res://docs/gyms/tiny_sword/buffs/spawn_worker_buff.tres" id="4_hnq3m"]
[ext_resource type="Resource" uid="uid://cg7os1rfknw05" path="res://docs/gyms/tiny_sword/buffs/farm_auto_flux_buff.tres" id="5_mii30"]
[ext_resource type="Resource" uid="uid://kamgujbqqhg3" path="res://docs/gyms/tiny_sword/buffs/forestry_auto_flux_buff.tres" id="6_k5yi4"]
[resource]
script = ExtResource("2_iuxc1")
buffs = Array[ExtResource("1_up80l")]([ExtResource("2_dtvfl"), ExtResource("3_0bb41"), ExtResource("4_hnq3m"), ExtResource("5_mii30"), ExtResource("6_k5yi4")])
metadata/_custom_type_script = "uid://ctc5yjlnvi0ok"

View File

@@ -0,0 +1,55 @@
# Alchemy Tower
The Alchemy Tower is a building that passively produces **magic gold** and allows **crafting** other currencies through alchemical recipes.
## Passive Production
The tower runs a continuous production cycle. Once a cycle completes, magic gold is added to your balance and the next cycle begins with a slightly longer duration.
| Data field | Default | Description |
|---|---|---|
| `base_production_time_seconds` | 5.0 | Duration of the first cycle (seconds) |
| `production_time_growth_multiplier` | 1.2 | Each completed cycle multiplies the next cycle's duration by this amount |
| `magic_gold_per_cycle` | 1.0 | Base magic gold produced per cycle |
Production is only active when at least one worker is assigned and the tower is available in the game state.
## Workers
Workers are assigned by spending 1 **worker** currency per worker. Each assigned worker provides a **+10% speed bonus** to production (configurable via `base_worker_speed_bonus`).
- Max workers: `max_workers` (default 10)
- The speed multiplier formula: `1.0 + (worker_count * base_worker_speed_bonus)`
- This multiplier affects both the rate time advances and the final cycle output
The UI panel includes a worker counter and an "Assign Worker" button. The button is disabled when you have no workers available or have reached the max.
## Crafting
The crafting panel shows recipes from an `AlchemyCraftCatalogue` resource. Each recipe (`AlchemyCraftRecipe`) defines:
- `id` — unique recipe identifier
- `output_currency` / `output_amount` — what you get
- `cost_entries` — array of `CurrencyCostEntry` resources, each specifying a currency and an amount
To craft, click the recipe's button. The tower deducts all costs from your balance via `game_state.spend_currency()`. If any cost can't be covered, the craft fails silently and nothing is deducted. On success, the output currency is added to your balance.
## Signals
| Signal | Emitted when |
|---|---|
| `production_progress_updated(progress: float)` | Every frame during production; 0.01.0 |
| `production_completed(amount: BigNumber)` | A production cycle finishes |
| `magic_gold_balance_updated(amount: BigNumber)` | Magic gold balance changes |
## Key Files
| File | Purpose |
|---|---|
| `alchemy_tower.gd` | Main tower logic: production loop, worker management, crafting |
| `alchemy_tower_data.gd` | Configuration resource (`AlchemyTowerData`) |
| `alchemy_craftable_panel.gd` | UI panel (`AlchemyCurrenciesPanel`) for progress bar, balance, workers, and recipe list |
| `alchemy_craftable_panel_tile.gd` | Individual recipe tile in the crafting list |
| `recipes/alchemy_craft_catalogue.gd` | Catalogue resource holding all available recipes |
| `recipes/alchemy_craft_recipe.gd` | Single recipe resource |
| `recipes/currency_cost_entry.gd` | Cost entry for a single currency in a recipe |

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-89ae300c234cff5100d7ac69a9b9290c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_sword/buildings/alchemy_tower/Tower.png"
dest_files=["res://.godot/imported/Tower.png-89ae300c234cff5100d7ac69a9b9290c.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,161 @@
class_name AlchemyCurrenciesPanel
extends PanelContainer
signal craft_requested(recipe: Variant)
signal alchemy_workers_changed(count: int)
# Currency used to pay crafts (magic gold)
@export var currency: Currency
# The list of crafts available to alchemy tower
@export var craft_recipes: AlchemyCraftCatalogue
@onready var _tile_scene: PackedScene = preload("res://docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_craftable_panel_tile.tscn")
@onready var _craft_list: VBoxContainer = $VBoxContainer/CraftList
@onready var _currency_name_label: Label = $VBoxContainer/HBoxCurrency/NameLabel
@onready var _progress_bar: ProgressBar = $VBoxContainer/HBoxCurrency/ProgressBar
@onready var _balance_label: Label = $VBoxContainer/HBoxCurrency/AmountLabel
@onready var _worker_label: Label = $VBoxContainer/HBoxWorker/WorkerLabel
@onready var _assign_button: Button = $VBoxContainer/HBoxWorker/AssignButton
var _alchemy_tower: AlchemyTower
var _game_state: LevelGameState
var _alchemy_worker_count: int = 0
func _ready() -> void:
assert(craft_recipes != null, "Craft recipes cannot be null")
_game_state = find_parent("LevelGameState")
if _game_state == null:
push_error("AlchemyCurrenciesPanel: Could not find LevelGameState")
return
# Find AlchemyTower in parent
_alchemy_tower = _find_alchemy_tower()
# Set up UI labels
_currency_name_label.text = currency.display_name if currency else "Magic Gold"
# Connect to tower signals
if _alchemy_tower:
_alchemy_tower.production_progress_updated.connect(_on_production_progress)
_alchemy_tower.magic_gold_balance_updated.connect(_on_magic_gold_changed)
_alchemy_tower.production_completed.connect(_on_production_completed)
# Connect worker button
if _assign_button:
_assign_button.pressed.connect(_on_assign_button_pressed)
# Initialize displays
_update_magic_gold_display()
_update_production_progress(0.0)
_update_worker_display()
# Connect to worker currency changes
_game_state.currency_changed.connect(_on_currency_changed)
# Clear and populate craft tiles
for child in _craft_list.get_children():
child.queue_free()
for recipe in craft_recipes.recipes:
var instance: AlchemyCraftableTile = _tile_scene.instantiate() as AlchemyCraftableTile
instance.setup(recipe)
instance.craft_button_pressed.connect(_on_craft_button_pressed)
_craft_list.add_child(instance)
func _find_alchemy_tower() -> AlchemyTower:
var parent: Node = get_parent()
while parent != null:
if parent is AlchemyTower:
return parent as AlchemyTower
parent = parent.get_parent()
return null
func _update_magic_gold_display() -> void:
if _alchemy_tower == null or _game_state == null:
return
var magic_gold_currency: Currency = _get_magic_gold_currency()
if magic_gold_currency == null:
_balance_label.text = "0"
return
var balance: BigNumber = _game_state.get_currency_amount(magic_gold_currency)
_balance_label.text = balance.to_string_suffix(2)
func _update_production_progress(progress: float) -> void:
if _progress_bar == null:
return
_progress_bar.value = progress * 100.0
func _update_worker_display() -> void:
if _worker_label == null:
return
_worker_label.text = "Alchemy Workers: %d" % _alchemy_worker_count
if _assign_button != null:
var worker_currency: Currency = _get_worker_currency()
var can_assign: bool = false
if worker_currency != null and _alchemy_worker_count < 10:
var worker_balance: BigNumber = _game_state.get_currency_amount(worker_currency)
can_assign = worker_balance.mantissa >= 1.0
_assign_button.disabled = not can_assign
_assign_button.text = "Assign Worker" if can_assign else "No Workers Available"
func _get_magic_gold_currency() -> Currency:
if _game_state == null or _game_state.currency_catalogue == null:
return null
for currency in _game_state.currency_catalogue.currencies:
if currency == null:
continue
if currency.id == &"magic_gold":
return currency
return null
func _get_worker_currency() -> Currency:
if _game_state == null or _game_state.currency_catalogue == null:
return null
for currency in _game_state.currency_catalogue.currencies:
if currency == null:
continue
if currency.id == &"worker":
return currency
return null
func _on_production_progress(progress: float) -> void:
_update_production_progress(progress)
func _on_magic_gold_changed(amount: BigNumber) -> void:
_update_magic_gold_display()
_update_worker_display()
func _on_production_completed(_amount: BigNumber) -> void:
_update_magic_gold_display()
func _on_currency_changed(currency_id: StringName, _amount: BigNumber) -> void:
if currency_id == &"worker":
_update_worker_display()
func _on_assign_button_pressed() -> void:
if _alchemy_tower == null or _game_state == null:
return
var worker_currency: Currency = _get_worker_currency()
if worker_currency == null:
return
# Spend a worker
if _game_state.spend_currency(worker_currency, BigNumber.from_float(1.0)):
_alchemy_worker_count += 1
_update_worker_display()
alchemy_workers_changed.emit(_alchemy_worker_count)
func _on_craft_button_pressed(recipe: Variant) -> void:
craft_requested.emit(recipe)

View File

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

View File

@@ -0,0 +1,40 @@
[gd_scene format=3 uid="uid://cbp6vpth8x4rw"]
[ext_resource type="Script" uid="uid://do1i3hrd0ueb6" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_craftable_panel.gd" id="1_rg8ty"]
[node name="AlchemyCraftablePanel" type="PanelContainer" unique_id=1000001]
custom_minimum_size = Vector2(400, 300)
script = ExtResource("1_rg8ty")
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=1115194594]
layout_mode = 2
[node name="HBoxWorker" type="HBoxContainer" parent="VBoxContainer" unique_id=1415354976]
layout_mode = 2
[node name="WorkerLabel" type="Label" parent="VBoxContainer/HBoxWorker" unique_id=4000008]
layout_mode = 2
text = "Alchemy Workers: 0"
[node name="AssignButton" type="Button" parent="VBoxContainer/HBoxWorker" unique_id=4000009]
layout_mode = 2
text = "Assign Worker"
[node name="HBoxCurrency" type="HBoxContainer" parent="VBoxContainer" unique_id=1815331819]
layout_mode = 2
[node name="NameLabel" type="Label" parent="VBoxContainer/HBoxCurrency" unique_id=4000005]
layout_mode = 2
text = "Magic Gold"
[node name="ProgressBar" type="ProgressBar" parent="VBoxContainer/HBoxCurrency" unique_id=4000006]
custom_minimum_size = Vector2(200, 0)
layout_mode = 2
[node name="AmountLabel" type="Label" parent="VBoxContainer/HBoxCurrency" unique_id=4000007]
layout_mode = 2
text = "0"
[node name="CraftList" type="VBoxContainer" parent="VBoxContainer" unique_id=3000005]
layout_mode = 2
size_flags_vertical = 8

View File

@@ -0,0 +1,81 @@
class_name AlchemyCraftableTile
extends HBoxContainer
signal craft_button_pressed(recipe: Variant)
@onready var _name_label: Label = $NameLabel
@onready var _balance_label: Label = $BalanceLabel
@onready var _cost_label: Label = $CostLabel
@onready var _button: Button = $Button
var _recipe: Variant
var _game_state: LevelGameState
var _initialized: bool = false
func _ready() -> void:
_game_state = find_parent("LevelGameState")
_game_state.ready.connect(_on_game_state_ready)
if not _button.pressed.is_connected(_on_button_pressed):
_button.pressed.connect(_on_button_pressed)
_initialized = true
func setup(recipe: AlchemyCraftRecipe) -> void:
_recipe = recipe
func _on_game_state_ready() -> void:
# Validate labels before use
if _name_label == null:
push_error("AlchemyCraftableTile: _name_label is null in setup")
return
# Set up display
_name_label.text = str(_recipe.output_currency.display_name) if _recipe.output_currency else "Unknown"
_update_cost_display()
# Connect to currency changes for balance updates
if _game_state != null:
_game_state.currency_changed.connect(_on_currency_changed)
# Initial balance update
_update_balance()
func _update_cost_display() -> void:
if _cost_label == null or _recipe == null:
return
if _recipe.cost_entries.is_empty():
_cost_label.text = "No cost"
return
var cost_text: String = ""
for entry in _recipe.cost_entries:
if entry == null:
continue
if not cost_text.is_empty():
cost_text += " + "
cost_text += "%d %s" % [entry.amount, entry.currency.display_name]
_cost_label.text = cost_text
func _update_balance() -> void:
if _balance_label == null or _recipe == null or _game_state == null:
return
var balance: BigNumber = _game_state.get_currency_amount(_recipe.output_currency)
_balance_label.text = balance.to_string_suffix(0)
func _on_button_pressed() -> void:
if _recipe == null:
push_warning("AlchemyCraftableTile: No recipe configured")
return
craft_button_pressed.emit(_recipe)
func _on_currency_changed(currency_id: StringName, _amount: BigNumber) -> void:
# Update balance if this currency changed
if _recipe != null:
var output_currency_id: StringName = _recipe.output_currency.id if _recipe.output_currency else &""
if currency_id == output_currency_id:
_update_balance()

View File

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

View File

@@ -0,0 +1,31 @@
[gd_scene format=3 uid="uid://cxusq0tunvjlb"]
[ext_resource type="Script" uid="uid://c63g772y4kxwm" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_craftable_panel_tile.gd" id="1_hw1b0"]
[node name="AlchemyCraftableTile" type="HBoxContainer" unique_id=1715275035]
offset_left = 10.0
offset_top = 10.0
offset_right = 280.0
offset_bottom = 41.0
script = ExtResource("1_hw1b0")
[node name="NameLabel" type="Label" parent="." unique_id=2031343677]
layout_mode = 2
size_flags_horizontal = 8
text = "Currency"
[node name="BalanceLabel" type="Label" parent="." unique_id=1367089480]
layout_mode = 2
size_flags_horizontal = 8
text = "0"
[node name="CostLabel" type="Label" parent="." unique_id=1649255694]
layout_mode = 2
size_flags_horizontal = 8
text = "10 Magic Gold"
[node name="Button" type="Button" parent="." unique_id=1649255693]
layout_mode = 2
text = "Craft"
[connection signal="pressed" from="Button" to="." method="_on_button_pressed"]

View File

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

View File

@@ -0,0 +1,202 @@
class_name AlchemyTower
extends Node2D
## Emitted when production progress changes (0.0 to 1.0)
signal production_progress_updated(progress: float)
## Emitted when magic gold balance changes
signal magic_gold_balance_updated(amount: BigNumber)
## Emitted when a production cycle completes
signal production_completed(amount: BigNumber)
## Configuration data for this tower
@export var data: AlchemyTowerData
## Available craft recipes
@export var craft_recipes: AlchemyCraftCatalogue
## Reference to game state
@onready var game_state: LevelGameState = find_parent("LevelGameState")
@onready var _alchemy_currencies_panel: AlchemyCurrenciesPanel = $AlchemyCurrenciesPanel
## Current production state
var production_time_elapsed: float = 0.0
var current_production_time: float
var cycle_count: int = 0
## Number of workers assigned to this tower
var _worker_count: int = 0
## UI panel reference
@onready var alchemy_panel: AlchemyCurrenciesPanel = $AlchemyCurrenciesPanel
func _ready() -> void:
assert(data != null, "AlchemyTowerData is required")
assert(craft_recipes != null, "Craft recipes catalogue is required")
assert(game_state != null, "LevelGameState is required")
# Initialize production time
current_production_time = data.base_production_time_seconds
# Register this tower as an available generator
game_state.set_generator_available(get_generator_id(), true)
# Connect to magic gold balance changes
game_state.currency_changed.connect(_on_currency_changed)
# Connect panel signals if available
if alchemy_panel:
alchemy_panel.craft_requested.connect(_on_craft_requested)
alchemy_panel.alchemy_workers_changed.connect(_on_alchemy_workers_changed)
# Initial progress update
production_progress_updated.emit(0.0)
func _process(delta: float) -> void:
if not _is_production_active():
return
var speed_multiplier: float = _get_worker_speed_multiplier()
# Add elapsed time scaled by worker count
production_time_elapsed += delta * speed_multiplier
# Update progress bar every frame
production_progress_updated.emit(_get_production_progress())
# Check if production is complete
if production_time_elapsed >= current_production_time:
_try_complete_production()
func _is_production_active() -> bool:
if not game_state.is_generator_available(get_generator_id()):
return false
return _get_worker_count() > 0
func _try_complete_production() -> void:
# Calculate how many cycles completed
var completed_cycles: int = floori(production_time_elapsed / current_production_time)
if completed_cycles <= 0:
return
# Reset elapsed time
production_time_elapsed -= current_production_time * float(completed_cycles)
# Calculate output
var output_per_cycle: BigNumber = BigNumber.from_float(data.magic_gold_per_cycle)
var total_output: BigNumber = output_per_cycle.multiply(BigNumber.from_float(float(completed_cycles)))
# Apply worker speed bonus (affects output, not time)
var worker_multiplier: float = _get_worker_speed_multiplier()
if worker_multiplier > 1.0:
total_output = total_output.multiply(BigNumber.from_float(worker_multiplier))
# Add magic gold
_add_magic_gold(total_output)
# Increment cycle count
cycle_count += completed_cycles
# Increase production time (mild exponential growth)
current_production_time *= pow(data.production_time_growth_multiplier, float(completed_cycles))
# Emit signals
production_completed.emit(total_output)
production_progress_updated.emit(_get_production_progress())
func _add_magic_gold(amount: BigNumber) -> void:
if data == null or game_state == null:
return
var magic_gold_currency: Currency = _get_magic_gold_currency()
if magic_gold_currency == null:
push_error("AlchemyTower: Could not find magic gold currency")
return
game_state.add_currency(magic_gold_currency, amount)
func _get_magic_gold_currency() -> Currency:
# Find magic gold in the currency catalogue
if game_state == null or game_state.currency_catalogue == null:
return null
for currency in game_state.currency_catalogue.currencies:
if currency == null:
continue
if currency.id == &"magic_gold":
return currency
return null
func _get_worker_count() -> int:
return mini(_worker_count, data.max_workers)
func _get_worker_speed_multiplier() -> float:
if game_state == null:
return 1.0
var worker_count: int = _get_worker_count()
var multiplier: float = 1.0 + (float(worker_count) * data.base_worker_speed_bonus)
return multiplier
func _get_worker_currency() -> Currency:
if game_state == null or game_state.currency_catalogue == null:
return null
for currency in game_state.currency_catalogue.currencies:
if currency == null:
continue
if currency.id == &"worker":
return currency
return null
func _get_production_progress() -> float:
if current_production_time <= 0.0:
return 1.0
var progress: float = production_time_elapsed / current_production_time
return clampf(progress, 0.0, 1.0)
func get_generator_id() -> StringName:
return data.id
func craft_item(recipe: Variant) -> bool:
if recipe == null:
return false
# Check and pay all costs
for entry in recipe.cost_entries:
if entry == null or entry.currency == null:
continue
if not game_state.spend_currency(entry.currency, BigNumber.from_float(float(entry.amount))):
return false
# Success - add output
game_state.add_currency(recipe.output_currency, BigNumber.from_float(float(recipe.output_amount)))
return true
func _on_currency_changed(currency_id: StringName, _amount: BigNumber) -> void:
if currency_id == &"magic_gold":
magic_gold_balance_updated.emit(_amount)
func _on_alchemy_workers_changed(count: int) -> void:
_worker_count = count
production_progress_updated.emit(_get_production_progress())
func _on_craft_requested(recipe: Variant) -> void:
if recipe == null:
return
var success: bool = craft_item(recipe)
if not success:
push_warning("AlchemyTower: Failed to craft %s - insufficient funds" % recipe.output_currency.display_name)
func _on_area_2d_mouse_entered() -> void:
_alchemy_currencies_panel.visible = true
func _on_area_2d_mouse_exited() -> void:
_alchemy_currencies_panel.visible = false

View File

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

View File

@@ -0,0 +1,37 @@
[gd_scene format=3 uid="uid://bp5ng4vu4ot4a"]
[ext_resource type="Texture2D" uid="uid://cieg8i3c8hca6" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/Tower.png" id="1_vbhae"]
[ext_resource type="PackedScene" uid="uid://cbp6vpth8x4rw" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_craftable_panel.tscn" id="2_8pntr"]
[ext_resource type="Script" uid="uid://bddaaj76msmvj" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_tower.gd" id="3_tower"]
[ext_resource type="Resource" uid="uid://cedxqlirp3imi" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_tower_data.tres" id="4_data"]
[ext_resource type="Resource" uid="uid://diboykfbbxpfs" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/recipes/alchemy_craft_catalogue.tres" id="5_recipes"]
[ext_resource type="Resource" uid="uid://dpbndqxvsffa0" path="res://docs/gyms/tiny_sword/currencies/magic_gold.tres" id="7_b8p5n"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_8pntr"]
size = Vector2(109, 182)
[node name="AlchemyTower" type="Node2D" unique_id=51852160]
script = ExtResource("3_tower")
data = ExtResource("4_data")
craft_recipes = ExtResource("5_recipes")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1160485854]
texture = ExtResource("1_vbhae")
[node name="Area2D" type="Area2D" parent="." unique_id=911128362]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=1059910507]
position = Vector2(0.5, 11)
shape = SubResource("RectangleShape2D_8pntr")
[node name="AlchemyCurrenciesPanel" parent="." unique_id=731368154 instance=ExtResource("2_8pntr")]
visible = false
offset_left = 65.0
offset_top = -75.0
offset_right = 65.0
offset_bottom = -75.0
currency = ExtResource("7_b8p5n")
craft_recipes = ExtResource("5_recipes")
[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,23 @@
class_name AlchemyTowerData
extends Resource
@export_group("Identification")
@export var id: StringName = &"alchemy_tower"
@export var name: String = "Alchemy Tower"
@export_group("Production")
## Base time to produce one magic gold (first production)
@export var base_production_time_seconds: float = 5.0
## Multiplier applied to production time each cycle (1.2 = 20% increase)
@export var production_time_growth_multiplier: float = 1.2
## Amount of magic gold produced per cycle
@export var magic_gold_per_cycle: float = 1.0
@export_group("Workers")
## Speed bonus per alchemy worker (0.1 = +10% speed per worker)
@export var base_worker_speed_bonus: float = 0.1
## Maximum workers that can be assigned
@export var max_workers: int = 10

View File

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

View File

@@ -0,0 +1,6 @@
[gd_resource type="Resource" script_class="AlchemyTowerData" format=3 uid="uid://cedxqlirp3imi"]
[ext_resource type="Script" uid="uid://dxgpic67x08c6" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_tower_data.gd" id="1_data"]
[resource]
script = ExtResource("1_data")

View File

@@ -0,0 +1,18 @@
class_name AlchemyCraftCatalogue
extends Resource
## Catalogue of alchemy craft recipes
@export var recipes: Array[AlchemyCraftRecipe] = []
func get_recipe_by_id(id: StringName) -> Variant:
for recipe in recipes:
if recipe != null and recipe.id == id:
return recipe
return null
func get_all_ids() -> Array[StringName]:
var ids: Array[StringName] = []
for recipe in recipes:
if recipe != null and recipe.id != &"":
ids.append(recipe.id)
return ids

View File

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

View File

@@ -0,0 +1,10 @@
[gd_resource type="Resource" script_class="AlchemyCraftCatalogue" format=3 uid="uid://diboykfbbxpfs"]
[ext_resource type="Script" uid="uid://biljlhsxr3rsc" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/recipes/alchemy_craft_catalogue.gd" id="1_cat"]
[ext_resource type="Resource" uid="uid://by8qmuhvo38nn" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/recipes/mana_stone_recipe.tres" id="2_mana_recipe"]
[ext_resource type="Resource" uid="uid://dliibkgb2mom0" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/recipes/cognite_recipe.tres" id="3_cognite_recipe"]
[ext_resource type="Resource" uid="uid://nfpkv6a2u0wf" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/recipes/philosoper_stone_recipe.tres" id="3_pbygp"]
[resource]
script = ExtResource("1_cat")
recipes = [ExtResource("2_mana_recipe"), ExtResource("3_cognite_recipe"), ExtResource("3_pbygp")]

View File

@@ -0,0 +1,10 @@
class_name AlchemyCraftRecipe
extends Resource
## Recipe for crafting currencies at the Alchemy Tower
@export var id: StringName = &""
@export var output_currency: Currency
@export var output_amount: int = 1
## Multi-currency cost to perform this craft
@export var cost_entries: Array[CurrencyCostEntry] = []

View File

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

View File

@@ -0,0 +1,10 @@
[gd_resource type="Resource" script_class="CurrencyCostEntry" format=3]
[ext_resource type="Script" uid="uid://ba8e403mb7hp0" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/recipes/currency_cost_entry.gd" id="1_cost"]
[ext_resource type="Resource" uid="uid://dpbndqxvsffa0" path="res://docs/gyms/tiny_sword/currencies/magic_gold.tres" id="2_magic_gold"]
[resource]
script = ExtResource("1_cost")
currency = ExtResource("2_magic_gold")
amount = 25
metadata/_custom_type_script = "res://docs/gyms/tiny_sword/buildings/alchemy_tower/currency_cost_entry.gd"

View File

@@ -0,0 +1,11 @@
[gd_resource type="Resource" script_class="AlchemyCraftRecipe" format=3 uid="uid://dliibkgb2mom0"]
[ext_resource type="Script" uid="uid://ddlnlpb0p750q" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/recipes/alchemy_craft_recipe.gd" id="1_recipe"]
[ext_resource type="Resource" uid="uid://t6du7gm2ywbi" path="res://docs/gyms/tiny_sword/currencies/cognite.tres" id="2_xltlj"]
[ext_resource type="Resource" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/recipes/cognite_cost_entry.tres" id="3_cost"]
[resource]
script = ExtResource("1_recipe")
id = &"cognite_recipe"
output_currency = ExtResource("2_xltlj")
cost_entries = [ExtResource("3_cost")]

View File

@@ -0,0 +1,6 @@
class_name CurrencyCostEntry
extends Resource
## Entry for multi-currency cost in alchemy recipes
@export var currency: Currency
@export var amount: int = 1

View File

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

View File

@@ -0,0 +1,10 @@
[gd_resource type="Resource" script_class="CurrencyCostEntry" format=3]
[ext_resource type="Script" uid="uid://ba8e403mb7hp0" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/recipes/currency_cost_entry.gd" id="1_cost"]
[ext_resource type="Resource" uid="uid://dpbndqxvsffa0" path="res://docs/gyms/tiny_sword/currencies/magic_gold.tres" id="2_magic_gold"]
[resource]
script = ExtResource("1_cost")
currency = ExtResource("2_magic_gold")
amount = 10
metadata/_custom_type_script = "res://docs/gyms/tiny_sword/buildings/alchemy_tower/currency_cost_entry.gd"

View File

@@ -0,0 +1,11 @@
[gd_resource type="Resource" script_class="AlchemyCraftRecipe" format=3 uid="uid://by8qmuhvo38nn"]
[ext_resource type="Script" uid="uid://ddlnlpb0p750q" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/recipes/alchemy_craft_recipe.gd" id="1_recipe"]
[ext_resource type="Resource" uid="uid://brctmnpmhjas6" path="res://docs/gyms/tiny_sword/currencies/mana_stone.tres" id="2_mana_stone"]
[ext_resource type="Resource" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/recipes/mana_stone_cost_entry.tres" id="3_cost"]
[resource]
script = ExtResource("1_recipe")
id = &"mana_stone_recipe"
output_currency = ExtResource("2_mana_stone")
cost_entries = [ExtResource("3_cost")]

View File

@@ -0,0 +1,9 @@
[gd_resource type="Resource" script_class="CurrencyCostEntry" format=3 uid="uid://cheww15gwet47"]
[ext_resource type="Resource" uid="uid://brctmnpmhjas6" path="res://docs/gyms/tiny_sword/currencies/mana_stone.tres" id="1_8mjcf"]
[ext_resource type="Script" uid="uid://ba8e403mb7hp0" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/recipes/currency_cost_entry.gd" id="1_cost"]
[resource]
script = ExtResource("1_cost")
currency = ExtResource("1_8mjcf")
amount = 10

View File

@@ -0,0 +1,9 @@
[gd_resource type="Resource" script_class="CurrencyCostEntry" format=3 uid="uid://bprij85vf66at"]
[ext_resource type="Resource" uid="uid://t6du7gm2ywbi" path="res://docs/gyms/tiny_sword/currencies/cognite.tres" id="1_3oqnk"]
[ext_resource type="Script" uid="uid://ba8e403mb7hp0" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/recipes/currency_cost_entry.gd" id="2_q6dwm"]
[resource]
script = ExtResource("2_q6dwm")
currency = ExtResource("1_3oqnk")
amount = 10

View File

@@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="AlchemyCraftRecipe" format=3 uid="uid://nfpkv6a2u0wf"]
[ext_resource type="Resource" uid="uid://cheww15gwet47" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/recipes/philosoper_stone_cost_entry_0.tres" id="1_jbac4"]
[ext_resource type="Resource" uid="uid://co4fiqgluwit0" path="res://docs/gyms/tiny_sword/currencies/philosoper_stone.tres" id="1_o0mnq"]
[ext_resource type="Script" uid="uid://ddlnlpb0p750q" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/recipes/alchemy_craft_recipe.gd" id="1_pxgqn"]
[resource]
script = ExtResource("1_pxgqn")
id = &"philosoper_stone_recipe"
output_currency = ExtResource("1_o0mnq")
cost_entries = [ExtResource("1_jbac4")]
metadata/_custom_type_script = "uid://ddlnlpb0p750q"

View File

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

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-e8b352108f4d5f1f213446b1f212024a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_sword/buildings/castle/Castle.png"
dest_files=["res://.godot/imported/Castle.png-e8b352108f4d5f1f213446b1f212024a.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,20 @@
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:
## TODO: remove this comment to enable prestige panel
#_prestige_panel.visible = true
pass
func _on_area_2d_mouse_exited() -> void:
_prestige_panel.visible = false

View File

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

View File

@@ -0,0 +1,72 @@
[gd_scene format=3 uid="uid://cl05bdri38mxf"]
[ext_resource type="Script" uid="uid://cjc0l13b07802" path="res://docs/gyms/tiny_sword/buildings/castle/castle.gd" id="1_cjtps"]
[ext_resource type="Texture2D" uid="uid://cry4arn00kgrt" path="res://docs/gyms/tiny_sword/buildings/castle/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_sword/buildings/castle/test_buff.gd" id="4_l7gct"]
[ext_resource type="PackedScene" uid="uid://dudfvxilbydas" path="res://core/goals/current_goal_panel.tscn" id="4_r36om"]
[ext_resource type="Resource" uid="uid://bjc6qmvr7pe12" path="res://docs/gyms/tiny_sword/buffs/spawn_worker_buff.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 = 161.0
offset_top = -232.0
offset_right = 581.0
offset_bottom = -3.0
[node name="PanelContainer" type="PanelContainer" parent="." unique_id=549346899]
offset_left = 160.0
offset_top = 5.0
offset_right = 575.0
offset_bottom = 201.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer" unique_id=321038386]
layout_mode = 2
theme_override_constants/margin_left = 20
theme_override_constants/margin_top = 20
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer" unique_id=450633732]
layout_mode = 2
size_flags_vertical = 0
theme_override_constants/separation = 4
alignment = 1
[node name="TestBuff" type="PanelContainer" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=1906280979]
layout_mode = 2
script = ExtResource("4_l7gct")
buff_data = ExtResource("5_s3a5k")
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/MarginContainer/VBoxContainer/TestBuff" unique_id=1293262110]
layout_mode = 2
[node name="Label" type="Label" parent="PanelContainer/MarginContainer/VBoxContainer/TestBuff/HBoxContainer" unique_id=1519392687]
layout_mode = 2
text = "Label"
[node name="Button" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer/TestBuff/HBoxContainer" unique_id=1254643833]
layout_mode = 2
text = "Button"
[node name="CurrentGoalPanel" parent="PanelContainer/MarginContainer/VBoxContainer" unique_id=1627561697 instance=ExtResource("4_r36om")]
layout_mode = 2
[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,118 @@
extends PanelContainer
@export var buff_data: GeneratorBuffData
@onready var _game_state: LevelGameState = find_parent("LevelGameState")
@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)
if _game_state:
_game_state.buff_level_changed.connect(_on_buff_level_changed)
_game_state.buff_unlocked_changed.connect(_on_buff_unlocked_changed)
_game_state.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 _game_state and _game_state.spend_currency_by_id(cost_currency_id, cost):
var next_level: int = _current_level + 1
_game_state.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 and _game_state:
_game_state.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 &""
if _game_state == null:
return &""
return _game_state.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 _game_state and not _game_state.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 = _game_state.get_currency_amount_by_id(cost_currency_id) if _game_state else BigNumber.from_float(0.0)
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 &""
if _game_state == null:
return &""
return _game_state.get_currency_id(buff.cost_currency)

View File

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

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-8d2a4466ed180272dd4fd5a1906cd2d6.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_sword/buildings/farm/House1.png"
dest_files=["res://.godot/imported/House1.png-8d2a4466ed180272dd4fd5a1906cd2d6.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,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/tiny_sword/currencies/food.tres" id="2_djlc5"]
[ext_resource type="Resource" uid="uid://d08h51y0pnsnf" path="res://docs/gyms/tiny_sword/buildings/farm/farm_generator.tres" id="3_82rmq"]
[ext_resource type="Texture2D" uid="uid://dfdh8r03sj7qv" path="res://docs/gyms/tiny_sword/buildings/farm/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 = 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,21 @@
[gd_resource type="Resource" script_class="CurrencyGeneratorData" format=3 uid="uid://d08h51y0pnsnf"]
[ext_resource type="Resource" uid="uid://50yq2hl3wfwq" path="res://docs/gyms/tiny_sword/research/farm_research.tres" id="2_hprai"]
[ext_resource type="Resource" uid="uid://dfxk30o34qe2s" path="res://docs/gyms/tiny_sword/currencies/worker.tres" id="3_bbypn"]
[ext_resource type="Script" uid="uid://b00tqsuhxdy0d" path="res://core/generator/currency_generator_data.gd" id="4_0kvfm"]
[ext_resource type="Resource" uid="uid://cts0407h130d6" path="res://docs/gyms/tiny_sword/goals/gold_total_1300_goal.tres" id="5_qiy1b"]
[resource]
script = ExtResource("4_0kvfm")
id = &"farm"
name = "Farm"
starts_unlocked = false
starts_available = false
initial_owned = 1
purchase_currency = ExtResource("3_bbypn")
unlock_goal = ExtResource("5_qiy1b")
initial_cost = 1.0
coefficient = 1.0
initial_productivity = 20.0
research_data = ExtResource("2_hprai")
metadata/_custom_type_script = "uid://b00tqsuhxdy0d"

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-86e0e955279bc70e5c6c622bf20a793e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_sword/buildings/forestry/House3.png"
dest_files=["res://.godot/imported/House3.png-86e0e955279bc70e5c6c622bf20a793e.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,13 @@
extends Node2D
@onready var _generator_container: GeneratorPanel = $GeneratorContainer
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
_generator_container.visible = false
func _on_area_2d_mouse_entered() -> void:
_generator_container.visible = true
func _on_area_2d_mouse_exited() -> void:
_generator_container.visible = false

View File

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

View File

@@ -0,0 +1,40 @@
[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="Script" uid="uid://cckf4nacd4qcr" path="res://docs/gyms/tiny_sword/buildings/forestry/forestry.gd" id="1_l4bxt"]
[ext_resource type="Resource" uid="uid://bgsk8h4w80h45" path="res://docs/gyms/tiny_sword/currencies/wood.tres" id="2_23x2t"]
[ext_resource type="Resource" uid="uid://v6hjoa2vky5k" path="res://docs/gyms/tiny_sword/buildings/forestry/forestry_generator.tres" id="3_pby1g"]
[ext_resource type="Texture2D" uid="uid://doxauaa3vn3lm" path="res://docs/gyms/tiny_sword/buildings/forestry/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]
script = ExtResource("1_l4bxt")
[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 = 128.0
offset_top = -100.0
offset_right = 392.0
offset_bottom = 110.0
_generator = NodePath("../CurrencyGenerator")
[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,21 @@
[gd_resource type="Resource" script_class="CurrencyGeneratorData" format=3 uid="uid://v6hjoa2vky5k"]
[ext_resource type="Resource" uid="uid://dfxk30o34qe2s" path="res://docs/gyms/tiny_sword/currencies/worker.tres" id="2_fs80u"]
[ext_resource type="Resource" uid="uid://cvow4sj6a5h23" path="res://docs/gyms/tiny_sword/research/forestry_research.tres" id="2_n4bxc"]
[ext_resource type="Resource" uid="uid://bo463s6jt0ep7" path="res://docs/gyms/tiny_sword/goals/gold_total_13k_goal.tres" id="4_mgk3v"]
[ext_resource type="Script" uid="uid://b00tqsuhxdy0d" path="res://core/generator/currency_generator_data.gd" id="4_rij12"]
[resource]
script = ExtResource("4_rij12")
id = &"forestry"
name = "Forestry"
starts_unlocked = false
starts_available = false
initial_owned = 1
purchase_currency = ExtResource("2_fs80u")
unlock_goal = ExtResource("4_mgk3v")
initial_cost = 1.0
coefficient = 1.0
initial_productivity = 20.0
research_data = ExtResource("2_n4bxc")
metadata/_custom_type_script = "uid://b00tqsuhxdy0d"

Binary file not shown.

After

Width:  |  Height:  |  Size: 802 B

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cfj3i3o3fkyb3"
path="res://.godot/imported/Gold Stone 1.png-7042dbb8b3bf15fcc9c607c8de62d4ac.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_sword/buildings/gold_mine/Gold Stone 1.png"
dest_files=["res://.godot/imported/Gold Stone 1.png-7042dbb8b3bf15fcc9c607c8de62d4ac.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: 2.1 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dv047glnug81l"
path="res://.godot/imported/Gold Stone 1_Highlight.png-7a880d843c9328a50dd550238ae23ff6.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_sword/buildings/gold_mine/Gold Stone 1_Highlight.png"
dest_files=["res://.godot/imported/Gold Stone 1_Highlight.png-7a880d843c9328a50dd550238ae23ff6.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: 797 B

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dgejk5scadnlt"
path="res://.godot/imported/Gold Stone 2.png-477006e016721179f332d1fec75a9ce7.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_sword/buildings/gold_mine/Gold Stone 2.png"
dest_files=["res://.godot/imported/Gold Stone 2.png-477006e016721179f332d1fec75a9ce7.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: 2.1 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bdp6vy36svbvn"
path="res://.godot/imported/Gold Stone 2_Highlight.png-35700856718370fa3e199b6e9fe3407e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_sword/buildings/gold_mine/Gold Stone 2_Highlight.png"
dest_files=["res://.godot/imported/Gold Stone 2_Highlight.png-35700856718370fa3e199b6e9fe3407e.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: 1.2 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://qimeviwtwkxx"
path="res://.godot/imported/Gold Stone 3.png-3c5063559feb891e83e5e47c1b0198e2.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_sword/buildings/gold_mine/Gold Stone 3.png"
dest_files=["res://.godot/imported/Gold Stone 3.png-3c5063559feb891e83e5e47c1b0198e2.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: 3.5 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bjqe3efu2aat6"
path="res://.godot/imported/Gold Stone 3_Highlight.png-539c0e6cdbe76410543390c2f48e7dd9.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_sword/buildings/gold_mine/Gold Stone 3_Highlight.png"
dest_files=["res://.godot/imported/Gold Stone 3_Highlight.png-539c0e6cdbe76410543390c2f48e7dd9.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: 1.3 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d3grr0fulpeje"
path="res://.godot/imported/Gold Stone 4.png-acf1f6375643d67fba247db251a84a6a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_sword/buildings/gold_mine/Gold Stone 4.png"
dest_files=["res://.godot/imported/Gold Stone 4.png-acf1f6375643d67fba247db251a84a6a.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: 3.8 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://befcjyx8tmc4a"
path="res://.godot/imported/Gold Stone 4_Highlight.png-f9cc5b1396d5ea96bb589d305b45bc4a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_sword/buildings/gold_mine/Gold Stone 4_Highlight.png"
dest_files=["res://.godot/imported/Gold Stone 4_Highlight.png-f9cc5b1396d5ea96bb589d305b45bc4a.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: 2.0 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bjaqlfshs823o"
path="res://.godot/imported/Gold Stone 5.png-c2b9b25484a63f524f46419e5fcf3e8f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_sword/buildings/gold_mine/Gold Stone 5.png"
dest_files=["res://.godot/imported/Gold Stone 5.png-c2b9b25484a63f524f46419e5fcf3e8f.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.0 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c35nxuw4x1go4"
path="res://.godot/imported/Gold Stone 5_Highlight.png-aecadbd44ed80072138aa4cfe3ab79cc.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_sword/buildings/gold_mine/Gold Stone 5_Highlight.png"
dest_files=["res://.godot/imported/Gold Stone 5_Highlight.png-aecadbd44ed80072138aa4cfe3ab79cc.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: 2.1 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bqf6yhtsnmjad"
path="res://.godot/imported/Gold Stone 6.png-0e048b3da07c839cd632ec6705baf4dc.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_sword/buildings/gold_mine/Gold Stone 6.png"
dest_files=["res://.godot/imported/Gold Stone 6.png-0e048b3da07c839cd632ec6705baf4dc.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.7 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c3ssnuxmsqyuq"
path="res://.godot/imported/Gold Stone 6_Highlight.png-782ec372f9d78c1068ab0c8f07008eeb.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_sword/buildings/gold_mine/Gold Stone 6_Highlight.png"
dest_files=["res://.godot/imported/Gold Stone 6_Highlight.png-782ec372f9d78c1068ab0c8f07008eeb.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,37 @@
[gd_scene format=3 uid="uid://brgkkw2n3o1ox"]
[ext_resource type="PackedScene" uid="uid://jeoiinukrrsp" path="res://core/generator/currency_generator.tscn" id="1_dgq4l"]
[ext_resource type="Resource" uid="uid://w4u1hddplb4e" path="res://docs/gyms/tiny_sword/currencies/gold.tres" id="2_d2x03"]
[ext_resource type="PackedScene" uid="uid://ckos7f22pnmyh" path="res://core/generator/generator_container.tscn" id="2_lnbxc"]
[ext_resource type="Texture2D" uid="uid://bqf6yhtsnmjad" path="res://docs/gyms/tiny_sword/buildings/gold_mine/Gold Stone 6.png" id="2_n0fgx"]
[ext_resource type="Resource" uid="uid://dliilvvjvksk1" path="res://docs/gyms/tiny_sword/buildings/gold_mine/gold_mine_generator.tres" id="2_sbi6i"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_sbi6i"]
size = Vector2(82, 84)
[node name="GoldMine" type="Node2D" unique_id=341660167]
[node name="CurrencyGenerator" parent="." unique_id=967969064 node_paths=PackedStringArray("info_generator_container") instance=ExtResource("1_dgq4l")]
currency = ExtResource("2_d2x03")
data = ExtResource("2_sbi6i")
info_generator_container = NodePath("../GeneratorContainer")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=115969252]
texture = ExtResource("2_n0fgx")
[node name="Area2D" type="Area2D" parent="." unique_id=1667681021]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=549597501]
position = Vector2(-1, -11)
shape = SubResource("RectangleShape2D_sbi6i")
[node name="GeneratorContainer" parent="." unique_id=1451609580 node_paths=PackedStringArray("_generator") instance=ExtResource("2_lnbxc")]
visible = false
offset_left = 127.0
offset_top = -103.0
offset_right = 391.0
offset_bottom = 107.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,19 @@
[gd_resource type="Resource" script_class="CurrencyGeneratorData" format=3 uid="uid://dliilvvjvksk1"]
[ext_resource type="Resource" uid="uid://dfxk30o34qe2s" path="res://docs/gyms/tiny_sword/currencies/worker.tres" id="2_j1lw5"]
[ext_resource type="Resource" uid="uid://dif6w6kesmw6u" path="res://docs/gyms/tiny_sword/research/gold_mine_research.tres" id="2_qkhnt"]
[ext_resource type="Script" uid="uid://b00tqsuhxdy0d" path="res://core/generator/currency_generator_data.gd" id="3_cnabh"]
[resource]
script = ExtResource("3_cnabh")
id = &"goldmine"
name = "Gold Mine"
purchase_currency = ExtResource("2_j1lw5")
initial_cost = 1.0
coefficient = 1.0
initial_productivity = 20.0
click_mantissa = 1.0
click_exponent = 0
click_cooldown_seconds = 0.2
research_data = ExtResource("2_qkhnt")
metadata/_custom_type_script = "uid://b00tqsuhxdy0d"

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-5f49b9547f0b0c767155d570a4d6cc55.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://docs/gyms/tiny_sword/buildings/monastery/Monastery.png"
dest_files=["res://.godot/imported/Monastery.png-5f49b9547f0b0c767155d570a4d6cc55.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,14 @@
extends Node2D
@onready var _research_panel: ResearchPanel = $ResearchPanel
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
_research_panel.visible = false
func _on_area_2d_mouse_entered() -> void:
_research_panel.visible = true
func _on_area_2d_mouse_exited() -> void:
_research_panel.visible = false

View File

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

View File

@@ -0,0 +1,30 @@
[gd_scene format=3 uid="uid://bf8lqbexvnx6e"]
[ext_resource type="Script" uid="uid://cj0sxoceqqyrm" path="res://docs/gyms/tiny_sword/buildings/monastery/monastery.gd" id="1_e17qd"]
[ext_resource type="Texture2D" uid="uid://dlmjd2berkb6v" path="res://docs/gyms/tiny_sword/buildings/monastery/Monastery.png" id="1_yyw6r"]
[ext_resource type="PackedScene" uid="uid://dd8roif0mqirl" path="res://core/research/research_panel.tscn" id="3_c6gi6"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_yyw6r"]
size = Vector2(160, 254)
[node name="Monastery" type="Node2D" unique_id=1545930496]
script = ExtResource("1_e17qd")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=2097167417]
texture = ExtResource("1_yyw6r")
[node name="Area2D" type="Area2D" parent="." unique_id=926221537]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=1198096629]
position = Vector2(1, 16)
shape = SubResource("RectangleShape2D_yyw6r")
[node name="ResearchPanel" parent="." unique_id=1105274967 instance=ExtResource("3_c6gi6")]
visible = false
offset_left = 78.0
offset_top = -98.0
offset_right = 478.0
offset_bottom = 128.0
[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,7 @@
[gd_resource type="Resource" script_class="CurrencyGeneratorData" format=3 uid="uid://56bnik1oe3ao"]
[ext_resource type="Script" uid="uid://b00tqsuhxdy0d" path="res://core/generator/currency_generator_data.gd" id="1_mnd3i"]
[resource]
script = ExtResource("1_mnd3i")
metadata/_custom_type_script = "uid://b00tqsuhxdy0d"

View File

@@ -0,0 +1,11 @@
[gd_resource type="Resource" script_class="Currency" format=3 uid="uid://bfrb0ayrljac2"]
[ext_resource type="Texture2D" uid="uid://d3nymghus6x3" path="res://sandbox/tiny_swords/UI Elements/UI Elements/Icons/Icon_03.png" id="1_icon"]
[ext_resource type="Script" uid="uid://dtgqjf3bl7pm8" path="res://core/currency/currency.gd" id="2_script"]
[resource]
script = ExtResource("2_script")
id = &"ascension"
display_name = "Ascension"
icon = ExtResource("1_icon")
metadata/_custom_type_script = "uid://dtgqjf3bl7pm8"

View File

@@ -0,0 +1,11 @@
[gd_resource type="Resource" script_class="Currency" format=3 uid="uid://t6du7gm2ywbi"]
[ext_resource type="Texture2D" uid="uid://c1gnh8jgctrcx" path="res://sandbox/tiny_swords/UI Elements/UI Elements/Icons/Icon_07.png" id="1_axihf"]
[ext_resource type="Script" uid="uid://dtgqjf3bl7pm8" path="res://core/currency/currency.gd" id="2_fxby5"]
[resource]
script = ExtResource("2_fxby5")
id = &"cognite"
display_name = "Cognite"
icon = ExtResource("1_axihf")
metadata/_custom_type_script = "uid://dtgqjf3bl7pm8"

View File

@@ -0,0 +1,10 @@
[gd_resource type="Resource" script_class="Currency" format=3 uid="uid://bxg2au0ijp242"]
[ext_resource type="Texture2D" uid="uid://dkt4s1eyw8puy" path="res://sandbox/tiny_swords/UI Elements/UI Elements/Icons/Icon_04.png" id="1_4u6o6"]
[ext_resource type="Script" uid="uid://dtgqjf3bl7pm8" path="res://core/currency/currency.gd" id="2_anstu"]
[resource]
script = ExtResource("2_anstu")
id = &"food"
display_name = "Food"
icon = ExtResource("1_4u6o6")

View File

@@ -0,0 +1,11 @@
[gd_resource type="Resource" script_class="Currency" format=3 uid="uid://w4u1hddplb4e"]
[ext_resource type="Texture2D" uid="uid://d3nymghus6x3" path="res://sandbox/tiny_swords/UI Elements/UI Elements/Icons/Icon_03.png" id="1_n656e"]
[ext_resource type="Script" uid="uid://dtgqjf3bl7pm8" path="res://core/currency/currency.gd" id="2_vohw6"]
[resource]
script = ExtResource("2_vohw6")
id = &"gold"
display_name = "Gold"
icon = ExtResource("1_n656e")
always_visible = true

View File

@@ -0,0 +1,11 @@
[gd_resource type="Resource" script_class="Currency" format=3 uid="uid://dpbndqxvsffa0"]
[ext_resource type="Script" uid="uid://dtgqjf3bl7pm8" path="res://core/currency/currency.gd" id="1_v6rd4"]
[ext_resource type="Texture2D" uid="uid://c1gnh8jgctrcx" path="res://sandbox/tiny_swords/UI Elements/UI Elements/Icons/Icon_07.png" id="1_wi1w3"]
[resource]
script = ExtResource("1_v6rd4")
id = &"magic_gold"
display_name = "Magic Gold"
icon = ExtResource("1_wi1w3")
metadata/_custom_type_script = "uid://dtgqjf3bl7pm8"

View File

@@ -0,0 +1,11 @@
[gd_resource type="Resource" script_class="Currency" format=3 uid="uid://brctmnpmhjas6"]
[ext_resource type="Texture2D" uid="uid://c1gnh8jgctrcx" path="res://sandbox/tiny_swords/UI Elements/UI Elements/Icons/Icon_07.png" id="1_c7yxi"]
[ext_resource type="Script" uid="uid://dtgqjf3bl7pm8" path="res://core/currency/currency.gd" id="1_fahg0"]
[resource]
script = ExtResource("1_fahg0")
id = &"mana_stone"
display_name = "Mana Stone"
icon = ExtResource("1_c7yxi")
metadata/_custom_type_script = "uid://dtgqjf3bl7pm8"

View File

@@ -0,0 +1,11 @@
[gd_resource type="Resource" script_class="Currency" format=3 uid="uid://co4fiqgluwit0"]
[ext_resource type="Texture2D" uid="uid://c1gnh8jgctrcx" path="res://sandbox/tiny_swords/UI Elements/UI Elements/Icons/Icon_07.png" id="1_cks7i"]
[ext_resource type="Script" uid="uid://dtgqjf3bl7pm8" path="res://core/currency/currency.gd" id="2_ih4no"]
[resource]
script = ExtResource("2_ih4no")
id = &"philosoper_stone"
display_name = "Philosoper Stone"
icon = ExtResource("1_cks7i")
metadata/_custom_type_script = "uid://dtgqjf3bl7pm8"

View File

@@ -0,0 +1,18 @@
[gd_resource type="Resource" script_class="CurrencyCatalogue" format=3 uid="uid://iqphilgfp2i7"]
[ext_resource type="Script" uid="uid://dtgqjf3bl7pm8" path="res://core/currency/currency.gd" id="1_501l6"]
[ext_resource type="Script" uid="uid://621tus0uvbrd" path="res://core/currency/currency_catalogue.gd" id="2_hmju3"]
[ext_resource type="Resource" uid="uid://w4u1hddplb4e" path="res://docs/gyms/tiny_sword/currencies/gold.tres" id="2_ucsji"]
[ext_resource type="Resource" uid="uid://dfxk30o34qe2s" path="res://docs/gyms/tiny_sword/currencies/worker.tres" id="3_7hx6u"]
[ext_resource type="Resource" uid="uid://bxg2au0ijp242" path="res://docs/gyms/tiny_sword/currencies/food.tres" id="4_c77gh"]
[ext_resource type="Resource" uid="uid://bgsk8h4w80h45" path="res://docs/gyms/tiny_sword/currencies/wood.tres" id="5_gyp05"]
[ext_resource type="Resource" uid="uid://bfrb0ayrljac2" path="res://docs/gyms/tiny_sword/currencies/ascension.tres" id="6_ascension"]
[ext_resource type="Resource" uid="uid://dpbndqxvsffa0" path="res://docs/gyms/tiny_sword/currencies/magic_gold.tres" id="7_vu05v"]
[ext_resource type="Resource" uid="uid://brctmnpmhjas6" path="res://docs/gyms/tiny_sword/currencies/mana_stone.tres" id="8_p3urk"]
[ext_resource type="Resource" uid="uid://t6du7gm2ywbi" path="res://docs/gyms/tiny_sword/currencies/cognite.tres" id="9_ejnoj"]
[ext_resource type="Resource" uid="uid://co4fiqgluwit0" path="res://docs/gyms/tiny_sword/currencies/philosoper_stone.tres" id="10_ejnoj"]
[resource]
script = ExtResource("2_hmju3")
currencies = Array[ExtResource("1_501l6")]([ExtResource("2_ucsji"), ExtResource("3_7hx6u"), ExtResource("4_c77gh"), ExtResource("5_gyp05"), ExtResource("6_ascension"), ExtResource("7_vu05v"), ExtResource("8_p3urk"), ExtResource("9_ejnoj"), ExtResource("10_ejnoj")])
metadata/_custom_type_script = "uid://621tus0uvbrd"

View File

@@ -0,0 +1,10 @@
[gd_resource type="Resource" script_class="Currency" format=3 uid="uid://bgsk8h4w80h45"]
[ext_resource type="Texture2D" uid="uid://bovjusa7o0l1m" path="res://sandbox/tiny_swords/UI Elements/UI Elements/Icons/Icon_02.png" id="1_gm6cf"]
[ext_resource type="Script" uid="uid://dtgqjf3bl7pm8" path="res://core/currency/currency.gd" id="2_jj4s4"]
[resource]
script = ExtResource("2_jj4s4")
id = &"wood"
display_name = "Wood"
icon = ExtResource("1_gm6cf")

View File

@@ -0,0 +1,11 @@
[gd_resource type="Resource" script_class="Currency" format=3 uid="uid://dfxk30o34qe2s"]
[ext_resource type="Texture2D" uid="uid://bx7tj1rd3vo3a" path="res://sandbox/tiny_swords/UI Elements/UI Elements/Icons/Icon_05.png" id="1_cbwhh"]
[ext_resource type="Script" uid="uid://dtgqjf3bl7pm8" path="res://core/currency/currency.gd" id="1_ovrsl"]
[resource]
script = ExtResource("1_ovrsl")
id = &"worker"
display_name = "Worker"
icon = ExtResource("1_cbwhh")
metadata/_custom_type_script = "uid://dtgqjf3bl7pm8"

View File

@@ -0,0 +1,15 @@
[gd_scene format=3 uid="uid://cur_panel_scene_uid"]
[ext_resource type="Script" uid="uid://9_vbox" path="res://core/currency/currency_panel.gd" id="1_cpnl"]
[node name="CurrencyPanel" type="PanelContainer" unique_id=3000000001]
custom_minimum_size = Vector2(250, 340)
offset_left = 5.0
offset_top = 5.0
offset_right = 255.0
offset_bottom = 345.0
script = ExtResource("1_cpnl")
[node name="CurrencyTiles" type="VBoxContainer" parent="." unique_id=3000000002]
layout_mode = 2
theme_override_constants/separation = 4

View File

@@ -0,0 +1,24 @@
[gd_resource type="Resource" script_class="GoalData" format=3 uid="uid://b6gb6vk0kgxnw"]
[ext_resource type="Script" uid="uid://r4js5eajolio" path="res://core/goals/goal_requirement_data.gd" id="1_68ddp"]
[ext_resource type="Resource" uid="uid://w4u1hddplb4e" path="res://docs/gyms/tiny_sword/currencies/gold.tres" id="2_2b0j8"]
[ext_resource type="Resource" uid="uid://bgsk8h4w80h45" path="res://docs/gyms/tiny_sword/currencies/wood.tres" id="3_7tb0t"]
[ext_resource type="Script" uid="uid://dx4kmh33rrkpy" path="res://core/goals/goal_data.gd" id="4_20y5g"]
[sub_resource type="Resource" id="Resource_tvl3d"]
script = ExtResource("1_68ddp")
currency = ExtResource("2_2b0j8")
amount_mantissa = 3.5
amount_exponent = 5
[sub_resource type="Resource" id="Resource_hyry2"]
script = ExtResource("1_68ddp")
currency = ExtResource("3_7tb0t")
amount_mantissa = 2.0
amount_exponent = 4
metadata/_custom_type_script = "uid://r4js5eajolio"
[resource]
script = ExtResource("4_20y5g")
id = &"gold_350k_wood_20k"
requirements = Array[ExtResource("1_68ddp")]([SubResource("Resource_tvl3d"), SubResource("Resource_hyry2")])

View File

@@ -0,0 +1,16 @@
[gd_resource type="Resource" script_class="GoalData" format=3 uid="uid://cts0407h130d6"]
[ext_resource type="Script" uid="uid://r4js5eajolio" path="res://core/goals/goal_requirement_data.gd" id="1_pahmu"]
[ext_resource type="Resource" uid="uid://w4u1hddplb4e" path="res://docs/gyms/tiny_sword/currencies/gold.tres" id="2_oek0g"]
[ext_resource type="Script" uid="uid://dx4kmh33rrkpy" path="res://core/goals/goal_data.gd" id="3_3fgtm"]
[sub_resource type="Resource" id="Resource_tvl3d"]
script = ExtResource("1_pahmu")
currency = ExtResource("2_oek0g")
amount_mantissa = 1.3
amount_exponent = 3
[resource]
script = ExtResource("3_3fgtm")
id = &"gold_total_1300"
requirements = Array[ExtResource("1_pahmu")]([SubResource("Resource_tvl3d")])

Some files were not shown because too many files have changed in this diff Show More