From 2235aa3d6a5630d8f8125f266f67e902b61327d2 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 18 Feb 2026 23:57:07 -0500 Subject: [PATCH] added more globals, building out DnD connections --- README.md | 4 +- project.godot | 3 ++ scenes/ui/character_creator.tscn | 71 ++++++++++++++++++++++++++++++ scripts/autoloads/abilities.gd | 44 ++++++++++++++++++ scripts/autoloads/abilities.gd.uid | 1 + scripts/autoloads/classes.gd | 42 ++++++++++++++++++ scripts/autoloads/classes.gd.uid | 1 + scripts/autoloads/dice.gd | 14 +++++- scripts/autoloads/skills.gd | 43 ++++++++++++++++++ scripts/autoloads/skills.gd.uid | 1 + 10 files changed, 222 insertions(+), 2 deletions(-) create mode 100644 scenes/ui/character_creator.tscn create mode 100644 scripts/autoloads/abilities.gd create mode 100644 scripts/autoloads/abilities.gd.uid create mode 100644 scripts/autoloads/classes.gd create mode 100644 scripts/autoloads/classes.gd.uid create mode 100644 scripts/autoloads/skills.gd create mode 100644 scripts/autoloads/skills.gd.uid diff --git a/README.md b/README.md index e86acde..013ab1a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # Basketball Tactics (working title) -A prototype for a turn-based, tactical basketball game. \ No newline at end of file +A prototype for a turn-based, tactical basketball game. +## Attribution +This work includes material from the System Reference Document 5.2.1 (“SRD 5.2.1”) by Wizards of the Coast LLC, available at https://www.dndbeyond.com/srd. The SRD 5.2.1 is licensed under the Creative Commons Attribution 4.0 International License, available at https://creativecommons.org/licenses/by/4.0/legalcode. diff --git a/project.godot b/project.godot index 869b533..3ac20e0 100644 --- a/project.godot +++ b/project.godot @@ -19,6 +19,9 @@ config/icon="uid://eyvap3pllv" Globals="*uid://bjvmd2grgcjl1" Dice="*uid://idushb7pc7k4" +Abilities="*uid://bmwkhgalg32ud" +Classes="*uid://dow1usjxob6oi" +Skills="*uid://h2dvjkkl5uhk" [display] diff --git a/scenes/ui/character_creator.tscn b/scenes/ui/character_creator.tscn new file mode 100644 index 0000000..200017b --- /dev/null +++ b/scenes/ui/character_creator.tscn @@ -0,0 +1,71 @@ +[gd_scene format=3 uid="uid://c7ry0sldgsd6g"] + +[node name="CharacterCreator" type="Control" unique_id=429203591] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=830349662] +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 40.0 + +[node name="TitleLabel" type="Label" parent="VBoxContainer" unique_id=1313428113] +layout_mode = 2 +theme_override_font_sizes/font_size = 64 +text = "Character/Player Creation" + +[node name="CharacterNameField" type="HBoxContainer" parent="VBoxContainer" unique_id=1144305927] +layout_mode = 2 + +[node name="CharacterNameLabel" type="Label" parent="VBoxContainer/CharacterNameField" unique_id=377396273] +layout_mode = 2 +text = "Name: " + +[node name="CharacterNameEntry" type="LineEdit" parent="VBoxContainer/CharacterNameField" unique_id=768350209] +layout_mode = 2 +size_flags_horizontal = 3 +placeholder_text = "Shaq the Enormous" + +[node name="CharacterClassField" type="HBoxContainer" parent="VBoxContainer" unique_id=285886400] +layout_mode = 2 + +[node name="CharacterClassLabel" type="Label" parent="VBoxContainer/CharacterClassField" unique_id=1412992125] +layout_mode = 2 +text = "Class: " + +[node name="CharacterClassOptions" type="OptionButton" parent="VBoxContainer/CharacterClassField" unique_id=1792788958] +layout_mode = 2 +size_flags_horizontal = 3 +item_count = 12 +popup/item_0/text = "Barbarian" +popup/item_0/id = 0 +popup/item_1/text = "Bard" +popup/item_1/id = 1 +popup/item_2/text = "Cleric" +popup/item_2/id = 2 +popup/item_3/text = "Druid" +popup/item_3/id = 3 +popup/item_4/text = "Fighter" +popup/item_4/id = 4 +popup/item_5/text = "Monk" +popup/item_5/id = 5 +popup/item_6/text = "Paladin" +popup/item_6/id = 6 +popup/item_7/text = "Ranger" +popup/item_7/id = 7 +popup/item_8/text = "Rogue" +popup/item_8/id = 8 +popup/item_9/text = "Sorcerer" +popup/item_9/id = 9 +popup/item_10/text = "Warlock" +popup/item_10/id = 10 +popup/item_11/text = "Wizard" +popup/item_11/id = 11 + +[node name="FinishButton" type="Button" parent="VBoxContainer" unique_id=586398404] +layout_mode = 2 +text = "Finish" diff --git a/scripts/autoloads/abilities.gd b/scripts/autoloads/abilities.gd new file mode 100644 index 0000000..891a952 --- /dev/null +++ b/scripts/autoloads/abilities.gd @@ -0,0 +1,44 @@ +extends Node + +enum Ability { + STRENGTH, + DEXTERITY, + CONSTITUTION, + INTELLIGENCE, + WISDOM, + CHARISMA +} + +var related_skills: Dictionary[Ability, Array] = { + Ability.STRENGTH: [ + Skills.Skill.ATHLETICS + ], + Ability.DEXTERITY: [ + Skills.Skill.ACROBATICS, + Skills.Skill.SLEIGHT_OF_HAND, + Skills.Skill.STEALTH, + ], + Ability.CONSTITUTION: [ + + ], + Ability.INTELLIGENCE: [ + Skills.Skill.ARCANA, + Skills.Skill.HISTORY, + Skills.Skill.INVESTIGATION, + Skills.Skill.NATURE, + Skills.Skill.RELIGION, + ], + Ability.WISDOM: [ + Skills.Skill.ANIMAL_HANDLING, + Skills.Skill.INSIGHT, + Skills.Skill.MEDICINE, + Skills.Skill.PERCEPTION, + Skills.Skill.SURVIVAL, + ], + Ability.CHARISMA: [ + Skills.Skill.DECEPTION, + Skills.Skill.INTIMIDATION, + Skills.Skill.PERFORMANCE, + Skills.Skill.PERSUASION, + ] +} diff --git a/scripts/autoloads/abilities.gd.uid b/scripts/autoloads/abilities.gd.uid new file mode 100644 index 0000000..a80929f --- /dev/null +++ b/scripts/autoloads/abilities.gd.uid @@ -0,0 +1 @@ +uid://bmwkhgalg32ud diff --git a/scripts/autoloads/classes.gd b/scripts/autoloads/classes.gd new file mode 100644 index 0000000..16eabaa --- /dev/null +++ b/scripts/autoloads/classes.gd @@ -0,0 +1,42 @@ +extends Node + +enum CharacterClass { + BARBARIAN, + BARD, + CLERIC, + DRUID, + FIGHTER, + MONK, + PALADIN, + RANGER, + ROGUE, + SORCERER, + WARLOCK, + WIZARD +} + +var class_info: Dictionary[CharacterClass, Dictionary] = { + CharacterClass.BARBARIAN: { + "description": "", + "primary_abilities": [ + Abilities.Abilities.STRENGTH + ], + "skill_proficiencies": [ + Skills.Skill.ANIMAL_HANDLING, + Skills.Skill.ATHLETICS, + Skills.Skill.INTIMIDATION, + Skills.Skill.NATURE, + Skills.Skill.PERCEPTION, + Skills.Skill.SURVIVAL, + ], + "skill_proficiency_number_to_choose": 2, + "default_ability_scores": { + Abilities.Ability.STRENGTH: 15, + Abilities.Ability.DEXTERITY: 13, + Abilities.Ability.CONSTITUTION: 14, + Abilities.Ability.INTELLIGENCE: 10, + Abilities.Ability.WISDOM: 12, + Abilities.Ability.CHARISMA: 8, + } + } +} diff --git a/scripts/autoloads/classes.gd.uid b/scripts/autoloads/classes.gd.uid new file mode 100644 index 0000000..1049b3b --- /dev/null +++ b/scripts/autoloads/classes.gd.uid @@ -0,0 +1 @@ +uid://dow1usjxob6oi diff --git a/scripts/autoloads/dice.gd b/scripts/autoloads/dice.gd index 1a47799..a521414 100644 --- a/scripts/autoloads/dice.gd +++ b/scripts/autoloads/dice.gd @@ -18,7 +18,19 @@ var dice: Dictionary[DiceType, Array] = { DiceType.d10: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], DiceType.d12: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], DiceType.d20: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], - DiceType.d100: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90] + DiceType.d100: [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100 + ] } func roll(dice_type: DiceType, number: int) -> int: diff --git a/scripts/autoloads/skills.gd b/scripts/autoloads/skills.gd new file mode 100644 index 0000000..73aaec8 --- /dev/null +++ b/scripts/autoloads/skills.gd @@ -0,0 +1,43 @@ +extends Node + +enum Skill { + ACROBATICS, + ANIMAL_HANDLING, + ARCANA, + ATHLETICS, + DECEPTION, + HISTORY, + INSIGHT, + INTIMIDATION, + INVESTIGATION, + MEDICINE, + NATURE, + PERCEPTION, + PERFORMANCE, + PERSUASION, + RELIGION, + SLEIGHT_OF_HAND, + STEALTH, + SURVIVAL +} + +var related_abilities: Dictionary[Skill, Abilities.Ability] = { + Skill.ACROBATICS: Abilities.Ability.DEXTERITY, + Skill.ANIMAL_HANDLING: Abilities.Ability.WISDOM, + Skill.ARCANA: Abilities.Ability.INTELLIGENCE, + Skill.ATHLETICS: Abilities.Ability.STRENGTH, + Skill.DECEPTION: Abilities.Ability.CHARISMA, + Skill.HISTORY: Abilities.Ability.INTELLIGENCE, + Skill.INSIGHT: Abilities.Ability.WISDOM, + Skill.INTIMIDATION: Abilities.Ability.CHARISMA, + Skill.INVESTIGATION: Abilities.Ability.INTELLIGENCE, + Skill.MEDICINE: Abilities.Ability.WISDOM, + Skill.NATURE: Abilities.Ability.INTELLIGENCE, + Skill.PERCEPTION: Abilities.Ability.WISDOM, + Skill.PERFORMANCE: Abilities.Ability.CHARISMA, + Skill.PERSUASION: Abilities.Ability.CHARISMA, + Skill.RELIGION: Abilities.Ability.INTELLIGENCE, + Skill.SLEIGHT_OF_HAND: Abilities.Ability.DEXTERITY, + Skill.STEALTH: Abilities.Ability.DEXTERITY, + Skill.SURVIVAL: Abilities.Ability.WISDOM, +} diff --git a/scripts/autoloads/skills.gd.uid b/scripts/autoloads/skills.gd.uid new file mode 100644 index 0000000..65d8e8e --- /dev/null +++ b/scripts/autoloads/skills.gd.uid @@ -0,0 +1 @@ +uid://h2dvjkkl5uhk