diff --git a/currency/currency.gd b/currency/currency.gd index aa3d55e..1ed9b57 100644 --- a/currency/currency.gd +++ b/currency/currency.gd @@ -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 diff --git a/currency/members/member_sprite.gd b/currency/members/member_sprite.gd index 2c3cd57..cc2deb3 100644 --- a/currency/members/member_sprite.gd +++ b/currency/members/member_sprite.gd @@ -25,3 +25,6 @@ func _input(event: InputEvent) -> void: func get_allegiance(): return allegiance.kingdom_name + +func get_combat(): + return currency.soldier diff --git a/currency/sentient/archer.tres b/currency/sentient/archer.tres index d93ccd4..c704edd 100644 --- a/currency/sentient/archer.tres +++ b/currency/sentient/archer.tres @@ -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" diff --git a/currency/sentient/calvary.tres b/currency/sentient/calvary.tres index 6a4f023..8965c25 100644 --- a/currency/sentient/calvary.tres +++ b/currency/sentient/calvary.tres @@ -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" diff --git a/currency/sentient/dinosaur.tres b/currency/sentient/dinosaur.tres index aba434f..1bc6459 100644 --- a/currency/sentient/dinosaur.tres +++ b/currency/sentient/dinosaur.tres @@ -132,4 +132,5 @@ 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_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" diff --git a/currency/sentient/kings_guard.tres b/currency/sentient/kings_guard.tres index 7f0d66f..699cbb9 100644 --- a/currency/sentient/kings_guard.tres +++ b/currency/sentient/kings_guard.tres @@ -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" diff --git a/currency/sentient/knight.tres b/currency/sentient/knight.tres index d5fbb8e..0ff92ef 100644 --- a/currency/sentient/knight.tres +++ b/currency/sentient/knight.tres @@ -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" diff --git a/currency/sentient/mercenary.tres b/currency/sentient/mercenary.tres index 3d541e3..a8abc91 100644 --- a/currency/sentient/mercenary.tres +++ b/currency/sentient/mercenary.tres @@ -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" diff --git a/currency/sentient/wizard.tres b/currency/sentient/wizard.tres index 005cf95..ebd3af4 100644 --- a/currency/sentient/wizard.tres +++ b/currency/sentient/wizard.tres @@ -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" diff --git a/map.tscn b/map.tscn index aafd3ff..0639dc7 100644 --- a/map.tscn +++ b/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) diff --git a/troup.gd b/troup.gd index d2586f4..f3e2cab 100644 --- a/troup.gd +++ b/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: