This commit is contained in:
Tandy 2026-09-27 11:31:17 -06:00
commit 850d94305d
43 changed files with 246 additions and 21 deletions

View file

@ -16,6 +16,7 @@ position = Vector2(50, 49)
shape = SubResource("RectangleShape2D_riqys") shape = SubResource("RectangleShape2D_riqys")
[node name="MemberSprite" parent="." unique_id=283117283 instance=ExtResource("2_v0at3")] [node name="MemberSprite" parent="." unique_id=283117283 instance=ExtResource("2_v0at3")]
unique_name_in_owner = true
instance_shader_parameters/border_color = Color(1, 0, 0, 1) instance_shader_parameters/border_color = Color(1, 0, 0, 1)
instance_shader_parameters/border_width = 0.16 instance_shader_parameters/border_width = 0.16
instance_shader_parameters/fill_color = Color(1, 0.7529412, 0.79607844, 1) instance_shader_parameters/fill_color = Color(1, 0.7529412, 0.79607844, 1)

5
command.gd Normal file
View file

@ -0,0 +1,5 @@
extends Resource
class_name Command
@export var name: String
@export var modal_name: String

1
command.gd.uid Normal file
View file

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

View file

@ -0,0 +1,14 @@
extends Button
signal command_succcess(c: Command)
@export var command: Command
func _ready() -> void:
sync()
func sync():
text = command.name
func _on_pressed() -> void:
command_succcess.emit(command)

View file

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

View file

@ -0,0 +1,8 @@
[gd_scene format=3 uid="uid://cno33rgilttxt"]
[ext_resource type="PackedScene" uid="uid://dqb4a1igddv71" path="res://gui/bribe_button.tscn" id="1_j6j61"]
[ext_resource type="Script" uid="uid://m5qf37ordikh" path="res://commands/command_button.gd" id="2_0fnf4"]
[node name="CommandButton" unique_id=1084248382 instance=ExtResource("1_j6j61")]
script = ExtResource("2_0fnf4")
command = null

2
commands/move.gd Normal file
View file

@ -0,0 +1,2 @@
extends Command
class_name MoveCommand

1
commands/move.gd.uid Normal file
View file

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

View file

@ -0,0 +1,9 @@
[gd_resource type="Resource" script_class="MoveCommand" format=3 uid="uid://u6lls6n0xw3n"]
[ext_resource type="Script" uid="uid://jxfw3ptlwg8d" path="res://commands/move.gd" id="1_cox6k"]
[resource]
script = ExtResource("1_cox6k")
name = "Move"
modal_name = "Moving!"
metadata/_custom_type_script = "uid://jxfw3ptlwg8d"

View file

@ -7,3 +7,4 @@ class_name Currency
@export var thumbnail: Texture2D @export var thumbnail: Texture2D
@export var color: Color = Color.PINK @export var color: Color = Color.PINK
@export var wants: Array[Production] @export var wants: Array[Production]
@export var commands: Array[Command] = [preload("res://commands/move_command.tres")]

View file

@ -9,6 +9,7 @@ shader = ExtResource("1_tm326")
[sub_resource type="CanvasTexture" id="CanvasTexture_wgite"] [sub_resource type="CanvasTexture" id="CanvasTexture_wgite"]
[node name="MemberSprite" type="TextureRect" unique_id=283117283] [node name="MemberSprite" type="TextureRect" unique_id=283117283]
z_index = 100
material = SubResource("ShaderMaterial_tm326") material = SubResource("ShaderMaterial_tm326")
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
texture = SubResource("CanvasTexture_wgite") texture = SubResource("CanvasTexture_wgite")

View file

@ -1,8 +1,10 @@
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://l8osuuxl7exe"] [gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://l8osuuxl7exe"]
[ext_resource type="Script" uid="uid://cn8rc6jyllrf0" path="res://command.gd" id="1_227pm"]
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_e7gnr"] [ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_e7gnr"]
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_m37xt"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_m37xt"]
[ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_b0duy"] [ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_b0duy"]
[ext_resource type="Resource" uid="uid://u6lls6n0xw3n" path="res://commands/move_command.tres" id="2_k5pub"]
[ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_k672a"] [ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_k672a"]
[ext_resource type="Resource" uid="uid://b8b6yr444ecdk" path="res://currency/inanimate/water.tres" id="5_2kil6"] [ext_resource type="Resource" uid="uid://b8b6yr444ecdk" path="res://currency/inanimate/water.tres" id="5_2kil6"]
[ext_resource type="Resource" uid="uid://ervsee7ku1i2" path="res://currency/inanimate/bread.tres" id="6_qqxwu"] [ext_resource type="Resource" uid="uid://ervsee7ku1i2" path="res://currency/inanimate/bread.tres" id="6_qqxwu"]

