Worked on some things
- Spellbooks - Spells - Spellcasting - Player controller - Particles - Animations
This commit is contained in:
parent
67e1cad070
commit
80a80e4c74
14
Resources/Spellbooks/oldBook.tres
Normal file
14
Resources/Spellbooks/oldBook.tres
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
[gd_resource type="Resource" script_class="Spellbook" load_steps=4 format=3 uid="uid://bxtiv2esuer8v"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://Resources/spellbook.gd" id="1_t8h8m"]
|
||||||
|
[ext_resource type="Resource" uid="uid://1xbik4qndtkh" path="res://Resources/Spells/firebolt.tres" id="2_ln222"]
|
||||||
|
[ext_resource type="Resource" uid="uid://dl6nv6lp460n3" path="res://Resources/Spells/rockThrow.tres" id="3_ocgmh"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_t8h8m")
|
||||||
|
name = "Old Book"
|
||||||
|
description = "An old spellbook you found on the side of the road"
|
||||||
|
spells = Array[Resource("res://Resources/spell.gd")]([ExtResource("2_ln222"), ExtResource("3_ocgmh"), null])
|
||||||
|
damageMod = 1.0
|
||||||
|
defenseMod = 1.0
|
||||||
|
element = 0
|
15
Resources/Spells/firebolt.tres
Normal file
15
Resources/Spells/firebolt.tres
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
[gd_resource type="Resource" script_class="Spell" load_steps=3 format=3 uid="uid://1xbik4qndtkh"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://wr45fiqtfyfe" path="res://Sprites/Spells/Ice & Fire Spells Pack by Captainskeleto/Fire Spell Pack by Captainskeleto/Fire Spells/Fire Spell Pack8.png" id="1_67qon"]
|
||||||
|
[ext_resource type="Script" path="res://Resources/spell.gd" id="2_ccu2m"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("2_ccu2m")
|
||||||
|
icon = ExtResource("1_67qon")
|
||||||
|
name = "Firebolt"
|
||||||
|
description = "Cast a small line of fire at your opponent"
|
||||||
|
animation = ""
|
||||||
|
damage = 1.0
|
||||||
|
castCombo = Array[String](["up", "down", "down"])
|
||||||
|
element = 1
|
||||||
|
stunning = false
|
15
Resources/Spells/rockThrow.tres
Normal file
15
Resources/Spells/rockThrow.tres
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
[gd_resource type="Resource" script_class="Spell" load_steps=3 format=3 uid="uid://dl6nv6lp460n3"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://Resources/spell.gd" id="1_6330o"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://7gkwrxdb1exv" path="res://Sprites/Spells/Stone Spells Pack by Captainskeleto/Stone Spells/Stone Spells33.png" id="1_qg8v4"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_6330o")
|
||||||
|
icon = ExtResource("1_qg8v4")
|
||||||
|
name = "Rock Throw"
|
||||||
|
description = "Throw a rock at your opponent"
|
||||||
|
animation = ""
|
||||||
|
damage = 0.5
|
||||||
|
castCombo = Array[String](["down", "up", "up"])
|
||||||
|
element = 4
|
||||||
|
stunning = true
|
@ -1,5 +0,0 @@
|
|||||||
extends Node
|
|
||||||
|
|
||||||
class_name Data
|
|
||||||
|
|
||||||
@export var spellbook: Spellbook
|
|
@ -1,3 +1,17 @@
|
|||||||
extends Resource
|
extends Resource
|
||||||
|
|
||||||
class_name Spell
|
class_name Spell
|
||||||
|
|
||||||
|
@export var icon: CompressedTexture2D
|
||||||
|
@export var name: String
|
||||||
|
@export var description: String
|
||||||
|
@export var animation: String
|
||||||
|
|
||||||
|
@export var damage: float = 1
|
||||||
|
@export var backfireStrength: float = 1
|
||||||
|
@export var castCombo: Array[String]
|
||||||
|
@export var castProgress: int = 0
|
||||||
|
@export var element: Data.Element
|
||||||
|
@export var stunning: bool
|
||||||
|
@export var timeout: float = 10
|
||||||
|
@export var cooldown: float = 1
|
||||||
|
@ -2,8 +2,18 @@ extends Resource
|
|||||||
|
|
||||||
class_name Spellbook
|
class_name Spellbook
|
||||||
|
|
||||||
@export var defensiveSpells: Array[Spell]
|
@export var name: String
|
||||||
@export var offensiveSpells: Array[Spell]
|
@export var description: String
|
||||||
|
|
||||||
|
@export var spells: Array[Spell]
|
||||||
|
var cooldowns: Array[float]
|
||||||
|
|
||||||
@export var damageMod: float = 1
|
@export var damageMod: float = 1
|
||||||
@export var defenseMod: float = 1
|
@export var defenseMod: float = 1
|
||||||
|
|
||||||
|
@export var element: Data.Element
|
||||||
|
|
||||||
|
func initCooldowns():
|
||||||
|
cooldowns = []
|
||||||
|
for i in range(spells.size()):
|
||||||
|
cooldowns.append(0)
|
||||||
|
@ -1,22 +1,15 @@
|
|||||||
[gd_scene load_steps=58 format=3 uid="uid://c8wwq1hoj4sd5"]
|
[gd_scene load_steps=57 format=3 uid="uid://c8wwq1hoj4sd5"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://beji0knfiddf2" path="res://Sprites/Characters/Wizard Pack/Attack1.png" id="1_2xk2o"]
|
[ext_resource type="Texture2D" uid="uid://beji0knfiddf2" path="res://Sprites/Characters/Wizard Pack/Attack1.png" id="1_2xk2o"]
|
||||||
[ext_resource type="Script" path="res://Scripts/wizard.gd" id="1_tgd3u"]
|
[ext_resource type="Script" path="res://Scripts/wizard.gd" id="1_tgd3u"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bdwuc8gl3a8wu" path="res://Sprites/Characters/Wizard Pack/Attack2.png" id="2_2f0nh"]
|
[ext_resource type="Texture2D" uid="uid://bdwuc8gl3a8wu" path="res://Sprites/Characters/Wizard Pack/Attack2.png" id="2_2f0nh"]
|
||||||
[ext_resource type="Script" path="res://Resources/spellbook.gd" id="2_ku131"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://6kb5caswncr5" path="res://Sprites/Characters/Wizard Pack/Death.png" id="3_7wnck"]
|
[ext_resource type="Texture2D" uid="uid://6kb5caswncr5" path="res://Sprites/Characters/Wizard Pack/Death.png" id="3_7wnck"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dmdw0qscqe02k" path="res://Sprites/Characters/Wizard Pack/Fall.png" id="4_kkrq5"]
|
[ext_resource type="Texture2D" uid="uid://dmdw0qscqe02k" path="res://Sprites/Characters/Wizard Pack/Fall.png" id="4_kkrq5"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dissh4k8ayq7j" path="res://Sprites/Characters/Wizard Pack/Hit.png" id="5_43qkb"]
|
[ext_resource type="Texture2D" uid="uid://dissh4k8ayq7j" path="res://Sprites/Characters/Wizard Pack/Hit.png" id="5_43qkb"]
|
||||||
[ext_resource type="Texture2D" uid="uid://72gmmgu75er5" path="res://Sprites/Characters/Wizard Pack/Idle.png" id="6_qwfsc"]
|
[ext_resource type="Texture2D" uid="uid://72gmmgu75er5" path="res://Sprites/Characters/Wizard Pack/Idle.png" id="6_qwfsc"]
|
||||||
[ext_resource type="Texture2D" uid="uid://gu3ou37avyp3" path="res://Sprites/Characters/Wizard Pack/Jump.png" id="7_w41g5"]
|
[ext_resource type="Texture2D" uid="uid://gu3ou37avyp3" path="res://Sprites/Characters/Wizard Pack/Jump.png" id="7_w41g5"]
|
||||||
[ext_resource type="Texture2D" uid="uid://d2oi5bvcmmgr1" path="res://Sprites/Characters/Wizard Pack/Run.png" id="8_pymsq"]
|
[ext_resource type="Texture2D" uid="uid://d2oi5bvcmmgr1" path="res://Sprites/Characters/Wizard Pack/Run.png" id="8_pymsq"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://davqo20o2ncpj" path="res://Scenes/chargingParticles.tscn" id="10_stcqi"]
|
||||||
[sub_resource type="Resource" id="Resource_te6il"]
|
|
||||||
script = ExtResource("2_ku131")
|
|
||||||
defensiveSpells = Array[Resource("res://Resources/spell.gd")]([])
|
|
||||||
offensiveSpells = Array[Resource("res://Resources/spell.gd")]([])
|
|
||||||
damageMod = 1.0
|
|
||||||
defenseMod = 1.0
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nhid5"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_nhid5"]
|
||||||
atlas = ExtResource("1_2xk2o")
|
atlas = ExtResource("1_2xk2o")
|
||||||
@ -225,7 +218,7 @@ animations = [{
|
|||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_w4pyb")
|
"texture": SubResource("AtlasTexture_w4pyb")
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": false,
|
||||||
"name": &"attack1",
|
"name": &"attack1",
|
||||||
"speed": 8.0
|
"speed": 8.0
|
||||||
}, {
|
}, {
|
||||||
@ -254,7 +247,7 @@ animations = [{
|
|||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_uyqo3")
|
"texture": SubResource("AtlasTexture_uyqo3")
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": false,
|
||||||
"name": &"attack2",
|
"name": &"attack2",
|
||||||
"speed": 8.0
|
"speed": 8.0
|
||||||
}, {
|
}, {
|
||||||
@ -280,7 +273,7 @@ animations = [{
|
|||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_m5sup")
|
"texture": SubResource("AtlasTexture_m5sup")
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": false,
|
||||||
"name": &"death",
|
"name": &"death",
|
||||||
"speed": 6.0
|
"speed": 6.0
|
||||||
}, {
|
}, {
|
||||||
@ -308,7 +301,7 @@ animations = [{
|
|||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_e84v3")
|
"texture": SubResource("AtlasTexture_e84v3")
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": false,
|
||||||
"name": &"hit",
|
"name": &"hit",
|
||||||
"speed": 6.0
|
"speed": 6.0
|
||||||
}, {
|
}, {
|
||||||
@ -377,11 +370,17 @@ animations = [{
|
|||||||
}]
|
}]
|
||||||
|
|
||||||
[node name="Wizard" type="Node2D"]
|
[node name="Wizard" type="Node2D"]
|
||||||
|
scale = Vector2(5, 5)
|
||||||
script = ExtResource("1_tgd3u")
|
script = ExtResource("1_tgd3u")
|
||||||
spellbook = SubResource("Resource_te6il")
|
|
||||||
|
|
||||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||||
sprite_frames = SubResource("SpriteFrames_pk2mw")
|
sprite_frames = SubResource("SpriteFrames_pk2mw")
|
||||||
animation = &"idle"
|
animation = &"idle"
|
||||||
autoplay = "idle"
|
autoplay = "idle"
|
||||||
frame_progress = 0.418961
|
|
||||||
|
[node name="chargingParticles" parent="." instance=ExtResource("10_stcqi")]
|
||||||
|
position = Vector2(-6, 46.6)
|
||||||
|
scale = Vector2(0.5, 0.5)
|
||||||
|
emitting = false
|
||||||
|
|
||||||
|
[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animated_sprite_2d_animation_finished"]
|
||||||
|
33
Scenes/are83F9.tmp
Normal file
33
Scenes/are83F9.tmp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
[gd_scene load_steps=6 format=3 uid="uid://fgo2hd37towj"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://d2owoq5q27v8q" path="res://Scenes/data.tscn" id="1_cjr1k"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://nckxh4vysmvv" path="res://Scenes/player_controller.tscn" id="2_ud5et"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dnuh0fkgjhkkf" path="res://Sprites/Backgrounds/Mountain Pack by CaptainSkeleto/Mountain Pack6.png" id="2_wgdhh"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://c8wwq1hoj4sd5" path="res://Scenes/Characters/wizard.tscn" id="3_arqpv"]
|
||||||
|
[ext_resource type="Resource" uid="uid://bxtiv2esuer8v" path="res://Resources/Spellbooks/oldBook.tres" id="4_3cleg"]
|
||||||
|
|
||||||
|
[node name="Arena" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Data" parent="." instance=ExtResource("1_cjr1k")]
|
||||||
|
spellbook = ExtResource("4_3cleg")
|
||||||
|
|
||||||
|
[node name="PlayerController" parent="." node_paths=PackedStringArray("avatar") instance=ExtResource("2_ud5et")]
|
||||||
|
avatar = NodePath("../Wizard")
|
||||||
|
|
||||||
|
[node name="Wizard" parent="." instance=ExtResource("3_arqpv")]
|
||||||
|
position = Vector2(277, 419)
|
||||||
|
spellbook = ExtResource("4_3cleg")
|
||||||
|
player = true
|
||||||
|
|
||||||
|
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||||
|
layer = -1
|
||||||
|
|
||||||
|
[node name="TextureRect" type="TextureRect" parent="CanvasLayer"]
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
texture = ExtResource("2_wgdhh")
|
||||||
|
expand_mode = 2
|
||||||
|
stretch_mode = 6
|
33
Scenes/arena.tscn
Normal file
33
Scenes/arena.tscn
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
[gd_scene load_steps=6 format=3 uid="uid://fgo2hd37towj"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://d2owoq5q27v8q" path="res://Scenes/data.tscn" id="1_cjr1k"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://nckxh4vysmvv" path="res://Scenes/player_controller.tscn" id="2_ud5et"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dnuh0fkgjhkkf" path="res://Sprites/Backgrounds/Mountain Pack by CaptainSkeleto/Mountain Pack6.png" id="2_wgdhh"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://c8wwq1hoj4sd5" path="res://Scenes/Characters/wizard.tscn" id="3_arqpv"]
|
||||||
|
[ext_resource type="Resource" uid="uid://bxtiv2esuer8v" path="res://Resources/Spellbooks/oldBook.tres" id="4_3cleg"]
|
||||||
|
|
||||||
|
[node name="Arena" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Data" parent="." instance=ExtResource("1_cjr1k")]
|
||||||
|
spellbook = ExtResource("4_3cleg")
|
||||||
|
|
||||||
|
[node name="PlayerController" parent="." node_paths=PackedStringArray("avatar") instance=ExtResource("2_ud5et")]
|
||||||
|
avatar = NodePath("../Wizard")
|
||||||
|
|
||||||
|
[node name="Wizard" parent="." instance=ExtResource("3_arqpv")]
|
||||||
|
position = Vector2(277, 419)
|
||||||
|
spellbook = ExtResource("4_3cleg")
|
||||||
|
player = true
|
||||||
|
|
||||||
|
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||||
|
layer = -1
|
||||||
|
|
||||||
|
[node name="TextureRect" type="TextureRect" parent="CanvasLayer"]
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
texture = ExtResource("2_wgdhh")
|
||||||
|
expand_mode = 2
|
||||||
|
stretch_mode = 6
|
27
Scenes/chargingParticles.tscn
Normal file
27
Scenes/chargingParticles.tscn
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://davqo20o2ncpj"]
|
||||||
|
|
||||||
|
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_yfagv"]
|
||||||
|
lifetime_randomness = 0.32
|
||||||
|
particle_flag_disable_z = true
|
||||||
|
emission_shape_scale = Vector3(5, 5, 5)
|
||||||
|
emission_shape = 3
|
||||||
|
emission_box_extents = Vector3(10, 1, 1)
|
||||||
|
gravity = Vector3(0, -100, 0)
|
||||||
|
linear_accel_min = 100.0
|
||||||
|
linear_accel_max = 100.0
|
||||||
|
radial_accel_max = 13.48
|
||||||
|
tangential_accel_max = 8.99
|
||||||
|
attractor_interaction_enabled = false
|
||||||
|
scale_min = 10.0
|
||||||
|
scale_max = 10.0
|
||||||
|
color = Color(0, 0.976574, 0.976574, 1)
|
||||||
|
turbulence_enabled = true
|
||||||
|
turbulence_noise_scale = 6.474
|
||||||
|
|
||||||
|
[node name="ChargingParticles" type="GPUParticles2D"]
|
||||||
|
amount = 20
|
||||||
|
process_material = SubResource("ParticleProcessMaterial_yfagv")
|
||||||
|
lifetime = 2.0
|
||||||
|
speed_scale = 2.94
|
||||||
|
trail_enabled = true
|
||||||
|
trail_sections = 4
|
@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=2 format=3 uid="uid://d2owoq5q27v8q"]
|
[gd_scene load_steps=2 format=3 uid="uid://d2owoq5q27v8q"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://Resources/data.gd" id="1_m1o6d"]
|
[ext_resource type="Script" path="res://Scripts/data.gd" id="1_m1o6d"]
|
||||||
|
|
||||||
[node name="Data" type="Node"]
|
[node name="Data" type="Node"]
|
||||||
script = ExtResource("1_m1o6d")
|
script = ExtResource("1_m1o6d")
|
6
Scenes/player_controller.tscn
Normal file
6
Scenes/player_controller.tscn
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://nckxh4vysmvv"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://Scripts/playerController.gd" id="1_wktnx"]
|
||||||
|
|
||||||
|
[node name="PlayerController" type="Node"]
|
||||||
|
script = ExtResource("1_wktnx")
|
34
Scripts/combatant.gd
Normal file
34
Scripts/combatant.gd
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
extends Node2D
|
||||||
|
|
||||||
|
class_name Combatant
|
||||||
|
|
||||||
|
@export var spellbook: Spellbook
|
||||||
|
@onready var renderer: AnimatedSprite2D = $AnimatedSprite2D
|
||||||
|
@onready var particleSystem: GPUParticles2D = $chargingParticles
|
||||||
|
@export var maxHealth: float = 10
|
||||||
|
@export var health: float = maxHealth
|
||||||
|
@export var player: bool = false
|
||||||
|
var casting = false
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready():
|
||||||
|
renderer.animation_finished.connect(animationFinished)
|
||||||
|
spellbook.initCooldowns()
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta):
|
||||||
|
if !player:
|
||||||
|
_aiControlled()
|
||||||
|
|
||||||
|
func _aiControlled():
|
||||||
|
pass
|
||||||
|
|
||||||
|
func alterHealth(damage: float, stun: bool):
|
||||||
|
health -= damage
|
||||||
|
if stun:
|
||||||
|
casting = false
|
||||||
|
renderer.play("hit")
|
||||||
|
|
||||||
|
func animationFinished():
|
||||||
|
renderer.play("idle")
|
||||||
|
|
21
Scripts/data.gd
Normal file
21
Scripts/data.gd
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
class_name Data
|
||||||
|
|
||||||
|
enum Element{
|
||||||
|
NORMAL,
|
||||||
|
FIRE,
|
||||||
|
ICE,
|
||||||
|
POISON,
|
||||||
|
STONE
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Difficulty{
|
||||||
|
EASY,
|
||||||
|
NORMAL,
|
||||||
|
HARD,
|
||||||
|
GAMER
|
||||||
|
}
|
||||||
|
|
||||||
|
@export var spellbook: Spellbook
|
||||||
|
@export var difficulty: Difficulty = Difficulty.NORMAL
|
35
Scripts/playerController.gd
Normal file
35
Scripts/playerController.gd
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
@onready var data = get_node("/root/Arena/Data")
|
||||||
|
@export var avatar: Combatant
|
||||||
|
var casting = false
|
||||||
|
var spell: Spell
|
||||||
|
var timer: float = 0
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready():
|
||||||
|
data.spellbook.initCooldowns()
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta):
|
||||||
|
if !casting:
|
||||||
|
for i in range(data.spellbook.spells.size()):
|
||||||
|
if Input.is_action_just_pressed("Spell" + str(i)):
|
||||||
|
casting = true
|
||||||
|
spell = data.spellbook.spells[i]
|
||||||
|
avatar.particleSystem.emitting = true
|
||||||
|
timer = 0
|
||||||
|
else:
|
||||||
|
timer += delta
|
||||||
|
if (Input.is_action_just_pressed(spell.castCombo[spell.castProgress])):
|
||||||
|
spell.castProgress += 1
|
||||||
|
if spell.castProgress == spell.castCombo.size():
|
||||||
|
casting = false
|
||||||
|
avatar.particleSystem.emitting = false
|
||||||
|
spell.castProgress = 0
|
||||||
|
avatar.renderer.play("attack1")
|
||||||
|
elif (timer >= spell.timeout || Input.is_action_just_pressed("up") || Input.is_action_just_pressed("down") || Input.is_action_just_pressed("left") || Input.is_action_just_pressed("right")):
|
||||||
|
avatar.alterHealth(-spell.backfireStrength, true)
|
||||||
|
casting = false
|
||||||
|
avatar.particleSystem.emitting = false
|
||||||
|
|
@ -1,12 +1,4 @@
|
|||||||
extends Node2D
|
extends "res://Scripts/combatant.gd"
|
||||||
|
|
||||||
@export var spellbook: Spellbook
|
func _aiControlled():
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
|
||||||
func _ready():
|
|
||||||
pass # Replace with function body.
|
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
||||||
func _process(delta):
|
|
||||||
pass
|
pass
|
||||||
|
@ -11,13 +11,85 @@ config_version=5
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Raise Your Wand"
|
config/name="Raise Your Wand"
|
||||||
|
run/main_scene="res://Scenes/arena.tscn"
|
||||||
config/features=PackedStringArray("4.2", "Forward Plus")
|
config/features=PackedStringArray("4.2", "Forward Plus")
|
||||||
config/icon="res://icon.svg"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
[display]
|
||||||
|
|
||||||
|
mouse_cursor/custom_image_hotspot=Vector2(64, 128)
|
||||||
|
|
||||||
[dotnet]
|
[dotnet]
|
||||||
|
|
||||||
project/assembly_name="Raise Your Wand"
|
project/assembly_name="Raise Your Wand"
|
||||||
|
|
||||||
|
[input]
|
||||||
|
|
||||||
|
up={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
down={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
left={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
right={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
Spell0={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":49,"key_label":0,"unicode":49,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194439,"key_label":0,"unicode":49,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
Spell1={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":50,"key_label":0,"unicode":50,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194440,"key_label":0,"unicode":50,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
Spell2={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":51,"key_label":0,"unicode":51,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194441,"key_label":0,"unicode":51,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
Spell3={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":52,"key_label":0,"unicode":52,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194442,"key_label":0,"unicode":52,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
Spell4={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": []
|
||||||
|
}
|
||||||
|
Spell5={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": []
|
||||||
|
}
|
||||||
|
Spell6={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": []
|
||||||
|
}
|
||||||
|
Spell7={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": []
|
||||||
|
}
|
||||||
|
|
||||||
[rendering]
|
[rendering]
|
||||||
|
|
||||||
textures/canvas_textures/default_texture_filter=0
|
textures/canvas_textures/default_texture_filter=0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user