diff --git a/Game.tscn b/Game.tscn new file mode 100644 index 0000000..6006380 --- /dev/null +++ b/Game.tscn @@ -0,0 +1,182 @@ +[gd_scene load_steps=3 format=3 uid="uid://xh0p6v5ir05f"] + +[ext_resource type="Script" path="res://Root.gd" id="1_fof5y"] +[ext_resource type="Script" path="res://UI.gd" id="1_rdmp6"] + +[node name="Root" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_fof5y") + +[node name="Header" type="CanvasLayer" parent="."] + +[node name="UI" type="Control" parent="Header"] +layout_mode = 3 +anchors_preset = 0 +offset_right = 1152.0 +offset_bottom = 40.0 + +[node name="PanelContainer" type="GridContainer" parent="Header/UI"] +layout_mode = 0 +offset_right = 1152.0 +offset_bottom = 40.0 +columns = 5 +script = ExtResource("1_rdmp6") + +[node name="ScoreLabel" type="Label" parent="Header/UI/PanelContainer"] +layout_mode = 2 +text = "Score:" + +[node name="Score" type="Label" parent="Header/UI/PanelContainer"] +layout_mode = 2 +text = "0" + +[node name="Click" type="Button" parent="Header/UI/PanelContainer"] +visible = false +layout_mode = 2 +shortcut_in_tooltip = false +text = "Click Me" +flat = true + +[node name="Timer" type="Timer" parent="Header/UI/PanelContainer"] +autostart = true + +[node name="ClickUpgrades" type="MenuButton" parent="Header/UI/PanelContainer"] +layout_mode = 2 +text = "Click Upgrades" +item_count = 9 +popup/item_0/text = "+1 Cost:10" +popup/item_0/id = 0 +popup/item_1/text = "+10 Cost: 100" +popup/item_1/id = 1 +popup/item_2/text = "+20 Cost:1,000" +popup/item_2/id = 2 +popup/item_3/text = "+40 Cost: 10,000" +popup/item_3/id = 3 +popup/item_4/text = "+60 Cost: 100,000" +popup/item_4/id = 4 +popup/item_5/text = "+80 Cost: 1,000,000" +popup/item_5/id = 5 +popup/item_6/text = "+100 Cost: 10,000,000" +popup/item_6/id = 6 +popup/item_7/text = "+200 Cost: 100,000,000" +popup/item_7/id = 7 +popup/item_8/text = "+400 Cost: 1,000,000,000" +popup/item_8/id = 8 + +[node name="PassiveUpgrades" type="MenuButton" parent="Header/UI/PanelContainer"] +layout_mode = 2 +text = "Passive Upgrades" +item_count = 9 +popup/item_0/text = "2/s Cost: 100" +popup/item_0/id = 0 +popup/item_1/text = "10/s Cost: 1,000" +popup/item_1/id = 1 +popup/item_2/text = "20/s Cost: 10,000" +popup/item_2/id = 2 +popup/item_3/text = "50/s Cost: 100,000" +popup/item_3/id = 3 +popup/item_4/text = "100/s Cost:1,000,000" +popup/item_4/id = 4 +popup/item_5/text = "200/s Cost: 10,000,000" +popup/item_5/id = 5 +popup/item_6/text = "500/s Cost: 100,000,000" +popup/item_6/id = 6 +popup/item_7/text = "1,000/s Cost: 1,000,000,000" +popup/item_7/id = 7 +popup/item_8/text = "10,000/s Cost: 10,000,000,000" +popup/item_8/id = 8 + +[node name="TeamButton" type="Button" parent="Header/UI/PanelContainer"] +layout_mode = 2 +text = "Team" +flat = true +alignment = 0 + +[node name="Team" type="Panel" parent="."] +layout_mode = 0 +offset_left = 2.0 +offset_top = 40.0 +offset_right = 1152.0 +offset_bottom = 648.0 + +[node name="GridContainer" type="GridContainer" parent="Team"] +layout_mode = 0 +offset_left = 63.0 +offset_top = 109.0 +offset_right = 1150.0 +offset_bottom = 609.0 +columns = 5 + +[node name="TeamMember1" type="Button" parent="Team/GridContainer"] +layout_mode = 2 +text = " + + + + + + + + + +Add Team Here++++++ + + + + + + + + + + +" + +[node name="TeamMember2" type="Button" parent="Team/GridContainer"] +layout_mode = 2 +text = "Add Team Here++++++" + +[node name="TeamMember3" type="Button" parent="Team/GridContainer"] +layout_mode = 2 +text = "Add Team Here++++++" + +[node name="TeamMember4" type="Button" parent="Team/GridContainer"] +layout_mode = 2 +text = "Add Team Here++++++" + +[node name="TeamMember5" type="Button" parent="Team/GridContainer"] +layout_mode = 2 +text = "Add Team Here++++++" + +[node name="MemberInventory" type="ColorRect" parent="."] +layout_mode = 0 +offset_left = 2.0 +offset_top = 40.0 +offset_right = 1152.0 +offset_bottom = 649.0 +color = Color(0.219501, 0.219501, 0.219501, 1) + +[node name="CenterContainer" type="CenterContainer" parent="MemberInventory"] +layout_mode = 0 +offset_right = 1150.0 +offset_bottom = 608.0 + +[node name="user Int" type="CanvasLayer" parent="."] + +[node name="MemberInterface" type="Control" parent="user Int"] +layout_mode = 3 +anchors_preset = 0 +offset_left = 21.2617 +offset_top = 125.673 +offset_right = 61.2617 +offset_bottom = 165.673 + +[node name="MemberInventory" type="PanelContainer" parent="user Int/MemberInterface"] +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 40.0 diff --git a/Images/Tiny RPG Character Asset Pack v1.02 -Free Soldier&Orc/Orc/Orc with shadows/Thumbs.db b/Images/Tiny RPG Character Asset Pack v1.02 -Free Soldier&Orc/Orc/Orc with shadows/Thumbs.db new file mode 100644 index 0000000..70f40fc Binary files /dev/null and b/Images/Tiny RPG Character Asset Pack v1.02 -Free Soldier&Orc/Orc/Orc with shadows/Thumbs.db differ diff --git a/Images/Tiny RPG Character Asset Pack v1.02 -Free Soldier&Orc/Orc/Orc/Thumbs.db b/Images/Tiny RPG Character Asset Pack v1.02 -Free Soldier&Orc/Orc/Orc/Thumbs.db new file mode 100644 index 0000000..adf8380 Binary files /dev/null and b/Images/Tiny RPG Character Asset Pack v1.02 -Free Soldier&Orc/Orc/Orc/Thumbs.db differ diff --git a/Images/Tiny RPG Character Asset Pack v1.02 -Free Soldier&Orc/Soldier/Soldier with shadows/Thumbs.db b/Images/Tiny RPG Character Asset Pack v1.02 -Free Soldier&Orc/Soldier/Soldier with shadows/Thumbs.db new file mode 100644 index 0000000..ce68c0f Binary files /dev/null and b/Images/Tiny RPG Character Asset Pack v1.02 -Free Soldier&Orc/Soldier/Soldier with shadows/Thumbs.db differ diff --git a/Images/Tiny RPG Character Asset Pack v1.02 -Free Soldier&Orc/Soldier/Soldier/Thumbs.db b/Images/Tiny RPG Character Asset Pack v1.02 -Free Soldier&Orc/Soldier/Soldier/Thumbs.db new file mode 100644 index 0000000..ef14f48 Binary files /dev/null and b/Images/Tiny RPG Character Asset Pack v1.02 -Free Soldier&Orc/Soldier/Soldier/Thumbs.db differ diff --git a/Inventory.tres b/Inventory.tres new file mode 100644 index 0000000..57eb4f8 --- /dev/null +++ b/Inventory.tres @@ -0,0 +1,20 @@ +[gd_resource type="Resource" script_class="InventoryData" load_steps=7 format=3 uid="uid://cvuvn1voknqbj"] + +[ext_resource type="Script" path="res://MemberInventory/Inventory_Data.gd" id="1_pvibr"] +[ext_resource type="Resource" path="res://Member/Members/apple.tres" id="2_aboym"] +[ext_resource type="Script" path="res://MemberInventory/Slot_Data.gd" id="3_22rk4"] +[ext_resource type="Resource" path="res://Member/Members/blue_book.tres" id="4_fg6vr"] + +[sub_resource type="Resource" id="Resource_vnpe5"] +script = ExtResource("3_22rk4") +memberData = ExtResource("2_aboym") +quantity = 11 + +[sub_resource type="Resource" id="Resource_cm5vi"] +script = ExtResource("3_22rk4") +memberData = ExtResource("4_fg6vr") +quantity = 5 + +[resource] +script = ExtResource("1_pvibr") +slot_datas = Array[ExtResource("3_22rk4")]([null, null, SubResource("Resource_vnpe5"), null, null, null, SubResource("Resource_cm5vi"), null, null, null, null, null, null, null, null, null, null, null]) diff --git a/MemberDatabase/memberData.gd b/MemberDatabase/memberData.gd new file mode 100644 index 0000000..fbefd4b --- /dev/null +++ b/MemberDatabase/memberData.gd @@ -0,0 +1,611 @@ +extends Node +const Rarity = { + "COMMON":0.8, + "UNCOMMON": 0.4, + "RARE": 0.2, + "SUPERRARE": 0.1, + "LEGENDARY": 0.05 +} + +var members = { + "squire": { + "name": "Squire", + "description": "Someone who does things for someone else, not very impressive.", + "perSec": 1, + "clickAdd": 1, + "scoreMultiplier": 1, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Squire.png", + "tier": 1, + "rarity": Rarity.COMMON + }, + "archer": { + "name": "Archer", + "description": "Better at accurate clicks than consistent damage", + "perSec": 2, + "clickAdd": 2, + "scoreMultiplier": 1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Archer.png", + "tier": 1, + "rarity": Rarity.COMMON + }, + "mage": { + "name": "Mage", + "description": "A good mix of DPS and click power", + "perSec": 3, + "clickAdd": 3, + "scoreMultiplier": 1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Mage.png", + "tier": 1, + "rarity": Rarity.COMMON + }, + "warrior": { + "name": "Warrior", + "description": "Strong and brave fighter", + "perSec": 4, + "clickAdd": 4, + "scoreMultiplier": 1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Warrior.png", + "tier": 1, + "rarity": Rarity.COMMON + }, + "healer": { + "name": "Healer", + "description": "Skilled in healing magic", + "perSec": 5, + "clickAdd": 5, + "scoreMultiplier": 1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Healer.png", + "tier": 1, + "rarity": Rarity.COMMON + }, + "knight": { + "name": "Knight", + "description": "Valiant defender of the realm", + "perSec": 6, + "clickAdd": 6, + "scoreMultiplier": 1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Knight.png", + "tier": 1, + "rarity": Rarity.COMMON + }, + "assassin": { + "name": "Assassin", + "description": "Expert in stealth and quick kills", + "perSec": 7, + "clickAdd": 7, + "scoreMultiplier": 1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Assassin.png", + "tier": 1, + "rarity": Rarity.COMMON + }, + "paladin": { + "name": "Paladin", + "description": "Holy warrior with healing abilities", + "perSec": 8, + "clickAdd": 8, + "scoreMultiplier": 1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Paladin.png", + "tier": 1, + "rarity": Rarity.COMMON + }, + "ranger": { + "name": "Ranger", + "description": "Skilled in ranged combat and survival", + "perSec": 9, + "clickAdd": 9, + "scoreMultiplier": 1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Ranger.png", + "tier": 1, + "rarity": Rarity.COMMON + }, + "bard": { + "name": "Bard", + "description": "Musical magician with supportive abilities", + "perSec": 10, + "clickAdd": 10, + "scoreMultiplier": 1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Bard.png", + "tier": 1, + "rarity": Rarity.COMMON + }, + "crusader": { + "name": "Crusader", + "description": "Devout warrior on a holy quest", + "perSec": 11, + "clickAdd": 11, + "scoreMultiplier": 1.1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Crusader.png", + "tier": 2, + "rarity": Rarity.UNCOMMON + }, + "druid": { + "name": "Druid", + "description": "Nature mage with control over the elements", + "perSec": 12, + "clickAdd": 12, + "scoreMultiplier": 1.1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Druid.png", + "tier": 2, + "rarity": Rarity.UNCOMMON + }, + "samurai": { + "name": "Samurai", + "description": "Noble warrior with unmatched skill", + "perSec": 13, + "clickAdd": 13, + "scoreMultiplier": 1.1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Samurai.png", + "tier": 2, + "rarity": Rarity.UNCOMMON + }, + "ninja": { + "name": "Ninja", + "description": "Stealthy assassin with deadly precision", + "perSec": 14, + "clickAdd": 14, + "scoreMultiplier": 1.1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Ninja.png", + "tier": 2, + "rarity": Rarity.UNCOMMON + }, + "summoner": { + "name": "Summoner", + "description": "Mage with the ability to summon creatures", + "perSec": 15, + "clickAdd": 15, + "scoreMultiplier": 1.1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Summoner.png", + "tier": 2, + "rarity": Rarity.UNCOMMON + }, + "shaman": { + "name": "Shaman", + "description": "Spiritual healer and magic user", + "perSec": 16, + "clickAdd": 16, + "scoreMultiplier": 1.1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Shaman.png", + "tier": 2, + "rarity": Rarity.UNCOMMON + }, + "necromancer": { + "name": "Necromancer", + "description": "Dark mage with control over the dead", + "perSec": 17, + "clickAdd": 17, + "scoreMultiplier": 1.1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Necromancer.png", + "tier": 2, + "rarity": Rarity.UNCOMMON + }, + "berserker": { + "name": "Berserker", + "description": "Fierce warrior with unstoppable rage", + "perSec": 18, + "clickAdd": 18, + "scoreMultiplier": 1.1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Berserker.png", + "tier": 2, + "rarity": Rarity.UNCOMMON + }, + "monk": { + "name": "Monk", + "description": "Master of martial arts and inner peace", + "perSec": 19, + "clickAdd": 19, + "scoreMultiplier": 1.1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Monk.png", + "tier": 2, + "rarity": Rarity.UNCOMMON + }, + "alchemist": { + "name": "Alchemist", + "description": "Skilled in the art of potion-making", + "perSec": 20, + "clickAdd": 20, + "scoreMultiplier": 1.1, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Alchemist.png", + "tier": 2, + "rarity": Rarity.UNCOMMON + }, + "barbarian": { + "name": "Barbarian", + "description": "Savage warrior with immense strength", + "perSec": 21, + "clickAdd": 21, + "scoreMultiplier": 1.2, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Barbarian.png", + "tier": 3, + "rarity": Rarity.RARE + }, + "illusionist": { + "name": "Illusionist", + "description": "Mage with mastery over illusions", + "perSec": 22, + "clickAdd": 22, + "scoreMultiplier": 1.2, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Illusionist.png", + "tier": 3, + "rarity": Rarity.RARE + }, + "warlock": { + "name": "Warlock", + "description": "Dark mage with forbidden knowledge", + "perSec": 23, + "clickAdd": 23, + "scoreMultiplier": 1.2, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Warlock.png", + "tier": 3, + "rarity": Rarity.RARE + }, + "pirate": { + "name": "Pirate", + "description": "Swashbuckling rogue of the seas", + "perSec": 24, + "clickAdd": 24, + "scoreMultiplier": 1.2, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Pirate.png", + "tier": 3, + "rarity": Rarity.RARE + }, + "gladiator": { + "name": "Gladiator", + "description": "Champion of the arena", + "perSec": 25, + "clickAdd": 25, + "scoreMultiplier": 1.2, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Gladiator.png", + "tier": 3, + "rarity": Rarity.RARE + }, + "rune_master": { + "name": "Rune Master", + "description": "Mage with mastery over runic magic", + "perSec": 26, + "clickAdd": 26, + "scoreMultiplier": 1.2, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Rune_Master.png", + "tier": 3, + "rarity": Rarity.RARE + }, + "beastmaster": { + "name": "Beastmaster", + "description": "Warrior with control over beasts", + "perSec": 27, + "clickAdd": 27, + "scoreMultiplier": 1.2, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Beastmaster.png", + "tier": 3, + "rarity": Rarity.RARE + }, + "elementalist": { + "name": "Elementalist", + "description": "Mage with control over the elements", + "perSec": 28, + "clickAdd": 28, + "scoreMultiplier": 1.2, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Elementalist.png", + "tier": 3, + "rarity": Rarity.RARE + }, + "shadow_knight": { + "name": "Shadow Knight", + "description": "Dark warrior with control over shadows", + "perSec": 29, + "clickAdd": 29, + "scoreMultiplier": 1.2, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Shadow_Knight.png", + "tier": 3, + "rarity": Rarity.RARE + }, + "archmage": { + "name": "Archmage", + "description": "Supreme master of magical arts", + "perSec": 30, + "clickAdd": 30, + "scoreMultiplier": 1.2, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Archmage.png", + "tier": 3, + "rarity": Rarity.RARE + }, + "dark_paladin": { + "name": "Dark Paladin", + "description": "Corrupted knight with dark powers", + "perSec": 31, + "clickAdd": 31, + "scoreMultiplier": 1.3, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Dark_Paladin.png", + "tier": 4, + "rarity": Rarity.SUPERRARE + }, + "demon_hunter": { + "name": "Demon Hunter", + "description": "Expert in slaying demonic creatures", + "perSec": 32, + "clickAdd": 32, + "scoreMultiplier": 1.3, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Demon_Hunter.png", + "tier": 4, + "rarity": Rarity.SUPERRARE + }, + "spirit_guardian": { + "name": "Spirit Guardian", + "description": "Protector of the spiritual realm", + "perSec": 33, + "clickAdd": 33, + "scoreMultiplier": 1.3, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Spirit_Guardian.png", + "tier": 4, + "rarity": Rarity.SUPERRARE + }, + "phoenix": { + "name": "Phoenix", + "description": "Immortal bird of fire and rebirth", + "perSec": 34, + "clickAdd": 34, + "scoreMultiplier": 1.3, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Phoenix.png", + "tier": 4, + "rarity": Rarity.SUPERRARE + }, + "dragon_rider": { + "name": "Dragon Rider", + "description": "Warrior who rides a mighty dragon", + "perSec": 35, + "clickAdd": 35, + "scoreMultiplier": 1.3, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Dragon_Rider.png", + "tier": 4, + "rarity": Rarity.SUPERRARE + }, + "soul_reaper": { + "name": "Soul Reaper", + "description": "Harvester of souls from the afterlife", + "perSec": 36, + "clickAdd": 36, + "scoreMultiplier": 1.3, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Soul_Reaper.png", + "tier": 4, + "rarity": Rarity.SUPERRARE + }, + "stormcaller": { + "name": "Stormcaller", + "description": "Mage with control over storms", + "perSec": 37, + "clickAdd": 37, + "scoreMultiplier": 1.3, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Stormcaller.png", + "tier": 4, + "rarity": Rarity.SUPERRARE + }, + "blade_dancer": { + "name": "Blade Dancer", + "description": "Agile warrior with deadly precision", + "perSec": 38, + "clickAdd": 38, + "scoreMultiplier": 1.3, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Blade_Dancer.png", + "tier": 4, + "rarity": Rarity.SUPERRARE + }, + "celestial_mage": { + "name": "Celestial Mage", + "description": "Mage with power over celestial bodies", + "perSec": 39, + "clickAdd": 39, + "scoreMultiplier": 1.3, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Celestial_Mage.png", + "tier": 4, + "rarity": Rarity.SUPERRARE + }, + "void_walker": { + "name": "Void Walker", + "description": "Mage with control over void magic", + "perSec": 40, + "clickAdd": 40, + "scoreMultiplier": 1.3, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Void_Walker.png", + "tier": 4, + "rarity": Rarity.SUPERRARE + }, + "eternal_knight": { + "name": "Eternal Knight", + "description": "Immortal protector of the realm", + "perSec": 41, + "clickAdd": 41, + "scoreMultiplier": 1.4, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Eternal_Knight.png", + "tier": 5, + "rarity": Rarity.LEGENDARY + }, + "chaos_warrior": { + "name": "Chaos Warrior", + "description": "Warrior with control over chaos", + "perSec": 42, + "clickAdd": 42, + "scoreMultiplier": 1.4, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Chaos_Warrior.png", + "tier": 5, + "rarity": Rarity.LEGENDARY + }, + "starfall_mage": { + "name": "Starfall Mage", + "description": "Mage with control over falling stars", + "perSec": 43, + "clickAdd": 43, + "scoreMultiplier": 1.4, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Starfall_Mage.png", + "tier": 5, + "rarity": Rarity.LEGENDARY + }, + "abyssal_warlock": { + "name": "Abyssal Warlock", + "description": "Dark mage with control over the abyss", + "perSec": 44, + "clickAdd": 44, + "scoreMultiplier": 1.4, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Abyssal_Warlock.png", + "tier": 5, + "rarity": Rarity.LEGENDARY + }, + "lunar_knight": { + "name": "Lunar Knight", + "description": "Warrior with power over the moon", + "perSec": 45, + "clickAdd": 45, + "scoreMultiplier": 1.4, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Lunar_Knight.png", + "tier": 5, + "rarity": Rarity.LEGENDARY + }, + "cosmic_mage": { + "name": "Cosmic Mage", + "description": "Mage with control over cosmic energy", + "perSec": 46, + "clickAdd": 46, + "scoreMultiplier": 1.4, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Cosmic_Mage.png", + "tier": 5, + "rarity": Rarity.LEGENDARY + }, + "shadow_assassin": { + "name": "Shadow Assassin", + "description": "Master assassin with control over shadows", + "perSec": 47, + "clickAdd": 47, + "scoreMultiplier": 1.4, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Shadow_Assassin.png", + "tier": 5, + "rarity": Rarity.LEGENDARY + }, + "firelord": { + "name": "Firelord", + "description": "Mage with mastery over fire", + "perSec": 48, + "clickAdd": 48, + "scoreMultiplier": 1.4, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Firelord.png", + "tier": 5, + "rarity": Rarity.LEGENDARY + }, + "ice_queen": { + "name": "Ice Queen", + "description": "Mage with mastery over ice", + "perSec": 49, + "clickAdd": 49, + "scoreMultiplier": 1.4, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Ice_Queen.png", + "tier": 5, + "rarity": Rarity.LEGENDARY + }, + "celeste_the_starcaller": { + "name": "Celeste the Starcaller", + "description": "Mage with control over stars", + "perSec": 50, + "clickAdd": 50, + "scoreMultiplier": 1.4, + "isObtained": false, + "memberAmount": 1, + "texturePath": "res://Images/Members/Celeste_the_Starcaller.png", + "tier": 5, + "rarity": Rarity.LEGENDARY + } +} diff --git a/MemberDatabase/memberData.json b/MemberDatabase/memberData.json index b015985..ee569b2 100644 --- a/MemberDatabase/memberData.json +++ b/MemberDatabase/memberData.json @@ -8,7 +8,9 @@ "scoreMultiplier": 1, "isObtained": true, "memberAmount": 1, - "texturePath": "res://Images/Members/Squire.png" + "texturePath": "res://Images/Members/Squire.png", + "tier": 1, + "rarity": "Rarity.COMMON" }, { "name": "Archer", @@ -18,7 +20,9 @@ "scoreMultiplier": 1, "isObtained": true, "memberAmount": 1, - "texturePath": "res://Images/Members/Archer.png" + "texturePath": "res://Images/Members/Archer.png", + "tier": 1, + "rarity": "Rarity.COMMON" }, { "name": "Mage", @@ -28,207 +32,561 @@ "scoreMultiplier": 1, "isObtained": true, "memberAmount": 1, - "texturePath": "res://Images/Members/Mage.png" + "texturePath": "res://Images/Members/Mage.png", + "tier": 1, + "rarity": "Rarity.COMMON" }, { - "name": "Knight", - "description": "A brave warrior in heavy armor.", - "perSec": 2, - "clickAdd": 5, - "scoreMultiplier": 1, - "isObtained": true, - "memberAmount": 1, - "texturePath": "res://Images/Members/Knight.png" - }, - { - "name": "Healer", - "description": "Specializes in healing magic.", - "perSec": 0, - "clickAdd": 0, - "scoreMultiplier": 1, - "isObtained": true, - "memberAmount": 1, - "texturePath": "res://Images/Members/Healer.png" - }, - { - "name": "Thief", - "description": "Quick and stealthy, perfect for stealing.", - "perSec": 3, + "name": "Warrior", + "description": "Strong and brave, with high attack power", + "perSec": 15, "clickAdd": 15, - "scoreMultiplier": 1, + "scoreMultiplier": 1.1, "isObtained": true, "memberAmount": 1, - "texturePath": "res://Images/Members/Thief.png" - }, - { - "name": "Berserker", - "description": "A frenzied warrior with immense power.", - "perSec": 5, - "clickAdd": 25, - "scoreMultiplier": 1, - "isObtained": true, - "memberAmount": 1, - "texturePath": "res://Images/Members/Berserker.png" - }, - { - "name": "Paladin", - "description": "A holy warrior with both offensive and defensive skills.", - "perSec": 3, - "clickAdd": 10, - "scoreMultiplier": 1, - "isObtained": true, - "memberAmount": 1, - "texturePath": "res://Images/Members/Paladin.png" - }, - { - "name": "Druid", - "description": "A nature mage with control over the elements.", - "perSec": 4, - "clickAdd": 20, - "scoreMultiplier": 1, - "isObtained": true, - "memberAmount": 1, - "texturePath": "res://Images/Members/Druid.png" + "texturePath": "res://Images/Members/Warrior.png", + "tier": 1, + "rarity": "Rarity.COMMON" }, { "name": "Rogue", - "description": "A master of stealth and quick strikes.", - "perSec": 2, - "clickAdd": 15, - "scoreMultiplier": 1, + "description": "Quick and stealthy, with a high critical hit chance", + "perSec": 12, + "clickAdd": 18, + "scoreMultiplier": 1.1, "isObtained": true, "memberAmount": 1, - "texturePath": "res://Images/Members/Rogue.png" + "texturePath": "res://Images/Members/Rogue.png", + "tier": 1, + "rarity": "Rarity.COMMON" }, { - "name": "Barbarian", - "description": "A powerful melee fighter with a wild nature.", - "perSec": 6, - "clickAdd": 30, - "scoreMultiplier": 1, + "name": "Priest", + "description": "Healer with powerful restorative abilities", + "perSec": 8, + "clickAdd": 8, + "scoreMultiplier": 1.2, "isObtained": true, "memberAmount": 1, - "texturePath": "res://Images/Members/Barbarian.png" + "texturePath": "res://Images/Members/Priest.png", + "tier": 1, + "rarity": "Rarity.COMMON" }, { - "name": "Sorcerer", - "description": "A spellcaster with a variety of powerful spells.", - "perSec": 7, - "clickAdd": 35, - "scoreMultiplier": 1, + "name": "Paladin", + "description": "Holy warrior with balanced stats", + "perSec": 11, + "clickAdd": 11, + "scoreMultiplier": 1.2, "isObtained": true, "memberAmount": 1, - "texturePath": "res://Images/Members/Sorcerer.png" + "texturePath": "res://Images/Members/Paladin.png", + "tier": 1, + "rarity": "Rarity.COMMON" + }, + { + "name": "Hunter", + "description": "Ranged attacker with high agility", + "perSec": 13, + "clickAdd": 13, + "scoreMultiplier": 1.2, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Hunter.png", + "tier": 1, + "rarity": "Rarity.COMMON" + }, + { + "name": "Bard", + "description": "Support character with buffs and debuffs", + "perSec": 9, + "clickAdd": 9, + "scoreMultiplier": 1.3, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Bard.png", + "tier": 1, + "rarity": "Rarity.COMMON" }, { "name": "Monk", - "description": "A martial artist with quick reflexes.", - "perSec": 3, - "clickAdd": 10, - "scoreMultiplier": 1, + "description": "Martial artist with high dodge and attack speed", + "perSec": 14, + "clickAdd": 14, + "scoreMultiplier": 1.3, "isObtained": true, "memberAmount": 1, - "texturePath": "res://Images/Members/Monk.png" + "texturePath": "res://Images/Members/Monk.png", + "tier": 1, + "rarity": "Rarity.COMMON" }, { - "name": "Godric the Forest King", - "description": "A wise ruler of the enchanted forest.", - "perSec": 10, - "clickAdd": 50, - "scoreMultiplier": 2, + "name": "Necromancer", + "description": "Master of dark magic and summoner of undead", + "perSec": 16, + "clickAdd": 16, + "scoreMultiplier": 1.4, "isObtained": true, "memberAmount": 1, - "texturePath": "res://Images/Members/Godric.png" + "texturePath": "res://Images/Members/Necromancer.png", + "tier": 2, + "rarity": "Rarity.UNCOMMON" }, { - "name": "Elara the Enchantress", - "description": "A mysterious sorceress with immense power.", - "perSec": 8, - "clickAdd": 40, - "scoreMultiplier": 2, + "name": "Samurai", + "description": "Warrior with high precision and honor", + "perSec": 18, + "clickAdd": 18, + "scoreMultiplier": 1.4, "isObtained": true, "memberAmount": 1, - "texturePath": "res://Images/Members/Elara.png" + "texturePath": "res://Images/Members/Samurai.png", + "tier": 2, + "rarity": "Rarity.UNCOMMON" }, { - "name": "Thane the Swiftblade", - "description": "A master swordsman with unparalleled speed.", - "perSec": 6, - "clickAdd": 30, - "scoreMultiplier": 2, + "name": "Elementalist", + "description": "Mage with control over the elements", + "perSec": 17, + "clickAdd": 17, + "scoreMultiplier": 1.4, "isObtained": true, "memberAmount": 1, - "texturePath": "res://Images/Members/Thane.png" + "texturePath": "res://Images/Members/Elementalist.png", + "tier": 2, + "rarity": "Rarity.UNCOMMON" }, { - "name": "Morgana the Dark Witch", - "description": "A dark mage with forbidden knowledge.", - "perSec": 7, - "clickAdd": 35, - "scoreMultiplier": 2, + "name": "Druid", + "description": "Nature guardian with healing and summoning abilities", + "perSec": 19, + "clickAdd": 19, + "scoreMultiplier": 1.5, "isObtained": true, "memberAmount": 1, - "texturePath": "res://Images/Members/Morgana.png" + "texturePath": "res://Images/Members/Druid.png", + "tier": 2, + "rarity": "Rarity.UNCOMMON" }, { - "name": "Baldric the Brave", - "description": "A knight known for his bravery and honor.", - "perSec": 5, - "clickAdd": 25, - "scoreMultiplier": 2, - "isObtained": true, - "memberAmount": 1, - "texturePath": "res://Images/Members/Baldric.png" - }, - { - "name": "Isolde the Ice Queen", - "description": "A queen with control over ice and frost.", - "perSec": 9, - "clickAdd": 45, - "scoreMultiplier": 2, - "isObtained": true, - "memberAmount": 1, - "texturePath": "res://Images/Members/Isolde.png" - }, - { - "name": "Draven the Shadow Assassin", - "description": "A deadly assassin who strikes from the shadows.", - "perSec": 4, + "name": "Sorcerer", + "description": "Powerful spellcaster with high damage", + "perSec": 20, "clickAdd": 20, - "scoreMultiplier": 2, + "scoreMultiplier": 1.5, "isObtained": true, "memberAmount": 1, - "texturePath": "res://Images/Members/Draven.png" + "texturePath": "res://Images/Members/Sorcerer.png", + "tier": 2, + "rarity": "Rarity.UNCOMMON" }, { - "name": "Fiora the Flamecaller", - "description": "A mage with mastery over fire.", - "perSec": 8, - "clickAdd": 40, - "scoreMultiplier": 2, + "name": "Assassin", + "description": "Deadly and stealthy killer", + "perSec": 21, + "clickAdd": 21, + "scoreMultiplier": 1.5, "isObtained": true, "memberAmount": 1, - "texturePath": "res://Images/Members/Fiora.png" + "texturePath": "res://Images/Members/Assassin.png", + "tier": 2, + "rarity": "Rarity.UNCOMMON" }, { - "name": "Alistair the Protector", - "description": "A guardian with a strong sense of duty.", - "perSec": 5, + "name": "Berserker", + "description": "Fierce warrior with high attack speed", + "perSec": 22, + "clickAdd": 22, + "scoreMultiplier": 1.6, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Berserker.png", + "tier": 2, + "rarity": "Rarity.UNCOMMON" + }, + { + "name": "Summoner", + "description": "Can summon powerful creatures to fight", + "perSec": 23, + "clickAdd": 23, + "scoreMultiplier": 1.6, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Summoner.png", + "tier": 2, + "rarity": "Rarity.UNCOMMON" + }, + { + "name": "Illusionist", + "description": "Master of illusion and trickery", + "perSec": 24, + "clickAdd": 24, + "scoreMultiplier": 1.6, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Illusionist.png", + "tier": 2, + "rarity": "Rarity.UNCOMMON" + }, + { + "name": "Gladiator", + "description": "Fearless fighter with high defense", + "perSec": 25, "clickAdd": 25, - "scoreMultiplier": 2, + "scoreMultiplier": 1.6, "isObtained": true, "memberAmount": 1, - "texturePath": "res://Images/Members/Alistair.png" + "texturePath": "res://Images/Members/Gladiator.png", + "tier": 2, + "rarity": "Rarity.UNCOMMON" }, { - "name": "Lyra the Lightbringer", - "description": "A healer with a radiant aura.", - "perSec": 6, + "name": "Warlord", + "description": "Leader with commanding presence", + "perSec": 26, + "clickAdd": 26, + "scoreMultiplier": 1.7, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Warlord.png", + "tier": 3, + "rarity": "Rarity.RARE" + }, + { + "name": "Mystic", + "description": "Enchanter with mystical powers", + "perSec": 27, + "clickAdd": 27, + "scoreMultiplier": 1.7, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Mystic.png", + "tier": 3, + "rarity": "Rarity.RARE" + }, + { + "name": "Shaman", + "description": "Spiritual guide with healing and offensive spells", + "perSec": 28, + "clickAdd": 28, + "scoreMultiplier": 1.7, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Shaman.png", + "tier": 3, + "rarity": "Rarity.RARE" + }, + { + "name": "Warlock", + "description": "Dark sorcerer with powerful curses", + "perSec": 29, + "clickAdd": 29, + "scoreMultiplier": 1.7, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Warlock.png", + "tier": 3, + "rarity": "Rarity.RARE" + }, + { + "name": "Barbarian", + "description": "Brutal warrior with immense strength", + "perSec": 30, "clickAdd": 30, + "scoreMultiplier": 1.8, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Barbarian.png", + "tier": 3, + "rarity": "Rarity.RARE" + }, + { + "name": "Spellblade", + "description": "Warrior with enchanted blades", + "perSec": 31, + "clickAdd": 31, + "scoreMultiplier": 1.8, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Spellblade.png", + "tier": 3, + "rarity": "Rarity.RARE" + }, + { + "name": "Runesmith", + "description": "Artisan with knowledge of magical runes", + "perSec": 32, + "clickAdd": 32, + "scoreMultiplier": 1.8, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Runesmith.png", + "tier": 3, + "rarity": "Rarity.RARE" + }, + { + "name": "Templar", + "description": "Holy warrior with divine protection", + "perSec": 33, + "clickAdd": 33, + "scoreMultiplier": 1.8, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Templar.png", + "tier": 3, + "rarity": "Rarity.RARE" + }, + { + "name": "Demon Hunter", + "description": "Hunter specialized in slaying demons", + "perSec": 34, + "clickAdd": 34, + "scoreMultiplier": 1.8, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Demon_Hunter.png", + "tier": 3, + "rarity": "Rarity.RARE" + }, + { + "name": "Chronomancer", + "description": "Mage with control over time", + "perSec": 35, + "clickAdd": 35, + "scoreMultiplier": 1.9, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Chronomancer.png", + "tier": 4, + "rarity": "Rarity.SUPERRARE" + }, + { + "name": "Phoenix Knight", + "description": "Knight reborn from the ashes", + "perSec": 36, + "clickAdd": 36, + "scoreMultiplier": 1.9, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Phoenix_Knight.png", + "tier": 4, + "rarity": "Rarity.SUPERRARE" + }, + { + "name": "Shadowblade", + "description": "Rogue with mastery over shadows", + "perSec": 37, + "clickAdd": 37, + "scoreMultiplier": 1.9, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Shadowblade.png", + "tier": 4, + "rarity": "Rarity.SUPERRARE" + }, + { + "name": "Starcaller", + "description": "Mage with power to call forth stars", + "perSec": 38, + "clickAdd": 38, + "scoreMultiplier": 1.9, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Starcaller.png", + "tier": 4, + "rarity": "Rarity.SUPERRARE" + }, + { + "name": "Lich King", + "description": "Undead sorcerer with dark powers", + "perSec": 39, + "clickAdd": 39, + "scoreMultiplier": 1.9, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Lich_King.png", + "tier": 4, + "rarity": "Rarity.SUPERRARE" + }, + { + "name": "Beastmaster", + "description": "Warrior with control over beasts", + "perSec": 40, + "clickAdd": 40, + "scoreMultiplier": 1.9, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Beastmaster.png", + "tier": 4, + "rarity": "Rarity.SUPERRARE" + }, + { + "name": "Archmage", + "description": "Supreme master of magic", + "perSec": 41, + "clickAdd": 41, "scoreMultiplier": 2, "isObtained": true, "memberAmount": 1, - "texturePath": "res://Images/Members/Lyra.png" + "texturePath": "res://Images/Members/Archmage.png", + "tier": 4, + "rarity": "Rarity.SUPERRARE" + }, + { + "name": "Witch Hunter", + "description": "Hunter specialized in hunting witches", + "perSec": 42, + "clickAdd": 42, + "scoreMultiplier": 2, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Witch_Hunter.png", + "tier": 4, + "rarity": "Rarity.SUPERRARE" + }, + { + "name": "Nyx the Shadowcaster", + "description": "Sorceress with control over shadows", + "perSec": 43, + "clickAdd": 43, + "scoreMultiplier": 2, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Nyx_the_Shadowcaster.png", + "tier": 4, + "rarity": "Rarity.SUPERRARE" + }, + { + "name": "Cedric the Valiant", + "description": "Knight with unmatched valor", + "perSec": 44, + "clickAdd": 44, + "scoreMultiplier": 2, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Cedric_the_Valiant.png", + "tier": 4, + "rarity": "Rarity.SUPERRARE" + }, + { + "name": "Raven the Silent", + "description": "Stealthy assassin with deadly skills", + "perSec": 45, + "clickAdd": 45, + "scoreMultiplier": 2.1, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Raven_the_Silent.png", + "tier": 5, + "rarity": "Rarity.LEGENDARY" + }, + { + "name": "Zephyr the Swift", + "description": "Fast and agile warrior", + "perSec": 46, + "clickAdd": 46, + "scoreMultiplier": 2.1, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Zephyr_the_Swift.png", + "tier": 5, + "rarity": "Rarity.LEGENDARY" + }, + { + "name": "Thorn the Protector", + "description": "Guardian with high defense", + "perSec": 47, + "clickAdd": 47, + "scoreMultiplier": 2.1, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Thorn_the_Protector.png", + "tier": 5, + "rarity": "Rarity.LEGENDARY" + }, + { + "name": "Inferno the Flamebringer", + "description": "Mage with control over fire", + "perSec": 48, + "clickAdd": 48, + "scoreMultiplier": 2.1, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Inferno_the_Flamebringer.png", + "tier": 5, + "rarity": "Rarity.LEGENDARY" + }, + { + "name": "Eclipse the Shadowmaster", + "description": "Sorcerer with mastery over darkness", + "perSec": 49, + "clickAdd": 49, + "scoreMultiplier": 2.1, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Eclipse_the_Shadowmaster.png", + "tier": 5, + "rarity": "Rarity.LEGENDARY" + }, + { + "name": "Avalanche the Frost Giant", + "description": "Giant with control over ice", + "perSec": 50, + "clickAdd": 50, + "scoreMultiplier": 2.2, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Avalanche_the_Frost_Giant.png", + "tier": 5, + "rarity": "Rarity.LEGENDARY" + }, + { + "name": "Storm the Thunderlord", + "description": "Lord with control over storms", + "perSec": 51, + "clickAdd": 51, + "scoreMultiplier": 2.2, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Storm_the_Thunderlord.png", + "tier": 5, + "rarity": "Rarity.LEGENDARY" + }, + { + "name": "Luna the Moon Sorceress", + "description": "Sorceress with power over the moon", + "perSec": 52, + "clickAdd": 52, + "scoreMultiplier": 2.2, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Luna_the_Moon_Sorceress.png", + "tier": 5, + "rarity": "Rarity.LEGENDARY" + }, + { + "name": "Drake the Dragon Knight", + "description": "Knight with dragon-like powers", + "perSec": 53, + "clickAdd": 53, + "scoreMultiplier": 2.2, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Drake_the_Dragon_Knight.png", + "tier": 5, + "rarity": "Rarity.LEGENDARY" + }, + { + "name": "Celeste the Starcaller", + "description": "Mage with control over stars", + "perSec": 54, + "clickAdd": 54, + "scoreMultiplier": 2.3, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Celeste_the_Starcaller.png", + "tier": 5, + "rarity": "Rarity.LEGENDARY" } ] } diff --git a/MemberDatabase/tier1.json b/MemberDatabase/tier1.json new file mode 100644 index 0000000..0c78a33 --- /dev/null +++ b/MemberDatabase/tier1.json @@ -0,0 +1,114 @@ +{ + "members": [ + { + "name": "Squire", + "description": "Someone who does things for someone else, not very impressive.", + "perSec": 1, + "clickAdd": 1, + "scoreMultiplier": 1, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Squire.png", + "tier": 1 + }, + { + "name": "Archer", + "description": "Better at accurate clicks than consistent damage", + "perSec": 1, + "clickAdd": 20, + "scoreMultiplier": 1, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Archer.png", + "tier": 1 + }, + { + "name": "Mage", + "description": "A good mix of DPS and click power", + "perSec": 10, + "clickAdd": 10, + "scoreMultiplier": 1, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Mage.png", + "tier": 1 + }, + { + "name": "Knight", + "description": "Strong and reliable, a true protector", + "perSec": 5, + "clickAdd": 5, + "scoreMultiplier": 1, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Knight.png", + "tier": 1 + }, + { + "name": "Healer", + "description": "Keeps the team alive with healing magic", + "perSec": 1, + "clickAdd": 0, + "scoreMultiplier": 1, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Healer.png", + "tier": 1 + }, + { + "name": "Thief", + "description": "Stealthy and quick, steals from enemies", + "perSec": 3, + "clickAdd": 2, + "scoreMultiplier": 1.2, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Thief.png", + "tier": 1 + }, + { + "name": "Berserker", + "description": "Frenzied warrior with high attack power", + "perSec": 7, + "clickAdd": 7, + "scoreMultiplier": 1.2, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Berserker.png", + "tier": 1 + }, + { + "name": "Paladin", + "description": "Holy warrior with balanced skills", + "perSec": 4, + "clickAdd": 4, + "scoreMultiplier": 1.2, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Paladin.png", + "tier": 1 + }, + { + "name": "Druid", + "description": "Nature magic user, versatile and powerful", + "perSec": 6, + "clickAdd": 6, + "scoreMultiplier": 1.2, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Druid.png", + "tier": 1 + }, + { + "name": "Rogue", + "description": "A master of stealth and quick attacks", + "perSec": 2, + "clickAdd": 8, + "scoreMultiplier": 1.2, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Rogue.png", + "tier": 1 + } + ] +} diff --git a/MemberDatabase/tier2.json b/MemberDatabase/tier2.json new file mode 100644 index 0000000..d3dc850 --- /dev/null +++ b/MemberDatabase/tier2.json @@ -0,0 +1,114 @@ +{ + "members": [ + { + "name": "Barbarian", + "description": "Brute strength with massive damage", + "perSec": 8, + "clickAdd": 8, + "scoreMultiplier": 1.3, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Barbarian.png", + "tier": 2 + }, + { + "name": "Sorcerer", + "description": "Wields powerful magic to destroy enemies", + "perSec": 9, + "clickAdd": 9, + "scoreMultiplier": 1.3, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Sorcerer.png", + "tier": 2 + }, + { + "name": "Monk", + "description": "Balanced fighter with spiritual power", + "perSec": 5, + "clickAdd": 5, + "scoreMultiplier": 1.3, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Monk.png", + "tier": 2 + }, + { + "name": "Godric the Forest King", + "description": "Ruler of the forest with nature powers", + "perSec": 15, + "clickAdd": 10, + "scoreMultiplier": 1.3, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Godric_the_Forest_King.png", + "tier": 2 + }, + { + "name": "Elara the Enchantress", + "description": "Mystical enchantress with powerful spells", + "perSec": 12, + "clickAdd": 12, + "scoreMultiplier": 1.3, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Elara_the_Enchantress.png", + "tier": 2 + }, + { + "name": "Thane the Swiftblade", + "description": "Master swordsman with unparalleled speed", + "perSec": 14, + "clickAdd": 14, + "scoreMultiplier": 1.4, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Thane_the_Swiftblade.png", + "tier": 2 + }, + { + "name": "Morgana the Dark Witch", + "description": "Dark magic user with devastating spells", + "perSec": 16, + "clickAdd": 16, + "scoreMultiplier": 1.4, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Morgana_the_Dark_Witch.png", + "tier": 2 + }, + { + "name": "Baldric the Brave", + "description": "Courageous knight with unmatched bravery", + "perSec": 13, + "clickAdd": 13, + "scoreMultiplier": 1.4, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Baldric_the_Brave.png", + "tier": 2 + }, + { + "name": "Isolde the Ice Queen", + "description": "Queen with control over ice and snow", + "perSec": 18, + "clickAdd": 18, + "scoreMultiplier": 1.4, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Isolde_the_Ice_Queen.png", + "tier": 2 + }, + { + "name": "Draven the Shadow Assassin", + "description": "Stealthy assassin from the shadows", + "perSec": 20, + "clickAdd": 20, + "scoreMultiplier": 1.4, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Draven_the_Shadow_Assassin.png", + "tier": 2 + } + ] +} \ No newline at end of file diff --git a/MemberDatabase/tier3.json b/MemberDatabase/tier3.json new file mode 100644 index 0000000..d5e653f --- /dev/null +++ b/MemberDatabase/tier3.json @@ -0,0 +1,114 @@ +{ + "members": [ + { + "name": "Fiora the Flamecaller", + "description": "Master of fire magic with destructive power", + "perSec": 17, + "clickAdd": 17, + "scoreMultiplier": 1.5, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Fiora_the_Flamecaller.png", + "tier": 3 + }, + { + "name": "Alistair the Protector", + "description": "Defender with strong protective abilities", + "perSec": 11, + "clickAdd": 11, + "scoreMultiplier": 1.5, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Alistair_the_Protector.png", + "tier": 3 + }, + { + "name": "Nerida the Sea Sorceress", + "description": "Sorceress with control over the seas", + "perSec": 19, + "clickAdd": 19, + "scoreMultiplier": 1.5, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Nerida_the_Sea_Sorceress.png", + "tier": 3 + }, + { + "name": "Garret the Fierce", + "description": "Warrior with unmatched ferocity", + "perSec": 21, + "clickAdd": 21, + "scoreMultiplier": 1.5, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Garret_the_Fierce.png", + "tier": 3 + }, + { + "name": "Lysandra the Mystic", + "description": "Mystic with powerful and ancient knowledge", + "perSec": 22, + "clickAdd": 22, + "scoreMultiplier": 1.5, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Lysandra_the_Mystic.png", + "tier": 3 + }, + { + "name": "Talia the Stormbringer", + "description": "Commands the power of storms", + "perSec": 23, + "clickAdd": 23, + "scoreMultiplier": 1.6, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Talia_the_Stormbringer.png", + "tier": 3 + }, + { + "name": "Borin the Boulder", + "description": "Unmovable force with great strength", + "perSec": 25, + "clickAdd": 25, + "scoreMultiplier": 1.6, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Borin_the_Boulder.png", + "tier": 3 + }, + { + "name": "Lyra the Moonshadow", + "description": "Assassin with the power of the moon", + "perSec": 26, + "clickAdd": 26, + "scoreMultiplier": 1.6, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Lyra_the_Moonshadow.png", + "tier": 3 + }, + { + "name": "Kara the Windrunner", + "description": "Swift archer with control over wind", + "perSec": 27, + "clickAdd": 27, + "scoreMultiplier": 1.6, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Kara_the_Windrunner.png", + "tier": 3 + }, + { + "name": "Darius the Earthshaker", + "description": "Warrior with the power to shake the earth", + "perSec": 28, + "clickAdd": 28, + "scoreMultiplier": 1.6, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Darius_the_Earthshaker.png", + "tier": 3 + } + ] +} \ No newline at end of file diff --git a/MemberDatabase/tier4.json b/MemberDatabase/tier4.json new file mode 100644 index 0000000..0ddb186 --- /dev/null +++ b/MemberDatabase/tier4.json @@ -0,0 +1,114 @@ +{ + "members": [ + { + "name": "Ariana the Starcaller", + "description": "Mage with the ability to call upon stars", + "perSec": 30, + "clickAdd": 30, + "scoreMultiplier": 1.7, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Ariana_the_Starcaller.png", + "tier": 4 + }, + { + "name": "Grom the Thunderfist", + "description": "Warrior with fists like thunder", + "perSec": 31, + "clickAdd": 31, + "scoreMultiplier": 1.7, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Grom_the_Thunderfist.png", + "tier": 4 + }, + { + "name": "Selene the Frostwitch", + "description": "Witch with the power of frost", + "perSec": 32, + "clickAdd": 32, + "scoreMultiplier": 1.7, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Selene_the_Frostwitch.png", + "tier": 4 + }, + { + "name": "Victor the Valiant", + "description": "Valiant knight with great courage", + "perSec": 33, + "clickAdd": 33, + "scoreMultiplier": 1.7, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Victor_the_Valiant.png", + "tier": 4 + }, + { + "name": "Fenris the Beastmaster", + "description": "Master of beasts and wild creatures", + "perSec": 34, + "clickAdd": 34, + "scoreMultiplier": 1.7, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Fenris_the_Beastmaster.png", + "tier": 4 + }, + { + "name": "Zara the Flamestrike", + "description": "Warrior with the power of flames", + "perSec": 35, + "clickAdd": 35, + "scoreMultiplier": 1.8, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Zara_the_Flamestrike.png", + "tier": 4 + }, + { + "name": "Eldrin the Wise", + "description": "Mage with great wisdom and power", + "perSec": 36, + "clickAdd": 36, + "scoreMultiplier": 1.8, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Eldrin_the_Wise.png", + "tier": 4 + }, + { + "name": "Luna the Moonlight", + "description": "Mystic with the power of moonlight", + "perSec": 37, + "clickAdd": 37, + "scoreMultiplier": 1.8, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Luna_the_Moonlight.png", + "tier": 4 + }, + { + "name": "Orin the Invincible", + "description": "Warrior with unmatched strength", + "perSec": 38, + "clickAdd": 38, + "scoreMultiplier": 1.8, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Orin_the_Invincible.png", + "tier": 4 + }, + { + "name": "Seraphina the Radiant", + "description": "Angel with radiant power", + "perSec": 39, + "clickAdd": 39, + "scoreMultiplier": 1.8, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Seraphina_the_Radiant.png", + "tier": 4 + } + ] +} \ No newline at end of file diff --git a/MemberDatabase/tier5.json b/MemberDatabase/tier5.json new file mode 100644 index 0000000..537b6c1 --- /dev/null +++ b/MemberDatabase/tier5.json @@ -0,0 +1,114 @@ +{ + "members": [ + { + "name": "Thalor the Dragonborn", + "description": "Warrior with dragon's strength", + "perSec": 40, + "clickAdd": 40, + "scoreMultiplier": 1.9, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Thalor_the_Dragonborn.png", + "tier": 5 + }, + { + "name": "Aeris the Skyblade", + "description": "Swift warrior of the skies", + "perSec": 41, + "clickAdd": 41, + "scoreMultiplier": 1.9, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Aeris_the_Skyblade.png", + "tier": 5 + }, + { + "name": "Nyx the Shadowcaster", + "description": "Mage with control over shadows", + "perSec": 42, + "clickAdd": 42, + "scoreMultiplier": 1.9, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Nyx_the_Shadowcaster.png", + "tier": 5 + }, + { + "name": "Cedric the Valiant", + "description": "Knight with unmatched valor", + "perSec": 43, + "clickAdd": 43, + "scoreMultiplier": 1.9, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Cedric_the_Valiant.png", + "tier": 5 + }, + { + "name": "Raven the Silent", + "description": "Stealthy assassin with deadly skills", + "perSec": 44, + "clickAdd": 44, + "scoreMultiplier": 1.9, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Raven_the_Silent.png", + "tier": 5 + }, + { + "name": "Lyra the Stardancer", + "description": "Mystic with power over stars", + "perSec": 45, + "clickAdd": 45, + "scoreMultiplier": 2, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Lyra_the_Stardancer.png", + "tier": 5 + }, + { + "name": "Eldrin the Sage", + "description": "Sage with ancient wisdom", + "perSec": 46, + "clickAdd": 46, + "scoreMultiplier": 2, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Eldrin_the_Sage.png", + "tier": 5 + }, + { + "name": "Orion the Hunter", + "description": "Hunter with unparalleled skill", + "perSec": 47, + "clickAdd": 47, + "scoreMultiplier": 2, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Orion_the_Hunter.png", + "tier": 5 + }, + { + "name": "Thalia the Sunseeker", + "description": "Seeker of the sun's power", + "perSec": 48, + "clickAdd": 48, + "scoreMultiplier": 2, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Thalia_the_Sunseeker.png", + "tier": 5 + }, + { + "name": "Zephyr the Windcaller", + "description": "Caller of the winds", + "perSec": 49, + "clickAdd": 49, + "scoreMultiplier": 2, + "isObtained": true, + "memberAmount": 1, + "texturePath": "res://Images/Members/Zephyr_the_Windcaller.png", + "tier": 5 + } + ] +} \ No newline at end of file diff --git a/MemberInventory/Inventory_Data.gd b/MemberInventory/Inventory_Data.gd new file mode 100644 index 0000000..e95ab64 --- /dev/null +++ b/MemberInventory/Inventory_Data.gd @@ -0,0 +1,5 @@ +extends Resource +class_name InventoryData + +@export var slot_datas: Array[Slot_Data] + diff --git a/MemberInventory/Slot_Data.gd b/MemberInventory/Slot_Data.gd new file mode 100644 index 0000000..a5bc467 --- /dev/null +++ b/MemberInventory/Slot_Data.gd @@ -0,0 +1,14 @@ +extends Resource +class_name Slot_Data + +const MAX_STACK_SIZE: int = 99 + +@export var memberData: Member_Data +@export_range(1, MAX_STACK_SIZE) var quantity: int = 1: set = set_quantity + +func set_quantity(value: int) -> void: + quantity = value + if quantity > 1 and not memberData.stackable: + quantity = 1 + push_error("%s is not stackable, setting quantity to 1" % memberData.name) + diff --git a/TeamSelection.gd b/TeamSelection.gd index dff8862..2ad36b3 100644 --- a/TeamSelection.gd +++ b/TeamSelection.gd @@ -25,7 +25,7 @@ func load_character_buttons(): for character in MemberDatabase.character_data["members"]: #print("iterating through data") if character["isObtained"] ==true: - print ("Created character:", character["name"]) + print ("Found character:", character["name"]) var button = create_character_button(character) add_child(button) else: @@ -36,7 +36,7 @@ func load_character_buttons(): func create_character_button(member: Dictionary) -> TextureButton: var button = TextureButton.new() #Loads the texture specified in the memberData sheet - if member.has("texturePath"): + if FileAccess.file_exists(member["texturePath"]): button.texture_normal = load(member["texturePath"]) else: button.texture_normal = preload("res://Images/Members/Soldier.png") # Use a default texture if none is specified @@ -80,7 +80,7 @@ func _on_button_pressed(button: TextureButton, member: Dictionary): ##print("Button pressed: ", button.name) var selected_texture = button.texture_normal - var texture = button.texture_normal + #var texture = button.texture_normal # Logic to determine which target button to update (this can be based on user selection or some other logic) # For this example, we'll update the first available slot update_global_texture_singleton(selected_texture) diff --git a/UI.gd b/UI.gd new file mode 100644 index 0000000..943fd8c --- /dev/null +++ b/UI.gd @@ -0,0 +1,260 @@ +extends Control + +#https://www.youtube.com/watch?v=V79YabQZC1s +#13:03 + +var score = 0 +var clickAdd = 1 +var scorePerSec = 1 +var scoreMultiplier = 1 + +#Click Upgrades Costs +var clickUpgradeReq1 = 10 +var clickUpgradeReq10 = 100 +var clickUpgradeReq20 = 1000 +var clickUpgradeReq40 = 10000 +var clickUpgradeReq60 = 100000 +var clickUpgradeReq80 = 1000000 +var clickUpgradeReq100 = 10000000 +var clickUpgradeReq200 = 100000000 +var clickUpgradeReq400 = 1000000000 + + +# Click Upgrades Amount +var clickUpgradeAmt1 = 1 +var clickUpgradeAmt10 = 10 +var clickUpgradeAmt20 = 20 +var clickUpgradeAmt40 = 40 +var clickUpgradeAmt60 = 60 +var clickUpgradeAmt80 = 80 +var clickUpgradeAmt100 = 100 +var clickUpgradeAmt200 = 200 +var clickUpgradeAmt400 = 400 + + +# Passive Upgrades Costs +var passiveUpgradeReq2 = 100 +var passiveUpgradeReq10 = 1000 +var passiveUpgradeReq20 = 10000 +var passiveUpgradeReq50 = 100000 +var passiveUpgradeReq100 = 1000000 +var passiveUpgradeReq200 = 10000000 +var passiveUpgradeReq500 = 100000000 +var passiveUpgradeReq1000 = 1000000000 +var passiveUpgradeReq10000 = 10000000000 + +# Passive Upgrades Amount +var passiveUpgradeAmt2 = 2 +var passiveUpgradeAmt10 = 10 +var passiveUpgradeAmt20 = 20 +var passiveUpgradeAmt50 = 50 +var passiveUpgradeAmt100 = 100 +var passiveUpgradeAmt200 = 200 +var passiveUpgradeAmt500 = 500 +var passiveUpgradeAmt1000 = 1000 +var passiveUpgradeAmt10000 = 10000 + + + +# Called when the node enters the scene tree for the first time. +func _ready(): + $ClickUpgrades.get_popup().connect("id_pressed",clickUpgrade) + $PassiveUpgrades.get_popup().connect("id_pressed",passiveUpgrade) + $Timer.connect("timeout", _on_Timer_timeout) + $TeamButton.pressed.connect(self.openTeamWindow) + #Code for the Click Me Button (deprecated) + #$Click.pressed.connect(self._on_button_pressed) + +#Prints all input events, only for debugging +#func _input(event): + #print(event.as_text()) + +func _on_Timer_timeout(): + score += scorePerSec * scoreMultiplier + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + #Displays normal numbers until commas are needed + if score > 999: + $Score.text = str(scoreFormat(score)) + else: + $Score.text = str(score) #Changes the score number + +#This checks any input that comes in +func _input(event): + #Function to record every left click as a "Click" to add to the score + if event.is_action_pressed("left_mouse"): + leftClick() + #_on_button_pressed() + +func openTeamWindow(): + print("button pressed") + #Useful for getting children from other nodes + get_owner().get_node("Team").show() + #$Team.visible = !$Team.visible + +#Formats the score string so commas are inserted +func scoreFormat(score): + # Convert value to string. + var str_value: String = str(score) + + # Loop backward starting at the last 3 digits, + # add comma then, repeat every 3rd step. + for i in range(str_value.length()-3, 0, -3): + str_value = str_value.insert(i, ",") + score = str_value + return score + +func leftClick(): + score += clickAdd * scoreMultiplier + + +func clickUpgrade(id): + match id: + 0: + if score >= clickUpgradeReq1: + print ("Score sufficient") + score -=clickUpgradeReq1 + $ClickUpgrades.get_popup().set_item_disabled(id, true) + clickAdd += clickUpgradeAmt1 + else: + print("not enough score") + 1: + if score >= clickUpgradeReq10: + print ("Score sufficient") + score -=clickUpgradeReq10 + $ClickUpgrades.get_popup().set_item_disabled(id, true) + clickAdd += clickUpgradeAmt10 + else: + print("not enough score") + 2: + if score >= clickUpgradeReq20: + print ("Score sufficient") + score -=clickUpgradeReq20 + $ClickUpgrades.get_popup().set_item_disabled(id, true) + clickAdd += clickUpgradeAmt20 + else: + print("not enough score") + 3: + if score >= clickUpgradeReq40: + print ("Score sufficient") + score -=clickUpgradeReq40 + $ClickUpgrades.get_popup().set_item_disabled(id, true) + clickAdd += clickUpgradeAmt40 + else: + print("not enough score") + 4: + if score >= clickUpgradeReq60: + print ("Score sufficient") + score -=clickUpgradeReq60 + $ClickUpgrades.get_popup().set_item_disabled(id, true) + clickAdd += clickUpgradeAmt60 + else: + print("not enough score") + 5: + if score >= clickUpgradeReq80: + print ("Score sufficient") + score -=clickUpgradeReq80 + $ClickUpgrades.get_popup().set_item_disabled(id, true) + clickAdd += clickUpgradeAmt80 + else: + print("not enough score") + 6: + if score >= clickUpgradeReq100: + print ("Score sufficient") + score -=clickUpgradeReq100 + $ClickUpgrades.get_popup().set_item_disabled(id, true) + clickAdd += clickUpgradeAmt100 + else: + print("not enough score") + 7: + if score >= clickUpgradeReq200: + print ("Score sufficient") + score -=clickUpgradeReq200 + $ClickUpgrades.get_popup().set_item_disabled(id, true) + clickAdd += clickUpgradeAmt200 + else: + print("not enough score") + 8: + if score >= clickUpgradeReq400: + print ("Score sufficient") + score -=clickUpgradeReq400 + $ClickUpgrades.get_popup().set_item_disabled(id, true) + clickAdd += clickUpgradeAmt400 + else: + print("not enough score") + +func passiveUpgrade(id): + match id: + 0: + if score >= passiveUpgradeReq2: + print ("Score sufficient") + score -=passiveUpgradeReq2 + $PassiveUpgrades.get_popup().set_item_disabled(id, true) + scorePerSec = passiveUpgradeAmt2 + else: + print("not enough score") + 1: + if score >= passiveUpgradeReq10: + print ("Score sufficient") + score -=passiveUpgradeReq10 + $PassiveUpgrades.get_popup().set_item_disabled(id, true) + scorePerSec = passiveUpgradeAmt10 + else: + print("not enough score") + 2: + if score >= passiveUpgradeReq20: + print ("Score sufficient") + score -=passiveUpgradeReq20 + $PassiveUpgrades.get_popup().set_item_disabled(id, true) + scorePerSec = passiveUpgradeAmt20 + else: + print("not enough score") + 3: + if score >= passiveUpgradeReq50: + print ("Score sufficient") + score -=passiveUpgradeReq50 + $PassiveUpgrades.get_popup().set_item_disabled(id, true) + scorePerSec = passiveUpgradeAmt50 + else: + print("not enough score") + 4: + if score >= passiveUpgradeReq100: + print ("Score sufficient") + score -=passiveUpgradeReq100 + $PassiveUpgrades.get_popup().set_item_disabled(id, true) + scorePerSec = passiveUpgradeAmt100 + else: + print("not enough score") + 5: + if score >= passiveUpgradeReq200: + print ("Score sufficient") + score -=passiveUpgradeReq200 + $PassiveUpgrades.get_popup().set_item_disabled(id, true) + scorePerSec = passiveUpgradeAmt200 + else: + print("not enough score") + 6: + if score >= passiveUpgradeReq500: + print ("Score sufficient") + score -=passiveUpgradeReq500 + $PassiveUpgrades.get_popup().set_item_disabled(id, true) + scorePerSec = passiveUpgradeAmt500 + else: + print("not enough score") + 7: + if score >= passiveUpgradeReq1000: + print ("Score sufficient") + score -=passiveUpgradeReq1000 + $PassiveUpgrades.get_popup().set_item_disabled(id, true) + scorePerSec = passiveUpgradeAmt1000 + else: + print("not enough score") + 8: + if score >= passiveUpgradeReq10000: + print ("Score sufficient") + score -=passiveUpgradeReq10000 + $PassiveUpgrades.get_popup().set_item_disabled(id, true) + scorePerSec = passiveUpgradeAmt10000 + else: + print("not enough score") diff --git a/User Interface/BossGrid.gd b/User Interface/BossGrid.gd index 6149636..2f2701a 100644 --- a/User Interface/BossGrid.gd +++ b/User Interface/BossGrid.gd @@ -26,7 +26,7 @@ func create_boss_button(boss: Dictionary) -> TextureButton: func _on_button_hovered(button: TextureButton, boss: Dictionary): - #current_member = member + #Generates the hovered tooltips #The backslash \ allows you to continue to the next line while concatenating the string var tooltip_text = "" + str(boss["name"]) + "\n" + "" + str(boss["description"]) + "\n" + "Total Health: " + str(boss["totalHealth"]) + "\n" + \ "Minimum DPS Required: " + str(boss["minDPS"]) @@ -38,7 +38,18 @@ func _on_button_exited(button: TextureButton): func _on_button_pressed(button: TextureButton, boss: Dictionary): - #var character_manager = get_node("/root/Root/UI/CharacterRoll") - #character_manager.roll_character() - - $CharacterRoll.roll_character() + #Checks you have the prerquisites, deducts damage + if Global.globalDamagePerClick >= int(boss["minClickDmg"]): + if Global.globalDamagePerSec >= int(boss["minDPS"]): + if Global.globalDamage >= int(boss["totalHealth"]): + var damageCost = int(boss["totalHealth"]) + var bossTier = boss["bossTier"] + Global.globalDamage -= damageCost + $CharacterRoll.roll_character(bossTier) + else: + print("Not enough Total Damage!") + else: + print("Not enough DPS!") + else: + print("Not enough Damage per Click!") + diff --git a/User Interface/CharacterRoll.gd b/User Interface/CharacterRoll.gd index b72dac5..b4d53f1 100644 --- a/User Interface/CharacterRoll.gd +++ b/User Interface/CharacterRoll.gd @@ -2,11 +2,20 @@ extends PanelContainer func _ready(): load_character_inventory() + #pass var character_data = [] var getMembers = [] +const Rarity = { + "COMMON":1.0, + "UNCOMMON": 0.8, + "RARE": 0.4, + "SUPERRARE": 0.08, + "LEGENDARY": 0.02 +} + func load_character_inventory(): var file_path = "user://MemberDatabase/memberData.json" if FileAccess.file_exists(file_path): @@ -52,17 +61,34 @@ func update_character(index, new_data): else: print("Invalid character index: ", index) -func roll_character(): +func roll_character(bossTier): if character_data.size() == 0: print("No characters in inventory.") return + print("Boss tier is:", bossTier) getMembers = character_data["members"] - var random_index = randi() % getMembers.size() - var random_character = getMembers[random_index] - if not random_character["isObtained"]: - random_character["isObtained"] = true - random_character["memberAmount"] += 1 - save_character_inventory() - print("Rolled character: ", random_character["name"]) + var rolledcharacter = choose_weighted_random_member(getMembers) + print("Weighted Character:", rolledcharacter) + for entry in getMembers: + if entry["name"] == rolledcharacter["name"]: + #var random_character = getMembers[entry] + #print ("Matched", entry["name"], "to", rolledcharacter["name"]) + if not rolledcharacter["isObtained"]: + rolledcharacter["isObtained"] = true + rolledcharacter["memberAmount"] += 1 + save_character_inventory() +func choose_weighted_random_member(getMembers): + var total_weight = 0.0 + for member in getMembers: + total_weight += Rarity.get(member["rarity"], 0) + + var random_value = randf() * total_weight + var cumulative_weight = 0.0 + + for member in getMembers: + cumulative_weight += Rarity.get(member["rarity"], 0) + if random_value < cumulative_weight: + return member + return null # Fallback if something goes wrong diff --git a/addons/weighted_choice/WeightedChoice.gd b/addons/weighted_choice/WeightedChoice.gd new file mode 100644 index 0000000..390ab55 --- /dev/null +++ b/addons/weighted_choice/WeightedChoice.gd @@ -0,0 +1,79 @@ +extends Object +class_name WeightedChoice +## This class provide a static [method pick] method you can call to +## choose an item from a dictionary based on weights. +## [br] +## Example: +## [codeblock] +## # Define weights for ease of use +## const Rarity = { +## "COMMON":0.85, +## "UNCOMMON": 0.10, +## "RARE": 0.05 +## } +## +## var items = { +## "copper": {"name": "Copper item", "rarity": Rarity.COMMON}, +## "silver": {"name": "Silver item", "rarity": Rarity.UNCOMMON}, +## "gold": {"name": "Gold item", "rarity": Rarity.RARE} +## } +## +## var key = WeightedChoice.pick(items, "rarity") # "copper", "silver", or "gold" +## [/codeblock] + + +## Takes a dictionary, and picks one item based based on weights. +## [br] +## If [param weight_key] is set, the function will search for weights in +## a nested dictionary +## [br][br] +## Returns a key. +## [br][br] +## [b]Usage[/b]: +## [br][br] +## [i]Non-nested weights:[/i] +## [codeblock] +## var dict = { +## "A": 0.85, +## "B": 0.10, +## "C": 0.05 +## } +## +## var key = WeightedChoice.pick(dict) # "A", "B", or "C" +## [/codeblock] +## +## [i]Nested weights[/i] +## [codeblock] +## var items = { +## "copper": {"name": "Copper item", "weight": 0.85}, +## "silver": {"name": "Silver item", "weight": 0.10}, +## "gold": {"name": "Gold item", "weight": 0.05} +## } +## +## var key = WeightedChoice.pick(items, "weight") # "copper", "silver", or "gold" +## [/codeblock] +static func pick(dict: Dictionary, weight_key = null) -> Variant: + + var weights_sum := 0.0 + var keys = dict.keys() + # only relevant for non-nested weights + var weights = null + # weights are in a innested dictionary + if weight_key: + for item_key in dict: + weights_sum += dict[item_key][weight_key] + else: + weights = dict.values() + for weight in weights: + weights_sum += weight + + var remaining_distance := randf() * weights_sum + for i in dict.size(): + if weight_key: + remaining_distance -= dict[keys[i]][weight_key] + else: + remaining_distance -= weights[i] + if remaining_distance < 0: + return keys[i] + + return keys[0] diff --git a/addons/weighted_choice/demo/loot_box_example.tscn b/addons/weighted_choice/demo/loot_box_example.tscn new file mode 100644 index 0000000..2400390 --- /dev/null +++ b/addons/weighted_choice/demo/loot_box_example.tscn @@ -0,0 +1,349 @@ +[gd_scene load_steps=18 format=3 uid="uid://ct50pprqfhtpi"] + +[ext_resource type="Script" path="res://addons/weighted_choice/demo/lootbox.gd" id="1_a5me8"] +[ext_resource type="Texture2D" uid="uid://biicl6o7uno0q" path="res://addons/weighted_choice/demo/sprites/Chests.png" id="2_givau"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_b3b1n"] +atlas = ExtResource("2_givau") +region = Rect2(0, 0, 48, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_s87vt"] +atlas = ExtResource("2_givau") +region = Rect2(240, 0, 48, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_yurex"] +atlas = ExtResource("2_givau") +region = Rect2(288, 0, 48, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_vmsgx"] +atlas = ExtResource("2_givau") +region = Rect2(384, 0, 48, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4og2n"] +atlas = ExtResource("2_givau") +region = Rect2(432, 0, 48, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_1ivt1"] +atlas = ExtResource("2_givau") +region = Rect2(336, 0, 48, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_b4g24"] +atlas = ExtResource("2_givau") +region = Rect2(48, 0, 48, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_j8qjv"] +atlas = ExtResource("2_givau") +region = Rect2(96, 0, 48, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ewh4q"] +atlas = ExtResource("2_givau") +region = Rect2(144, 0, 48, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_n7p1f"] +atlas = ExtResource("2_givau") +region = Rect2(192, 0, 48, 32) + +[sub_resource type="SpriteFrames" id="SpriteFrames_n52p6"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_b3b1n") +}], +"loop": false, +"name": &"idle", +"speed": 0.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_s87vt") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_yurex") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_vmsgx") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_4og2n") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_1ivt1") +}], +"loop": false, +"name": &"open", +"speed": 9.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_b3b1n") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_b4g24") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_j8qjv") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ewh4q") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_n7p1f") +}], +"loop": true, +"name": &"shake", +"speed": 10.0 +}] + +[sub_resource type="Animation" id="Animation_0enfg"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("ItemSprite2D:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(1, 1)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("ItemSprite2D:visible") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [true] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("ItemSprite2D:position") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(303, 172)] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("ResetButton:visible") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} + +[sub_resource type="Animation" id="Animation_1oyc2"] +resource_name = "close" +length = 5.0 +tracks/0/type = "method" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("AnimatedSprite2D") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.6), +"transitions": PackedFloat32Array(1, 1), +"values": [{ +"args": [&"open"], +"method": &"play_backwards" +}, { +"args": [&"idle"], +"method": &"play" +}] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("ItemSprite2D:visible") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("ItemLabel:visible") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("ResetButton:visible") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} + +[sub_resource type="Animation" id="Animation_mw7va"] +resource_name = "open" +length = 5.0 +tracks/0/type = "method" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("AnimatedSprite2D") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1.8), +"transitions": PackedFloat32Array(1, 1), +"values": [{ +"args": [&"shake"], +"method": &"play" +}, { +"args": [&"open"], +"method": &"play" +}] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("ItemSprite2D:scale") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(2.5, 2.7), +"transitions": PackedFloat32Array(0.5, 1), +"update": 0, +"values": [Vector2(0.5, 0.5), Vector2(2, 2)] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("ItemSprite2D:visible") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0, 2.5), +"transitions": PackedFloat32Array(1, 1), +"update": 1, +"values": [false, true] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("ItemSprite2D:position") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(2.5, 2.7), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Vector2(303, 172), Vector2(303, 127)] +} +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("ItemLabel:visible") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"times": PackedFloat32Array(0, 2.5), +"transitions": PackedFloat32Array(1, 1), +"update": 1, +"values": [false, true] +} +tracks/5/type = "value" +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/path = NodePath("ResetButton:visible") +tracks/5/interp = 1 +tracks/5/loop_wrap = true +tracks/5/keys = { +"times": PackedFloat32Array(0, 2.5), +"transitions": PackedFloat32Array(1, 1), +"update": 1, +"values": [false, true] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_3kcay"] +_data = { +"RESET": SubResource("Animation_0enfg"), +"close": SubResource("Animation_1oyc2"), +"open": SubResource("Animation_mw7va") +} + +[node name="LootBoxExample" type="Node2D"] +script = ExtResource("1_a5me8") + +[node name="ColorRect" type="ColorRect" parent="."] +offset_left = -6.0 +offset_top = -12.0 +offset_right = 583.0 +offset_bottom = 333.0 +color = Color(0.270588, 0.156863, 0.235294, 1) +metadata/_edit_lock_ = true + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +texture_filter = 1 +position = Vector2(305, 185) +scale = Vector2(2.9375, 2.9375) +sprite_frames = SubResource("SpriteFrames_n52p6") +animation = &"idle" +autoplay = "idle" + +[node name="TextureButton" type="TextureButton" parent="."] +offset_left = 1.0 +offset_top = -2.0 +offset_right = 574.0 +offset_bottom = 320.0 +ignore_texture_size = true +metadata/_edit_lock_ = true + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_3kcay") +} + +[node name="ItemLabel" type="Label" parent="."] +visible = false +offset_left = 201.0 +offset_top = 57.0 +offset_right = 404.0 +offset_bottom = 83.0 +text = "Copper Sword" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="ItemSprite2D" type="Sprite2D" parent="."] +texture_filter = 1 +position = Vector2(303, 172) +region_rect = Rect2(10, 0, 20, 20) + +[node name="ResetButton" type="Button" parent="."] +visible = false +offset_left = 268.0 +offset_top = 277.0 +offset_right = 319.0 +offset_bottom = 308.0 +text = "Reset" + +[connection signal="pressed" from="TextureButton" to="." method="_on_texture_button_pressed"] +[connection signal="pressed" from="ResetButton" to="." method="_on_reset_button_pressed"] diff --git a/addons/weighted_choice/demo/lootbox.gd b/addons/weighted_choice/demo/lootbox.gd new file mode 100644 index 0000000..14f6154 --- /dev/null +++ b/addons/weighted_choice/demo/lootbox.gd @@ -0,0 +1,55 @@ +extends Node + +const Rarity = { + "COMMON":0.8, + "UNCOMMON": 0.2, + "RARE": 0.1, + "LEGENDARY": 0.05 +} + +var items = { + "copper_sword": { + "name": "Copper Sword", + "sprite": preload("res://addons/weighted_choice/demo/sprites/copper_sword.png"), + "damage": 10, + "rarity": Rarity.COMMON + }, + "iron_sword": { + "name": "Iron Sword", + "sprite": preload("res://addons/weighted_choice/demo/sprites/iron_sword.png"), + "damage": 25, + "rarity": Rarity.UNCOMMON + }, + "gold_sword": { + "name": "Gold Sword", + "sprite": preload("res://addons/weighted_choice/demo/sprites/gold_sword.png"), + "damage": 50, + "rarity": Rarity.RARE + }, + "diamond_sword": { + "name": "Diamond Sword", + "sprite": preload("res://addons/weighted_choice/demo/sprites/diamond_sword.png"), + "damage": 80, + "rarity": Rarity.LEGENDARY + } +} + +var opened = false +var loot + +func open(): + opened = true + loot = items[WeightedChoice.pick(items, "rarity")] + $ItemLabel.text = loot.name + $ItemSprite2D.texture = loot.sprite + $AnimationPlayer.play("open") + + +func _on_texture_button_pressed(): + if not opened: + open() + +func _on_reset_button_pressed(): + opened = false + loot = "" + $AnimationPlayer.play("close") diff --git a/addons/weighted_choice/demo/sprites/Chests.png b/addons/weighted_choice/demo/sprites/Chests.png new file mode 100644 index 0000000..ccda88a Binary files /dev/null and b/addons/weighted_choice/demo/sprites/Chests.png differ diff --git a/addons/weighted_choice/demo/sprites/Chests.png.import b/addons/weighted_choice/demo/sprites/Chests.png.import new file mode 100644 index 0000000..b0259f0 --- /dev/null +++ b/addons/weighted_choice/demo/sprites/Chests.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://biicl6o7uno0q" +path="res://.godot/imported/Chests.png-05f25aacdd0ef5d4d6807ab80d3500ca.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/weighted_choice/demo/sprites/Chests.png" +dest_files=["res://.godot/imported/Chests.png-05f25aacdd0ef5d4d6807ab80d3500ca.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/addons/weighted_choice/demo/sprites/copper_sword.png b/addons/weighted_choice/demo/sprites/copper_sword.png new file mode 100644 index 0000000..9e6bb12 Binary files /dev/null and b/addons/weighted_choice/demo/sprites/copper_sword.png differ diff --git a/addons/weighted_choice/demo/sprites/copper_sword.png.import b/addons/weighted_choice/demo/sprites/copper_sword.png.import new file mode 100644 index 0000000..fc00396 --- /dev/null +++ b/addons/weighted_choice/demo/sprites/copper_sword.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c6fcfm54auk24" +path="res://.godot/imported/copper_sword.png-c1698f7115d81b126e7db535c91c167a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/weighted_choice/demo/sprites/copper_sword.png" +dest_files=["res://.godot/imported/copper_sword.png-c1698f7115d81b126e7db535c91c167a.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/addons/weighted_choice/demo/sprites/diamond_sword.png b/addons/weighted_choice/demo/sprites/diamond_sword.png new file mode 100644 index 0000000..9e5754e Binary files /dev/null and b/addons/weighted_choice/demo/sprites/diamond_sword.png differ diff --git a/addons/weighted_choice/demo/sprites/diamond_sword.png.import b/addons/weighted_choice/demo/sprites/diamond_sword.png.import new file mode 100644 index 0000000..c91a4ca --- /dev/null +++ b/addons/weighted_choice/demo/sprites/diamond_sword.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d4njor6814bhx" +path="res://.godot/imported/diamond_sword.png-1aae9c799b9ec45fff305ebb1d641fb0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/weighted_choice/demo/sprites/diamond_sword.png" +dest_files=["res://.godot/imported/diamond_sword.png-1aae9c799b9ec45fff305ebb1d641fb0.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/addons/weighted_choice/demo/sprites/gold_sword.png b/addons/weighted_choice/demo/sprites/gold_sword.png new file mode 100644 index 0000000..c6e15f0 Binary files /dev/null and b/addons/weighted_choice/demo/sprites/gold_sword.png differ diff --git a/addons/weighted_choice/demo/sprites/gold_sword.png.import b/addons/weighted_choice/demo/sprites/gold_sword.png.import new file mode 100644 index 0000000..d4a8c68 --- /dev/null +++ b/addons/weighted_choice/demo/sprites/gold_sword.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cpevadwbo3xlv" +path="res://.godot/imported/gold_sword.png-ea456cc0aa9cc73dd4ac96d890acfdf4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/weighted_choice/demo/sprites/gold_sword.png" +dest_files=["res://.godot/imported/gold_sword.png-ea456cc0aa9cc73dd4ac96d890acfdf4.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/addons/weighted_choice/demo/sprites/iron_sword.png b/addons/weighted_choice/demo/sprites/iron_sword.png new file mode 100644 index 0000000..9bc8736 Binary files /dev/null and b/addons/weighted_choice/demo/sprites/iron_sword.png differ diff --git a/addons/weighted_choice/demo/sprites/iron_sword.png.import b/addons/weighted_choice/demo/sprites/iron_sword.png.import new file mode 100644 index 0000000..621d0e4 --- /dev/null +++ b/addons/weighted_choice/demo/sprites/iron_sword.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://0jrhvuff1uwr" +path="res://.godot/imported/iron_sword.png-c40e6914f6a8e966ffc4d2f9a12d99fe.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/weighted_choice/demo/sprites/iron_sword.png" +dest_files=["res://.godot/imported/iron_sword.png-c40e6914f6a8e966ffc4d2f9a12d99fe.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/addons/weighted_choice/plugin.cfg b/addons/weighted_choice/plugin.cfg new file mode 100644 index 0000000..2d85b3e --- /dev/null +++ b/addons/weighted_choice/plugin.cfg @@ -0,0 +1,7 @@ +[plugin] + +name="Weighted Choice" +description="Chance Based Random Choice in Godot 4." +author="rehhouari" +version="1.0.0" +script="plugin.gd" diff --git a/addons/weighted_choice/plugin.gd b/addons/weighted_choice/plugin.gd new file mode 100644 index 0000000..5af87f6 --- /dev/null +++ b/addons/weighted_choice/plugin.gd @@ -0,0 +1,2 @@ +@tool +extends EditorPlugin diff --git a/inventory.gd b/inventory.gd new file mode 100644 index 0000000..270d461 --- /dev/null +++ b/inventory.gd @@ -0,0 +1,21 @@ +extends PanelContainer + +const Slot = preload("res://slot.tscn") + +@onready var member_grid = $MarginContainer/MemberGrid + +func _ready() -> void: + var inv_data = preload("res://Inventory.tres") + populate_member_grid(inv_data.slot_datas) + +func populate_member_grid(slot_datas: Array[Slot_Data]) -> void: + for child in member_grid.get_children(): + child.queue_free() + + for slot_data in slot_datas: + var slot = Slot.instantiate() + member_grid.add_child(slot) + + #Populates slot + if slot_data: + slot.set_slot_data(slot_data) diff --git a/slot.gd b/slot.gd new file mode 100644 index 0000000..da9d696 --- /dev/null +++ b/slot.gd @@ -0,0 +1,14 @@ +extends PanelContainer + +@onready var texture_rect = $MarginContainer/TextureRect +@onready var quantity_label = $"Quantity Label" + +func set_slot_data(slot_data: Slot_Data) -> void: + var member_data = slot_data.memberData + #Updates texture + texture_rect.texture = member_data.texture + tooltip_text = "%s\n%s" % [member_data.name, member_data.description] + + if slot_data.quantity > 1: + quantity_label.text = "x%s" % slot_data.quantity + quantity_label.show()