View file

@ -1,8 +1,10 @@
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://dlxnbyiurne1s"] [gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://dlxnbyiurne1s"]
[ext_resource type="Script" uid="uid://cn8rc6jyllrf0" path="res://command.gd" id="1_2uxum"]
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_cnnt2"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_cnnt2"]
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_o1w50"] [ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_o1w50"]
[ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_hqcau"] [ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_hqcau"]
[ext_resource type="Resource" uid="uid://u6lls6n0xw3n" path="res://commands/move_command.tres" id="2_npspm"]
[ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_lyu7q"] [ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_lyu7q"]
[ext_resource type="Resource" uid="uid://b8b6yr444ecdk" path="res://currency/inanimate/water.tres" id="5_fxi61"] [ext_resource type="Resource" uid="uid://b8b6yr444ecdk" path="res://currency/inanimate/water.tres" id="5_fxi61"]
[ext_resource type="Resource" uid="uid://ervsee7ku1i2" path="res://currency/inanimate/bread.tres" id="6_vf3g1"] [ext_resource type="Resource" uid="uid://ervsee7ku1i2" path="res://currency/inanimate/bread.tres" id="6_vf3g1"]

View file

@ -1,7 +1,9 @@
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://clx8tbrad4m7c"] [gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://clx8tbrad4m7c"]
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_0dcki"] [ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_0dcki"]
[ext_resource type="Script" uid="uid://cn8rc6jyllrf0" path="res://command.gd" id="1_eu6eo"]
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_qayfp"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_qayfp"]
[ext_resource type="Resource" uid="uid://u6lls6n0xw3n" path="res://commands/move_command.tres" id="2_3kirj"]
[ext_resource type="Resource" uid="uid://6xylw7p78fvf" path="res://currency/sentient/wizard.tres" id="3_2x36w"] [ext_resource type="Resource" uid="uid://6xylw7p78fvf" path="res://currency/sentient/wizard.tres" id="3_2x36w"]
[ext_resource type="Texture2D" uid="uid://c4snl0k8eu4n5" path="res://thumbnails/dino.jpg" id="3_bufop"] [ext_resource type="Texture2D" uid="uid://c4snl0k8eu4n5" path="res://thumbnails/dino.jpg" id="3_bufop"]
[ext_resource type="Resource" uid="uid://dfj4jwdmff6bu" path="res://currency/sentient/spy.tres" id="4_bufop"] [ext_resource type="Resource" uid="uid://dfj4jwdmff6bu" path="res://currency/sentient/spy.tres" id="4_bufop"]

View file

@ -1,8 +1,10 @@
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://b1tgtujqs5lnr"] [gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://b1tgtujqs5lnr"]
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_8u0th"] [ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_8u0th"]
[ext_resource type="Script" uid="uid://cn8rc6jyllrf0" path="res://command.gd" id="1_hu81m"]
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_ohece"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_ohece"]
[ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_u3n2t"] [ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_u3n2t"]
[ext_resource type="Resource" uid="uid://u6lls6n0xw3n" path="res://commands/move_command.tres" id="2_w0d8m"]
[ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_yv5d2"] [ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_yv5d2"]
[ext_resource type="Texture2D" uid="uid://bbcjo350ne8pv" path="res://thumbnails/doctor.jpg" id="5_e68kt"] [ext_resource type="Texture2D" uid="uid://bbcjo350ne8pv" path="res://thumbnails/doctor.jpg" id="5_e68kt"]
[ext_resource type="Resource" uid="uid://crnhu4w6lfopb" path="res://currency/inanimate/beer.tres" id="6_r8lqy"] [ext_resource type="Resource" uid="uid://crnhu4w6lfopb" path="res://currency/inanimate/beer.tres" id="6_r8lqy"]

View file

