Compare commits
No commits in common. "8c628ddf602f911750c57d260d7881cafdf2ec6f" and "eedc1a603415e12df345dd353550853e064723d1" have entirely different histories.
8c628ddf60
...
eedc1a6034
43 changed files with 21 additions and 243 deletions
|
|
@ -16,7 +16,6 @@ position = Vector2(50, 49)
|
|||
shape = SubResource("RectangleShape2D_riqys")
|
||||
|
||||
[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_width = 0.16
|
||||
instance_shader_parameters/fill_color = Color(1, 0.7529412, 0.79607844, 1)
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
extends Resource
|
||||
class_name Command
|
||||
|
||||
@export var name: String
|
||||
@export var modal_name: String
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://cn8rc6jyllrf0
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
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)
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://m5qf37ordikh
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
[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
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
extends Command
|
||||
class_name MoveCommand
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://jxfw3ptlwg8d
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
[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"
|
||||
|
|
@ -7,4 +7,3 @@ class_name Currency
|
|||
@export var thumbnail: Texture2D
|
||||
@export var color: Color = Color.PINK
|
||||
@export var wants: Array[Production]
|
||||
@export var commands: Array[Command] = [preload("res://commands/move_command.tres")]
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ shader = ExtResource("1_tm326")
|
|||
[sub_resource type="CanvasTexture" id="CanvasTexture_wgite"]
|
||||
|
||||
[node name="MemberSprite" type="TextureRect" unique_id=283117283]
|
||||
z_index = 100
|
||||
material = SubResource("ShaderMaterial_tm326")
|
||||
mouse_default_cursor_shape = 2
|
||||
texture = SubResource("CanvasTexture_wgite")
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
[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://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://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://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"]
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
[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://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://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://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"]
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
[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://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="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="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"]
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
[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://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="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="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"]
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
[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://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://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"]
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
[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://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://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://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"]
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
[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://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://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"]
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
[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://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://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"]
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
[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://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://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"]
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
[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://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="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://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"]
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
[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://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="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://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"]
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
[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://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://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://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"]
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
[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://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="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://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"]
|
||||
|
|
|
|||
|
|
@ -83,9 +83,7 @@ func simulate():
|
|||
produce(o)
|
||||
production_log.emit(null, o)
|
||||
if e.timeline != null:
|
||||
GameState.add_letter.emit(e.into_letter())
|
||||
if randf() < 0.01:
|
||||
LetterGeneration.try_generate_offer()
|
||||
Dialogic.start(e.timeline)
|
||||
|
||||
|
||||
func get_all_currencies_in(dir: StringName):
|
||||
|
|
|
|||
10
event.gd
10
event.gd
|
|
@ -9,10 +9,8 @@ enum EventNature {
|
|||
Random,
|
||||
Certain,
|
||||
}
|
||||
@export var probability: float = 0.01
|
||||
@export var probability: float = 0.005
|
||||
@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:
|
||||
for requirement in requirements:
|
||||
|
|
@ -30,9 +28,3 @@ func outcome() -> Array[Production]:
|
|||
stuff.append_array(extra_mods)
|
||||
return stuff
|
||||
|
||||
func into_letter() -> EventLetter:
|
||||
var el := EventLetter.new()
|
||||
el.source = email_source
|
||||
el.subject_field = email_subject
|
||||
el.timeline = timeline
|
||||
return el
|
||||
|
|
|
|||
11
game.tscn
11
game.tscn
|
|
@ -2,9 +2,6 @@
|
|||
|
||||
[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://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]
|
||||
|
||||
|
|
@ -13,11 +10,3 @@
|
|||
[node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=1213874033]
|
||||
|
||||
[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")
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
[ext_resource type="Script" uid="uid://olr6663hny8n" path="res://bribe_button.gd" id="1_2abdb"]
|
||||
|
||||
[node name="BribeButton" type="Button" unique_id=1084248382]
|
||||
custom_minimum_size = Vector2(0, 50)
|
||||
text = "< num > of < currency >"
|
||||
script = ExtResource("1_2abdb")
|
||||
|
||||
|
|
|
|||
|
|
@ -5,12 +5,8 @@ var currency: Currency = null
|
|||
func _ready() -> void:
|
||||
UserContext.currency_inspect.connect(currency_inspect)
|
||||
UserContext.member_inspect.connect(member_inspect)
|
||||
UserContext.modal_command_change.connect(modal_command_change)
|
||||
update()
|
||||
|
||||
func modal_command_change(_c: Command):
|
||||
visible = false
|
||||
|
||||
func member_inspect(_m: CurrencyMemberSprite):
|
||||
visible = false
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
[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
|
||||
|
|
@ -7,9 +7,8 @@ func _ready() -> void:
|
|||
%Source.text = letter.source.name
|
||||
%Subject.text = letter.subject_field
|
||||
|
||||
func on_remove_letter(l: Letter):
|
||||
if letter == l:
|
||||
queue_free()
|
||||
func on_remove_letter(_l: Letter):
|
||||
queue_free()
|
||||
|
||||
func _on_pressed() -> void:
|
||||
letter.start()
|
||||
|
|
|
|||
|
|
@ -6,14 +6,11 @@ func _ready() -> void:
|
|||
visible = false
|
||||
|
||||
func add_letter(l: Letter):
|
||||
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()
|
||||
var ldis := preload("res://gui/inbox_message_subject.tscn").instantiate()
|
||||
ldis.letter = l
|
||||
%Letters.add_child(ldis)
|
||||
|
||||
|
||||
func open():
|
||||
visible = true
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,6 @@ extends VBoxContainer
|
|||
|
||||
func _ready() -> void:
|
||||
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]):
|
||||
for child in get_children():
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
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!")
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://d30k84i53crwu
|
||||
|
|
@ -5,12 +5,8 @@ extends "res://gui/currency_inspector_panel.gd"
|
|||
func _ready() -> void:
|
||||
UserContext.currency_inspect.connect(currency_inspect)
|
||||
UserContext.member_inspect.connect(member_inspect)
|
||||
UserContext.modal_command_change.connect(modal_command_change)
|
||||
update()
|
||||
|
||||
func modal_command_change(_c: Command):
|
||||
visible = false
|
||||
|
||||
func member_inspect(m: CurrencyMemberSprite):
|
||||
if member != null:
|
||||
member.tree_exiting.disconnect(member_left)
|
||||
|
|
@ -26,9 +22,6 @@ func member_left():
|
|||
func clear_bribes():
|
||||
for child in %BribesList.get_children():
|
||||
child.queue_free()
|
||||
func clear_commands():
|
||||
for child in %CommandsList.get_children():
|
||||
child.queue_free()
|
||||
|
||||
func bribe_success():
|
||||
member.allegiance = preload("res://allegiance/good.tres")
|
||||
|
|
@ -42,13 +35,6 @@ func load_bribes():
|
|||
btn.bribe_succees.connect(bribe_success)
|
||||
%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):
|
||||
visible = false
|
||||
|
|
@ -61,13 +47,8 @@ func update():
|
|||
%CurrencyMemberSprite.allegiance = member.allegiance
|
||||
%CurrencyMemberSprite.sync()
|
||||
clear_bribes()
|
||||
clear_commands()
|
||||
%Bribes.visible = false
|
||||
%Commands.visible = true
|
||||
if member.allegiance != preload("res://allegiance/good.tres"):
|
||||
load_bribes()
|
||||
%Bribes.visible = true
|
||||
%Commands.visible = false
|
||||
else:
|
||||
load_commands()
|
||||
|
||||
|
|
|
|||
|
|
@ -39,12 +39,3 @@ text = "Bribe with"
|
|||
[node name="BribesList" type="VBoxContainer" parent="VBoxContainer" parent_id_path=PackedInt32Array(362599487) index="10" unique_id=476203914]
|
||||
unique_name_in_owner = true
|
||||
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
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
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
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://cvwxv4hfw4u0o
|
||||
|
|
@ -6,9 +6,11 @@ func _on_get_cow_pressed() -> void:
|
|||
p.amount += 1
|
||||
|
||||
|
||||
|
||||
func _on_run_simulate_pressed() -> void:
|
||||
Economy.simulate()
|
||||
|
||||
|
||||
func _on_open_inbox_pressed() -> void:
|
||||
UserContext.open_inbox.emit()
|
||||
LetterGeneration.try_generate_offer()
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
[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://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]
|
||||
layout_mode = 3
|
||||
|
|
@ -18,7 +17,6 @@ anchor_right = 1.0
|
|||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
script = ExtResource("1_s48qe")
|
||||
|
||||
[node name="ScrollContainer2" type="ScrollContainer" parent="." unique_id=872959271]
|
||||
|
|
@ -71,15 +69,18 @@ text = "Get cow"
|
|||
layout_mode = 2
|
||||
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")]
|
||||
layout_mode = 1
|
||||
offset_left = -467.0
|
||||
offset_right = 33.0
|
||||
|
||||
[node name="MemberInspectorPanel" parent="." unique_id=1641024074 instance=ExtResource("5_i7808")]
|
||||
custom_minimum_size = Vector2(0, 100)
|
||||
layout_mode = 1
|
||||
offset_left = -468.0
|
||||
offset_right = 32.0
|
||||
offset_left = -189.0
|
||||
offset_right = -189.0
|
||||
|
||||
[node name="InboxPanel" parent="." unique_id=534578339 instance=ExtResource("5_n4oyp")]
|
||||
layout_mode = 1
|
||||
|
|
@ -98,37 +99,8 @@ offset_bottom = 406.0
|
|||
currency = ExtResource("7_s0mui")
|
||||
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/RunSimulate" to="." method="_on_run_simulate_pressed"]
|
||||
[connection signal="pressed" from="OpenInbox" to="." method="_on_open_inbox_pressed"]
|
||||
[connection signal="pressed" from="Control/VBoxContainer/OpenInbox" to="." method="_on_open_inbox_pressed"]
|
||||
|
||||
[editable path="MemberSprite"]
|
||||
|
|
|
|||
17
troup.gd
17
troup.gd
|
|
@ -5,19 +5,12 @@ const SPEED = 100.0
|
|||
const JUMP_VELOCITY = -400.0
|
||||
@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
|
||||
|
||||
func removed_target():
|
||||
target = null
|
||||
|
||||
func _get_target(event) -> void:
|
||||
if target != null:
|
||||
return
|
||||
if UserContext.selected_member == self:
|
||||
pass
|
||||
|
||||
#func _Direction() -> Vector2:
|
||||
#self.position = self.position.move_toward(target.transform.position, speed * delta)
|
||||
|
|
|
|||
|
|
@ -8,44 +8,19 @@ signal member_inspect(c: CurrencyMemberSprite)
|
|||
|
||||
@warning_ignore("unused_signal")
|
||||
signal open_inbox
|
||||
signal set_target_for(who: CurrencyMemberSprite, target: Node2D)
|
||||
|
||||
var selected_member: CurrencyMemberSprite = null
|
||||
var focused_members: Array[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():
|
||||
if modal_command is MoveCommand:
|
||||
if focused_member() == selected_member:
|
||||
modal(null)
|
||||
return
|
||||
set_target_for.emit(selected_member, focused_member())
|
||||
return
|
||||
var candidate := focused_member()
|
||||
if candidate == null:
|
||||
return
|
||||
if selected_member != null:
|
||||
unselect_member()
|
||||
selected_member = candidate
|
||||
selected_member.tree_exiting.connect(unselect_member)
|
||||
selected_member_change.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:
|
||||
if focused_members.size() == 0:
|
||||
return null
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue