inching towards better class inheritence and multiplayer compatibility
This commit is contained in:
@ -1,19 +1,19 @@
|
||||
[gd_resource type="Resource" script_class="Card" load_steps=7 format=3 uid="uid://b1gd7d12pr52k"]
|
||||
[gd_resource type="Resource" script_class="Card" load_steps=6 format=3 uid="uid://bibx2my7igspq"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scripts/Resources/card.gd" id="1_opk1n"]
|
||||
[ext_resource type="Texture2D" uid="uid://ca4lwwd3e0y73" path="res://Assets/TextureAtlases/g_assault.tres" id="2_51tvo"]
|
||||
[ext_resource type="Resource" uid="uid://b8a635kajtq6" path="res://Resources/TurretStats/fireball.tres" id="3_8w2yo"]
|
||||
[ext_resource type="PackedScene" uid="uid://dr2bmfj8fquxr" path="res://PCs/Universal/ClassCards/Fireball/tower_fireball.tscn" id="4_cxojl"]
|
||||
[ext_resource type="PackedScene" uid="uid://cxlr31wydvroj" path="res://PCs/Universal/ClassCards/Fireball/weapon_fireball.tscn" id="5_47hbf"]
|
||||
[ext_resource type="Resource" uid="uid://c473xvhm2g6m0" path="res://Resources/WeaponStats/fireball.tres" id="6_05wvy"]
|
||||
[ext_resource type="Script" path="res://Scripts/Resources/card.gd" id="1_qktm8"]
|
||||
[ext_resource type="Texture2D" uid="uid://mwgpnnm3g3re" path="res://PCs/Universal/ClassCards/Fireball/fireball.png" id="2_lfltq"]
|
||||
[ext_resource type="PackedScene" uid="uid://dnwjfb4fexr0o" path="res://PCs/Universal/ClassCards/Fireball/weapon_fireball.tscn" id="3_4c0mu"]
|
||||
[ext_resource type="Resource" uid="uid://dhwhwicgpw7yh" path="res://PCs/Universal/ClassCards/Fireball/weapon_stats.tres" id="4_folo6"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wvh1s"]
|
||||
atlas = ExtResource("2_lfltq")
|
||||
region = Rect2(0, 0, 64, 64)
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_opk1n")
|
||||
script = ExtResource("1_qktm8")
|
||||
title = "Fireball"
|
||||
rarity = 3
|
||||
faction = 0
|
||||
sprite = ExtResource("2_51tvo")
|
||||
turret = ExtResource("4_cxojl")
|
||||
weapon = ExtResource("5_47hbf")
|
||||
weapon_stats = ExtResource("6_05wvy")
|
||||
tower_stats = ExtResource("3_8w2yo")
|
||||
sprite = SubResource("AtlasTexture_wvh1s")
|
||||
weapon_scene = ExtResource("3_4c0mu")
|
||||
weapon_stats = ExtResource("4_folo6")
|
||||
|
@ -1,32 +0,0 @@
|
||||
extends RigidBody3D
|
||||
class_name Fireball
|
||||
|
||||
@export var explosion_range := 6.0
|
||||
var acceleration := 15.0
|
||||
var direction
|
||||
var status_stats : StatusStats
|
||||
var lifetime := 15.0
|
||||
var time_alive := 0.0
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
time_alive += delta
|
||||
if time_alive >= lifetime:
|
||||
explode()
|
||||
|
||||
|
||||
func _physics_process(_delta: float) -> void:
|
||||
apply_central_force(direction * acceleration)
|
||||
|
||||
|
||||
func _on_body_entered(_body: Node) -> void:
|
||||
explode()
|
||||
|
||||
|
||||
func explode():
|
||||
for enemy in get_tree().get_nodes_in_group("Enemies"):
|
||||
if global_position.distance_to(enemy.global_position) <= explosion_range:
|
||||
var status = StatusOnFire.new()
|
||||
status.stats = status_stats
|
||||
enemy.status_manager.add_effect(status)
|
||||
queue_free()
|
BIN
PCs/Universal/ClassCards/Fireball/fireball.png
Normal file
BIN
PCs/Universal/ClassCards/Fireball/fireball.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
34
PCs/Universal/ClassCards/Fireball/fireball.png.import
Normal file
34
PCs/Universal/ClassCards/Fireball/fireball.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://mwgpnnm3g3re"
|
||||
path="res://.godot/imported/fireball.png-a75470cb6074cbc91efe353b08c6eb50.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://PCs/Universal/ClassCards/Fireball/fireball.png"
|
||||
dest_files=["res://.godot/imported/fireball.png-a75470cb6074cbc91efe353b08c6eb50.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=true
|
||||
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=0
|
@ -1,30 +0,0 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://dyglfv8lh2rbg"]
|
||||
|
||||
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/Fireball/fireball.gd" id="1_a3evl"]
|
||||
[ext_resource type="Texture2D" uid="uid://b54d5dc4jmlau" path="res://Assets/Textures/bomb.png" id="2_h8lqn"]
|
||||
|
||||
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_whkhx"]
|
||||
bounce = 0.6
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_mi0in"]
|
||||
radius = 0.2
|
||||
|
||||
[node name="RigidBody3D" type="RigidBody3D"]
|
||||
collision_layer = 0
|
||||
collision_mask = 5
|
||||
physics_material_override = SubResource("PhysicsMaterial_whkhx")
|
||||
gravity_scale = 0.0
|
||||
max_contacts_reported = 1
|
||||
contact_monitor = true
|
||||
script = ExtResource("1_a3evl")
|
||||
|
||||
[node name="Node3D" type="Sprite3D" parent="."]
|
||||
transform = Transform3D(1.4, 0, 0, 0, 1.4, 0, 0, 0, 1.4, 0, 0, 0)
|
||||
billboard = 1
|
||||
texture_filter = 0
|
||||
texture = ExtResource("2_h8lqn")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("SphereShape3D_mi0in")
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
8
PCs/Universal/ClassCards/Fireball/fireball_projectile.gd
Normal file
8
PCs/Universal/ClassCards/Fireball/fireball_projectile.gd
Normal file
@ -0,0 +1,8 @@
|
||||
extends StatusApplyingProjectile
|
||||
class_name FireballProjectile
|
||||
|
||||
|
||||
func build_status_object() -> StatusEffect:
|
||||
var status = StatusDoT.new()
|
||||
status.stats = status_stats
|
||||
return status
|
BIN
PCs/Universal/ClassCards/Fireball/fireball_projectile.png
Normal file
BIN
PCs/Universal/ClassCards/Fireball/fireball_projectile.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://baarbcx0nxi7w"
|
||||
path="res://.godot/imported/fireball_projectile.png-bb6edb8e296f3f750c1296e8d3dde180.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://PCs/Universal/ClassCards/Fireball/fireball_projectile.png"
|
||||
dest_files=["res://.godot/imported/fireball_projectile.png-bb6edb8e296f3f750c1296e8d3dde180.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=true
|
||||
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=0
|
13
PCs/Universal/ClassCards/Fireball/fireball_projectile.tscn
Normal file
13
PCs/Universal/ClassCards/Fireball/fireball_projectile.tscn
Normal file
@ -0,0 +1,13 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://ddpixntjsbpqp"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://beq6rn0babncg" path="res://Scenes/Projectiles/status_applying_projectile.tscn" id="1_a8cjq"]
|
||||
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/Fireball/fireball_projectile.gd" id="2_rin44"]
|
||||
[ext_resource type="Resource" uid="uid://dbanx8taicddm" path="res://Resources/StatusEffects/on_fire.tres" id="3_vb4ff"]
|
||||
[ext_resource type="Texture2D" uid="uid://baarbcx0nxi7w" path="res://PCs/Universal/ClassCards/Fireball/fireball_projectile.png" id="4_uua74"]
|
||||
|
||||
[node name="Fireball" instance=ExtResource("1_a8cjq")]
|
||||
script = ExtResource("2_rin44")
|
||||
status_stats = ExtResource("3_vb4ff")
|
||||
|
||||
[node name="Sprite3D" parent="." index="1"]
|
||||
texture = ExtResource("4_uua74")
|
@ -1,16 +0,0 @@
|
||||
extends Weapon
|
||||
class_name FireballWeapon
|
||||
|
||||
@export var fireball_scene : PackedScene
|
||||
@export var status_stats : StatusStats
|
||||
|
||||
|
||||
func shoot():
|
||||
if other_cooldown <= 0 and stats != null:
|
||||
other_cooldown = cooldown
|
||||
$AnimationPlayer.play("shoot")
|
||||
var fireball = fireball_scene.instantiate() as Fireball
|
||||
fireball.position = $RayCast3D.global_position
|
||||
fireball.status_stats = status_stats
|
||||
get_tree().root.add_child(fireball)
|
||||
fireball.direction = -global_transform.basis.z
|
2
PCs/Universal/ClassCards/Fireball/weapon_fireball.gd
Normal file
2
PCs/Universal/ClassCards/Fireball/weapon_fireball.gd
Normal file
@ -0,0 +1,2 @@
|
||||
extends ProjectileWeapon
|
||||
class_name FireballWeapon
|
@ -1,79 +1,19 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://cxlr31wydvroj"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://dnwjfb4fexr0o"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://clr6kfyci5jqb" path="res://Assets/TextureAtlases/g_rocket_launcher.tres" id="1_jmfbt"]
|
||||
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/Fireball/fireballweapon.gd" id="2_rmmdm"]
|
||||
[ext_resource type="PackedScene" uid="uid://dyglfv8lh2rbg" path="res://PCs/Universal/ClassCards/Fireball/fireball.tscn" id="3_xtqoc"]
|
||||
[ext_resource type="Resource" uid="uid://dbanx8taicddm" path="res://Resources/StatusEffects/on_fire.tres" id="4_a0kl2"]
|
||||
[ext_resource type="Resource" uid="uid://c473xvhm2g6m0" path="res://Resources/WeaponStats/fireball.tres" id="5_n36an"]
|
||||
[ext_resource type="Texture2D" uid="uid://bgeu8dnqaxq7v" path="res://Assets/TextureAtlases/target_list.tres" id="6_bpghv"]
|
||||
[ext_resource type="PackedScene" uid="uid://bqdllitxbbpyp" path="res://Scenes/Weapons/projectile_weapon.tscn" id="1_7k6fb"]
|
||||
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/Fireball/weapon_fireball.gd" id="2_nprco"]
|
||||
[ext_resource type="PackedScene" uid="uid://ddpixntjsbpqp" path="res://PCs/Universal/ClassCards/Fireball/fireball_projectile.tscn" id="3_2j1mm"]
|
||||
[ext_resource type="Resource" uid="uid://dhwhwicgpw7yh" path="res://PCs/Universal/ClassCards/Fireball/weapon_stats.tres" id="4_rqdnu"]
|
||||
[ext_resource type="Texture2D" uid="uid://mwgpnnm3g3re" path="res://PCs/Universal/ClassCards/Fireball/fireball.png" id="5_r42ic"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_n8b32"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:texture:region")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Rect2(0, 0, 64, 64)]
|
||||
}
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hfmm6"]
|
||||
atlas = ExtResource("5_r42ic")
|
||||
region = Rect2(0, 0, 64, 64)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_g0h8q"]
|
||||
resource_name = "shoot"
|
||||
length = 0.15
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:texture:region")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.15),
|
||||
"transitions": PackedFloat32Array(0, 0),
|
||||
"update": 0,
|
||||
"values": [Rect2(64, 0, 64, 64), Rect2(0, 0, 64, 64)]
|
||||
}
|
||||
[node name="FireballWeapon" instance=ExtResource("1_7k6fb")]
|
||||
script = ExtResource("2_nprco")
|
||||
projectile_scene = ExtResource("3_2j1mm")
|
||||
stats = ExtResource("4_rqdnu")
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_ntl6p"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_n8b32"),
|
||||
"shoot": SubResource("Animation_g0h8q")
|
||||
}
|
||||
|
||||
[node name="Weapon" type="Sprite3D"]
|
||||
layers = 2
|
||||
billboard = 1
|
||||
texture_filter = 0
|
||||
texture = ExtResource("1_jmfbt")
|
||||
script = ExtResource("2_rmmdm")
|
||||
fireball_scene = ExtResource("3_xtqoc")
|
||||
status_stats = ExtResource("4_a0kl2")
|
||||
stats = ExtResource("5_n36an")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_ntl6p")
|
||||
}
|
||||
|
||||
[node name="RayCast3D" type="RayCast3D" parent="."]
|
||||
collision_mask = 4
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
visible = false
|
||||
texture_filter = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -20.0
|
||||
offset_top = -20.0
|
||||
offset_right = 20.0
|
||||
offset_bottom = 20.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("6_bpghv")
|
||||
[node name="Sprite3D" parent="." index="0"]
|
||||
texture = SubResource("AtlasTexture_hfmm6")
|
||||
|
8
PCs/Universal/ClassCards/Fireball/weapon_stats.tres
Normal file
8
PCs/Universal/ClassCards/Fireball/weapon_stats.tres
Normal file
@ -0,0 +1,8 @@
|
||||
[gd_resource type="Resource" script_class="CardText" load_steps=2 format=3 uid="uid://dhwhwicgpw7yh"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scripts/Resources/card_text.gd" id="1_hmbwy"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_hmbwy")
|
||||
attributes = Array[Resource("res://Scripts/Resources/stat_attribute.gd")]([])
|
||||
text = ""
|
Reference in New Issue
Block a user