@ -2,6 +2,8 @@
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_35xhy"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_35xhy"]
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_kipvp"] [ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_kipvp"]
[ext_resource type="Script" uid="uid://cn8rc6jyllrf0" path="res://command.gd" id="1_uh6l7"]
[ext_resource type="Resource" uid="uid://u6lls6n0xw3n" path="res://commands/move_command.tres" id="2_7lva1"]
[ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_jkjll"] [ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_jkjll"]
[ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_kfqfp"] [ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_kfqfp"]
[ext_resource type="Resource" uid="uid://b5qok0rcalr" path="res://currency/sentient/cow.tres" id="5_uddvy"] [ext_resource type="Resource" uid="uid://b5qok0rcalr" path="res://currency/sentient/cow.tres" id="5_uddvy"]

View file

@ -1,8 +1,10 @@
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://cwpk5e2exbgcr"] [gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://cwpk5e2exbgcr"]
[ext_resource type="Script" uid="uid://cn8rc6jyllrf0" path="res://command.gd" id="1_1ptox"]
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_f1fuf"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_f1fuf"]
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_y7sat"] [ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_y7sat"]
[ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_s3h3i"] [ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_s3h3i"]
[ext_resource type="Resource" uid="uid://u6lls6n0xw3n" path="res://commands/move_command.tres" id="2_t2htw"]
[ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_3jtdd"] [ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_3jtdd"]
[ext_resource type="Resource" uid="uid://bnlnq4ucsgfxe" path="res://currency/inanimate/gold.tres" id="5_bom44"] [ext_resource type="Resource" uid="uid://bnlnq4ucsgfxe" path="res://currency/inanimate/gold.tres" id="5_bom44"]
[ext_resource type="Resource" uid="uid://ervsee7ku1i2" path="res://currency/inanimate/bread.tres" id="6_y0tsi"] [ext_resource type="Resource" uid="uid://ervsee7ku1i2" path="res://currency/inanimate/bread.tres" id="6_y0tsi"]

View file

@ -1,6 +1,8 @@
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://ihsvxienxbeu"] [gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://ihsvxienxbeu"]
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_626vc"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_626vc"]
[ext_resource type="Script" uid="uid://cn8rc6jyllrf0" path="res://command.gd" id="1_ds1y1"]
[ext_resource type="Resource" uid="uid://u6lls6n0xw3n" path="res://commands/move_command.tres" id="2_gpemk"]
[ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_sa77c"] [ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_sa77c"]
[ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_xhy5h"] [ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_xhy5h"]
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="4_7d8n3"] [ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="4_7d8n3"]

View file

@ -2,6 +2,8 @@
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_81xhi"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_81xhi"]
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_m8i4c"] [ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_m8i4c"]
[ext_resource type="Script" uid="uid://cn8rc6jyllrf0" path="res://command.gd" id="1_vs85s"]
[ext_resource type="Resource" uid="uid://u6lls6n0xw3n" path="res://commands/move_command.tres" id="2_ul3xr"]
[ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_x1puw"] [ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_x1puw"]
[ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_yveov"] [ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_yveov"]
[ext_resource type="Resource" uid="uid://bnlnq4ucsgfxe" path="res://currency/inanimate/gold.tres" id="5_p4ceb"] [ext_resource type="Resource" uid="uid://bnlnq4ucsgfxe" path="res://currency/inanimate/gold.tres" id="5_p4ceb"]

View file

@ -2,6 +2,8 @@
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_egwdx"] [ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_egwdx"]
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_iy37t"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_iy37t"]
[ext_resource type="Script" uid="uid://cn8rc6jyllrf0" path="res://command.gd" id="1_mf0hi"]
[ext_resource type="Resource" uid="uid://u6lls6n0xw3n" path="res://commands/move_command.tres" id="2_0uhpw"]
[ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_demtt"] [ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_demtt"]
[ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_mxgt6"] [ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_mxgt6"]
[ext_resource type="Resource" uid="uid://bnlnq4ucsgfxe" path="res://currency/inanimate/gold.tres" id="5_rq11v"] [ext_resource type="Resource" uid="uid://bnlnq4ucsgfxe" path="res://currency/inanimate/gold.tres" id="5_rq11v"]

View file

