From 4edacc0a955cecd8e21497f438120f806335c3c0 Mon Sep 17 00:00:00 2001 From: PersonGuyGit Date: Sun, 3 Dec 2023 12:08:11 -0700 Subject: [PATCH] Created a generic class for Special Abilities --- .../specialabliities/specialabilities.gd | 24 +++++++++++++++++++ Phase2/Godot_Toolset/Main/project.godot | 10 ++++++++ 2 files changed, 34 insertions(+) create mode 100644 Phase2/Godot_Toolset/Main/middleware/specialabliities/specialabilities.gd diff --git a/Phase2/Godot_Toolset/Main/middleware/specialabliities/specialabilities.gd b/Phase2/Godot_Toolset/Main/middleware/specialabliities/specialabilities.gd new file mode 100644 index 0000000..303417e --- /dev/null +++ b/Phase2/Godot_Toolset/Main/middleware/specialabliities/specialabilities.gd @@ -0,0 +1,24 @@ +extends Object + +class_name SpecialAbility +#This class, is used to define special ability data. Such as for attacks like shooting fireballs. +#This is the middle ware, to define the structure of the data, before it is accesable by the character sheet. +#This class is also used to define the structure, as to make it normalized for the database / XML layers. + +# Luke, 12/9/2023, Godot 3.5 + + +var Name: String + +#Add TypeCheck for arrays of only strings at some point. +var Attribute: Array + +var Cost: int + +var Damage: int + +func _init(initName: String, initAttribute: Array, initCost: int, initDamage: int): + Name = initName + Attribute = initAttribute + Cost = initCost + Damage = initDamage diff --git a/Phase2/Godot_Toolset/Main/project.godot b/Phase2/Godot_Toolset/Main/project.godot index 4420a7c..67d7808 100644 --- a/Phase2/Godot_Toolset/Main/project.godot +++ b/Phase2/Godot_Toolset/Main/project.godot @@ -8,6 +8,16 @@ config_version=4 +_global_script_classes=[ { +"base": "Object", +"class": "SpecialAbility", +"language": "GDScript", +"path": "res://middleware/specialabliities/specialabilities.gd" +} ] +_global_script_class_icons={ +"SpecialAbility": "" +} + [application] config/name="bcirpg_toolset"