From 16c92a49038be1e4449f4e0c6ec7f0e6676f9619 Mon Sep 17 00:00:00 2001 From: Lexi Quinn Date: Sat, 23 Aug 2025 20:27:22 +1000 Subject: [PATCH] Added decent remix system --- Scenes/ShopStand/shop_stand.gd | 1 + Scenes/TowerBase/tower_base.gd | 21 +++- .../ExtendedBarrel/extended_barrel.gd | 6 ++ .../ExtendedBarrel/extended_barrel.gd.uid | 1 + .../extended_barrel_feature.tres | 12 +++ .../ExtendedBarrel/extended_barrel_icon.png | Bin 0 -> 728 bytes .../extended_barrel_icon.png.import | 34 +++++++ .../Features/HeavyRounds/HeavyRounds_icon.png | Bin 0 -> 816 bytes .../HeavyRounds/HeavyRounds_icon.png.import | 34 +++++++ Scripts/Features/HeavyRounds/heavy_rounds.gd | 10 ++ .../Features/HeavyRounds/heavy_rounds.gd.uid | 1 + .../HeavyRounds/heavy_rounds_feature.tres | 12 +++ Scripts/Features/Radar/radar.gd | 6 ++ Scripts/Features/Radar/radar.gd.uid | 1 + Scripts/Features/Radar/radar_feature.tres | 11 +++ Scripts/Features/Radar/radar_icon.png | Bin 0 -> 802 bytes Scripts/Features/Radar/radar_icon.png.import | 34 +++++++ Scripts/Resources/card_text.gd | 26 ++++- Scripts/Resources/feature.gd | 15 +++ Scripts/Resources/feature.gd.uid | 1 + Scripts/card_hand.gd | 4 +- Scripts/data.gd | 5 + Scripts/game.gd | 2 + Towers/Ascension/tower_stats.tres | 29 ++---- Towers/Assault/tower_stats.tres | 27 ++---- Towers/Blowdart/tower_stats.tres | 26 ++--- Towers/BombLauncher/tower_stats.tres | 26 ++--- Towers/Fireball/tower_stats.tres | 26 ++--- Towers/Flamethrower/tower_stats.tres | 26 ++--- Towers/Gatling/tower_stats.tres | 38 ++------ Towers/GlueLauncher/tower_stats.tres | 26 ++--- Towers/Icicle/tower_stats.tres | 26 ++--- Towers/Overclock/tower_stats.tres | 29 ++---- Towers/Reactor/tower_stats.tres | 25 ++--- Towers/Refrigerator/tower_stats.tres | 26 ++--- Towers/RocketLauncher/tower_stats.tres | 35 +++---- Towers/Sniper/tower_stats.tres | 26 ++--- Towers/tower.gd | 1 + UI/CardSelectionBox/card_selection_box.tscn | 8 ++ Weapons/Ascension/weapon_stats.tres | 31 ++---- Weapons/Assault/weapon_stats.tres | 32 ++---- Weapons/Blowdart/weapon_stats.tres | 34 ++----- Weapons/BombLauncher/weapon_stats.tres | 34 ++----- Weapons/Fireball/weapon_stats.tres | 34 ++----- Weapons/Flamethrower/weapon_stats.tres | 34 ++----- Weapons/Gatling/weapon_stats.tres | 46 +++------ Weapons/GlueLauncher/weapon_stats.tres | 34 ++----- Weapons/Icicle/weapon_stats.tres | 34 ++----- Weapons/Overclock/weapon_stats.tres | 45 +++------ Weapons/Reactor/weapon_stats.tres | 34 ++----- Weapons/Refrigerator/weapon_stats.tres | 34 ++----- Weapons/RocketLauncher/weapon_stats.tres | 34 ++----- Weapons/Sniper/weapon_stats.tres | 34 ++----- Worlds/GreenPlanet/Levels/Bridge/bridge.tscn | 6 +- card_description_ui.gd | 60 ++++++++++++ card_description_ui.gd.uid | 1 + card_description_ui.tscn | 46 +++++++++ choose_card_screen.gd | 12 +-- choose_card_screen.tscn | 37 +------ feature_ui.gd | 10 ++ feature_ui.gd.uid | 1 + feature_ui.tscn | 25 +++++ remix_menu.gd | 91 ++++++++++++++++++ remix_menu.gd.uid | 1 + remix_menu.tscn | 81 ++++++++++++++++ remix_table.gd | 27 ++++++ remix_table.gd.uid | 1 + remix_table.tscn | 33 +++++++ 68 files changed, 885 insertions(+), 678 deletions(-) create mode 100644 Scripts/Features/ExtendedBarrel/extended_barrel.gd create mode 100644 Scripts/Features/ExtendedBarrel/extended_barrel.gd.uid create mode 100644 Scripts/Features/ExtendedBarrel/extended_barrel_feature.tres create mode 100644 Scripts/Features/ExtendedBarrel/extended_barrel_icon.png create mode 100644 Scripts/Features/ExtendedBarrel/extended_barrel_icon.png.import create mode 100644 Scripts/Features/HeavyRounds/HeavyRounds_icon.png create mode 100644 Scripts/Features/HeavyRounds/HeavyRounds_icon.png.import create mode 100644 Scripts/Features/HeavyRounds/heavy_rounds.gd create mode 100644 Scripts/Features/HeavyRounds/heavy_rounds.gd.uid create mode 100644 Scripts/Features/HeavyRounds/heavy_rounds_feature.tres create mode 100644 Scripts/Features/Radar/radar.gd create mode 100644 Scripts/Features/Radar/radar.gd.uid create mode 100644 Scripts/Features/Radar/radar_feature.tres create mode 100644 Scripts/Features/Radar/radar_icon.png create mode 100644 Scripts/Features/Radar/radar_icon.png.import create mode 100644 Scripts/Resources/feature.gd create mode 100644 Scripts/Resources/feature.gd.uid create mode 100644 card_description_ui.gd create mode 100644 card_description_ui.gd.uid create mode 100644 card_description_ui.tscn create mode 100644 feature_ui.gd create mode 100644 feature_ui.gd.uid create mode 100644 feature_ui.tscn create mode 100644 remix_menu.gd create mode 100644 remix_menu.gd.uid create mode 100644 remix_menu.tscn create mode 100644 remix_table.gd create mode 100644 remix_table.gd.uid create mode 100644 remix_table.tscn diff --git a/Scenes/ShopStand/shop_stand.gd b/Scenes/ShopStand/shop_stand.gd index 371fda6..62955e7 100644 --- a/Scenes/ShopStand/shop_stand.gd +++ b/Scenes/ShopStand/shop_stand.gd @@ -35,6 +35,7 @@ func close() -> void: func randomize_cards() -> void: #TODO: use seeded randomness + blanks_available = 5 var random_faction: int = randi_range(1, Card.Faction.values().size() - 1) var cheap_cards: Array[Card] = [] var medium_cards: Array[Card] = [] diff --git a/Scenes/TowerBase/tower_base.gd b/Scenes/TowerBase/tower_base.gd index 428f6f3..f56b26c 100644 --- a/Scenes/TowerBase/tower_base.gd +++ b/Scenes/TowerBase/tower_base.gd @@ -33,11 +33,28 @@ func set_float(value: float) -> void: func add_card(card: Card, caller_id: int) -> void: - networked_spawn_tower.rpc(Data.cards.find(card), caller_id) + inventory.add(card) + tower = inventory.item_at(0).turret_scene.instantiate() as Tower + tower.stats = inventory.item_at(0).tower_stats + tower.name = "tower" + tower.base_name = name + tower.owner_id = caller_id + tower.position = Vector3(0, 1.2, 0) + minimap_icon.modulate = Color.RED + duration = 999 + #enable_duration_sprites() + add_child(tower) func remove_card() -> void: - networked_remove_tower.rpc() + var card: Card = inventory.remove_at(0) + if !game_manager.card_gameplay: + game_manager.connected_players_nodes[tower.owner_id].add_card(card) + game_manager.connected_players_nodes[tower.owner_id].unready_self() + tower.queue_free() + #disable_duration_sprites() + tower = null + minimap_icon.modulate = Color.GREEN func toggle_collision() -> void: diff --git a/Scripts/Features/ExtendedBarrel/extended_barrel.gd b/Scripts/Features/ExtendedBarrel/extended_barrel.gd new file mode 100644 index 0000000..fabafa8 --- /dev/null +++ b/Scripts/Features/ExtendedBarrel/extended_barrel.gd @@ -0,0 +1,6 @@ +class_name ExtendedBarrelFeature +extends Feature + + +func attach_to_tower(tower_stats: CardText) -> void: + tower_stats.set_attribute("Range", tower_stats.get_attribute("Range") * (1.0 + (strength / 100.0))) diff --git a/Scripts/Features/ExtendedBarrel/extended_barrel.gd.uid b/Scripts/Features/ExtendedBarrel/extended_barrel.gd.uid new file mode 100644 index 0000000..c62ea59 --- /dev/null +++ b/Scripts/Features/ExtendedBarrel/extended_barrel.gd.uid @@ -0,0 +1 @@ +uid://dwff1058vp6af diff --git a/Scripts/Features/ExtendedBarrel/extended_barrel_feature.tres b/Scripts/Features/ExtendedBarrel/extended_barrel_feature.tres new file mode 100644 index 0000000..b9bf4f8 --- /dev/null +++ b/Scripts/Features/ExtendedBarrel/extended_barrel_feature.tres @@ -0,0 +1,12 @@ +[gd_resource type="Resource" script_class="ExtendedBarrelFeature" load_steps=3 format=3 uid="uid://bij61ul87ka0r"] + +[ext_resource type="Script" uid="uid://dwff1058vp6af" path="res://Scripts/Features/ExtendedBarrel/extended_barrel.gd" id="1_5j68e"] +[ext_resource type="Texture2D" uid="uid://dixdtcy64v4s0" path="res://Scripts/Features/ExtendedBarrel/extended_barrel_icon.png" id="1_grhjs"] + +[resource] +script = ExtResource("1_5j68e") +display_name = "FEATURE_NAME_EXTENDED_BARREL" +description = "FEATURE_DESC_EXTENDED_BARREL" +icon = ExtResource("1_grhjs") +strength = 30.0 +metadata/_custom_type_script = "uid://dwff1058vp6af" diff --git a/Scripts/Features/ExtendedBarrel/extended_barrel_icon.png b/Scripts/Features/ExtendedBarrel/extended_barrel_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d2cde53c75e69dfc4a8ae4bf0e08a864365ea3df GIT binary patch literal 728 zcmeAS@N?(olHy`uVBq!ia0y~yU~m9o4mJh`hEk44ofy`glX=O&z%`S>o;JJ-PcyNlc5HE^F+I;HNAu6V0wFY_7O=erDm5 z{mNWx_Me{?pUr%1X5D?Y)6eZA?dCjK-`+cu#h7vXtp73$H#{YDrGxuK^|B2HS)E2PW zxCS+KG|c)SqRDxc)#E_0ib{y?QWcw}+gh?zuQn{dG9_T?mRTRBL%OR9v{? z%Crwtf;exg<}=O)M%D^Sb9>X1#tmt!tt{swRtk@a-6{sDqO}+?Xbi!|44X%=BIL zyO@+5?}#nJP3teNTw0@lYLiyW;2VUvQozrZTK#~zuhuj(~HTpa^2@y z|M#jEJSdDaU~*W+Vm_zi#(&1qtndHlnF`|B1r75B?Iuj~Y0|0sIzz{| zeeaZ=vdP&G94d4V2t7N)?bYVic{SzCB#Ua(7j3WqI`4LDxMQ^IRGq`g7YAIWWIS$* zap!ehnY4hBkK--pG>;2R>^=s|-hR05JbOv4 z(~{T5POV)azgO7KqwhIB+)5yW+r$ pcOMMo*bi)bHoN2L+QL)v6C^IZxup5WhJk^B!PC{xWt~$(697S(Qg8qO literal 0 HcmV?d00001 diff --git a/Scripts/Features/ExtendedBarrel/extended_barrel_icon.png.import b/Scripts/Features/ExtendedBarrel/extended_barrel_icon.png.import new file mode 100644 index 0000000..59a15be --- /dev/null +++ b/Scripts/Features/ExtendedBarrel/extended_barrel_icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dixdtcy64v4s0" +path="res://.godot/imported/extended_barrel_icon.png-1c0812e89e02473dd1787f3bd00ca247.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Scripts/Features/ExtendedBarrel/extended_barrel_icon.png" +dest_files=["res://.godot/imported/extended_barrel_icon.png-1c0812e89e02473dd1787f3bd00ca247.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Scripts/Features/HeavyRounds/HeavyRounds_icon.png b/Scripts/Features/HeavyRounds/HeavyRounds_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..5e9d9476a5af5f82d082f6ffb4199d0acf15d99b GIT binary patch literal 816 zcmeAS@N?(olHy`uVBq!ia0y~yU~m9o4mJh`hEk44ofy`glX=O&!1T(~ z#WAE}&ePe3K`e>_uK#l)-zlCky>{kIcZHRHQrfbO&*YMHS6@5uO7}=x-iy2okKC(3=Mz( z{=Q(uYu?bTe%2sy1*2)jr3~RV$pww-y(WnrjJh9|1gf=2Utso^N_1MmC{_`)g)@<@ z;=p7jUk<|q!t+E@n|3n_eptdG9OEs?>Ho>>;Myh14?O3o?U+)gVsr8|OL1rVfyp*L z22-olY))o5m7iSv@cVWD<>%X{-_DBa=8WZ5Qhva%zg@}V<)3Fl4)+&%88@2OL|s;4 zQdi#cDwES!MDT;ALhNKs-49E`gs-T~`>^%LwgZ!+d@L@fNHCtix~GKS)9Cr1XF~Gl z^DS&*WK@NZ_!+EvR=gr;^^07=TYVe7p7QE9ddeovi&NH==}L+Fu(fIVvMWxDOHEFM z8aMJb3Vw*$^~X4N`kBkC#Q64e*giDfs@BRj-T$1xh-pBqG6jHf;S?osJ}mL<}QUwFrT zuf;C9`kHf9UPd;|<@)}OGlu8+{;BJh+Eg!z6xXohi?%uz#Qngj`SJ-@!HvD&Tbj29 zf0^|pBdjGPWUtziNeZ@EvKjHhA-dhszghJD?POne@q@#MRU5u>p0BRDT@?SLn(?)a zgYxOw3)iVDtmdp|m6Q0Acj0&7v@h@P@l_wS-tgmJ!_x8&oxScEFJqIu-wVf7Eq`&T zx^? void: + tower_stats.set_attribute("Damage", tower_stats.get_attribute("Damage") * (1.0 + (strength / 100.0))) + + +func attach_to_weapon(weapon_stats: CardText) -> void: + weapon_stats.set_attribute("Damage", weapon_stats.get_attribute("Damage") * (1.0 + (strength / 100.0))) diff --git a/Scripts/Features/HeavyRounds/heavy_rounds.gd.uid b/Scripts/Features/HeavyRounds/heavy_rounds.gd.uid new file mode 100644 index 0000000..de3ac71 --- /dev/null +++ b/Scripts/Features/HeavyRounds/heavy_rounds.gd.uid @@ -0,0 +1 @@ +uid://uabrepvb5cur diff --git a/Scripts/Features/HeavyRounds/heavy_rounds_feature.tres b/Scripts/Features/HeavyRounds/heavy_rounds_feature.tres new file mode 100644 index 0000000..de5c4ad --- /dev/null +++ b/Scripts/Features/HeavyRounds/heavy_rounds_feature.tres @@ -0,0 +1,12 @@ +[gd_resource type="Resource" script_class="HeavyRoundsFeature" load_steps=3 format=3 uid="uid://dfup264h2pun7"] + +[ext_resource type="Texture2D" uid="uid://dykfm5ad0mxfw" path="res://Scripts/Features/HeavyRounds/HeavyRounds_icon.png" id="1_drp05"] +[ext_resource type="Script" uid="uid://uabrepvb5cur" path="res://Scripts/Features/HeavyRounds/heavy_rounds.gd" id="1_hyapt"] + +[resource] +script = ExtResource("1_hyapt") +display_name = "FEATURE_NAME_HEAVY_ROUNDS" +description = "FEATURE_DESC_HEAVY_ROUNDS" +icon = ExtResource("1_drp05") +strength = 15.0 +metadata/_custom_type_script = "uid://uabrepvb5cur" diff --git a/Scripts/Features/Radar/radar.gd b/Scripts/Features/Radar/radar.gd new file mode 100644 index 0000000..9e80a9d --- /dev/null +++ b/Scripts/Features/Radar/radar.gd @@ -0,0 +1,6 @@ +class_name RadarFeature +extends Feature + + +func attach_to_tower(tower_stats: CardText) -> void: + tower_stats.target_type.append(Data.TargetType.AIR) diff --git a/Scripts/Features/Radar/radar.gd.uid b/Scripts/Features/Radar/radar.gd.uid new file mode 100644 index 0000000..f962bb7 --- /dev/null +++ b/Scripts/Features/Radar/radar.gd.uid @@ -0,0 +1 @@ +uid://b8tigm0aru8nu diff --git a/Scripts/Features/Radar/radar_feature.tres b/Scripts/Features/Radar/radar_feature.tres new file mode 100644 index 0000000..41b1e93 --- /dev/null +++ b/Scripts/Features/Radar/radar_feature.tres @@ -0,0 +1,11 @@ +[gd_resource type="Resource" script_class="RadarFeature" load_steps=3 format=3 uid="uid://nh7g23b3rnvr"] + +[ext_resource type="Texture2D" uid="uid://cps7onfe2s1gi" path="res://Scripts/Features/Radar/radar_icon.png" id="1_tw681"] +[ext_resource type="Script" uid="uid://b8tigm0aru8nu" path="res://Scripts/Features/Radar/radar.gd" id="2_f4mox"] + +[resource] +script = ExtResource("2_f4mox") +display_name = "FEATURE_NAME_RADAR" +description = "FEATURE_DESC_RADAR" +icon = ExtResource("1_tw681") +metadata/_custom_type_script = "uid://b8tigm0aru8nu" diff --git a/Scripts/Features/Radar/radar_icon.png b/Scripts/Features/Radar/radar_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..07c931520a24cc234e66d5969d94a6b22940874f GIT binary patch literal 802 zcmeAS@N?(olHy`uVBq!ia0y~yU~m9o4mJh`hEk44ofy`glX=O&z;wsc z#WAE}&fD3xe$0jft@jt%I#@-uXed>2Es;^>b$_5@$>h6kqMne`OF>qrkSli>R&gHt zk)Ct@OqKG!qVlrG-);Uy-j+-_arEEl{bs_bIG66RiTu2XlAKn zmGX;IE3euKo@%le_Y1XoINQK4u;cvi*)R4UeU=a*q|a=UeP490(8=EHgJ+q(@+dgQ z80N*i+-xc{_ri+5=YP+Bb|`zML*xQ89$9KMJgzLRx}S*NN^5I+Bs<*$U1qm?k5 zgW2EU)+bAf*9lKCO1xA1Aa%Et%WMZfo2A8E=W0(rOE41ETWM9UNjuaWD%$3Kg2-r2Lkqgq^$*=f;^>o2StUd%YZH>^35?a8GZ zd(*EnGRf+6L@eKP{s|kyxA_P3CQBPEtysX!yzJPShDm+C*?0IAlNz2}xN5azT2Wf1 z0;k99gwW5A-!U_M*c8jV$~$T2&Kiw-?zg8ru4;G|<*=6H<#)k6wizW&rpDH*pB3c% z59iNUO8>Patfh!sd+Uy^{2FUGm)XT9zph<4LqIBW;U&&z`yQ(PZVs#CZ45fwFhOg} z6DN%ilm9h*Iyd3=&#Tv}-foWh=hL)gbHj|Pe1nkR4G-THWSrL*Pj@VkS~Hb3Sa5Z% zLZRD>5Fd|D_J7xzFCBmKY#!^*TkI0-s?W2S+-(lnXjz*J?|9VMbof%S;X)UifQp!X z<-%S^nMLboytv3B#5bjrUF*Nm<;k47j~b8J`}$_OtS(qo>3ZW9OSr`aH93JlkC!YH z+?TN+)H%oPfI`k?X!IMJnpvI$9Fmk=?N@VSfIuw0qgo7q>GrFfcH9 My85}Sb4q9e05fiAs{jB1 literal 0 HcmV?d00001 diff --git a/Scripts/Features/Radar/radar_icon.png.import b/Scripts/Features/Radar/radar_icon.png.import new file mode 100644 index 0000000..149ce05 --- /dev/null +++ b/Scripts/Features/Radar/radar_icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cps7onfe2s1gi" +path="res://.godot/imported/radar_icon.png-3ea7bb6ea2b253a4a5535d5dd7d1158e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Scripts/Features/Radar/radar_icon.png" +dest_files=["res://.godot/imported/radar_icon.png-3ea7bb6ea2b253a4a5535d5dd7d1158e.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Scripts/Resources/card_text.gd b/Scripts/Resources/card_text.gd index 3f32293..e2a8868 100644 --- a/Scripts/Resources/card_text.gd +++ b/Scripts/Resources/card_text.gd @@ -3,12 +3,30 @@ extends Resource @export var target_type: Array[Data.TargetType] @export var energy_type: Data.EnergyType -@export var attributes: Array[StatAttribute] +@export var attributes: Dictionary[String, float] +@export var features: Array[Feature] @export_multiline var text: String func get_attribute(attribute: String) -> float: - for stat: StatAttribute in attributes: - if stat.key == attribute: - return stat.value + if attributes.has(attribute): + return attributes[attribute] return 0.0 + + +func set_attribute(attribute: String, value: float) -> void: + attributes[attribute] = value + + +func tower_features_applied() -> CardText: + var card_text: CardText = self.duplicate() + for feature: Feature in features: + feature.attach_to_tower(card_text) + return card_text + + +func weapon_features_applied() -> CardText: + var card_text: CardText = self.duplicate() + for feature: Feature in features: + feature.attach_to_weapon(card_text) + return card_text diff --git a/Scripts/Resources/feature.gd b/Scripts/Resources/feature.gd new file mode 100644 index 0000000..9823261 --- /dev/null +++ b/Scripts/Resources/feature.gd @@ -0,0 +1,15 @@ +class_name Feature +extends Resource + +@export var display_name: String +@export var description: String +@export var icon: Texture2D +@export var strength: float + + +func attach_to_tower(tower_stats: CardText) -> void: + pass + + +func attach_to_weapon(weapon_stats: CardText) -> void: + pass diff --git a/Scripts/Resources/feature.gd.uid b/Scripts/Resources/feature.gd.uid new file mode 100644 index 0000000..b8a5411 --- /dev/null +++ b/Scripts/Resources/feature.gd.uid @@ -0,0 +1 @@ +uid://bsuinotkvh7eu diff --git a/Scripts/card_hand.gd b/Scripts/card_hand.gd index 91a14d1..6111fdf 100644 --- a/Scripts/card_hand.gd +++ b/Scripts/card_hand.gd @@ -20,8 +20,8 @@ func set_card(value: Card) -> void: func process_card_text(card_text: CardText) -> String: var processed_string: String = card_text.text - for stat: StatAttribute in card_text.attributes: - processed_string = processed_string.replace(stat.key, str(stat.value)) + for key: String in card_text.attributes: + processed_string = processed_string.replace(key, str(card_text.attributes[key])) processed_string = processed_string.replace("%", "") return processed_string diff --git a/Scripts/data.gd b/Scripts/data.gd index 0049f7f..41885b3 100644 --- a/Scripts/data.gd +++ b/Scripts/data.gd @@ -19,6 +19,11 @@ enum EnemyType {UNDEFINED = 0, LAND = 1, AIR = 2} enum Rarity {COMMON = 0, UNCOMMON = 1, RARE = 2, EPIC = 3, LEGENDARY = 4} enum CardTags {DAMAGE = 0, UTILITY = 1, TARGETS_FLYING = 2} +static var target_type_names: Dictionary[TargetType, String] = { + TargetType.LAND : "TARGET_TYPE_LAND", + TargetType.AIR : "TARGET_TYPE_AIR", +} + static var weapon_recharge_delay: float = 0.5 static var starting_cash: int = 10 static var player_energy: int = 6 diff --git a/Scripts/game.gd b/Scripts/game.gd index 452cf27..d09ed86 100644 --- a/Scripts/game.gd +++ b/Scripts/game.gd @@ -30,6 +30,7 @@ var wave_limit: int = 20 var shop_chance: float = 0.0 var stats: RoundStats var card_gameplay: bool = false +var starting_blanks: int = 10 #TODO: Create a reference to some generic Lobby object that wraps the multiplayer players list stuff @@ -126,6 +127,7 @@ func spawn_players() -> void: player.game_manager = self player.edit_tool.level = level player.hud.map_anchor = level + player.blank_cassettes += starting_blanks player.player_name_tag.text = connected_player_profiles[peer_id].display_name player.position = level.player_spawns[p_i].global_position player.profile = connected_player_profiles[peer_id] diff --git a/Towers/Ascension/tower_stats.tres b/Towers/Ascension/tower_stats.tres index 41f4201..fa2594b 100644 --- a/Towers/Ascension/tower_stats.tres +++ b/Towers/Ascension/tower_stats.tres @@ -1,30 +1,17 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=6 format=3 uid="uid://c756rtt7ujowk"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://c756rtt7ujowk"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_tiqmf"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_tiqmf"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_bpl71"] -[sub_resource type="Resource" id="Resource_tiqmf"] -script = ExtResource("1_tiqmf") -key = "Fire Delay" -value = 9999.0 -metadata/_custom_type_script = "uid://yjb0uv6og430" - -[sub_resource type="Resource" id="Resource_bpl71"] -script = ExtResource("1_tiqmf") -key = "Damage" -value = 0.0 -metadata/_custom_type_script = "uid://yjb0uv6og430" - -[sub_resource type="Resource" id="Resource_imnjp"] -script = ExtResource("1_tiqmf") -key = "Range " -value = 1.0 -metadata/_custom_type_script = "uid://yjb0uv6og430" - [resource] script = ExtResource("2_bpl71") target_type = Array[int]([]) energy_type = 0 -attributes = Array[ExtResource("1_tiqmf")]([SubResource("Resource_tiqmf"), SubResource("Resource_bpl71"), SubResource("Resource_imnjp")]) +attributes = Dictionary[String, float]({ +"Damage": 0.0, +"Fire Delay": 9999.0, +"Range": 1.0 +}) +features = Array[ExtResource("1_tiqmf")]([]) text = "DESC_TOWER_PLATFORM_DASH" metadata/_custom_type_script = "uid://dg7gxxqfqxcmc" diff --git a/Towers/Assault/tower_stats.tres b/Towers/Assault/tower_stats.tres index 464845a..6e8887d 100644 --- a/Towers/Assault/tower_stats.tres +++ b/Towers/Assault/tower_stats.tres @@ -1,26 +1,17 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=6 format=3 uid="uid://bdmsiw45xxhiv"] +[gd_resource type="Resource" script_class="CardText" load_steps=4 format=3 uid="uid://bdmsiw45xxhiv"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_qgv2j"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_7wr4x"] - -[sub_resource type="Resource" id="Resource_bukji"] -script = ExtResource("1_qgv2j") -key = "Fire Delay" -value = 0.45 - -[sub_resource type="Resource" id="Resource_2e75s"] -script = ExtResource("1_qgv2j") -key = "Damage" -value = 2.0 - -[sub_resource type="Resource" id="Resource_1vpnf"] -script = ExtResource("1_qgv2j") -key = "Range" -value = 10.0 +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="2_74txn"] +[ext_resource type="Resource" uid="uid://dfup264h2pun7" path="res://Scripts/Features/HeavyRounds/heavy_rounds_feature.tres" id="3_wqog5"] [resource] script = ExtResource("2_7wr4x") target_type = Array[int]([1]) energy_type = 0 -attributes = Array[ExtResource("1_qgv2j")]([SubResource("Resource_bukji"), SubResource("Resource_2e75s"), SubResource("Resource_1vpnf")]) +attributes = Dictionary[String, float]({ +"Damage": 2.0, +"Fire Delay": 0.5, +"Range": 10.0 +}) +features = Array[ExtResource("2_74txn")]([ExtResource("3_wqog5")]) text = "DESC_TOWER_BASIC_GUN" diff --git a/Towers/Blowdart/tower_stats.tres b/Towers/Blowdart/tower_stats.tres index 8c0a4a0..f2ed956 100644 --- a/Towers/Blowdart/tower_stats.tres +++ b/Towers/Blowdart/tower_stats.tres @@ -1,26 +1,16 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=6 format=3 uid="uid://cfbap4o68urti"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://cfbap4o68urti"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_otqsh"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_dcpbj"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_2k5i0"] -[sub_resource type="Resource" id="Resource_1txa7"] -script = ExtResource("1_otqsh") -key = "Damage" -value = 0.0 - -[sub_resource type="Resource" id="Resource_46kv2"] -script = ExtResource("1_otqsh") -key = "Range" -value = 20.0 - -[sub_resource type="Resource" id="Resource_gb76x"] -script = ExtResource("1_otqsh") -key = "Fire Delay" -value = 2.0 - [resource] script = ExtResource("2_2k5i0") target_type = Array[int]([1, 2]) energy_type = 0 -attributes = Array[ExtResource("1_otqsh")]([SubResource("Resource_1txa7"), SubResource("Resource_46kv2"), SubResource("Resource_gb76x")]) +attributes = Dictionary[String, float]({ +"Damage": 0.0, +"Fire Delay": 2.0, +"Range": 20.0 +}) +features = Array[ExtResource("1_dcpbj")]([]) text = "DESC_TOWER_POISON" diff --git a/Towers/BombLauncher/tower_stats.tres b/Towers/BombLauncher/tower_stats.tres index 9910564..772e179 100644 --- a/Towers/BombLauncher/tower_stats.tres +++ b/Towers/BombLauncher/tower_stats.tres @@ -1,26 +1,16 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=6 format=3 uid="uid://8eaecilvan23"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://8eaecilvan23"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_eglp5"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_73lec"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_1vuma"] -[sub_resource type="Resource" id="Resource_yb48y"] -script = ExtResource("1_eglp5") -key = "Fire Delay" -value = 4.0 - -[sub_resource type="Resource" id="Resource_ewwvw"] -script = ExtResource("1_eglp5") -key = "Damage" -value = 10.0 - -[sub_resource type="Resource" id="Resource_qu5dv"] -script = ExtResource("1_eglp5") -key = "Range" -value = 8.0 - [resource] script = ExtResource("2_1vuma") target_type = Array[int]([1]) energy_type = 0 -attributes = Array[ExtResource("1_eglp5")]([SubResource("Resource_yb48y"), SubResource("Resource_ewwvw"), SubResource("Resource_qu5dv")]) +attributes = Dictionary[String, float]({ +"Damage": 10.0, +"Fire Delay": 4.0, +"Range": 8.0 +}) +features = Array[ExtResource("1_73lec")]([]) text = "DESC_TOWER_BOMB" diff --git a/Towers/Fireball/tower_stats.tres b/Towers/Fireball/tower_stats.tres index d48eddc..410f917 100644 --- a/Towers/Fireball/tower_stats.tres +++ b/Towers/Fireball/tower_stats.tres @@ -1,26 +1,16 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=6 format=3 uid="uid://dnvqghpwyuw84"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://dnvqghpwyuw84"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_wvk31"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_may4k"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_nconk"] -[sub_resource type="Resource" id="Resource_68ba3"] -script = ExtResource("1_wvk31") -key = "Fire Delay" -value = 3.0 - -[sub_resource type="Resource" id="Resource_gogvm"] -script = ExtResource("1_wvk31") -key = "Damage" -value = 5.0 - -[sub_resource type="Resource" id="Resource_pswb4"] -script = ExtResource("1_wvk31") -key = "Range" -value = 15.0 - [resource] script = ExtResource("2_nconk") target_type = Array[int]([1, 2]) energy_type = 0 -attributes = Array[ExtResource("1_wvk31")]([SubResource("Resource_68ba3"), SubResource("Resource_gogvm"), SubResource("Resource_pswb4")]) +attributes = Dictionary[String, float]({ +"Damage": 5.0, +"Fire Delay": 3.0, +"Range": 15.0 +}) +features = Array[ExtResource("1_may4k")]([]) text = "DESC_TOWER_FIREBALL" diff --git a/Towers/Flamethrower/tower_stats.tres b/Towers/Flamethrower/tower_stats.tres index e1e05a0..0333979 100644 --- a/Towers/Flamethrower/tower_stats.tres +++ b/Towers/Flamethrower/tower_stats.tres @@ -1,26 +1,16 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=6 format=3 uid="uid://cdtjbxs21peqg"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://cdtjbxs21peqg"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_ikp33"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_8a4q3"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_wptab"] -[sub_resource type="Resource" id="Resource_j28f4"] -script = ExtResource("1_ikp33") -key = "Fire Delay" -value = 0.5 - -[sub_resource type="Resource" id="Resource_likes"] -script = ExtResource("1_ikp33") -key = "Damage" -value = 0.0 - -[sub_resource type="Resource" id="Resource_b65mk"] -script = ExtResource("1_ikp33") -key = "Range" -value = 3.0 - [resource] script = ExtResource("2_wptab") target_type = Array[int]([1]) energy_type = 0 -attributes = Array[ExtResource("1_ikp33")]([SubResource("Resource_j28f4"), SubResource("Resource_likes"), SubResource("Resource_b65mk")]) +attributes = Dictionary[String, float]({ +"Damage": 0.0, +"Fire Delay": 0.5, +"Range": 3.0 +}) +features = Array[ExtResource("1_8a4q3")]([]) text = "DESC_TOWER_FLAMETHROWER" diff --git a/Towers/Gatling/tower_stats.tres b/Towers/Gatling/tower_stats.tres index 30eff3b..bc3ef26 100644 --- a/Towers/Gatling/tower_stats.tres +++ b/Towers/Gatling/tower_stats.tres @@ -1,36 +1,18 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=8 format=3 uid="uid://nxl5wabgl36t"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://nxl5wabgl36t"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_w20qq"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_5mpl7"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_ky46y"] -[sub_resource type="Resource" id="Resource_oayfg"] -script = ExtResource("1_w20qq") -key = "Fire Delay" -value = 0.6 - -[sub_resource type="Resource" id="Resource_fekle"] -script = ExtResource("1_w20qq") -key = "Damage" -value = 1.0 - -[sub_resource type="Resource" id="Resource_ud8xi"] -script = ExtResource("1_w20qq") -key = "Range" -value = 10.0 - -[sub_resource type="Resource" id="Resource_cvkxf"] -script = ExtResource("1_w20qq") -key = "Speed Multiplier" -value = 2.0 - -[sub_resource type="Resource" id="Resource_pivwn"] -script = ExtResource("1_w20qq") -key = "Speed Time" -value = 3.0 - [resource] script = ExtResource("2_ky46y") target_type = Array[int]([1]) energy_type = 0 -attributes = Array[ExtResource("1_w20qq")]([SubResource("Resource_oayfg"), SubResource("Resource_fekle"), SubResource("Resource_ud8xi"), SubResource("Resource_cvkxf"), SubResource("Resource_pivwn")]) +attributes = Dictionary[String, float]({ +"Damage": 1.0, +"Fire Delay": 0.6, +"Range": 10.0, +"Speed Multiplier": 2.0, +"Speed Time": 3.0 +}) +features = Array[ExtResource("1_5mpl7")]([]) text = "DESC_TOWER_ACCEL" diff --git a/Towers/GlueLauncher/tower_stats.tres b/Towers/GlueLauncher/tower_stats.tres index b8fd300..34fa65a 100644 --- a/Towers/GlueLauncher/tower_stats.tres +++ b/Towers/GlueLauncher/tower_stats.tres @@ -1,26 +1,16 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=6 format=3 uid="uid://bvkwgmbxje0dp"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://bvkwgmbxje0dp"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_ytycf"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_qb1t6"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_226sm"] -[sub_resource type="Resource" id="Resource_gbocu"] -script = ExtResource("1_ytycf") -key = "Damage" -value = 0.0 - -[sub_resource type="Resource" id="Resource_6a2im"] -script = ExtResource("1_ytycf") -key = "Range" -value = 10.0 - -[sub_resource type="Resource" id="Resource_7npe0"] -script = ExtResource("1_ytycf") -key = "Fire Delay" -value = 2.0 - [resource] script = ExtResource("2_226sm") target_type = Array[int]([1]) energy_type = 0 -attributes = Array[ExtResource("1_ytycf")]([SubResource("Resource_gbocu"), SubResource("Resource_6a2im"), SubResource("Resource_7npe0")]) +attributes = Dictionary[String, float]({ +"Damage": 0.0, +"Fire Delay": 2.0, +"Range": 10.0 +}) +features = Array[ExtResource("1_qb1t6")]([]) text = "DESC_TOWER_GLUE" diff --git a/Towers/Icicle/tower_stats.tres b/Towers/Icicle/tower_stats.tres index 07ba935..b4c2f25 100644 --- a/Towers/Icicle/tower_stats.tres +++ b/Towers/Icicle/tower_stats.tres @@ -1,26 +1,16 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=6 format=3 uid="uid://d34bfj5togyyt"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://d34bfj5togyyt"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_wgjcy"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_ju6am"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_dorn5"] -[sub_resource type="Resource" id="Resource_68ba3"] -script = ExtResource("1_wgjcy") -key = "Fire Delay" -value = 3.0 - -[sub_resource type="Resource" id="Resource_gogvm"] -script = ExtResource("1_wgjcy") -key = "Damage" -value = 4.0 - -[sub_resource type="Resource" id="Resource_pswb4"] -script = ExtResource("1_wgjcy") -key = "Range" -value = 15.0 - [resource] script = ExtResource("2_dorn5") target_type = Array[int]([1, 2]) energy_type = 0 -attributes = Array[ExtResource("1_wgjcy")]([SubResource("Resource_68ba3"), SubResource("Resource_gogvm"), SubResource("Resource_pswb4")]) +attributes = Dictionary[String, float]({ +"Damage": 4.0, +"Fire Delay": 3.0, +"Range": 15.0 +}) +features = Array[ExtResource("1_ju6am")]([]) text = "DESC_TOWER_ICE_SPIKE" diff --git a/Towers/Overclock/tower_stats.tres b/Towers/Overclock/tower_stats.tres index af24b57..569e793 100644 --- a/Towers/Overclock/tower_stats.tres +++ b/Towers/Overclock/tower_stats.tres @@ -1,30 +1,17 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=6 format=3 uid="uid://v13yoous66bc"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://v13yoous66bc"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_0swcp"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_0swcp"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_fax6y"] -[sub_resource type="Resource" id="Resource_0swcp"] -script = ExtResource("1_0swcp") -key = "Fire Delay" -value = 0.0 -metadata/_custom_type_script = "uid://yjb0uv6og430" - -[sub_resource type="Resource" id="Resource_fax6y"] -script = ExtResource("1_0swcp") -key = "Damage" -value = 0.0 -metadata/_custom_type_script = "uid://yjb0uv6og430" - -[sub_resource type="Resource" id="Resource_v0e26"] -script = ExtResource("1_0swcp") -key = "Range" -value = 4.0 -metadata/_custom_type_script = "uid://yjb0uv6og430" - [resource] script = ExtResource("2_fax6y") target_type = Array[int]([]) energy_type = 0 -attributes = Array[ExtResource("1_0swcp")]([SubResource("Resource_0swcp"), SubResource("Resource_fax6y"), SubResource("Resource_v0e26")]) +attributes = Dictionary[String, float]({ +"Damage": 0.0, +"Fire Delay": 0.0, +"Range": 4.0 +}) +features = Array[ExtResource("1_0swcp")]([]) text = "DESC_TOWER_SPEED_INCREASER" metadata/_custom_type_script = "uid://dg7gxxqfqxcmc" diff --git a/Towers/Reactor/tower_stats.tres b/Towers/Reactor/tower_stats.tres index e4ccdab..b84ff81 100644 --- a/Towers/Reactor/tower_stats.tres +++ b/Towers/Reactor/tower_stats.tres @@ -1,26 +1,15 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=6 format=3 uid="uid://cssdyxk8oefsd"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://cssdyxk8oefsd"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_peekg"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_8hcmy"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_8w61k"] -[sub_resource type="Resource" id="Resource_j28f4"] -script = ExtResource("1_peekg") -key = "Fire Delay" -value = 4.0 - -[sub_resource type="Resource" id="Resource_likes"] -script = ExtResource("1_peekg") -key = "Damage" -value = 0.0 - -[sub_resource type="Resource" id="Resource_b65mk"] -script = ExtResource("1_peekg") -key = "Range" -value = 30.0 - [resource] script = ExtResource("2_8w61k") target_type = Array[int]([1, 2]) energy_type = 0 -attributes = Array[ExtResource("1_peekg")]([SubResource("Resource_j28f4"), SubResource("Resource_likes"), SubResource("Resource_b65mk")]) +attributes = Dictionary[String, float]({ +"Fire Delay": 4.0, +"Range": 30.0 +}) +features = Array[ExtResource("1_8hcmy")]([]) text = "DESC_TOWER_RADIATION" diff --git a/Towers/Refrigerator/tower_stats.tres b/Towers/Refrigerator/tower_stats.tres index c5e7595..4eac0a9 100644 --- a/Towers/Refrigerator/tower_stats.tres +++ b/Towers/Refrigerator/tower_stats.tres @@ -1,26 +1,16 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=6 format=3 uid="uid://st0qrut5nxrm"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://st0qrut5nxrm"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_wa26m"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_mfkpu"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_w4q6a"] -[sub_resource type="Resource" id="Resource_j28f4"] -script = ExtResource("1_wa26m") -key = "Fire Delay" -value = 1.0 - -[sub_resource type="Resource" id="Resource_likes"] -script = ExtResource("1_wa26m") -key = "Damage" -value = 0.0 - -[sub_resource type="Resource" id="Resource_b65mk"] -script = ExtResource("1_wa26m") -key = "Range" -value = 3.0 - [resource] script = ExtResource("2_w4q6a") target_type = Array[int]([1]) energy_type = 0 -attributes = Array[ExtResource("1_wa26m")]([SubResource("Resource_j28f4"), SubResource("Resource_likes"), SubResource("Resource_b65mk")]) +attributes = Dictionary[String, float]({ +"Damage": 0.0, +"Fire Delay": 1.0, +"Range": 3.0 +}) +features = Array[ExtResource("1_mfkpu")]([]) text = "DESC_TOWER_FREEZER" diff --git a/Towers/RocketLauncher/tower_stats.tres b/Towers/RocketLauncher/tower_stats.tres index 71cd757..80da923 100644 --- a/Towers/RocketLauncher/tower_stats.tres +++ b/Towers/RocketLauncher/tower_stats.tres @@ -1,31 +1,18 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=7 format=3 uid="uid://c65rq455ma8f6"] +[gd_resource type="Resource" script_class="CardText" load_steps=4 format=3 uid="uid://c65rq455ma8f6"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_jajj0"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="2_gaqbj"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_lag26"] - -[sub_resource type="Resource" id="Resource_4fjm2"] -script = ExtResource("1_jajj0") -key = "Fire Delay" -value = 5.0 - -[sub_resource type="Resource" id="Resource_uwj4j"] -script = ExtResource("1_jajj0") -key = "Target Limit" -value = 3.0 - -[sub_resource type="Resource" id="Resource_6qv5v"] -script = ExtResource("1_jajj0") -key = "Damage" -value = 8.0 - -[sub_resource type="Resource" id="Resource_y1rtq"] -script = ExtResource("1_jajj0") -key = "Range" -value = 20.0 +[ext_resource type="Resource" uid="uid://nh7g23b3rnvr" path="res://Scripts/Features/Radar/radar_feature.tres" id="3_h2m5c"] [resource] script = ExtResource("2_lag26") -target_type = Array[int]([2]) +target_type = Array[int]([]) energy_type = 0 -attributes = Array[ExtResource("1_jajj0")]([SubResource("Resource_4fjm2"), SubResource("Resource_uwj4j"), SubResource("Resource_6qv5v"), SubResource("Resource_y1rtq")]) +attributes = Dictionary[String, float]({ +"Damage": 8.0, +"Fire Delay": 5.0, +"Range": 20.0, +"Target Limit": 3.0 +}) +features = Array[ExtResource("2_gaqbj")]([ExtResource("3_h2m5c")]) text = "DESC_TOWER_ROCKET" diff --git a/Towers/Sniper/tower_stats.tres b/Towers/Sniper/tower_stats.tres index f344fca..bb76a89 100644 --- a/Towers/Sniper/tower_stats.tres +++ b/Towers/Sniper/tower_stats.tres @@ -1,26 +1,16 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=6 format=3 uid="uid://eb0by6ba1d43"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://eb0by6ba1d43"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_5wjgg"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_b3d4q"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_5j62t"] -[sub_resource type="Resource" id="Resource_1ct8q"] -script = ExtResource("1_5wjgg") -key = "Fire Delay" -value = 2.0 - -[sub_resource type="Resource" id="Resource_erx05"] -script = ExtResource("1_5wjgg") -key = "Damage" -value = 20.0 - -[sub_resource type="Resource" id="Resource_vfpmb"] -script = ExtResource("1_5wjgg") -key = "Range" -value = 50.0 - [resource] script = ExtResource("2_5j62t") target_type = Array[int]([1, 2]) energy_type = 0 -attributes = Array[ExtResource("1_5wjgg")]([SubResource("Resource_1ct8q"), SubResource("Resource_erx05"), SubResource("Resource_vfpmb")]) +attributes = Dictionary[String, float]({ +"Damage": 20.0, +"Fire Delay": 2.0, +"Range": 50.0 +}) +features = Array[ExtResource("1_b3d4q")]([]) text = "DESC_TOWER_SNIPER" diff --git a/Towers/tower.gd b/Towers/tower.gd index f2c1cf9..dc6cc60 100644 --- a/Towers/tower.gd +++ b/Towers/tower.gd @@ -24,6 +24,7 @@ var small_speed_buff_timer: float = 0.0 func _ready() -> void: + stats = stats.tower_features_applied() time_between_shots = stats.get_attribute("Fire Delay") effect.damage = int(stats.get_attribute("Damage")) target_range = stats.get_attribute("Range") diff --git a/UI/CardSelectionBox/card_selection_box.tscn b/UI/CardSelectionBox/card_selection_box.tscn index 25e8d3d..2766d96 100644 --- a/UI/CardSelectionBox/card_selection_box.tscn +++ b/UI/CardSelectionBox/card_selection_box.tscn @@ -10,6 +10,7 @@ custom_minimum_size = Vector2(170, 0) layout_mode = 3 anchors_preset = 0 +mouse_filter = 2 script = ExtResource("1_m0g3h") icon = NodePath("PanelContainer/VBoxContainer/HBoxContainer/Icon") tags = NodePath("PanelContainer/VBoxContainer/HBoxContainer/MarginContainer/Tags") @@ -22,18 +23,22 @@ amount_label = NodePath("PanelContainer/VBoxContainer/Label") layout_mode = 2 offset_right = 152.0 offset_bottom = 124.0 +mouse_filter = 2 theme_override_styles/panel = ExtResource("2_ek0dh") [node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] layout_mode = 2 +mouse_filter = 2 [node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 +mouse_filter = 2 [node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 +mouse_filter = 2 theme_override_constants/margin_top = 10 theme_override_constants/margin_bottom = 10 @@ -49,12 +54,14 @@ stretch_mode = 5 [node name="Icon" type="TextureRect" parent="PanelContainer/VBoxContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 +mouse_filter = 2 texture = ExtResource("2_m0g3h") stretch_mode = 5 [node name="Stats" type="VBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 +mouse_filter = 2 [node name="Cost" type="Label" parent="PanelContainer/VBoxContainer/HBoxContainer/Stats"] layout_mode = 2 @@ -76,6 +83,7 @@ offset_left = -25.0 offset_top = 100.0 offset_right = 25.0 offset_bottom = 150.0 +mouse_filter = 2 bbcode_enabled = true fit_content = true vertical_alignment = 2 diff --git a/Weapons/Ascension/weapon_stats.tres b/Weapons/Ascension/weapon_stats.tres index a9d2488..e0bd31a 100644 --- a/Weapons/Ascension/weapon_stats.tres +++ b/Weapons/Ascension/weapon_stats.tres @@ -1,30 +1,17 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=6 format=3 uid="uid://do05i1xtdwfqk"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://do05i1xtdwfqk"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_c5ghd"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_c5ghd"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_hwijr"] -[sub_resource type="Resource" id="Resource_c5ghd"] -script = ExtResource("1_c5ghd") -key = "Fire Delay" -value = 2.0 -metadata/_custom_type_script = "uid://yjb0uv6og430" - -[sub_resource type="Resource" id="Resource_hwijr"] -script = ExtResource("1_c5ghd") -key = "Damage" -value = 0.0 -metadata/_custom_type_script = "uid://yjb0uv6og430" - -[sub_resource type="Resource" id="Resource_5pac0"] -script = ExtResource("1_c5ghd") -key = "Energy" -value = 5.0 -metadata/_custom_type_script = "uid://yjb0uv6og430" - [resource] script = ExtResource("2_hwijr") -target_type = 2 +target_type = Array[int]([]) energy_type = 1 -attributes = Array[ExtResource("1_c5ghd")]([SubResource("Resource_c5ghd"), SubResource("Resource_hwijr"), SubResource("Resource_5pac0")]) +attributes = Dictionary[String, float]({ +"Damage": 0.0, +"Energy": 5.0, +"Fire Delay": 2.0 +}) +features = Array[ExtResource("1_c5ghd")]([]) text = "DESC_WEAPON_PLATFORM_DASH" metadata/_custom_type_script = "uid://dg7gxxqfqxcmc" diff --git a/Weapons/Assault/weapon_stats.tres b/Weapons/Assault/weapon_stats.tres index 82c4123..b3e999e 100644 --- a/Weapons/Assault/weapon_stats.tres +++ b/Weapons/Assault/weapon_stats.tres @@ -1,31 +1,17 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=7 format=3 uid="uid://smctw4ogm4rx"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://smctw4ogm4rx"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_rbqj6"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_vqq5l"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_k26ta"] -[sub_resource type="Resource" id="Resource_bcrtt"] -script = ExtResource("1_rbqj6") -key = "Damage" -value = 3.0 - -[sub_resource type="Resource" id="Resource_llper"] -script = ExtResource("1_rbqj6") -key = "Range" -value = 15.0 - -[sub_resource type="Resource" id="Resource_7i2dt"] -script = ExtResource("1_rbqj6") -key = "Fire Delay" -value = 0.14 - -[sub_resource type="Resource" id="Resource_8cirl"] -script = ExtResource("1_rbqj6") -key = "Energy" -value = 20.0 - [resource] script = ExtResource("2_k26ta") target_type = Array[int]([]) energy_type = 2 -attributes = Array[ExtResource("1_rbqj6")]([SubResource("Resource_bcrtt"), SubResource("Resource_llper"), SubResource("Resource_7i2dt"), SubResource("Resource_8cirl")]) +attributes = Dictionary[String, float]({ +"Damage": 3.0, +"Energy": 20.0, +"Fire Delay": 0.2, +"Range": 15.0 +}) +features = Array[ExtResource("1_vqq5l")]([]) text = "DESC_WEAPON_BASIC_GUN" diff --git a/Weapons/Blowdart/weapon_stats.tres b/Weapons/Blowdart/weapon_stats.tres index e30cc5b..1ac2cdb 100644 --- a/Weapons/Blowdart/weapon_stats.tres +++ b/Weapons/Blowdart/weapon_stats.tres @@ -1,31 +1,17 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=7 format=3 uid="uid://c6e50linnk2i7"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://c6e50linnk2i7"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_3nyhi"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_uay7i"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_lbj0i"] -[sub_resource type="Resource" id="Resource_1txa7"] -script = ExtResource("1_3nyhi") -key = "Damage" -value = 0.0 - -[sub_resource type="Resource" id="Resource_46kv2"] -script = ExtResource("1_3nyhi") -key = "Range" -value = 15.0 - -[sub_resource type="Resource" id="Resource_gb76x"] -script = ExtResource("1_3nyhi") -key = "Fire Delay" -value = 0.8 - -[sub_resource type="Resource" id="Resource_dtjel"] -script = ExtResource("1_3nyhi") -key = "Energy" -value = 8.0 - [resource] script = ExtResource("2_lbj0i") -target_type = 0 +target_type = Array[int]([]) energy_type = 1 -attributes = Array[ExtResource("1_3nyhi")]([SubResource("Resource_1txa7"), SubResource("Resource_46kv2"), SubResource("Resource_gb76x"), SubResource("Resource_dtjel")]) +attributes = Dictionary[String, float]({ +"Damage": 0.0, +"Energy": 8.0, +"Fire Delay": 0.8, +"Range": 15.0 +}) +features = Array[ExtResource("1_uay7i")]([]) text = "DESC_WEAPON_POISON" diff --git a/Weapons/BombLauncher/weapon_stats.tres b/Weapons/BombLauncher/weapon_stats.tres index 81ba193..1107316 100644 --- a/Weapons/BombLauncher/weapon_stats.tres +++ b/Weapons/BombLauncher/weapon_stats.tres @@ -1,31 +1,17 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=7 format=3 uid="uid://co6eorobj1xuu"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://co6eorobj1xuu"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_vg7y2"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_gv6l8"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_fe8lx"] -[sub_resource type="Resource" id="Resource_yb48y"] -script = ExtResource("1_vg7y2") -key = "Fire Delay" -value = 2.0 - -[sub_resource type="Resource" id="Resource_ewwvw"] -script = ExtResource("1_vg7y2") -key = "Damage" -value = 10.0 - -[sub_resource type="Resource" id="Resource_qu5dv"] -script = ExtResource("1_vg7y2") -key = "Range" -value = 10.0 - -[sub_resource type="Resource" id="Resource_67t30"] -script = ExtResource("1_vg7y2") -key = "Energy" -value = 10.0 - [resource] script = ExtResource("2_fe8lx") -target_type = 0 +target_type = Array[int]([]) energy_type = 1 -attributes = Array[ExtResource("1_vg7y2")]([SubResource("Resource_yb48y"), SubResource("Resource_ewwvw"), SubResource("Resource_qu5dv"), SubResource("Resource_67t30")]) +attributes = Dictionary[String, float]({ +"Damage": 10.0, +"Energy": 10.0, +"Fire Delay": 2.0, +"Range": 10.0 +}) +features = Array[ExtResource("1_gv6l8")]([]) text = "DESC_WEAPON_BOMB" diff --git a/Weapons/Fireball/weapon_stats.tres b/Weapons/Fireball/weapon_stats.tres index 3ba3577..3d2f8a3 100644 --- a/Weapons/Fireball/weapon_stats.tres +++ b/Weapons/Fireball/weapon_stats.tres @@ -1,31 +1,17 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=7 format=3 uid="uid://dhwhwicgpw7yh"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://dhwhwicgpw7yh"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_kqy5w"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_ehd58"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_yto3f"] -[sub_resource type="Resource" id="Resource_68ba3"] -script = ExtResource("1_kqy5w") -key = "Fire Delay" -value = 2.0 - -[sub_resource type="Resource" id="Resource_gogvm"] -script = ExtResource("1_kqy5w") -key = "Damage" -value = 5.0 - -[sub_resource type="Resource" id="Resource_pswb4"] -script = ExtResource("1_kqy5w") -key = "Range" -value = 15.0 - -[sub_resource type="Resource" id="Resource_y1gjj"] -script = ExtResource("1_kqy5w") -key = "Energy" -value = 5.0 - [resource] script = ExtResource("2_yto3f") -target_type = 0 +target_type = Array[int]([]) energy_type = 1 -attributes = Array[ExtResource("1_kqy5w")]([SubResource("Resource_68ba3"), SubResource("Resource_gogvm"), SubResource("Resource_pswb4"), SubResource("Resource_y1gjj")]) +attributes = Dictionary[String, float]({ +"Damage": 5.0, +"Energy": 5.0, +"Fire Delay": 2.0, +"Range": 15.0 +}) +features = Array[ExtResource("1_ehd58")]([]) text = "DESC_WEAPON_FIREBALL" diff --git a/Weapons/Flamethrower/weapon_stats.tres b/Weapons/Flamethrower/weapon_stats.tres index 6095121..968c69d 100644 --- a/Weapons/Flamethrower/weapon_stats.tres +++ b/Weapons/Flamethrower/weapon_stats.tres @@ -1,31 +1,17 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=7 format=3 uid="uid://yjknwdimtm8g"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://yjknwdimtm8g"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_xqcf3"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_rinww"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_drgp3"] -[sub_resource type="Resource" id="Resource_j28f4"] -script = ExtResource("1_xqcf3") -key = "Fire Delay" -value = 0.4 - -[sub_resource type="Resource" id="Resource_likes"] -script = ExtResource("1_xqcf3") -key = "Damage" -value = 1.0 - -[sub_resource type="Resource" id="Resource_b65mk"] -script = ExtResource("1_xqcf3") -key = "Range" -value = 3.0 - -[sub_resource type="Resource" id="Resource_rjpjf"] -script = ExtResource("1_xqcf3") -key = "Energy" -value = 15.0 - [resource] script = ExtResource("2_drgp3") -target_type = 0 +target_type = Array[int]([]) energy_type = 2 -attributes = Array[ExtResource("1_xqcf3")]([SubResource("Resource_j28f4"), SubResource("Resource_likes"), SubResource("Resource_b65mk"), SubResource("Resource_rjpjf")]) +attributes = Dictionary[String, float]({ +"Damage": 1.0, +"Energy": 15.0, +"Fire Delay": 0.4, +"Range": 3.0 +}) +features = Array[ExtResource("1_rinww")]([]) text = "DESC_WEAPON_FLAMETHROWER" diff --git a/Weapons/Gatling/weapon_stats.tres b/Weapons/Gatling/weapon_stats.tres index 71723e7..e3d6817 100644 --- a/Weapons/Gatling/weapon_stats.tres +++ b/Weapons/Gatling/weapon_stats.tres @@ -1,41 +1,19 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=9 format=3 uid="uid://cj2x1jvo8l4ot"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://cj2x1jvo8l4ot"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_7oh83"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_vn048"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_y36gr"] -[sub_resource type="Resource" id="Resource_fi7tc"] -script = ExtResource("1_7oh83") -key = "Fire Delay" -value = 0.3 - -[sub_resource type="Resource" id="Resource_r6h5d"] -script = ExtResource("1_7oh83") -key = "Damage" -value = 2.0 - -[sub_resource type="Resource" id="Resource_gwg1i"] -script = ExtResource("1_7oh83") -key = "Range" -value = 20.0 - -[sub_resource type="Resource" id="Resource_ogk1x"] -script = ExtResource("1_7oh83") -key = "Speed Multiplier" -value = 3.0 - -[sub_resource type="Resource" id="Resource_wdp3h"] -script = ExtResource("1_7oh83") -key = "Speed Time" -value = 4.0 - -[sub_resource type="Resource" id="Resource_d1lvi"] -script = ExtResource("1_7oh83") -key = "Energy" -value = 30.0 - [resource] script = ExtResource("2_y36gr") -target_type = 0 +target_type = Array[int]([]) energy_type = 2 -attributes = Array[ExtResource("1_7oh83")]([SubResource("Resource_fi7tc"), SubResource("Resource_r6h5d"), SubResource("Resource_gwg1i"), SubResource("Resource_ogk1x"), SubResource("Resource_wdp3h"), SubResource("Resource_d1lvi")]) +attributes = Dictionary[String, float]({ +"Damage": 2.0, +"Energy": 20.0, +"Fire Delay": 0.4, +"Range": 20.0, +"Speed Multiplier": 3.0, +"Speed Time": 4.0 +}) +features = Array[ExtResource("1_vn048")]([]) text = "DESC_WEAPON_ACCEL" diff --git a/Weapons/GlueLauncher/weapon_stats.tres b/Weapons/GlueLauncher/weapon_stats.tres index a62b13a..36421ef 100644 --- a/Weapons/GlueLauncher/weapon_stats.tres +++ b/Weapons/GlueLauncher/weapon_stats.tres @@ -1,31 +1,17 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=7 format=3 uid="uid://boj1ho5x0sxtq"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://boj1ho5x0sxtq"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_8ysxs"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_58qpp"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_nlx26"] -[sub_resource type="Resource" id="Resource_gbocu"] -script = ExtResource("1_8ysxs") -key = "Damage" -value = 0.0 - -[sub_resource type="Resource" id="Resource_6a2im"] -script = ExtResource("1_8ysxs") -key = "Range" -value = 13.0 - -[sub_resource type="Resource" id="Resource_7npe0"] -script = ExtResource("1_8ysxs") -key = "Fire Delay" -value = 0.5 - -[sub_resource type="Resource" id="Resource_o1b5x"] -script = ExtResource("1_8ysxs") -key = "Energy" -value = 12.0 - [resource] script = ExtResource("2_nlx26") -target_type = 0 +target_type = Array[int]([]) energy_type = 1 -attributes = Array[ExtResource("1_8ysxs")]([SubResource("Resource_gbocu"), SubResource("Resource_6a2im"), SubResource("Resource_7npe0"), SubResource("Resource_o1b5x")]) +attributes = Dictionary[String, float]({ +"Damage": 0.0, +"Energy": 12.0, +"Fire Delay": 0.5, +"Range": 13.0 +}) +features = Array[ExtResource("1_58qpp")]([]) text = "DESC_WEAPON_GLUE" diff --git a/Weapons/Icicle/weapon_stats.tres b/Weapons/Icicle/weapon_stats.tres index 46596c4..5bad054 100644 --- a/Weapons/Icicle/weapon_stats.tres +++ b/Weapons/Icicle/weapon_stats.tres @@ -1,31 +1,17 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=7 format=3 uid="uid://ckjmym1ofww4"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://ckjmym1ofww4"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_nkpmf"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_5i8ch"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_5m6w7"] -[sub_resource type="Resource" id="Resource_68ba3"] -script = ExtResource("1_nkpmf") -key = "Fire Delay" -value = 2.0 - -[sub_resource type="Resource" id="Resource_gogvm"] -script = ExtResource("1_nkpmf") -key = "Damage" -value = 5.0 - -[sub_resource type="Resource" id="Resource_pswb4"] -script = ExtResource("1_nkpmf") -key = "Range" -value = 15.0 - -[sub_resource type="Resource" id="Resource_cfu7u"] -script = ExtResource("1_nkpmf") -key = "Energy" -value = 5.0 - [resource] script = ExtResource("2_5m6w7") -target_type = 0 +target_type = Array[int]([]) energy_type = 1 -attributes = Array[ExtResource("1_nkpmf")]([SubResource("Resource_68ba3"), SubResource("Resource_gogvm"), SubResource("Resource_pswb4"), SubResource("Resource_cfu7u")]) +attributes = Dictionary[String, float]({ +"Damage": 5.0, +"Energy": 5.0, +"Fire Delay": 2.0, +"Range": 15.0 +}) +features = Array[ExtResource("1_5i8ch")]([]) text = "DESC_WEAPON_ICE_SPIKE" diff --git a/Weapons/Overclock/weapon_stats.tres b/Weapons/Overclock/weapon_stats.tres index f258e71..740ba98 100644 --- a/Weapons/Overclock/weapon_stats.tres +++ b/Weapons/Overclock/weapon_stats.tres @@ -1,42 +1,19 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=8 format=3 uid="uid://d3qmy6puuh1gl"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://d3qmy6puuh1gl"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_m84e5"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_m84e5"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_rl1ek"] -[sub_resource type="Resource" id="Resource_m84e5"] -script = ExtResource("1_m84e5") -key = "Fire Delay" -value = 0.3 -metadata/_custom_type_script = "uid://yjb0uv6og430" - -[sub_resource type="Resource" id="Resource_rl1ek"] -script = ExtResource("1_m84e5") -key = "Damage" -value = 0.0 -metadata/_custom_type_script = "uid://yjb0uv6og430" - -[sub_resource type="Resource" id="Resource_gglou"] -script = ExtResource("1_m84e5") -key = "Energy" -value = 20.0 -metadata/_custom_type_script = "uid://yjb0uv6og430" - -[sub_resource type="Resource" id="Resource_0g051"] -script = ExtResource("1_m84e5") -key = "Range" -value = 100.0 -metadata/_custom_type_script = "uid://yjb0uv6og430" - -[sub_resource type="Resource" id="Resource_uq2yv"] -script = ExtResource("1_m84e5") -key = "EffectDuration" -value = 1.0 -metadata/_custom_type_script = "uid://yjb0uv6og430" - [resource] script = ExtResource("2_rl1ek") -target_type = 1 +target_type = Array[int]([]) energy_type = 2 -attributes = Array[ExtResource("1_m84e5")]([SubResource("Resource_m84e5"), SubResource("Resource_rl1ek"), SubResource("Resource_gglou"), SubResource("Resource_0g051"), SubResource("Resource_uq2yv")]) +attributes = Dictionary[String, float]({ +"Damage": 0.0, +"Effect Duration": 1.0, +"Energy": 20.0, +"Fire Delay": 0.3, +"Range": 100.0 +}) +features = Array[ExtResource("1_m84e5")]([]) text = "DESC_WEAPON_SPEED_INCREASER" metadata/_custom_type_script = "uid://dg7gxxqfqxcmc" diff --git a/Weapons/Reactor/weapon_stats.tres b/Weapons/Reactor/weapon_stats.tres index 4a41bcb..32c35e1 100644 --- a/Weapons/Reactor/weapon_stats.tres +++ b/Weapons/Reactor/weapon_stats.tres @@ -1,31 +1,17 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=7 format=3 uid="uid://ipfr7emuarbj"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://ipfr7emuarbj"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_b6ubt"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_2higs"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_ahbcx"] -[sub_resource type="Resource" id="Resource_j28f4"] -script = ExtResource("1_b6ubt") -key = "Fire Delay" -value = 0.5 - -[sub_resource type="Resource" id="Resource_likes"] -script = ExtResource("1_b6ubt") -key = "Damage" -value = 1.0 - -[sub_resource type="Resource" id="Resource_b65mk"] -script = ExtResource("1_b6ubt") -key = "Range" -value = 3.0 - -[sub_resource type="Resource" id="Resource_b4805"] -script = ExtResource("1_b6ubt") -key = "Energy" -value = 9.0 - [resource] script = ExtResource("2_ahbcx") -target_type = 0 +target_type = Array[int]([]) energy_type = 2 -attributes = Array[ExtResource("1_b6ubt")]([SubResource("Resource_j28f4"), SubResource("Resource_likes"), SubResource("Resource_b65mk"), SubResource("Resource_b4805")]) +attributes = Dictionary[String, float]({ +"Damage": 1.0, +"Energy": 9.0, +"Fire Delay": 0.5, +"Range": 3.0 +}) +features = Array[ExtResource("1_2higs")]([]) text = "DESC_WEAPON_RADIATION" diff --git a/Weapons/Refrigerator/weapon_stats.tres b/Weapons/Refrigerator/weapon_stats.tres index f6b9a0f..5f0fd0e 100644 --- a/Weapons/Refrigerator/weapon_stats.tres +++ b/Weapons/Refrigerator/weapon_stats.tres @@ -1,31 +1,17 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=7 format=3 uid="uid://5l758yxfpi1e"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://5l758yxfpi1e"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_dxffl"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_18tr7"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_wny82"] -[sub_resource type="Resource" id="Resource_j28f4"] -script = ExtResource("1_dxffl") -key = "Fire Delay" -value = 0.5 - -[sub_resource type="Resource" id="Resource_likes"] -script = ExtResource("1_dxffl") -key = "Damage" -value = 1.0 - -[sub_resource type="Resource" id="Resource_b65mk"] -script = ExtResource("1_dxffl") -key = "Range" -value = 3.0 - -[sub_resource type="Resource" id="Resource_voaa5"] -script = ExtResource("1_dxffl") -key = "Energy" -value = 14.0 - [resource] script = ExtResource("2_wny82") -target_type = 0 +target_type = Array[int]([]) energy_type = 2 -attributes = Array[ExtResource("1_dxffl")]([SubResource("Resource_j28f4"), SubResource("Resource_likes"), SubResource("Resource_b65mk"), SubResource("Resource_voaa5")]) +attributes = Dictionary[String, float]({ +"Damage": 1.0, +"Energy": 14.0, +"Fire Delay": 0.5, +"Range": 3.0 +}) +features = Array[ExtResource("1_18tr7")]([]) text = "DESC_WEAPON_FREEZER" diff --git a/Weapons/RocketLauncher/weapon_stats.tres b/Weapons/RocketLauncher/weapon_stats.tres index 8f60e7f..6c2f5fe 100644 --- a/Weapons/RocketLauncher/weapon_stats.tres +++ b/Weapons/RocketLauncher/weapon_stats.tres @@ -1,31 +1,17 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=7 format=3 uid="uid://d2yo07m2mp2mp"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://d2yo07m2mp2mp"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_5gy7w"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_h5r83"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_ow0r7"] -[sub_resource type="Resource" id="Resource_4fjm2"] -script = ExtResource("1_5gy7w") -key = "Fire Delay" -value = 2.0 - -[sub_resource type="Resource" id="Resource_uwj4j"] -script = ExtResource("1_5gy7w") -key = "Target Limit" -value = 3.0 - -[sub_resource type="Resource" id="Resource_6qv5v"] -script = ExtResource("1_5gy7w") -key = "Damage" -value = 8.0 - -[sub_resource type="Resource" id="Resource_ymyed"] -script = ExtResource("1_5gy7w") -key = "Energy" -value = 12.0 - [resource] script = ExtResource("2_ow0r7") -target_type = 0 +target_type = Array[int]([]) energy_type = 1 -attributes = Array[ExtResource("1_5gy7w")]([SubResource("Resource_4fjm2"), SubResource("Resource_uwj4j"), SubResource("Resource_6qv5v"), SubResource("Resource_ymyed")]) +attributes = Dictionary[String, float]({ +"Damage": 8.0, +"Energy": 12.0, +"Fire Delay": 2.0, +"Target Limit": 3.0 +}) +features = Array[ExtResource("1_h5r83")]([]) text = "DESC_WEAPON_ROCKET" diff --git a/Weapons/Sniper/weapon_stats.tres b/Weapons/Sniper/weapon_stats.tres index 6f376ee..248c3fb 100644 --- a/Weapons/Sniper/weapon_stats.tres +++ b/Weapons/Sniper/weapon_stats.tres @@ -1,31 +1,17 @@ -[gd_resource type="Resource" script_class="CardText" load_steps=7 format=3 uid="uid://3y7n1vdvf822"] +[gd_resource type="Resource" script_class="CardText" load_steps=3 format=3 uid="uid://3y7n1vdvf822"] -[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_aub52"] +[ext_resource type="Script" uid="uid://bsuinotkvh7eu" path="res://Scripts/Resources/feature.gd" id="1_y0q7b"] [ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_qyvv8"] -[sub_resource type="Resource" id="Resource_58kde"] -script = ExtResource("1_aub52") -key = "Fire Delay" -value = 0.9 - -[sub_resource type="Resource" id="Resource_jl4jv"] -script = ExtResource("1_aub52") -key = "Damage" -value = 30.0 - -[sub_resource type="Resource" id="Resource_28kyj"] -script = ExtResource("1_aub52") -key = "Range" -value = 100.0 - -[sub_resource type="Resource" id="Resource_7pvmq"] -script = ExtResource("1_aub52") -key = "Energy" -value = 10.0 - [resource] script = ExtResource("2_qyvv8") -target_type = 0 +target_type = Array[int]([]) energy_type = 1 -attributes = Array[ExtResource("1_aub52")]([SubResource("Resource_58kde"), SubResource("Resource_jl4jv"), SubResource("Resource_28kyj"), SubResource("Resource_7pvmq")]) +attributes = Dictionary[String, float]({ +"Damage": 30.0, +"Energy": 10.0, +"Fire Delay": 0.9, +"Range": 100.0 +}) +features = Array[ExtResource("1_y0q7b")]([]) text = "DESC_WEAPON_SNIPER" diff --git a/Worlds/GreenPlanet/Levels/Bridge/bridge.tscn b/Worlds/GreenPlanet/Levels/Bridge/bridge.tscn index 0f86735..6ead30d 100644 --- a/Worlds/GreenPlanet/Levels/Bridge/bridge.tscn +++ b/Worlds/GreenPlanet/Levels/Bridge/bridge.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=33 format=3 uid="uid://y1qa1g3ic8sp"] +[gd_scene load_steps=34 format=3 uid="uid://y1qa1g3ic8sp"] [ext_resource type="Script" uid="uid://cvejbo3srx8py" path="res://Scripts/level.gd" id="1_ws6nn"] [ext_resource type="PackedScene" uid="uid://d2yv447trxkwt" path="res://Scenes/enemy_spawner.tscn" id="3_5imwp"] @@ -15,6 +15,7 @@ [ext_resource type="PackedScene" uid="uid://d3h3lmlf3hljl" path="res://Worlds/GreenPlanet/Decorations/bush.tscn" id="16_lhsvw"] [ext_resource type="PackedScene" uid="uid://7g3jev3v6d3l" path="res://Scenes/ShopStand/shop_stand.tscn" id="19_h6brl"] [ext_resource type="PackedScene" uid="uid://cmneu5o0m02l8" path="res://Worlds/GreenPlanet/Enemies/leaping_enemy.tscn" id="20_ttr7n"] +[ext_resource type="PackedScene" uid="uid://c6isprnkaliqr" path="res://remix_table.tscn" id="21_ks6qx"] [ext_resource type="PackedScene" uid="uid://2vv6mrxiwibf" path="res://Scenes/FlowField/flow_field_tool_output.tscn" id="24_sbix1"] [ext_resource type="Script" uid="uid://cy6oj2hr8q8br" path="res://Scripts/killbox.gd" id="26_tuncf"] [ext_resource type="PackedScene" uid="uid://c2avjln5vmr0y" path="res://Scenes/Shredder/shredder.tscn" id="27_gppb4"] @@ -535,5 +536,8 @@ texture = ExtResource("28_6od8s") [node name="FlowField2" parent="." instance=ExtResource("24_sbix1")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.215, 1.56, 0) +[node name="Node3D" parent="." instance=ExtResource("21_ks6qx")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 24.4581, 1.00142, -12.2655) + [connection signal="body_entered" from="EnemyGoal/Area3D" to="EnemyGoal" method="_on_area_3d_body_entered"] [connection signal="body_entered" from="Killbox" to="Killbox" method="_on_body_entered"] diff --git a/card_description_ui.gd b/card_description_ui.gd new file mode 100644 index 0000000..ba385cf --- /dev/null +++ b/card_description_ui.gd @@ -0,0 +1,60 @@ +class_name CardDescriptionUI +extends VBoxContainer + +@export var card_name_label: Label +@export var card_description_label: RichTextLabel +@export var feature_list: VBoxContainer +@export var feature_scene: PackedScene +@export var target_list: VBoxContainer + +var card: Card +var side_a: bool + + +func show_card_name() -> void: + card_name_label.visible = true + + +func hide_card_name() -> void: + card_name_label.visible = false + + +func set_card(new_card: Card, side: bool) -> void: + card = new_card + side_a = side + card_name_label.text = tr(card.display_name) + card_description_label.text = process_card_text(card.tower_stats.tower_features_applied()) if side_a else process_card_text(card.weapon_stats.weapon_features_applied()) + populate_features() + populate_targets() + + +func populate_features() -> void: + for child: Node in feature_list.get_children(): + child.queue_free() + var card_text: CardText = card.tower_stats if side_a else card.weapon_stats + for feature: Feature in card_text.features: + var ui: FeatureUI = feature_scene.instantiate() + ui.set_feature(feature) + feature_list.add_child(ui) + + +func populate_targets() -> void: + for child: Node in target_list.get_children(): + child.queue_free() + if !side_a: + var label: Label = Label.new() + label.text = tr("TARGET_ALL") + target_list.add_child(label) + else: + for target: Data.TargetType in card.tower_stats.tower_features_applied().target_type: + var label: Label = Label.new() + label.text = tr(Data.target_type_names[target]) + target_list.add_child(label) + + +func process_card_text(card_text: CardText) -> String: + var processed_string: String = tr(card_text.text) + for key: String in card_text.attributes: + processed_string = processed_string.replace(key, "[color=red]" + str(card_text.attributes[key]) + "[color=white]") + processed_string = processed_string.replace("%", "") + return processed_string diff --git a/card_description_ui.gd.uid b/card_description_ui.gd.uid new file mode 100644 index 0000000..5588bef --- /dev/null +++ b/card_description_ui.gd.uid @@ -0,0 +1 @@ +uid://dipne6u86gxth diff --git a/card_description_ui.tscn b/card_description_ui.tscn new file mode 100644 index 0000000..16b7df1 --- /dev/null +++ b/card_description_ui.tscn @@ -0,0 +1,46 @@ +[gd_scene load_steps=3 format=3 uid="uid://cmlpmr78tmo6p"] + +[ext_resource type="Script" uid="uid://dipne6u86gxth" path="res://card_description_ui.gd" id="1_bxjpl"] +[ext_resource type="PackedScene" uid="uid://c8xdsg6gtwvh3" path="res://feature_ui.tscn" id="2_hr2hd"] + +[node name="DescriptionVBox" type="VBoxContainer" node_paths=PackedStringArray("card_name_label", "card_description_label", "feature_list", "target_list")] +size_flags_horizontal = 3 +script = ExtResource("1_bxjpl") +card_name_label = NodePath("NameLabel") +card_description_label = NodePath("DescriptionText") +feature_list = NodePath("FeaturesVBox") +feature_scene = ExtResource("2_hr2hd") +target_list = NodePath("TargetVBox") + +[node name="NameLabel" type="Label" parent="."] +visible = false +layout_mode = 2 +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="DescriptionLabel" type="Label" parent="."] +layout_mode = 2 +text = "LABEL_CARD_DESCRIPTION" + +[node name="DescriptionText" type="RichTextLabel" parent="."] +auto_translate_mode = 2 +layout_mode = 2 +size_flags_vertical = 3 +bbcode_enabled = true +text = "a long ass example description of a card that goes into honestly way too much detail but at least if we can support a lot of text at a good size then we dont have to worry about really complicated cards fucking up our UI later in developement if we end up needing to explain a lot" + +[node name="FeaturesLabel" type="Label" parent="."] +layout_mode = 2 +text = "LABEL_CARD_FEATURES" + +[node name="FeaturesVBox" type="VBoxContainer" parent="."] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="TargettingLabel" type="Label" parent="."] +layout_mode = 2 +text = "LABEL_TARGET_LIST" + +[node name="TargetVBox" type="VBoxContainer" parent="."] +layout_mode = 2 +size_flags_vertical = 3 diff --git a/choose_card_screen.gd b/choose_card_screen.gd index 6f7255a..ede2347 100644 --- a/choose_card_screen.gd +++ b/choose_card_screen.gd @@ -3,8 +3,8 @@ class_name ChooseCardScreen extends Control signal card_chosen(card: Card) @export var choice_buttons: VBoxContainer +@export var card_desc: CardDescriptionUI @export var card_name_label: Label -@export var card_description_label: RichTextLabel var choices: Array[Card] = [] var chosen_card: Card = null @@ -23,14 +23,6 @@ func add_cards(cards: Array[Card]) -> void: choose_card(0) -func process_card_text(card_text: CardText) -> String: - var processed_string: String = tr(card_text.text) - for stat: StatAttribute in card_text.attributes: - processed_string = processed_string.replace(stat.key, "[color=red]" + str(stat.value) + "[color=black]") - processed_string = processed_string.replace("%", "") - return processed_string - - func choose_card(choice: int) -> void: chosen_card = choices[choice] card_name_label.text = tr(chosen_card.display_name) @@ -39,7 +31,7 @@ func choose_card(choice: int) -> void: func choose_side(side_a_chosen: bool) -> void: side_a = side_a_chosen - card_description_label.text = process_card_text(chosen_card.tower_stats) if side_a else process_card_text(chosen_card.weapon_stats) + card_desc.set_card(chosen_card, side_a) func _on_confirm_button_pressed() -> void: diff --git a/choose_card_screen.tscn b/choose_card_screen.tscn index 1a779da..427c398 100644 --- a/choose_card_screen.tscn +++ b/choose_card_screen.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=2 format=3 uid="uid://bcvjgl0s1wp8y"] +[gd_scene load_steps=3 format=3 uid="uid://bcvjgl0s1wp8y"] [ext_resource type="Script" uid="uid://nc0df5y8tll7" path="res://choose_card_screen.gd" id="1_y4oar"] +[ext_resource type="PackedScene" uid="uid://cmlpmr78tmo6p" path="res://card_description_ui.tscn" id="2_3npvv"] -[node name="ChooseCardScreen" type="Control" node_paths=PackedStringArray("choice_buttons", "card_name_label", "card_description_label")] +[node name="ChooseCardScreen" type="Control" node_paths=PackedStringArray("choice_buttons", "card_desc", "card_name_label")] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -11,8 +12,8 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_y4oar") choice_buttons = NodePath("PanelContainer/Content/HBoxContainer/ChoicesVBox") +card_desc = NodePath("PanelContainer/Content/HBoxContainer/DescriptionVBox") card_name_label = NodePath("PanelContainer/Content/HBoxContainer/VBoxContainer/NameLabel") -card_description_label = NodePath("PanelContainer/Content/HBoxContainer/DescriptionVBox/DescriptionText") [node name="PanelContainer" type="PanelContainer" parent="."] layout_mode = 1 @@ -74,36 +75,8 @@ layout_mode = 2 size_flags_horizontal = 4 text = "BUTTON_FINALIZE_CARD_CHOICE" -[node name="DescriptionVBox" type="VBoxContainer" parent="PanelContainer/Content/HBoxContainer"] +[node name="DescriptionVBox" parent="PanelContainer/Content/HBoxContainer" instance=ExtResource("2_3npvv")] layout_mode = 2 -size_flags_horizontal = 3 - -[node name="DescriptionLabel" type="Label" parent="PanelContainer/Content/HBoxContainer/DescriptionVBox"] -layout_mode = 2 -text = "LABEL_CARD_DESCRIPTION" - -[node name="DescriptionText" type="RichTextLabel" parent="PanelContainer/Content/HBoxContainer/DescriptionVBox"] -auto_translate_mode = 2 -layout_mode = 2 -size_flags_vertical = 3 -bbcode_enabled = true -text = "a long ass example description of a card that goes into honestly way too much detail but at least if we can support a lot of text at a good size then we dont have to worry about really complicated cards fucking up our UI later in developement if we end up needing to explain a lot" - -[node name="FeaturesLabel" type="Label" parent="PanelContainer/Content/HBoxContainer/DescriptionVBox"] -layout_mode = 2 -text = "LABEL_CARD_FEATURES" - -[node name="FeaturesVBox" type="VBoxContainer" parent="PanelContainer/Content/HBoxContainer/DescriptionVBox"] -layout_mode = 2 -size_flags_vertical = 3 - -[node name="TargettingLabel" type="Label" parent="PanelContainer/Content/HBoxContainer/DescriptionVBox"] -layout_mode = 2 -text = "LABEL_TARGET_LIST" - -[node name="TargetVBox" type="VBoxContainer" parent="PanelContainer/Content/HBoxContainer/DescriptionVBox"] -layout_mode = 2 -size_flags_vertical = 3 [connection signal="pressed" from="PanelContainer/Content/HBoxContainer/VBoxContainer/HBoxContainer/TowerButton" to="." method="choose_side" binds= [true]] [connection signal="pressed" from="PanelContainer/Content/HBoxContainer/VBoxContainer/HBoxContainer/WeaponButton" to="." method="choose_side" binds= [false]] diff --git a/feature_ui.gd b/feature_ui.gd new file mode 100644 index 0000000..d96f68d --- /dev/null +++ b/feature_ui.gd @@ -0,0 +1,10 @@ +class_name FeatureUI +extends VBoxContainer + +@export var icon: TextureRect +@export var name_label: Label + + +func set_feature(feature: Feature) -> void: + icon.texture = feature.icon + name_label.text = tr(feature.display_name) diff --git a/feature_ui.gd.uid b/feature_ui.gd.uid new file mode 100644 index 0000000..a385242 --- /dev/null +++ b/feature_ui.gd.uid @@ -0,0 +1 @@ +uid://o668c5lfhgm5 diff --git a/feature_ui.tscn b/feature_ui.tscn new file mode 100644 index 0000000..9ac4a36 --- /dev/null +++ b/feature_ui.tscn @@ -0,0 +1,25 @@ +[gd_scene load_steps=3 format=3 uid="uid://c8xdsg6gtwvh3"] + +[ext_resource type="Script" uid="uid://o668c5lfhgm5" path="res://feature_ui.gd" id="1_tms0v"] +[ext_resource type="Texture2D" uid="uid://cps7onfe2s1gi" path="res://Scripts/Features/Radar/radar_icon.png" id="2_w6jf0"] + +[node name="FeatureUI" type="VBoxContainer" node_paths=PackedStringArray("icon", "name_label")] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_tms0v") +icon = NodePath("TextureRect") +name_label = NodePath("Label") + +[node name="TextureRect" type="TextureRect" parent="."] +layout_mode = 2 +texture = ExtResource("2_w6jf0") +stretch_mode = 5 + +[node name="Label" type="Label" parent="."] +layout_mode = 2 +text = "Radar" +horizontal_alignment = 1 +vertical_alignment = 1 diff --git a/remix_menu.gd b/remix_menu.gd new file mode 100644 index 0000000..abbb029 --- /dev/null +++ b/remix_menu.gd @@ -0,0 +1,91 @@ +class_name RemixMenu +extends Control + +signal cards_remixed(cards_consumed: Array[Card], cards_created: Array[Card]) + +@export var card_ui_one: CardDescriptionUI +@export var card_ui_two: CardDescriptionUI +@export var option_button_one: OptionButton +@export var option_button_two: OptionButton + +var cards: Array[Card] + +var card_one: Card +var card_two: Card + +var temp_card_one: Card +var temp_card_two: Card + + +func add_option(card_options: Array[Card]) -> void: + cards = card_options + for card: Card in cards: + option_button_one.add_item(tr(card.display_name)) + option_button_two.add_item(tr(card.display_name)) + option_button_one.select(0) + set_card_one(0) + option_button_two.select(1) + set_card_two(1) + + +func set_cards(first_card: Card, second_card: Card) -> void: + card_one = first_card + card_two = second_card + + +func set_card_one(option: int) -> void: + card_one = cards[option] + card_ui_one.set_card(card_one, true) + + +func set_card_two(option: int) -> void: + card_two = cards[option] + card_ui_two.set_card(card_two, true) + + +func remix() -> void: + temp_card_one = Card.new() + temp_card_one.cost = card_one.cost + temp_card_one.faction = card_one.faction + temp_card_one.rarity = card_one.rarity + temp_card_one.tags = card_one.tags + temp_card_one.icon = card_one.icon + temp_card_one.display_name = card_one.display_name + temp_card_one.turret_scene = card_one.turret_scene + temp_card_one.weapon_scene = card_one.weapon_scene + temp_card_one.tower_stats = card_one.tower_stats.duplicate() + temp_card_one.weapon_stats = card_one.weapon_stats.duplicate() + for feature: Feature in card_two.tower_stats.features: + temp_card_one.tower_stats.features.append(feature) + for feature: Feature in card_two.weapon_stats.features: + temp_card_one.weapon_stats.features.append(feature) + + temp_card_two = Card.new() + temp_card_two.cost = card_two.cost + temp_card_two.faction = card_two.faction + temp_card_two.rarity = card_two.rarity + temp_card_two.tags = card_two.tags + temp_card_two.icon = card_two.icon + temp_card_two.display_name = card_two.display_name + temp_card_two.turret_scene = card_two.turret_scene + temp_card_two.weapon_scene = card_two.weapon_scene + temp_card_two.tower_stats = card_two.tower_stats.duplicate() + temp_card_two.weapon_stats = card_two.weapon_stats.duplicate() + for feature: Feature in card_one.tower_stats.features: + temp_card_two.tower_stats.features.append(feature) + for feature: Feature in card_one.weapon_stats.features: + temp_card_two.weapon_stats.features.append(feature) + + card_ui_one.set_card(temp_card_one, true) + card_ui_two.set_card(temp_card_two, true) + + +func _on_button_2_pressed() -> void: + var card_array_one: Array[Card] + var card_array_two: Array[Card] + card_array_one.append(card_one) + card_array_one.append(card_two) + card_array_two.append(temp_card_one) + card_array_two.append(temp_card_two) + cards_remixed.emit(card_array_one, card_array_two) + queue_free() diff --git a/remix_menu.gd.uid b/remix_menu.gd.uid new file mode 100644 index 0000000..eaf6158 --- /dev/null +++ b/remix_menu.gd.uid @@ -0,0 +1 @@ +uid://ccnvchtd8tlaw diff --git a/remix_menu.tscn b/remix_menu.tscn new file mode 100644 index 0000000..924ec30 --- /dev/null +++ b/remix_menu.tscn @@ -0,0 +1,81 @@ +[gd_scene load_steps=3 format=3 uid="uid://cqdft7j5pwg4b"] + +[ext_resource type="Script" uid="uid://ccnvchtd8tlaw" path="res://remix_menu.gd" id="1_jyl8o"] +[ext_resource type="PackedScene" uid="uid://cmlpmr78tmo6p" path="res://card_description_ui.tscn" id="2_vjjvi"] + +[node name="Control" type="Control" node_paths=PackedStringArray("card_ui_one", "card_ui_two", "option_button_one", "option_button_two")] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_jyl8o") +card_ui_one = NodePath("PanelContainer/VBoxContainer/HBoxContainer/Card1") +card_ui_two = NodePath("PanelContainer/VBoxContainer/HBoxContainer/Card2") +option_button_one = NodePath("PanelContainer/VBoxContainer/HBoxContainer2/OptionButton") +option_button_two = NodePath("PanelContainer/VBoxContainer/HBoxContainer2/OptionButton2") + +[node name="PanelContainer" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.03 +anchor_top = 0.03 +anchor_right = 0.97 +anchor_bottom = 0.97 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="PanelContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 1 +text = "TITLE_REMIX" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="HBoxContainer2" type="HBoxContainer" parent="PanelContainer/VBoxContainer"] +layout_mode = 2 + +[node name="OptionButton" type="OptionButton" parent="PanelContainer/VBoxContainer/HBoxContainer2"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/HBoxContainer2"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 2.0 + +[node name="OptionButton2" type="OptionButton" parent="PanelContainer/VBoxContainer/HBoxContainer2"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="Card1" parent="PanelContainer/VBoxContainer/HBoxContainer" instance=ExtResource("2_vjjvi")] +layout_mode = 2 + +[node name="UI" type="VBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 2.0 + +[node name="Button" type="Button" parent="PanelContainer/VBoxContainer/HBoxContainer/UI"] +layout_mode = 2 +text = "BUTTON_SHOW_REMIX_RESULT" + +[node name="Button2" type="Button" parent="PanelContainer/VBoxContainer/HBoxContainer/UI"] +layout_mode = 2 +text = "BUTTON_CONFIRM_REMIX" + +[node name="Card2" parent="PanelContainer/VBoxContainer/HBoxContainer" instance=ExtResource("2_vjjvi")] +layout_mode = 2 + +[connection signal="item_selected" from="PanelContainer/VBoxContainer/HBoxContainer2/OptionButton" to="." method="set_card_one"] +[connection signal="item_selected" from="PanelContainer/VBoxContainer/HBoxContainer2/OptionButton2" to="." method="set_card_two"] +[connection signal="pressed" from="PanelContainer/VBoxContainer/HBoxContainer/UI/Button" to="." method="remix"] +[connection signal="pressed" from="PanelContainer/VBoxContainer/HBoxContainer/UI/Button2" to="." method="_on_button_2_pressed"] diff --git a/remix_table.gd b/remix_table.gd new file mode 100644 index 0000000..da540c7 --- /dev/null +++ b/remix_table.gd @@ -0,0 +1,27 @@ +class_name RemixTable +extends StaticBody3D + +@export var remix_menu_scene: PackedScene + +var reply_player: Hero + + +func _on_static_body_3d_button_interacted(value: int, callback: Hero) -> void: + if callback.hand.size >= 2: + reply_player = callback + var menu: RemixMenu = remix_menu_scene.instantiate() as RemixMenu + var card_array: Array[Card] = [] + for card: Card in callback.hand.contents: + card_array.append(card) + menu.add_option(card_array) + menu.cards_remixed.connect(output) + reply_player.pause() + reply_player.hud.add_child(menu) + + +func output(cards_to_remove: Array[Card], cards_to_add: Array[Card]) -> void: + for card: Card in cards_to_remove: + reply_player.hand.contents.erase(card) + for card: Card in cards_to_add: + reply_player.add_card(card) + reply_player.unpause() diff --git a/remix_table.gd.uid b/remix_table.gd.uid new file mode 100644 index 0000000..7af6f6c --- /dev/null +++ b/remix_table.gd.uid @@ -0,0 +1 @@ +uid://bpvmvx10q4ayd diff --git a/remix_table.tscn b/remix_table.tscn new file mode 100644 index 0000000..01542f3 --- /dev/null +++ b/remix_table.tscn @@ -0,0 +1,33 @@ +[gd_scene load_steps=6 format=3 uid="uid://c6isprnkaliqr"] + +[ext_resource type="Script" uid="uid://bpvmvx10q4ayd" path="res://remix_table.gd" id="1_q8doq"] +[ext_resource type="PackedScene" uid="uid://cqdft7j5pwg4b" path="res://remix_menu.tscn" id="2_ibyhf"] +[ext_resource type="Script" uid="uid://dkfswql8ui0bt" path="res://Scripts/interact_button.gd" id="2_mjah6"] + +[sub_resource type="BoxShape3D" id="BoxShape3D_ibyhf"] + +[sub_resource type="BoxShape3D" id="BoxShape3D_78x4u"] +size = Vector3(0.5, 0.5, 0.5) + +[node name="Node3D" type="StaticBody3D"] +script = ExtResource("1_q8doq") +remix_menu_scene = ExtResource("2_ibyhf") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +shape = SubResource("BoxShape3D_ibyhf") + +[node name="CSGBox3D" type="CSGBox3D" parent="."] + +[node name="StaticBody3D" type="StaticBody3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.524303, 0) +collision_layer = 16 +collision_mask = 0 +script = ExtResource("2_mjah6") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"] +shape = SubResource("BoxShape3D_78x4u") + +[node name="CSGBox3D" type="CSGBox3D" parent="StaticBody3D"] +size = Vector3(0.5, 0.5, 0.5) + +[connection signal="button_interacted" from="StaticBody3D" to="." method="_on_static_body_3d_button_interacted"]