@ -1,8 +1,10 @@
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://dpaj2dk3qm7ow"] [gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://dpaj2dk3qm7ow"]
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_phc4h"] [ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_phc4h"]
[ext_resource type="Script" uid="uid://cn8rc6jyllrf0" path="res://command.gd" id="1_tbpph"]
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_yn73g"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_yn73g"]
[ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_8h62s"] [ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_8h62s"]
[ext_resource type="Resource" uid="uid://u6lls6n0xw3n" path="res://commands/move_command.tres" id="2_t4qyg"]
[ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_2kvuq"] [ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_2kvuq"]
[ext_resource type="Resource" uid="uid://b8b6yr444ecdk" path="res://currency/inanimate/water.tres" id="5_eaivi"] [ext_resource type="Resource" uid="uid://b8b6yr444ecdk" path="res://currency/inanimate/water.tres" id="5_eaivi"]
[ext_resource type="Resource" uid="uid://ervsee7ku1i2" path="res://currency/inanimate/bread.tres" id="6_4664q"] [ext_resource type="Resource" uid="uid://ervsee7ku1i2" path="res://currency/inanimate/bread.tres" id="6_4664q"]

View file

@ -1,8 +1,10 @@
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://dfj4jwdmff6bu"] [gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://dfj4jwdmff6bu"]
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_ou6ev"] [ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_ou6ev"]
[ext_resource type="Script" uid="uid://cn8rc6jyllrf0" path="res://command.gd" id="1_wnwuo"]
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_wync1"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_wync1"]
[ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_30yvg"] [ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_30yvg"]
[ext_resource type="Resource" uid="uid://u6lls6n0xw3n" path="res://commands/move_command.tres" id="2_jpoxk"]
[ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_pvkom"] [ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_pvkom"]
[ext_resource type="Resource" uid="uid://bnlnq4ucsgfxe" path="res://currency/inanimate/gold.tres" id="5_ssejx"] [ext_resource type="Resource" uid="uid://bnlnq4ucsgfxe" path="res://currency/inanimate/gold.tres" id="5_ssejx"]
[ext_resource type="Resource" uid="uid://ervsee7ku1i2" path="res://currency/inanimate/bread.tres" id="6_dmqey"] [ext_resource type="Resource" uid="uid://ervsee7ku1i2" path="res://currency/inanimate/bread.tres" id="6_dmqey"]

View file

@ -2,7 +2,9 @@
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_0qymk"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_0qymk"]
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_an3bl"] [ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_an3bl"]
[ext_resource type="Script" uid="uid://cn8rc6jyllrf0" path="res://command.gd" id="1_urykh"]
[ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_0o8mq"] [ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_0o8mq"]
[ext_resource type="Resource" uid="uid://u6lls6n0xw3n" path="res://commands/move_command.tres" id="2_lqdse"]
[ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_xknsl"] [ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_xknsl"]
[ext_resource type="Resource" uid="uid://ervsee7ku1i2" path="res://currency/inanimate/bread.tres" id="5_hkj46"] [ext_resource type="Resource" uid="uid://ervsee7ku1i2" path="res://currency/inanimate/bread.tres" id="5_hkj46"]
[ext_resource type="Resource" uid="uid://b7vjuqkog7cxd" path="res://currency/inanimate/wood.tres" id="6_s7hyh"] [ext_resource type="Resource" uid="uid://b7vjuqkog7cxd" path="res://currency/inanimate/wood.tres" id="6_s7hyh"]

View file

