Fix alchemy tower
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
class_name AlchemyCraftCatalogue
|
||||
extends Resource
|
||||
|
||||
## Catalogue of alchemy craft recipes
|
||||
@export var recipes: Array = []
|
||||
|
||||
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
|
||||
@@ -0,0 +1 @@
|
||||
uid://biljlhsxr3rsc
|
||||
@@ -0,0 +1,9 @@
|
||||
[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" 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"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_cat")
|
||||
recipes = [ExtResource("2_mana_recipe"), ExtResource("3_cognite_recipe")]
|
||||
@@ -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 = []
|
||||
@@ -0,0 +1 @@
|
||||
uid://ddlnlpb0p750q
|
||||
@@ -0,0 +1,10 @@
|
||||
[gd_resource type="Resource" script_class="CurrencyCatalogue" format=3]
|
||||
|
||||
[ext_resource type="Script" uid="uid://621tus0uvbrd" path="res://core/currency/currency_catalogue.gd" id="1_cat"]
|
||||
[ext_resource type="Resource" 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"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_cat")
|
||||
currencies = [ExtResource("2_mana_recipe"), ExtResource("3_cognite_recipe")]
|
||||
metadata/_custom_type_script = "uid://catalogue_script"
|
||||
@@ -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"
|
||||
@@ -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")]
|
||||
@@ -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
|
||||
@@ -0,0 +1 @@
|
||||
uid://ba8e403mb7hp0
|
||||
@@ -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"
|
||||
@@ -0,0 +1,13 @@
|
||||
[gd_resource type="Resource" script_class="AlchemyCraftRecipe" format=3]
|
||||
|
||||
[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")
|
||||
output_amount = 1
|
||||
cost_entries = [ExtResource("3_cost")]
|
||||
metadata/_custom_type_script = "res://docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_craft_recipe.gd"
|
||||
Reference in New Issue
Block a user