diff --git a/combat_manager.gd b/combat_manager.gd index b52837a..e9f9bbb 100644 --- a/combat_manager.gd +++ b/combat_manager.gd @@ -20,3 +20,8 @@ func _ready(): # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): pass + + +# TODO: Implement this to interact with party manager +func steal_spell(): + pass diff --git a/player.tscn b/player.tscn index 6a84b06..ca24484 100644 --- a/player.tscn +++ b/player.tscn @@ -5,7 +5,7 @@ [ext_resource type="Script" uid="uid://bn30k0xs8ptdn" path="res://AnimatedSprite2D.gd" id="3_vc6mf"] [ext_resource type="Script" uid="uid://kdor8udfe8ks" path="res://CollisionShape2D.gd" id="4_85fth"] [ext_resource type="PackedScene" uid="uid://cdm43kunrogx" path="res://src/components/attack_component.tscn" id="5_xlubi"] -[ext_resource type="Script" uid="uid://dd1246q3kr7u8" path="res://resources/attack_rsc.gd" id="6_bcgn8"] +[ext_resource type="Script" uid="uid://dd1246q3kr7u8" path="res://resources/attacks/attack_rsc.gd" id="6_bcgn8"] [ext_resource type="Resource" uid="uid://cs60ixhmh86wm" path="res://resources/attacks/normal_attack.tres" id="6_i87wm"] [ext_resource type="Resource" uid="uid://hodugild11n5" path="res://resources/attacks/slash_attack.tres" id="7_u0ent"] diff --git a/resources/attack_rsc.gd b/resources/attacks/attack_rsc.gd similarity index 100% rename from resources/attack_rsc.gd rename to resources/attacks/attack_rsc.gd diff --git a/resources/attack_rsc.gd.uid b/resources/attacks/attack_rsc.gd.uid similarity index 100% rename from resources/attack_rsc.gd.uid rename to resources/attacks/attack_rsc.gd.uid diff --git a/resources/attacks/normal_attack.tres b/resources/attacks/normal_attack.tres index 33c1278..371601c 100644 --- a/resources/attacks/normal_attack.tres +++ b/resources/attacks/normal_attack.tres @@ -1,9 +1,9 @@ [gd_resource type="Resource" script_class="Attack" load_steps=2 format=3 uid="uid://cs60ixhmh86wm"] -[ext_resource type="Script" path="res://resources/attack_rsc.gd" id="1_u4bsk"] +[ext_resource type="Script" uid="uid://dd1246q3kr7u8" path="res://resources/attacks/attack_rsc.gd" id="1_56r1r"] [resource] -script = ExtResource("1_u4bsk") +script = ExtResource("1_56r1r") name = "Normal Attack" description = "Basic attack for the character" damage = 10.0 diff --git a/resources/attacks/slash_attack.tres b/resources/attacks/slash_attack.tres index 6762918..779ec50 100644 --- a/resources/attacks/slash_attack.tres +++ b/resources/attacks/slash_attack.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="Attack" load_steps=2 format=3 uid="uid://hodugild11n5"] -[ext_resource type="Script" path="res://resources/attack_rsc.gd" id="1_gfnbq"] +[ext_resource type="Script" uid="uid://dd1246q3kr7u8" path="res://resources/attacks/attack_rsc.gd" id="1_gfnbq"] [resource] script = ExtResource("1_gfnbq") diff --git a/resources/divine_gifts/divine_gift.gd b/resources/divine_gifts/divine_gift.gd new file mode 100644 index 0000000..c9aebc4 --- /dev/null +++ b/resources/divine_gifts/divine_gift.gd @@ -0,0 +1,16 @@ +extends Resource +class_name DivineGift + +enum DivineGiftType { + STEAL_SPELLS +} + +# General Divine Gift Attributes +@export var name: String # Used to overwrite button name in combat +@export var description: String +@export var divine_gift: DivineGiftType + +# Default function to override divine gift combat button, to be overwritten +# by resources to call the right combat_manager function +func _cast() -> void: + print("Divine Gift: ", name) diff --git a/resources/divine_gifts/divine_gift.gd.uid b/resources/divine_gifts/divine_gift.gd.uid new file mode 100644 index 0000000..469fd7b --- /dev/null +++ b/resources/divine_gifts/divine_gift.gd.uid @@ -0,0 +1 @@ +uid://ufvmls6ohupj diff --git a/resources/divine_gifts/steal_spells.gd b/resources/divine_gifts/steal_spells.gd new file mode 100644 index 0000000..721493f --- /dev/null +++ b/resources/divine_gifts/steal_spells.gd @@ -0,0 +1,4 @@ +extends DivineGift + +func _cast() -> void: + CombatManager.steal_spell() diff --git a/resources/divine_gifts/steal_spells.gd.uid b/resources/divine_gifts/steal_spells.gd.uid new file mode 100644 index 0000000..7f6033b --- /dev/null +++ b/resources/divine_gifts/steal_spells.gd.uid @@ -0,0 +1 @@ +uid://c4of6cad0gjxd diff --git a/resources/divine_gifts/steal_spells.tres b/resources/divine_gifts/steal_spells.tres new file mode 100644 index 0000000..c0c5258 --- /dev/null +++ b/resources/divine_gifts/steal_spells.tres @@ -0,0 +1,10 @@ +[gd_resource type="Resource" script_class="DivineGift" load_steps=2 format=3 uid="uid://cpll3f8nqjv27"] + +[ext_resource type="Script" uid="uid://ufvmls6ohupj" path="res://resources/divine_gifts/divine_gift.gd" id="1_1ec7g"] + +[resource] +script = ExtResource("1_1ec7g") +name = "Steal" +description = "Allows the player to steal an enemy spells that persists outside of combat" +divine_gift = 0 +metadata/_custom_type_script = "uid://ufvmls6ohupj" diff --git a/resources/spells/spell_database.tres b/resources/spells/spell_database.tres index 15d4116..d128cf1 100644 --- a/resources/spells/spell_database.tres +++ b/resources/spells/spell_database.tres @@ -1,7 +1,7 @@ -[gd_resource type="Resource" load_steps=5 format=3 uid="uid://dwtsb7cb6wt6d"] +[gd_resource type="Resource" script_class="SpellDatabase" load_steps=5 format=3 uid="uid://dwtsb7cb6wt6d"] -[ext_resource type="Script" path="res://resources/spells/spell_database.gd" id="1_sfgwt"] -[ext_resource type="Script" path="res://resources/spells/spell.gd" id="2_lrf77"] +[ext_resource type="Script" uid="uid://clt5x8c7nj0mu" path="res://resources/spells/spell_database.gd" id="1_sfgwt"] +[ext_resource type="Script" uid="uid://b4308qcr0gk0a" path="res://resources/spells/spell.gd" id="2_lrf77"] [ext_resource type="Resource" uid="uid://bhidthvpqenlc" path="res://resources/spells/grass_whip.tres" id="3_ykmwl"] [ext_resource type="Resource" uid="uid://cc65m1tmobhat" path="res://resources/spells/starlight.tres" id="4_gd5w5"] diff --git a/src/components/attack_component.tscn b/src/components/attack_component.tscn index 0a71fc4..0a018f2 100644 --- a/src/components/attack_component.tscn +++ b/src/components/attack_component.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://cdm43kunrogx"] -[ext_resource type="Script" path="res://src/components/attack_component.gd" id="1_10dg0"] +[ext_resource type="Script" uid="uid://cvmbgnm58dvx7" path="res://src/components/attack_component.gd" id="1_10dg0"] [node name="AttackComponent" type="Node"] script = ExtResource("1_10dg0") diff --git a/src/components/divine_gift_component.gd b/src/components/divine_gift_component.gd new file mode 100644 index 0000000..b8484a0 --- /dev/null +++ b/src/components/divine_gift_component.gd @@ -0,0 +1,4 @@ +extends Node + +# Store divine gift resource that this character has +@export var divine_gift : DivineGift diff --git a/src/components/divine_gift_component.gd.uid b/src/components/divine_gift_component.gd.uid new file mode 100644 index 0000000..c4149ce --- /dev/null +++ b/src/components/divine_gift_component.gd.uid @@ -0,0 +1 @@ +uid://t037q272etvh diff --git a/src/components/divine_gift_component.tscn b/src/components/divine_gift_component.tscn new file mode 100644 index 0000000..c120593 --- /dev/null +++ b/src/components/divine_gift_component.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://coepmnkl23pdw"] + +[ext_resource type="Script" uid="uid://t037q272etvh" path="res://src/components/divine_gift_component.gd" id="1_271up"] + +[node name="DivineGiftComponent" type="Node"] +script = ExtResource("1_271up") diff --git a/src/components/spells_component.gd b/src/components/spells_component.gd index 7264f8c..4b2a536 100644 --- a/src/components/spells_component.gd +++ b/src/components/spells_component.gd @@ -1,4 +1,4 @@ -extends Node2D +extends Node # Current unit's spells @export var MAX_SPELLS = 4 diff --git a/src/components/spells_component.tscn b/src/components/spells_component.tscn index 09296b9..0a9d1b2 100644 --- a/src/components/spells_component.tscn +++ b/src/components/spells_component.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://dprvni6fde6dc"] -[ext_resource type="Script" path="res://src/components/spells_component.gd" id="1_xm8yn"] +[ext_resource type="Script" uid="uid://dpat2vlglhmvs" path="res://src/components/spells_component.gd" id="1_xm8yn"] -[node name="SpellsComponent" type="Node2D" groups=["has_spells"]] +[node name="SpellsComponent" type="Node" groups=["has_spells"]] script = ExtResource("1_xm8yn")