asdsad
This commit is contained in:
commit
aa6b04212d
18 changed files with 135 additions and 5 deletions
|
|
@ -8,3 +8,4 @@ class_name Currency
|
|||
@export var color: Color = Color.PINK
|
||||
@export var wants: Array[Production]
|
||||
@export var commands: Array[Command] = [preload("res://commands/move_command.tres")]
|
||||
@export var soldier: bool
|
||||
|
|
|
|||
|
|
@ -25,3 +25,6 @@ func _input(event: InputEvent) -> void:
|
|||
|
||||
func get_allegiance():
|
||||
return allegiance.kingdom_name
|
||||
|
||||
func get_combat():
|
||||
return currency.soldier
|
||||
|
|
|
|||
|
|
@ -49,4 +49,5 @@ production = Array[ExtResource("1_m37xt")]([ExtResource("2_b0duy"), ExtResource(
|
|||
description = "arrow go fweeewww"
|
||||
color = Color(1.1310726e-06, 0.67725253, 0.15828604, 1)
|
||||
wants = Array[ExtResource("1_m37xt")]([SubResource("Resource_ui157"), SubResource("Resource_ah5vq"), SubResource("Resource_2437s"), SubResource("Resource_n5gpp"), SubResource("Resource_b1lqu")])
|
||||
soldier = true
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -49,4 +49,5 @@ production = Array[ExtResource("1_cnnt2")]([ExtResource("2_hqcau"), ExtResource(
|
|||
description = "save a horse ride a cowboy or something."
|
||||
color = Color(1, 0.14509805, 0.08627451, 1)
|
||||
wants = Array[ExtResource("1_cnnt2")]([SubResource("Resource_ui157"), SubResource("Resource_ah5vq"), SubResource("Resource_2437s"), SubResource("Resource_n5gpp"), SubResource("Resource_b1lqu")])
|
||||
soldier = true
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -110,5 +110,7 @@ name = "Dinosaur"
|
|||
description = "*rawrs at you gayly and prehistorically*"
|
||||
thumbnail = ExtResource("3_bufop")
|
||||
color = Color(1, 0.48235294, 0, 1)
|
||||
wants = Array[ExtResource("1_qayfp")]([SubResource("Resource_unbv5"), SubResource("Resource_awlnm"), SubResource("Resource_jihtj"), SubResource("Resource_utj6b"), SubResource("Resource_hi66y"), SubResource("Resource_mf31s"), SubResource("Resource_gdovn"), SubResource("Resource_ts66k"), SubResource("Resource_gt1pn"), SubResource("Resource_evrxh"), SubResource("Resource_b1bj4"), SubResource("Resource_mjehd"), SubResource("Resource_c4cgt"), SubResource("Resource_n7bnc")])
|
||||
|
||||
wants = Array[ExtResource("1_qayfp")]([SubResource("Resource_unbv5"), SubResource("Resource_awlnm"), SubResource("Resource_jihtj"), SubResource("Resource_utj6b"), SubResource("Resource_2b5sm"), SubResource("Resource_yq4u0"), SubResource("Resource_hi66y"), SubResource("Resource_mf31s"), SubResource("Resource_gdovn"), SubResource("Resource_ts66k"), SubResource("Resource_gt1pn"), SubResource("Resource_evrxh"), SubResource("Resource_b1bj4"), SubResource("Resource_mjehd"), SubResource("Resource_c6wya"), SubResource("Resource_c4cgt"), SubResource("Resource_n7bnc")])
|
||||
soldier = true
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -42,4 +42,5 @@ production = Array[ExtResource("1_f1fuf")]([ExtResource("2_s3h3i"), ExtResource(
|
|||
description = "better hope these guys are loyal."
|
||||
color = Color(0.54509807, 0, 1, 1)
|
||||
wants = Array[ExtResource("1_f1fuf")]([SubResource("Resource_1g3kj"), SubResource("Resource_kmdkm"), SubResource("Resource_3p8gt"), SubResource("Resource_m16xj")])
|
||||
soldier = true
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -35,4 +35,5 @@ production = Array[ExtResource("1_626vc")]([ExtResource("2_sa77c"), ExtResource(
|
|||
description = "Nighty night Knight"
|
||||
color = Color(0.54901963, 0, 0, 1)
|
||||
wants = Array[ExtResource("1_626vc")]([SubResource("Resource_ui157"), SubResource("Resource_ah5vq"), SubResource("Resource_2437s")])
|
||||
soldier = true
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -21,4 +21,5 @@ production = Array[ExtResource("1_81xhi")]([ExtResource("2_x1puw"), ExtResource(
|
|||
description = "For some reason I always think of masonry when I read this word."
|
||||
color = Color(0.36862746, 0.3019608, 0.7529412, 1)
|
||||
wants = Array[ExtResource("1_81xhi")]([SubResource("Resource_3og8x")])
|
||||
soldier = true
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
|
|
@ -69,4 +69,5 @@ production = Array[ExtResource("1_05kyk")]([ExtResource("2_ud150"), ExtResource(
|
|||
description = "FIREBALL!!!"
|
||||
color = Color(0, 0, 0.79607844, 1)
|
||||
wants = Array[ExtResource("1_05kyk")]([SubResource("Resource_60ga3"), SubResource("Resource_i5jpd"), SubResource("Resource_2l2nr"), SubResource("Resource_6v7ae"), SubResource("Resource_iph2q"), SubResource("Resource_i8tft"), SubResource("Resource_j0xkl")])
|
||||
soldier = true
|
||||
metadata/_custom_type_script = "uid://hcvynq5fjypj"
|
||||
|
|
|
|||
10
economy.gd
10
economy.gd
|
|
@ -3,6 +3,7 @@ extends Node
|
|||
signal productions_update(p: Array[Production])
|
||||
@warning_ignore("unused_signal")
|
||||
signal production_log(producer: Currency, p: Production)
|
||||
@warning_ignore("unused_signal")
|
||||
signal log(s: String)
|
||||
@export var currencies: Array[Production]
|
||||
@export var members: Array
|
||||
|
|
@ -65,6 +66,7 @@ func produce(production: Production):
|
|||
sync_currency.call_deferred()
|
||||
var c := get_currency(production.currency)
|
||||
c.amount += production.amount
|
||||
c.amount = clamp(c.amount, 0, 9999)
|
||||
|
||||
func update_currencies():
|
||||
productions_update.emit.call_deferred(currencies)
|
||||
|
|
@ -79,6 +81,10 @@ func simulate():
|
|||
update_currencies()
|
||||
for e in events:
|
||||
if e.requirements_satisfied() and e.will_happen():
|
||||
if e.game_over_timeline != null:
|
||||
get_tree().change_scene_to_file("res://game_over.tscn")
|
||||
Dialogic.start(e.game_over_timeline)
|
||||
return
|
||||
if e.log_message != "" and not e.skip_log:
|
||||
Economy.log.emit(e.log_message)
|
||||
var outcome := e.outcome()
|
||||
|
|
@ -111,8 +117,12 @@ func get_all_inanimate_currencies() -> Array:
|
|||
func _ready() -> void:
|
||||
%SimulateTickTimer.start()
|
||||
update_currencies()
|
||||
log.emit.call_deferred("Welcome to your kingdom!")
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
if get_tree().current_scene.scene_file_path != "res://game.tscn":
|
||||
%SimulateTickTimer.start()
|
||||
return
|
||||
if Dialogic.current_timeline != null:
|
||||
%SimulateTickTimer.start()
|
||||
return
|
||||
|
|
|
|||
6
game_over.gd
Normal file
6
game_over.gd
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
extends Control
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
await Dialogic.timeline_ended
|
||||
get_tree().quit()
|
||||
1
game_over.gd.uid
Normal file
1
game_over.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://newnma6kkptj
|
||||
21
game_over.tscn
Normal file
21
game_over.tscn
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
[gd_scene format=3 uid="uid://cqfexy3yy3tbr"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://newnma6kkptj" path="res://game_over.gd" id="1_y26ei"]
|
||||
|
||||
[node name="GameOver" type="Control" unique_id=880250183]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_y26ei")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="." unique_id=619694373]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 1)
|
||||
4
map.tscn
4
map.tscn
|
|
@ -7,7 +7,6 @@
|
|||
[ext_resource type="Resource" uid="uid://dlxnbyiurne1s" path="res://currency/sentient/calvary.tres" id="4_iw27f"]
|
||||
[ext_resource type="Resource" uid="uid://b7lxfjhx4qhts" path="res://allegiance/good.tres" id="5_71pa8"]
|
||||
[ext_resource type="Resource" uid="uid://dn0c1pfq04obw" path="res://currency/sentient/farmer.tres" id="6_05x41"]
|
||||
[ext_resource type="Resource" uid="uid://l8osuuxl7exe" path="res://currency/sentient/archer.tres" id="8_oysan"]
|
||||
[ext_resource type="Resource" uid="uid://clx8tbrad4m7c" path="res://currency/sentient/dinosaur.tres" id="9_sb2pt"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_bhunq"]
|
||||
|
|
@ -180,6 +179,7 @@ allegiance = ExtResource("5_71pa8")
|
|||
position = Vector2(905, 42)
|
||||
|
||||
[node name="MemberSprite" parent="CharacterBody2D3" index="1" unique_id=283117283]
|
||||
currency = ExtResource("9_sb2pt")
|
||||
allegiance = ExtResource("5_71pa8")
|
||||
|
||||
[node name="CharacterBody2D4" parent="." unique_id=327546409 instance=ExtResource("3_e0an3")]
|
||||
|
|
@ -245,7 +245,7 @@ currency = ExtResource("6_05x41")
|
|||
position = Vector2(853, -17.999998)
|
||||
|
||||
[node name="MemberSprite" parent="CharacterBody2D12" index="1" unique_id=283117283]
|
||||
currency = ExtResource("8_oysan")
|
||||
currency = ExtResource("9_sb2pt")
|
||||
|
||||
[node name="CharacterBody2D13" parent="." unique_id=799583982 instance=ExtResource("3_e0an3")]
|
||||
position = Vector2(905.99994, -11.999985)
|
||||
|
|
|
|||
10
start_screen.gd
Normal file
10
start_screen.gd
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
extends Control
|
||||
|
||||
func _on_button_pressed() -> void:
|
||||
Dialogic.start(preload("res://test/timeline.dtl"))
|
||||
await Dialogic.timeline_ended
|
||||
get_tree().change_scene_to_file("res://game.tscn")
|
||||
|
||||
|
||||
func _on_button_2_pressed() -> void:
|
||||
get_tree().change_scene_to_file("res://game.tscn")
|
||||
1
start_screen.gd.uid
Normal file
1
start_screen.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://qt8u20vettgk
|
||||
59
start_screen.tscn
Normal file
59
start_screen.tscn
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
[gd_scene format=3 uid="uid://d1hx10534r452"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://qt8u20vettgk" path="res://start_screen.gd" id="1_ncxyx"]
|
||||
|
||||
[node name="StartScreen" type="Control" unique_id=637740603]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_ncxyx")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="." unique_id=490588497]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 1)
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=384868949]
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -54.0
|
||||
offset_top = -71.0
|
||||
offset_right = 54.0
|
||||
offset_bottom = -31.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="Button" type="Button" parent="HBoxContainer" unique_id=1726767847]
|
||||
layout_mode = 2
|
||||
text = "Play Game"
|
||||
|
||||
[node name="Button2" type="Button" parent="HBoxContainer" unique_id=783169397]
|
||||
layout_mode = 2
|
||||
text = "Skip Intro"
|
||||
|
||||
[node name="Label" type="Label" parent="." unique_id=380038515]
|
||||
layout_mode = 1
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
offset_left = -481.0
|
||||
offset_top = 77.0
|
||||
offset_right = 482.0
|
||||
offset_bottom = 169.0
|
||||
grow_horizontal = 2
|
||||
theme_override_font_sizes/font_size = 72
|
||||
text = "For King and Currency"
|
||||
|
||||
[connection signal="pressed" from="HBoxContainer/Button" to="." method="_on_button_pressed"]
|
||||
[connection signal="pressed" from="HBoxContainer/Button2" to="." method="_on_button_2_pressed"]
|
||||
14
troup.gd
14
troup.gd
|
|
@ -21,8 +21,18 @@ func removed_target():
|
|||
target = null
|
||||
|
||||
func combat(target):
|
||||
if get_node("MemberSprite").get_combat() == false:
|
||||
var p := Production.new()
|
||||
p.amount = -1
|
||||
p.currency = %MemberSprite.currency
|
||||
Economy.produce(p)
|
||||
self.queue_free()
|
||||
return
|
||||
var winner = randf_range(0,2)
|
||||
print(winner)
|
||||
if %MemberSprite.currency.name == "Dinosaur" or %MemberSprite.currency.name == "Wizard":
|
||||
winner -= 0.5
|
||||
if target.get_node("MemberSprite").currency.name == "Dinosaur" or target.get_node("MemberSprite").currency.name == "Wizard":
|
||||
winner += 0.5
|
||||
if winner <= 1:
|
||||
target.queue_free()
|
||||
else:
|
||||
|
|
@ -30,7 +40,7 @@ func combat(target):
|
|||
p.amount = -1
|
||||
p.currency = %MemberSprite.currency
|
||||
Economy.produce(p)
|
||||
|
||||
Economy.log.emit("A " + p.currency.name +" died in combat!")
|
||||
self.queue_free()
|
||||
|
||||
#func _Direction() -> Vector2:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue