inching towards better class inheritence and multiplayer compatibility

This commit is contained in:
2023-11-15 15:19:40 +11:00
parent f004f64b71
commit 1500c22ccc
204 changed files with 1920 additions and 1951 deletions

View File

@ -1,19 +1,23 @@
[gd_resource type="Resource" script_class="Card" load_steps=7 format=3 uid="uid://cvf5bxtu6er17"]
[gd_resource type="Resource" script_class="Card" load_steps=8 format=3 uid="uid://ckm88acryitl4"]
[ext_resource type="Script" path="res://Scripts/Resources/card.gd" id="1_5vmtk"]
[ext_resource type="Texture2D" uid="uid://fmqq24n7rwvm" path="res://Assets/TextureAtlases/g_sniper.tres" id="2_skiu7"]
[ext_resource type="Resource" uid="uid://85iany3x0uv2" path="res://Resources/WeaponStats/sniper.tres" id="3_acfmb"]
[ext_resource type="PackedScene" uid="uid://v21rc7vtqp8l" path="res://Scenes/Weapons/scopedweapon.tscn" id="3_i0e3w"]
[ext_resource type="Resource" uid="uid://ddw7pj1ckwmp8" path="res://Resources/TurretStats/sniper.tres" id="3_tfyul"]
[ext_resource type="PackedScene" uid="uid://ryhc48vl36fc" path="res://Scenes/Towers/snipertower.tscn" id="4_kbb6b"]
[ext_resource type="Texture2D" uid="uid://cv2eycs1j0ho7" path="res://PCs/Universal/ClassCards/Sniper/g_sniper.png" id="2_go86x"]
[ext_resource type="Resource" uid="uid://eb0by6ba1d43" path="res://PCs/Universal/ClassCards/Sniper/tower_stats.tres" id="3_6i55t"]
[ext_resource type="PackedScene" uid="uid://bd65e03fscyxr" path="res://PCs/Universal/ClassCards/Sniper/weapon_sniper.tscn" id="3_qfpvu"]
[ext_resource type="Resource" uid="uid://3y7n1vdvf822" path="res://PCs/Universal/ClassCards/Sniper/weapon_stats.tres" id="4_7kvq1"]
[ext_resource type="PackedScene" uid="uid://bt4qbc5lp4nhr" path="res://PCs/Universal/ClassCards/Sniper/tower_sniper.tscn" id="4_k5nhs"]
[sub_resource type="AtlasTexture" id="AtlasTexture_fckie"]
atlas = ExtResource("2_go86x")
region = Rect2(0, 0, 64, 64)
[resource]
script = ExtResource("1_5vmtk")
title = "Sniper"
rarity = 4
faction = 0
sprite = ExtResource("2_skiu7")
turret = ExtResource("4_kbb6b")
weapon = ExtResource("3_i0e3w")
weapon_stats = ExtResource("3_acfmb")
tower_stats = ExtResource("3_tfyul")
sprite = SubResource("AtlasTexture_fckie")
turret_scene = ExtResource("4_k5nhs")
weapon_scene = ExtResource("3_qfpvu")
weapon_stats = ExtResource("4_7kvq1")
tower_stats = ExtResource("3_6i55t")

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cv2eycs1j0ho7"
path="res://.godot/imported/g_sniper.png-60dd6bed4ee309636ac895a2e167e09c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://PCs/Universal/ClassCards/Sniper/g_sniper.png"
dest_files=["res://.godot/imported/g_sniper.png-60dd6bed4ee309636ac895a2e167e09c.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bepgxu7wtcl1i"
path="res://.godot/imported/scopetest.png-6eaf83096c5e4493d2c0b323ec8f5877.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://PCs/Universal/ClassCards/Sniper/scopetest.png"
dest_files=["res://.godot/imported/scopetest.png-6eaf83096c5e4493d2c0b323ec8f5877.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=false
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=1

View File

@ -0,0 +1,2 @@
extends HitscanTower
class_name SniperTower

View File

@ -1,37 +1,10 @@
[gd_scene load_steps=4 format=3 uid="uid://ryhc48vl36fc"]
[gd_scene load_steps=4 format=3 uid="uid://bt4qbc5lp4nhr"]
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/Assault/tower.gd" id="1_tmpm5"]
[ext_resource type="Resource" uid="uid://ddw7pj1ckwmp8" path="res://Resources/TurretStats/sniper.tres" id="2_opda8"]
[ext_resource type="PackedScene" uid="uid://dumiyjlnea4gq" path="res://Scenes/Towers/hitscan_tower.tscn" id="1_x1nem"]
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/Sniper/tower_sniper.gd" id="2_v5fr7"]
[ext_resource type="Resource" uid="uid://eb0by6ba1d43" path="res://PCs/Universal/ClassCards/Sniper/tower_stats.tres" id="3_a0vis"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_mt54a"]
transparency = 1
cull_mode = 2
shading_mode = 0
albedo_color = Color(0.686275, 0, 0, 0.278431)
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model", "range_sphere", "minimap_range_sphere")]
script = ExtResource("1_tmpm5")
stats = ExtResource("2_opda8")
model = NodePath("Model")
range_sphere = NodePath("Model/CSGSphere3D")
minimap_range_sphere = NodePath("Model/CSGSphere3D2")
[node name="Model" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
[node name="CSGBox3D" type="CSGBox3D" parent="Model"]
[node name="CSGBox3D3" type="CSGBox3D" parent="Model"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.776406)
size = Vector3(0.481654, 0.427749, 1.38438)
[node name="CSGSphere3D" type="CSGSphere3D" parent="Model"]
visible = false
radius = 7.5
material = SubResource("StandardMaterial3D_mt54a")
[node name="CSGSphere3D2" type="CSGSphere3D" parent="Model"]
visible = false
layers = 4
radius = 7.5
material = SubResource("StandardMaterial3D_mt54a")
[node name="HitscanTower" instance=ExtResource("1_x1nem")]
script = ExtResource("2_v5fr7")
target_type = 3
stats = ExtResource("3_a0vis")

View File

@ -0,0 +1,25 @@
[gd_resource type="Resource" script_class="CardText" load_steps=6 format=3 uid="uid://eb0by6ba1d43"]
[ext_resource type="Script" path="res://Scripts/Resources/stat_attribute.gd" id="1_ihl3s"]
[ext_resource type="Script" path="res://Scripts/Resources/card_text.gd" id="1_otwn2"]
[sub_resource type="Resource" id="Resource_1ct8q"]
script = ExtResource("1_ihl3s")
key = "Fire Delay"
value = 2.0
[sub_resource type="Resource" id="Resource_erx05"]
script = ExtResource("1_ihl3s")
key = "Damage"
value = 20.0
[sub_resource type="Resource" id="Resource_vfpmb"]
script = ExtResource("1_ihl3s")
key = "Range"
value = 50.0
[resource]
script = ExtResource("1_otwn2")
target_type = 3
attributes = Array[ExtResource("1_ihl3s")]([SubResource("Resource_1ct8q"), SubResource("Resource_erx05"), SubResource("Resource_vfpmb")])
text = "Fires a shot every /Fire Delay\\ seconds dealing /Damage\\ damage at a range of /Range\\m"

View File

@ -1,15 +1,15 @@
extends Weapon
class_name ScopedWeapon
extends HitscanWeapon
class_name SniperWeapon
var scope_mask : Texture
@export var scope_mask : CanvasLayer
func hold_second_trigger():
super.hold_second_trigger()
$CanvasLayer.set_visible(true)
scope_mask.set_visible(true)
hero.set_zoom_factor(3.0)
func release_second_trigger():
super.release_second_trigger()
$CanvasLayer.set_visible(false)
scope_mask.set_visible(false)

View File

@ -1,85 +1,30 @@
[gd_scene load_steps=8 format=3 uid="uid://v21rc7vtqp8l"]
[gd_scene load_steps=7 format=3 uid="uid://bd65e03fscyxr"]
[ext_resource type="Texture2D" uid="uid://fmqq24n7rwvm" path="res://Assets/TextureAtlases/g_sniper.tres" id="1_6a01i"]
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/Sniper/scopedweapon.gd" id="2_qemq6"]
[ext_resource type="Resource" uid="uid://85iany3x0uv2" path="res://Resources/WeaponStats/sniper.tres" id="3_3c36k"]
[ext_resource type="Texture2D" uid="uid://bepgxu7wtcl1i" path="res://Assets/Textures/scopetest.png" id="3_pyugo"]
[ext_resource type="PackedScene" uid="uid://difwo7wlyqr3h" path="res://Scenes/Weapons/hitscan_weapon.tscn" id="1_6ph0d"]
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/Sniper/weapon_sniper.gd" id="2_r0w4v"]
[ext_resource type="Texture2D" uid="uid://bepgxu7wtcl1i" path="res://PCs/Universal/ClassCards/Sniper/scopetest.png" id="3_fhx8q"]
[ext_resource type="Resource" uid="uid://3y7n1vdvf822" path="res://PCs/Universal/ClassCards/Sniper/weapon_stats.tres" id="3_mmfq3"]
[ext_resource type="Texture2D" uid="uid://cv2eycs1j0ho7" path="res://PCs/Universal/ClassCards/Sniper/g_sniper.png" id="4_ub37g"]
[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_cussn"]
atlas = ExtResource("4_ub37g")
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="HitscanWeapon" node_paths=PackedStringArray("scope_mask") instance=ExtResource("1_6ph0d")]
script = ExtResource("2_r0w4v")
scope_mask = NodePath("CanvasLayer")
stats = ExtResource("3_mmfq3")
[sub_resource type="AnimationLibrary" id="AnimationLibrary_ntl6p"]
_data = {
"RESET": SubResource("Animation_n8b32"),
"shoot": SubResource("Animation_g0h8q")
}
[node name="Sprite3D" parent="." index="0"]
texture = SubResource("AtlasTexture_cussn")
[node name="Weapon" type="Sprite3D"]
layers = 2
billboard = 1
texture_filter = 0
texture = ExtResource("1_6a01i")
script = ExtResource("2_qemq6")
stats = ExtResource("3_3c36k")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_ntl6p")
}
[node name="RayCast3D" type="RayCast3D" parent="."]
collision_mask = 4
[node name="CanvasLayer" type="CanvasLayer" parent="."]
layer = 2
[node name="CanvasLayer" type="CanvasLayer" parent="." index="4"]
visible = false
[node name="TextureRect" type="TextureRect" parent="CanvasLayer"]
clip_children = 1
visibility_layer = 2
texture_filter = 1
[node name="TextureRect" type="TextureRect" parent="CanvasLayer" index="0"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
texture = ExtResource("3_pyugo")
[node name="ColorRect" type="ColorRect" parent="CanvasLayer/TextureRect"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
color = Color(0, 0, 0, 1)
texture = ExtResource("3_fhx8q")

View File

@ -0,0 +1,25 @@
[gd_resource type="Resource" script_class="CardText" load_steps=6 format=3 uid="uid://3y7n1vdvf822"]
[ext_resource type="Script" path="res://Scripts/Resources/stat_attribute.gd" id="1_7xbx2"]
[ext_resource type="Script" path="res://Scripts/Resources/card_text.gd" id="1_t3oy2"]
[sub_resource type="Resource" id="Resource_58kde"]
script = ExtResource("1_7xbx2")
key = "Fire Delay"
value = 1.2
[sub_resource type="Resource" id="Resource_jl4jv"]
script = ExtResource("1_7xbx2")
key = "Damage"
value = 30.0
[sub_resource type="Resource" id="Resource_28kyj"]
script = ExtResource("1_7xbx2")
key = "Range"
value = 50.0
[resource]
script = ExtResource("1_t3oy2")
target_type = 0
attributes = Array[ExtResource("1_7xbx2")]([SubResource("Resource_58kde"), SubResource("Resource_jl4jv"), SubResource("Resource_28kyj")])
text = "Fires a shot every /Fire Delay\\ seconds dealing /Damage\\ damage at a range of /Range\\m"