@ -1,7 +1,9 @@
[gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://6xylw7p78fvf"] [gd_resource type="Resource" script_class="SentientCurrency" format=3 uid="uid://6xylw7p78fvf"]
[ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_05kyk"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_05kyk"]
[ext_resource type="Script" uid="uid://cn8rc6jyllrf0" path="res://command.gd" id="1_fu5ce"]
[ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_tds6s"] [ext_resource type="Script" uid="uid://hcvynq5fjypj" path="res://currency/sentient_currency.gd" id="1_tds6s"]
[ext_resource type="Resource" uid="uid://u6lls6n0xw3n" path="res://commands/move_command.tres" id="2_rx02f"]
[ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_ud150"] [ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_ud150"]
[ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_mp872"] [ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_mp872"]
[ext_resource type="Resource" uid="uid://crnhu4w6lfopb" path="res://currency/inanimate/beer.tres" id="5_g2km3"] [ext_resource type="Resource" uid="uid://crnhu4w6lfopb" path="res://currency/inanimate/beer.tres" id="5_g2km3"]

View file

@ -80,10 +80,14 @@ func simulate():
if e.requirements_satisfied() and e.will_happen(): if e.requirements_satisfied() and e.will_happen():
var outcome := e.outcome() var outcome := e.outcome()
for o in outcome: for o in outcome:
if o == null:
continue
produce(o) produce(o)
production_log.emit(null, o) production_log.emit(null, o)
if e.timeline != null: if e.timeline != null:
Dialogic.start(e.timeline) GameState.add_letter.emit(e.into_letter())
if randf() < 0.01:
LetterGeneration.try_generate_offer()
func get_all_currencies_in(dir: StringName): func get_all_currencies_in(dir: StringName):

View file

@ -9,8 +9,10 @@ enum EventNature {
Random, Random,
Certain, Certain,
} }
@export var probability: float = 0.005 @export var probability: float = 0.01
@export var nature: EventNature = EventNature.Random @export var nature: EventNature = EventNature.Random
@export var email_source: Currency = preload("res://currency/sentient/town_crier.tres")
@export var email_subject: String = "Something is amok!"
func requirements_satisfied() -> bool: func requirements_satisfied() -> bool:
for requirement in requirements: for requirement in requirements:
@ -28,3 +30,9 @@ func outcome() -> Array[Production]:
stuff.append_array(extra_mods) stuff.append_array(extra_mods)
return stuff return stuff
func into_letter() -> EventLetter:
var el := EventLetter.new()
el.source = email_source
el.subject_field = email_subject
el.timeline = timeline
return el

View file

@ -2,6 +2,9 @@
[ext_resource type="PackedScene" uid="uid://bdk1r2u8clllr" path="res://map.tscn" id="1_e2o6t"] [ext_resource type="PackedScene" uid="uid://bdk1r2u8clllr" path="res://map.tscn" id="1_e2o6t"]
[ext_resource type="PackedScene" uid="uid://d06w1wtct0mfs" path="res://test/test_economy.tscn" id="2_feb5d"] [ext_resource type="PackedScene" uid="uid://d06w1wtct0mfs" path="res://test/test_economy.tscn" id="2_feb5d"]
[ext_resource type="PackedScene" uid="uid://coebykrbnhlif" path="res://currency/members/MemberSprite.tscn" id="3_7jktm"]
[ext_resource type="Resource" uid="uid://dn0c1pfq04obw" path="res://currency/sentient/farmer.tres" id="4_ryrav"]
[ext_resource type="Resource" uid="uid://b7lxfjhx4qhts" path="res://allegiance/good.tres" id="5_eow3j"]
[node name="Game" type="Node2D" unique_id=1791439508] [node name="Game" type="Node2D" unique_id=1791439508]
@ -10,3 +13,11 @@
[node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=1213874033] [node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=1213874033]
[node name="TestEconomy" parent="CanvasLayer" unique_id=629898212 instance=ExtResource("2_feb5d")] [node name="TestEconomy" parent="CanvasLayer" unique_id=629898212 instance=ExtResource("2_feb5d")]
[node name="MemberSprite" parent="." unique_id=283117283 instance=ExtResource("3_7jktm")]
offset_left = 294.0
offset_top = 1177.0
offset_right = 345.0
offset_bottom = 1219.0
currency = ExtResource("4_ryrav")
allegiance = ExtResource("5_eow3j")

View file

@ -3,6 +3,7 @@
[ext_resource type="Script" uid="uid://olr6663hny8n" path="res://bribe_button.gd" id="1_2abdb"] [ext_resource type="Script" uid="uid://olr6663hny8n" path="res://bribe_button.gd" id="1_2abdb"]
[node name="BribeButton" type="Button" unique_id=1084248382] [node name="BribeButton" type="Button" unique_id=1084248382]
custom_minimum_size = Vector2(0, 50)
text = "< num > of < currency >" text = "< num > of < currency >"
script = ExtResource("1_2abdb") script = ExtResource("1_2abdb")

View file

@ -5,7 +5,11 @@ var currency: Currency = null
func _ready() -> void: func _ready() -> void:
UserContext.currency_inspect.connect(currency_inspect) UserContext.currency_inspect.connect(currency_inspect)
UserContext.member_inspect.connect(member_inspect) UserContext.member_inspect.connect(member_inspect)
UserContext.modal_command_change.connect(modal_command_change)
update() update()
func modal_command_change(_c: Command):
visible = false
func member_inspect(_m: CurrencyMemberSprite): func member_inspect(_m: CurrencyMemberSprite):
visible = false visible = false

View file

@ -0,0 +1,8 @@
[gd_scene format=3 uid="uid://choixlqgx0jo7"]
[ext_resource type="PackedScene" uid="uid://da2ldx7una0a2" path="res://gui/inbox_message_subject.tscn" id="1_nc3yv"]
[node name="InboxEvent" unique_id=1590519653 instance=ExtResource("1_nc3yv")]
[node name="ReplyButton" parent="MarginContainer/HBoxContainer" parent_id_path=PackedInt32Array(1418860833) index="2" unique_id=803741826]
visible = false

View file

@ -7,8 +7,9 @@ func _ready() -> void:
%Source.text = letter.source.name %Source.text = letter.source.name
%Subject.text = letter.subject_field %Subject.text = letter.subject_field
func on_remove_letter(_l: Letter): func on_remove_letter(l: Letter):
queue_free() if letter == l:
queue_free()
func _on_pressed() -> void: func _on_pressed() -> void:
letter.start() letter.start()

View file

@ -6,11 +6,14 @@ func _ready() -> void:
visible = false visible = false
func add_letter(l: Letter): func add_letter(l: Letter):
var ldis := preload("res://gui/inbox_message_subject.tscn").instantiate() var ldis: Button
if l is EventLetter:
ldis = preload("res://gui/inbox_event_only.tscn").instantiate()
else:
ldis = preload("res://gui/inbox_message_subject.tscn").instantiate()
ldis.letter = l ldis.letter = l
%Letters.add_child(ldis) %Letters.add_child(ldis)
func open(): func open():
visible = true visible = true

View file

@ -2,6 +2,10 @@ extends VBoxContainer
func _ready() -> void: func _ready() -> void:
Economy.productions_update.connect(sync) Economy.productions_update.connect(sync)
UserContext.modal_command_change.connect(modal_command_change)
func modal_command_change(c: Command):
visible = c == null
func sync(productions: Array[Production]): func sync(productions: Array[Production]):
for child in get_children(): for child in get_children():

10
letters/event_letter.gd Normal file
View file

@ -0,0 +1,10 @@
extends Letter
class_name EventLetter
func start():
Dialogic.start(timeline)
await Dialogic.timeline_ended
GameState.remove_letter.emit(self)
func reply():
push_error("reply Not implemented!")

View file

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

View file

@ -5,8 +5,12 @@ extends "res://gui/currency_inspector_panel.gd"
func _ready() -> void: func _ready() -> void:
UserContext.currency_inspect.connect(currency_inspect) UserContext.currency_inspect.connect(currency_inspect)
UserContext.member_inspect.connect(member_inspect) UserContext.member_inspect.connect(member_inspect)
UserContext.modal_command_change.connect(modal_command_change)
update() update()
func modal_command_change(_c: Command):
visible = false
func member_inspect(m: CurrencyMemberSprite): func member_inspect(m: CurrencyMemberSprite):
if member != null: if member != null:
member.tree_exiting.disconnect(member_left) member.tree_exiting.disconnect(member_left)
@ -22,6 +26,9 @@ func member_left():
func clear_bribes(): func clear_bribes():
for child in %BribesList.get_children(): for child in %BribesList.get_children():
child.queue_free() child.queue_free()
func clear_commands():
for child in %CommandsList.get_children():
child.queue_free()
func bribe_success(): func bribe_success():
member.allegiance = preload("res://allegiance/good.tres") member.allegiance = preload("res://allegiance/good.tres")
@ -35,6 +42,13 @@ func load_bribes():
btn.bribe_succees.connect(bribe_success) btn.bribe_succees.connect(bribe_success)
%BribesList.add_child(btn) %BribesList.add_child(btn)
func load_commands():
for p in member.currency.commands:
var btn := preload("res://commands/command_button.tscn").instantiate()
btn.command = p
btn.command_succcess.connect(UserContext.modal)
%CommandsList.add_child(btn)
func currency_inspect(_c: Currency): func currency_inspect(_c: Currency):
visible = false visible = false
@ -47,8 +61,13 @@ func update():
%CurrencyMemberSprite.allegiance = member.allegiance %CurrencyMemberSprite.allegiance = member.allegiance
%CurrencyMemberSprite.sync() %CurrencyMemberSprite.sync()
clear_bribes() clear_bribes()
clear_commands()
%Bribes.visible = false %Bribes.visible = false
%Commands.visible = true
if member.allegiance != preload("res://allegiance/good.tres"): if member.allegiance != preload("res://allegiance/good.tres"):
load_bribes() load_bribes()
%Bribes.visible = true %Bribes.visible = true
%Commands.visible = false
else:
load_commands()

View file

@ -39,3 +39,12 @@ text = "Bribe with"
[node name="BribesList" type="VBoxContainer" parent="VBoxContainer" parent_id_path=PackedInt32Array(362599487) index="10" unique_id=476203914] [node name="BribesList" type="VBoxContainer" parent="VBoxContainer" parent_id_path=PackedInt32Array(362599487) index="10" unique_id=476203914]
unique_name_in_owner = true unique_name_in_owner = true
layout_mode = 2 layout_mode = 2
[node name="Commands" type="Label" parent="VBoxContainer" parent_id_path=PackedInt32Array(362599487) index="11" unique_id=87746800]
unique_name_in_owner = true
layout_mode = 2
text = "Command"
[node name="CommandsList" type="VBoxContainer" parent="VBoxContainer" parent_id_path=PackedInt32Array(362599487) index="12" unique_id=73835062]
unique_name_in_owner = true
layout_mode = 2

12
test/command_modal.gd Normal file
View file

@ -0,0 +1,12 @@
extends Label
func _ready() -> void:
UserContext.modal_command_change.connect(modal_command_change)
modal_command_change(null)
func modal_command_change(c: Command):
if c == null:
visible = false
return
visible = true
text = c.modal_name + " " + UserContext.selected_member.currency.name

View file

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

View file

@ -6,11 +6,9 @@ func _on_get_cow_pressed() -> void:
p.amount += 1 p.amount += 1
func _on_run_simulate_pressed() -> void: func _on_run_simulate_pressed() -> void:
Economy.simulate() Economy.simulate()
func _on_open_inbox_pressed() -> void: func _on_open_inbox_pressed() -> void:
UserContext.open_inbox.emit() UserContext.open_inbox.emit()
LetterGeneration.try_generate_offer()

View file

@ -9,6 +9,7 @@
[ext_resource type="PackedScene" uid="uid://coebykrbnhlif" path="res://currency/members/MemberSprite.tscn" id="6_vua3v"] [ext_resource type="PackedScene" uid="uid://coebykrbnhlif" path="res://currency/members/MemberSprite.tscn" id="6_vua3v"]
[ext_resource type="Resource" uid="uid://ihsvxienxbeu" path="res://currency/sentient/knight.tres" id="7_s0mui"] [ext_resource type="Resource" uid="uid://ihsvxienxbeu" path="res://currency/sentient/knight.tres" id="7_s0mui"]
[ext_resource type="Resource" uid="uid://dfbgxc6nlcjct" path="res://allegiance/bad.tres" id="8_i7808"] [ext_resource type="Resource" uid="uid://dfbgxc6nlcjct" path="res://allegiance/bad.tres" id="8_i7808"]
[ext_resource type="Script" uid="uid://cvwxv4hfw4u0o" path="res://test/command_modal.gd" id="10_ccsa3"]
[node name="TestEconomy" type="Control" unique_id=629898212] [node name="TestEconomy" type="Control" unique_id=629898212]
layout_mode = 3 layout_mode = 3
@ -17,6 +18,7 @@ anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_s48qe") script = ExtResource("1_s48qe")
[node name="ScrollContainer2" type="ScrollContainer" parent="." unique_id=872959271] [node name="ScrollContainer2" type="ScrollContainer" parent="." unique_id=872959271]
@ -69,18 +71,15 @@ text = "Get cow"
layout_mode = 2 layout_mode = 2
text = "Run simulate" text = "Run simulate"
[node name="OpenInbox" type="Button" parent="Control/VBoxContainer" unique_id=1148713984]
layout_mode = 2
text = "OpenInbox"
[node name="CurrencyInspectorPanel" parent="." unique_id=169191981 instance=ExtResource("4_7ya5o")] [node name="CurrencyInspectorPanel" parent="." unique_id=169191981 instance=ExtResource("4_7ya5o")]
layout_mode = 1 layout_mode = 1
offset_left = -467.0
offset_right = 33.0
[node name="MemberInspectorPanel" parent="." unique_id=1641024074 instance=ExtResource("5_i7808")] [node name="MemberInspectorPanel" parent="." unique_id=1641024074 instance=ExtResource("5_i7808")]
custom_minimum_size = Vector2(0, 100)
layout_mode = 1 layout_mode = 1
offset_left = -189.0 offset_left = -468.0
offset_right = -189.0 offset_right = 32.0
[node name="InboxPanel" parent="." unique_id=534578339 instance=ExtResource("5_n4oyp")] [node name="InboxPanel" parent="." unique_id=534578339 instance=ExtResource("5_n4oyp")]
layout_mode = 1 layout_mode = 1
@ -99,8 +98,37 @@ offset_bottom = 406.0
currency = ExtResource("7_s0mui") currency = ExtResource("7_s0mui")
allegiance = ExtResource("8_i7808") allegiance = ExtResource("8_i7808")
[node name="CommandModal" type="Label" parent="." unique_id=562980582]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -63.0
offset_top = 19.0
offset_right = 64.0
offset_bottom = 42.0
grow_horizontal = 2
theme_override_font_sizes/font_size = 52
text = "<Commanding!>"
script = ExtResource("10_ccsa3")
[node name="OpenInbox" type="Button" parent="." unique_id=1148713984]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -114.0
offset_top = -64.0
offset_right = -20.0
offset_bottom = -33.0
grow_horizontal = 0
grow_vertical = 0
text = "OpenInbox"
[connection signal="pressed" from="Control/VBoxContainer/GetCow" to="." method="_on_get_cow_pressed"] [connection signal="pressed" from="Control/VBoxContainer/GetCow" to="." method="_on_get_cow_pressed"]
[connection signal="pressed" from="Control/VBoxContainer/RunSimulate" to="." method="_on_run_simulate_pressed"] [connection signal="pressed" from="Control/VBoxContainer/RunSimulate" to="." method="_on_run_simulate_pressed"]
[connection signal="pressed" from="Control/VBoxContainer/OpenInbox" to="." method="_on_open_inbox_pressed"] [connection signal="pressed" from="OpenInbox" to="." method="_on_open_inbox_pressed"]
[editable path="MemberSprite"] [editable path="MemberSprite"]

View file

@ -5,12 +5,20 @@ const SPEED = 100.0
const JUMP_VELOCITY = -400.0 const JUMP_VELOCITY = -400.0
@export var target : Node2D @export var target : Node2D
func _ready() -> void:
UserContext. set_target_for . connect(set_target_for)
func set_target_for(who: CurrencyMemberSprite, t: Node2D):
if %MemberSprite == who:
if target != null:
target.tree_exiting.disconnect(removed_target)
t.tree_exiting.connect(removed_target)
target = t
UserContext.modal(null)
func removed_target():
target = null
func _get_target(event) -> void:
if target != null:
return
if UserContext.selected_member == self:
pass
#func _Direction() -> Vector2: #func _Direction() -> Vector2:
#self.position = self.position.move_toward(target.transform.position, speed * delta) #self.position = self.position.move_toward(target.transform.position, speed * delta)

View file

@ -8,19 +8,44 @@ signal member_inspect(c: CurrencyMemberSprite)
@warning_ignore("unused_signal") @warning_ignore("unused_signal")
signal open_inbox signal open_inbox
signal set_target_for(who: CurrencyMemberSprite, target: Node2D)
var selected_member: CurrencyMemberSprite = null var selected_member: CurrencyMemberSprite = null
var focused_members: Array[CurrencyMemberSprite] = [] var focused_members: Array[CurrencyMemberSprite] = []
signal selected_member_change(current: CurrencyMemberSprite) signal selected_member_change(current: CurrencyMemberSprite)
var modal_command: Command
signal modal_command_change(c: Command)
func modal(c: Command):
modal_command = c
modal_command_change.emit(c)
func select_focused_member(): func select_focused_member():
if modal_command is MoveCommand:
if focused_member() == selected_member:
modal(null)
return
set_target_for.emit(selected_member, focused_member().get_parent())
return
var candidate := focused_member() var candidate := focused_member()
if candidate == null: if candidate == null:
return return
if selected_member != null:
unselect_member()
selected_member = candidate selected_member = candidate
selected_member.tree_exiting.connect(unselect_member)
selected_member_change.emit(selected_member) selected_member_change.emit(selected_member)
UserContext.member_inspect.emit(selected_member) UserContext.member_inspect.emit(selected_member)
func unselect_member():
if selected_member == null:
return
selected_member.tree_exiting.disconnect(unselect_member)
selected_member = null
func focused_member() -> CurrencyMemberSprite: func focused_member() -> CurrencyMemberSprite:
if focused_members.size() == 0: if focused_members.size() == 0:
return null return null