waited far too long for an initial commit but here we are

This commit is contained in:
2023-11-08 14:28:55 +11:00
commit 0427a58635
299 changed files with 10191 additions and 0 deletions

View File

@ -0,0 +1,19 @@
[gd_resource type="Resource" script_class="Card" load_steps=7 format=3 uid="uid://bmoreipvttks8"]
[ext_resource type="Script" path="res://Scripts/Resources/card.gd" id="1_yqa4b"]
[ext_resource type="Texture2D" uid="uid://ca4lwwd3e0y73" path="res://Assets/TextureAtlases/g_assault.tres" id="2_8j5h0"]
[ext_resource type="PackedScene" uid="uid://fernyl7fsifv" path="res://PCs/Universal/ClassCards/Assault/tower_assault.tscn" id="3_0r6s7"]
[ext_resource type="Resource" uid="uid://w15ojqyxd72q" path="res://Resources/WeaponStats/assault.tres" id="3_k2yr3"]
[ext_resource type="Resource" uid="uid://cktq4o3yuxgsa" path="res://Resources/TurretStats/assault.tres" id="3_p4byc"]
[ext_resource type="PackedScene" uid="uid://d1xe6hsq05110" path="res://PCs/Universal/ClassCards/Assault/weapon_assault.tscn" id="3_wj5gm"]
[resource]
script = ExtResource("1_yqa4b")
title = "Assault"
rarity = 0
faction = 0
sprite = ExtResource("2_8j5h0")
turret = ExtResource("3_0r6s7")
weapon = ExtResource("3_wj5gm")
weapon_stats = ExtResource("3_k2yr3")
tower_stats = ExtResource("3_p4byc")

View File

@ -0,0 +1,45 @@
extends Node3D
class_name Tower
@export var stats : TowerStats
@export var model : Node3D
var targeted_enemy
var cooldown := 0.0
var other_cooldown := 0.0
func _ready() -> void:
cooldown = 1.0 / stats.fire_rate
func _process(delta: float) -> void:
other_cooldown -= delta
if !targeted_enemy:
acquire_target()
else:
if model.global_position.distance_to(targeted_enemy.global_position) > stats.fire_range:
targeted_enemy = null
if targeted_enemy:
aim()
if other_cooldown <= 0:
shoot()
other_cooldown = cooldown
func shoot():
targeted_enemy.damage(stats.damage)
func aim():
model.look_at(targeted_enemy.global_position)
func acquire_target():
var most_progressed_enemy = null
for enemy in get_tree().get_nodes_in_group("Enemies"):
if model.global_position.distance_to(enemy.global_position) > stats.fire_range:
continue
if (most_progressed_enemy == null or enemy.progress >= most_progressed_enemy.progress) and enemy.stats.target_type & stats.can_target:
most_progressed_enemy = enemy
if most_progressed_enemy != null:
targeted_enemy = most_progressed_enemy

View File

@ -0,0 +1,22 @@
[gd_scene load_steps=3 format=3 uid="uid://fernyl7fsifv"]
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/Assault/tower.gd" id="1_c2874"]
[ext_resource type="Resource" uid="uid://cktq4o3yuxgsa" path="res://Resources/TurretStats/assault.tres" id="2_t516u"]
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model")]
script = ExtResource("1_c2874")
stats = ExtResource("2_t516u")
model = NodePath("Model")
[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="CSGBox3D2" type="CSGBox3D" parent="Model"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.714825, 0, -0.423869)
size = Vector3(0.481654, 0.427749, 1.38438)
[node name="CSGBox3D3" type="CSGBox3D" parent="Model"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.715, 0, -0.424)
size = Vector3(0.481654, 0.427749, 1.38438)

View File

@ -0,0 +1,66 @@
extends Sprite3D
class_name Weapon
@export var stats : WeaponStats
@export var hero : Hero
var cooldown := 0.0
var other_cooldown := 0.0
var trigger_held := false
var second_trigger_held := false
func _ready() -> void:
cooldown = 1.0 / stats.fire_rate
$RayCast3D.target_position = Vector3(0, 0, -stats.fire_range)
func set_raycast_origin(node):
$RayCast3D.global_position = node.global_position
func set_hero(value):
hero = value
func _process(delta: float) -> void:
if stats != null:
other_cooldown -= delta
func _physics_process(_delta: float) -> void:
if trigger_held:
shoot()
func hold_trigger():
trigger_held = true
func release_trigger():
trigger_held = false
func hold_second_trigger():
second_trigger_held = true
func release_second_trigger():
second_trigger_held = false
func shoot():
if other_cooldown <= 0 and stats != null:
other_cooldown = cooldown
$AnimationPlayer.play("shoot")
if $RayCast3D.is_colliding():
var target = $RayCast3D.get_collider()
if target != null:
var target_hitbox = target.shape_owner_get_owner($RayCast3D.get_collider_shape())
if target_hitbox is Hitbox:
target_hitbox.damage(stats.damage)
@rpc
func networked_shoot():
$AnimationPlayer.play("shoot")

View File

@ -0,0 +1,58 @@
[gd_scene load_steps=7 format=3 uid="uid://d1xe6hsq05110"]
[ext_resource type="Texture2D" uid="uid://ca4lwwd3e0y73" path="res://Assets/TextureAtlases/g_assault.tres" id="1_117ne"]
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/Assault/weapon.gd" id="2_4ie8w"]
[ext_resource type="Resource" uid="uid://w15ojqyxd72q" path="res://Resources/WeaponStats/assault.tres" id="3_s4ckt"]
[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="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)]
}
[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_117ne")
script = ExtResource("2_4ie8w")
stats = ExtResource("3_s4ckt")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_ntl6p")
}
[node name="RayCast3D" type="RayCast3D" parent="."]
collision_mask = 4

View File

@ -0,0 +1,20 @@
extends RigidBody3D
class_name Bomb
@export var max_bounces := 1
@export var damage := 10.0
@export var explosion_range := 3.0
var bounces := 0
func _on_body_entered(_body: Node) -> void:
bounces += 1
var collided_body = get_colliding_bodies()[0].get_collision_layer_value(3)
if bounces > max_bounces or collided_body:
explode()
func explode():
for enemy in get_tree().get_nodes_in_group("Enemies"):
if global_position.distance_to(enemy.global_position) <= explosion_range:
enemy.damage(damage)
queue_free()

View File

@ -0,0 +1,29 @@
[gd_scene load_steps=5 format=3 uid="uid://d147iwg2wcqc5"]
[ext_resource type="Texture2D" uid="uid://b54d5dc4jmlau" path="res://Assets/Textures/bomb.png" id="1_u615o"]
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/BombLauncher/bomb.gd" id="1_vekqm"]
[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")
max_contacts_reported = 1
contact_monitor = true
script = ExtResource("1_vekqm")
[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("1_u615o")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("SphereShape3D_mi0in")
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View File

@ -0,0 +1,30 @@
extends Tower
class_name BombTower
@export var bomb_scene: PackedScene
var firing_velocity
func _ready() -> void:
super._ready()
firing_velocity = sqrt((stats.fire_range * ProjectSettings.get_setting("physics/3d/default_gravity")) / sin(2 * 45))
func shoot():
var bomb = bomb_scene.instantiate() as Bomb
bomb.position = model.global_position
bomb.damage = stats.damage
get_tree().root.add_child(bomb)
bomb.apply_impulse(-model.global_transform.basis.z * firing_velocity)
func aim():
var pos = Vector2(global_position.x, global_position.z)
var t_pos = Vector2(targeted_enemy.global_position.x, targeted_enemy.global_position.z)
var x = pos.distance_to(t_pos)
var y = targeted_enemy.global_position.y - global_position.y
var v = firing_velocity
var g = ProjectSettings.get_setting("physics/3d/default_gravity")
var v2 = pow(v, 2)
var angle = atan((v2 + sqrt(pow(v, 4) - g * ((g * pow(x, 2)) + (2 * y * v2)))) / (g * x))
model.look_at(Vector3(t_pos.x, model.global_position.y, t_pos.y))
model.rotate(model.global_transform.basis.x.normalized(), angle)

View File

@ -0,0 +1,21 @@
extends Weapon
class_name BombWeapon
@export var bomb_scene: PackedScene
var firing_velocity
func _ready() -> void:
cooldown = 1.0 / stats.fire_rate
firing_velocity = sqrt((stats.fire_range * ProjectSettings.get_setting("physics/3d/default_gravity")) / sin(2 * 45))
$RayCast3D.target_position = Vector3(0, 0, -stats.fire_range)
func shoot():
if other_cooldown <= 0 and stats != null:
other_cooldown = cooldown
$AnimationPlayer.play("shoot")
var bomb = bomb_scene.instantiate() as Bomb
bomb.position = $RayCast3D.global_position
bomb.damage = stats.damage
get_tree().root.add_child(bomb)
bomb.apply_impulse(-global_transform.basis.z * firing_velocity)

View File

@ -0,0 +1,19 @@
[gd_resource type="Resource" script_class="Card" load_steps=7 format=3 uid="uid://bvpkvmda845o5"]
[ext_resource type="Script" path="res://Scripts/Resources/card.gd" id="1_bscy2"]
[ext_resource type="Texture2D" uid="uid://bwufgga1pjyt" path="res://Assets/TextureAtlases/g_grenade_launcher.tres" id="2_xtrq2"]
[ext_resource type="Resource" uid="uid://crmsk6lvp5i4e" path="res://Resources/TurretStats/bomblauncher.tres" id="3_c1c3t"]
[ext_resource type="PackedScene" uid="uid://6ckryuql3bh8" path="res://PCs/Universal/ClassCards/BombLauncher/weapon_bomb_launcher.tscn" id="4_iaadg"]
[ext_resource type="PackedScene" uid="uid://cwc8y1nv53btu" path="res://PCs/Universal/ClassCards/BombLauncher/tower_bomb_launcher.tscn" id="4_ux0v3"]
[ext_resource type="Resource" uid="uid://kbaiy5u6imtu" path="res://Resources/WeaponStats/bomblauncher.tres" id="5_mhhrq"]
[resource]
script = ExtResource("1_bscy2")
title = "Grenade Launcher"
rarity = 1
faction = 0
sprite = ExtResource("2_xtrq2")
turret = ExtResource("4_ux0v3")
weapon = ExtResource("4_iaadg")
weapon_stats = ExtResource("5_mhhrq")
tower_stats = ExtResource("3_c1c3t")

View File

@ -0,0 +1,20 @@
[gd_scene load_steps=4 format=3 uid="uid://cwc8y1nv53btu"]
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/BombLauncher/bombtower.gd" id="1_u2hyk"]
[ext_resource type="PackedScene" uid="uid://d147iwg2wcqc5" path="res://PCs/Universal/ClassCards/BombLauncher/bomb.tscn" id="2_n307r"]
[ext_resource type="Resource" uid="uid://crmsk6lvp5i4e" path="res://Resources/TurretStats/bomblauncher.tres" id="3_xv5rx"]
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model")]
script = ExtResource("1_u2hyk")
bomb_scene = ExtResource("2_n307r")
stats = ExtResource("3_xv5rx")
model = NodePath("Model")
[node name="Model" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.13842, 0)
[node name="CSGBox3D" type="CSGBox3D" parent="Model"]
[node name="CSGBox3D2" type="CSGBox3D" parent="Model"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.65)
size = Vector3(0.596453, 0.632841, 0.539216)

View File

@ -0,0 +1,59 @@
[gd_scene load_steps=8 format=3 uid="uid://6ckryuql3bh8"]
[ext_resource type="Texture2D" uid="uid://bwufgga1pjyt" path="res://Assets/TextureAtlases/g_grenade_launcher.tres" id="1_n7mif"]
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/BombLauncher/bombweapon.gd" id="2_4iyo6"]
[ext_resource type="PackedScene" uid="uid://d147iwg2wcqc5" path="res://PCs/Universal/ClassCards/BombLauncher/bomb.tscn" id="3_506dv"]
[ext_resource type="Resource" uid="uid://kbaiy5u6imtu" path="res://Resources/WeaponStats/bomblauncher.tres" id="4_45cu2"]
[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="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)]
}
[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_n7mif")
script = ExtResource("2_4iyo6")
bomb_scene = ExtResource("3_506dv")
stats = ExtResource("4_45cu2")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_ntl6p")
}
[node name="RayCast3D" type="RayCast3D" parent="."]

View File

@ -0,0 +1,15 @@
[gd_resource type="Resource" script_class="Card" load_steps=5 format=3 uid="uid://1xke2uy2vfuf"]
[ext_resource type="Script" path="res://Scripts/Resources/card.gd" id="1_xmwih"]
[ext_resource type="Resource" uid="uid://5ywipj3632u8" path="res://Resources/TurretStats/flametower.tres" id="2_80w0f"]
[ext_resource type="PackedScene" uid="uid://dvqk2lysu02gf" path="res://PCs/Universal/ClassCards/Flamethrower/tower_flamethrower.tscn" id="3_yfmjg"]
[ext_resource type="Resource" uid="uid://c4ihsd13o1esd" path="res://Resources/WeaponStats/flamethrower.tres" id="4_rdoaa"]
[resource]
script = ExtResource("1_xmwih")
title = "Flamethrower"
rarity = 3
faction = 0
turret = ExtResource("3_yfmjg")
weapon_stats = ExtResource("4_rdoaa")
tower_stats = ExtResource("2_80w0f")

View File

@ -0,0 +1,30 @@
extends Tower
class_name FlameyTower
@export var shapecast : ShapeCast3D
@export var particlesystem : GPUParticles3D
@export var status_stats : StatusStats
func _process(delta: float) -> void:
super._process(delta)
if targeted_enemy:
particlesystem.emitting = true
else:
particlesystem.emitting = false
func shoot():
for index in shapecast.get_collision_count():
var target = shapecast.get_collider(index) as CharacterBody3D
#TODO: its shit the way the enemy and status have to know about each other
var status = StatusOnFire.new()
status.affected = target.get_parent()
status.stats = status_stats
target.get_parent().status_manager.add_effect(status)
target.get_parent().add_child(status)
func aim():
model.look_at(targeted_enemy.global_position)
model.rotation.x = 0.0

View File

@ -0,0 +1,63 @@
[gd_scene load_steps=9 format=3 uid="uid://dvqk2lysu02gf"]
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/Flamethrower/tower_flamethrower.gd" id="1_6dcsj"]
[ext_resource type="Resource" uid="uid://dbanx8taicddm" path="res://Resources/StatusEffects/on_fire.tres" id="2_yo2b7"]
[sub_resource type="Gradient" id="Gradient_kkqms"]
offsets = PackedFloat32Array(0.00591716, 1)
colors = PackedColorArray(0.898039, 0.447059, 0, 1, 1, 0, 0, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_gpquw"]
gradient = SubResource("Gradient_kkqms")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_2nhns"]
direction = Vector3(0, 1, 0)
spread = 20.0
gravity = Vector3(0, 0, 0)
initial_velocity_min = 5.0
initial_velocity_max = 5.0
damping_min = 4.464
damping_max = 4.464
color_ramp = SubResource("GradientTexture1D_gpquw")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_2yd7w"]
vertex_color_use_as_albedo = true
[sub_resource type="BoxMesh" id="BoxMesh_q83y7"]
material = SubResource("StandardMaterial3D_2yd7w")
size = Vector3(0.3, 0.3, 0.3)
[sub_resource type="BoxShape3D" id="BoxShape3D_vck5q"]
size = Vector3(2.145, 3.125, 2.415)
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("shapecast", "particlesystem", "model")]
script = ExtResource("1_6dcsj")
shapecast = NodePath("Model/Node3D/ShapeCast3D")
particlesystem = NodePath("Model/Node3D/GPUParticles3D")
status_stats = ExtResource("2_yo2b7")
model = NodePath("Model")
[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"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.569646, 0)
size = Vector3(1, 1.78698, 1)
[node name="CSGBox3D2" type="CSGBox3D" parent="Model"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00567371, -0.274218, -0.514041)
size = Vector3(0.481654, 0.427749, 1.38438)
[node name="Node3D" type="Node3D" parent="Model"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, -0.301084, -1.2154)
[node name="GPUParticles3D" type="GPUParticles3D" parent="Model/Node3D"]
amount = 48
visibility_aabb = AABB(-2.2922, -3.14731, -1.92995, 4.5844, 6.29461, 3.85991)
process_material = SubResource("ParticleProcessMaterial_2nhns")
draw_pass_1 = SubResource("BoxMesh_q83y7")
[node name="ShapeCast3D" type="ShapeCast3D" parent="Model/Node3D"]
shape = SubResource("BoxShape3D_vck5q")
target_position = Vector3(0, 1.51, 0)
collision_mask = 4

View File

@ -0,0 +1,19 @@
[gd_resource type="Resource" script_class="Card" load_steps=7 format=3 uid="uid://q23ludhji5p4"]
[ext_resource type="Script" path="res://Scripts/Resources/card.gd" id="1_5html"]
[ext_resource type="Texture2D" uid="uid://d1am28tgvwaa0" path="res://Assets/TextureAtlases/g_accelerator.tres" id="2_a3hso"]
[ext_resource type="Resource" uid="uid://cc20tomywj0jm" path="res://Resources/TurretStats/accelerator.tres" id="3_yj53i"]
[ext_resource type="PackedScene" uid="uid://rcqf3vangjlp" path="res://PCs/Universal/ClassCards/Gatling/weapon_gatling.tscn" id="4_4xp1m"]
[ext_resource type="PackedScene" uid="uid://bwcdgglljbmot" path="res://PCs/Universal/ClassCards/Gatling/tower_gatling.tscn" id="4_maix8"]
[ext_resource type="Resource" uid="uid://ouwge5etb4me" path="res://Resources/WeaponStats/accelerator.tres" id="5_hguan"]
[resource]
script = ExtResource("1_5html")
title = "Accelerator"
rarity = 0
faction = 0
sprite = ExtResource("2_a3hso")
turret = ExtResource("4_maix8")
weapon = ExtResource("4_4xp1m")
weapon_stats = ExtResource("5_hguan")
tower_stats = ExtResource("3_yj53i")

View File

@ -0,0 +1,32 @@
extends Tower
class_name SpeedyTower
var third_cooldown := 0.0
var time_since_firing_started := 0.0
var time_to_reach_max_speed := 3.0
var max_speed_multiplier := 2.0
var destination_multiplier := 0.0
func _ready() -> void:
cooldown = 1.0 / stats.fire_rate
destination_multiplier = 1.0 / max_speed_multiplier
func _process(delta: float) -> void:
other_cooldown -= delta
if !targeted_enemy:
acquire_target()
else:
if model.global_position.distance_to(targeted_enemy.global_position) > stats.fire_range:
targeted_enemy = null
time_since_firing_started = 0.0
third_cooldown = cooldown
if targeted_enemy:
time_since_firing_started += delta
var progress = clamp(time_since_firing_started / time_to_reach_max_speed, 0, 1.0)
third_cooldown = cooldown * (1.0 - (destination_multiplier * progress))
aim()
if other_cooldown <= 0:
shoot()
other_cooldown = third_cooldown

View File

@ -0,0 +1,60 @@
extends Weapon
class_name SpeedyWeapon
var third_cooldown := 0.0
var time_since_firing_started := 0.0
var time_to_reach_max_speed := 3.0
var max_speed_multiplier := 2.0
var destination_multiplier := 0.0
func _ready() -> void:
cooldown = 1.0 / stats.fire_rate
destination_multiplier = 1.0 / max_speed_multiplier
$RayCast3D.target_position = Vector3(0, 0, -stats.fire_range)
func set_raycast_origin(node):
$RayCast3D.global_position = node.global_position
func _process(delta: float) -> void:
if stats != null:
other_cooldown -= delta
if trigger_held:
time_since_firing_started += delta
var progress = clamp(time_since_firing_started / time_to_reach_max_speed, 0, 1.0)
third_cooldown = cooldown * (1.0 - (destination_multiplier * progress))
func _physics_process(_delta: float) -> void:
if trigger_held:
shoot()
func hold_trigger():
trigger_held = true
func release_trigger():
trigger_held = false
time_since_firing_started = 0.0
third_cooldown = cooldown
func shoot():
if other_cooldown <= 0 and stats != null:
other_cooldown = third_cooldown
$AnimationPlayer.play("shoot")
if $RayCast3D.is_colliding():
var target = $RayCast3D.get_collider()
if target != null:
var target_hitbox = target.shape_owner_get_owner($RayCast3D.get_collider_shape())
if target_hitbox is Hitbox:
target_hitbox.damage(stats.damage)
@rpc
func networked_shoot():
$AnimationPlayer.play("shoot")

View File

@ -0,0 +1,38 @@
[gd_scene load_steps=3 format=3 uid="uid://bwcdgglljbmot"]
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/Gatling/speedytower.gd" id="1_26he3"]
[ext_resource type="Resource" uid="uid://cc20tomywj0jm" path="res://Resources/TurretStats/accelerator.tres" id="2_puwlv"]
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model")]
script = ExtResource("1_26he3")
stats = ExtResource("2_puwlv")
model = NodePath("Model")
[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="CSGBox3D2" type="CSGBox3D" parent="Model"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00131059, 0.27342, -0.880753)
size = Vector3(0.177, 0.148, 0.929)
[node name="CSGBox3D3" type="CSGBox3D" parent="Model"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.226066, 0.0918715, -0.880753)
size = Vector3(0.177, 0.148, 0.929)
[node name="CSGBox3D4" type="CSGBox3D" parent="Model"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.227674, -0.174673, -0.880753)
size = Vector3(0.177, 0.148, 0.929)
[node name="CSGBox3D5" type="CSGBox3D" parent="Model"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00246562, -0.314903, -0.880753)
size = Vector3(0.177, 0.148, 0.929)
[node name="CSGBox3D6" type="CSGBox3D" parent="Model"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.259054, -0.125834, -0.880753)
size = Vector3(0.177, 0.148, 0.929)
[node name="CSGBox3D7" type="CSGBox3D" parent="Model"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.26701, 0.102116, -0.880753)
size = Vector3(0.177, 0.148, 0.929)

View File

@ -0,0 +1,58 @@
[gd_scene load_steps=7 format=3 uid="uid://rcqf3vangjlp"]
[ext_resource type="Texture2D" uid="uid://d1am28tgvwaa0" path="res://Assets/TextureAtlases/g_accelerator.tres" id="1_n3tw0"]
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/Gatling/speedyweapon.gd" id="2_fkecd"]
[ext_resource type="Resource" uid="uid://ouwge5etb4me" path="res://Resources/WeaponStats/accelerator.tres" id="3_nq6wu"]
[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="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)]
}
[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_n3tw0")
script = ExtResource("2_fkecd")
stats = ExtResource("3_nq6wu")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_ntl6p")
}
[node name="RayCast3D" type="RayCast3D" parent="."]
collision_mask = 4

View File

@ -0,0 +1,19 @@
[gd_resource type="Resource" script_class="Card" load_steps=7 format=3 uid="uid://bhmbk26whdsys"]
[ext_resource type="Script" path="res://Scripts/Resources/card.gd" id="1_4m1rh"]
[ext_resource type="Texture2D" uid="uid://jmxhiwsiw1f5" path="res://Assets/TextureAtlases/g_glue_gun.tres" id="2_xsq3l"]
[ext_resource type="Resource" uid="uid://dhcukj44khkd7" path="res://Resources/TurretStats/glue.tres" id="3_tb5qj"]
[ext_resource type="PackedScene" uid="uid://d24q8j53oiyd4" path="res://PCs/Universal/ClassCards/GlueLauncher/weapon_glue_launcher.tscn" id="4_0jn1x"]
[ext_resource type="PackedScene" uid="uid://dja1b2ke8clo5" path="res://PCs/Universal/ClassCards/GlueLauncher/tower_glue_launcher.tscn" id="4_1nhoo"]
[ext_resource type="Resource" uid="uid://dnucn65m12dmq" path="res://Resources/WeaponStats/glue.tres" id="5_qk2lw"]
[resource]
script = ExtResource("1_4m1rh")
title = "Glue Gun"
rarity = 3
faction = 0
sprite = ExtResource("2_xsq3l")
turret = ExtResource("4_1nhoo")
weapon = ExtResource("4_0jn1x")
weapon_stats = ExtResource("5_qk2lw")
tower_stats = ExtResource("3_tb5qj")

View File

@ -0,0 +1,12 @@
extends Tower
class_name StickyTower
@export var status_stats : StatusStats
func shoot():
var status = StatusSticky.new()
status.stats = status_stats
status.affected = targeted_enemy
status.affected.status_manager.add_effect(status)
targeted_enemy.add_child(status)

View File

@ -0,0 +1,19 @@
extends Weapon
class_name StickyWeapon
@export var status_stats : StatusStats
func shoot():
if other_cooldown <= 0 and stats != null:
other_cooldown = cooldown
$AnimationPlayer.play("shoot")
if $RayCast3D.is_colliding():
var target = $RayCast3D.get_collider()
if target != null:
var target_hitbox = target.shape_owner_get_owner($RayCast3D.get_collider_shape())
if target_hitbox is Hitbox:
var status = StatusSticky.new()
status.stats = status_stats
status.affected = target.get_parent()
status.affected.status_manager.add_effect(status)
target.add_child(status)

View File

@ -0,0 +1,26 @@
[gd_scene load_steps=3 format=3 uid="uid://dja1b2ke8clo5"]
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/GlueLauncher/stickytower.gd" id="1_0fo13"]
[ext_resource type="Resource" uid="uid://d0643gfp52x3s" path="res://Resources/StatusEffects/sticky.tres" id="2_f8mxi"]
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model")]
script = ExtResource("1_0fo13")
status_stats = ExtResource("2_f8mxi")
model = NodePath("Model")
[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="CSGBox3D2" type="CSGBox3D" parent="Model"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0158235, 0, -0.956956)
size = Vector3(0.481654, 0.427749, 1.38438)
[node name="CSGBox3D3" type="CSGBox3D" parent="Model"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00590318, 0.717947, 0.210929)
size = Vector3(0.329535, 0.622842, 0.319929)
[node name="CSGBox3D4" type="CSGBox3D" parent="Model"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00590295, 0.453314, -0.265725)
size = Vector3(0.329535, 0.622842, 0.319929)

View File

@ -0,0 +1,58 @@
[gd_scene load_steps=7 format=3 uid="uid://d24q8j53oiyd4"]
[ext_resource type="Texture2D" uid="uid://jmxhiwsiw1f5" path="res://Assets/TextureAtlases/g_glue_gun.tres" id="1_pl6t8"]
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/Sniper/scopedweapon.gd" id="2_8m6e6"]
[ext_resource type="Resource" uid="uid://dnucn65m12dmq" path="res://Resources/WeaponStats/glue.tres" id="3_li2dn"]
[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="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)]
}
[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_pl6t8")
script = ExtResource("2_8m6e6")
stats = ExtResource("3_li2dn")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_ntl6p")
}
[node name="RayCast3D" type="RayCast3D" parent="."]
collision_mask = 4

View File

@ -0,0 +1,19 @@
[gd_resource type="Resource" script_class="Card" load_steps=7 format=3 uid="uid://dh5fjnbp8auw1"]
[ext_resource type="Script" path="res://Scripts/Resources/card.gd" id="1_dg0td"]
[ext_resource type="Texture2D" uid="uid://clr6kfyci5jqb" path="res://Assets/TextureAtlases/g_rocket_launcher.tres" id="2_duef5"]
[ext_resource type="Resource" uid="uid://duofn25nuu84q" path="res://Resources/TurretStats/rocketlauncher.tres" id="3_tj17y"]
[ext_resource type="Resource" uid="uid://dtfgyt85mp1ar" path="res://Resources/WeaponStats/rocketlauncher.tres" id="4_hwkrq"]
[ext_resource type="PackedScene" uid="uid://cbmoi73hquaer" path="res://PCs/Universal/ClassCards/RocketLauncher/weapon_rocket_launcher.tscn" id="4_ioexd"]
[ext_resource type="PackedScene" uid="uid://br3bd1jmi235x" path="res://PCs/Universal/ClassCards/RocketLauncher/tower_rocket_launcher.tscn" id="4_mvvp4"]
[resource]
script = ExtResource("1_dg0td")
title = "Rocket Launcher"
rarity = 2
faction = 0
sprite = ExtResource("2_duef5")
turret = ExtResource("4_mvvp4")
weapon = ExtResource("4_ioexd")
weapon_stats = ExtResource("4_hwkrq")
tower_stats = ExtResource("3_tj17y")

View File

@ -0,0 +1,33 @@
extends RigidBody3D
class_name Rocket
@export var damage := 10.0
@export var explosion_range := 6.0
var target : Node3D
var acceleration := 15.0
var direction
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:
if is_instance_valid(target):
direction = global_position.direction_to(target.global_position)
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:
enemy.damage(damage)
queue_free()

View File

@ -0,0 +1,30 @@
[gd_scene load_steps=5 format=3 uid="uid://hr0dw2533tsl"]
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/RocketLauncher/rocket.gd" id="1_7il2o"]
[ext_resource type="Texture2D" uid="uid://b54d5dc4jmlau" path="res://Assets/Textures/bomb.png" id="2_moh5p"]
[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_7il2o")
[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_moh5p")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("SphereShape3D_mi0in")
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View File

@ -0,0 +1,66 @@
extends Weapon
class_name RocketWeapon
@export var rocket_scene : PackedScene
@export var target_icon_scene : PackedScene
var rocket_speed = 20.0
var target_max := 3
var targets = []
var target_icons = []
func _ready() -> void:
super._ready()
for x in target_max:
var icon = target_icon_scene.instantiate()
add_child(icon)
icon.set_visible(false)
target_icons.append(icon)
func _process(delta: float) -> void:
super._process(delta)
if !trigger_held or other_cooldown > 0:
return
var target_list = targets.duplicate()
for target in target_list:
if !is_instance_valid(target):
targets.erase(target)
continue
for x in target_icons.size():
if x < targets.size():
target_icons[x].global_position = targets[x].global_position
target_icons[x].set_visible(true)
else:
target_icons[x].set_visible(false)
$TextureRect.set_visible(true)
$TextureRect.texture.region = Rect2(128 * targets.size(), 0, 128, 128)
if targets.size() < target_max and $RayCast3D.is_colliding() and !targets.has($RayCast3D.get_collider()):
targets.append($RayCast3D.get_collider())
func _physics_process(_delta: float) -> void:
pass
func release_trigger():
if trigger_held:
super.release_trigger()
shoot()
func shoot():
if other_cooldown <= 0 and stats != null:
other_cooldown = cooldown
$AnimationPlayer.play("shoot")
for target in targets:
var rocket = rocket_scene.instantiate() as Rocket
rocket.position = $RayCast3D.global_position
rocket.damage = stats.damage
rocket.target = target
get_tree().root.add_child(rocket)
rocket.apply_central_impulse(Vector3.UP * 3.0)
targets.clear()
$TextureRect.set_visible(false)
for icon in target_icons:
icon.set_visible(false)

View File

@ -0,0 +1,56 @@
extends Tower
class_name RocketTower
var targeted_enemies = []
@export var rocket_scene : PackedScene
@export var target_max := 3
var targets = []
func _process(delta: float) -> void:
other_cooldown -= delta
if targets.size() < target_max:
acquire_target()
if targets.size() > 0:
var target_list = targets.duplicate()
for target in target_list:
if !is_instance_valid(target):
targets.erase(target)
continue
if model.global_position.distance_to(target.global_position) > stats.fire_range:
targets.erase(target)
if targets.size() > 0:
targeted_enemy = targets[0]
aim()
if other_cooldown <= 0:
shoot()
other_cooldown = cooldown
func shoot():
for target in targets:
var rocket = rocket_scene.instantiate() as Rocket
rocket.position = model.global_position
rocket.damage = stats.damage
get_tree().root.add_child(rocket)
rocket.target = target
func acquire_target():
var possible_enemies = []
for enemy in get_tree().get_nodes_in_group("Enemies"):
if model.global_position.distance_to(enemy.global_position) > stats.fire_range:
continue
if !(enemy.stats.target_type & stats.can_target):
continue
if targets.has(enemy):
continue
possible_enemies.append(enemy)
for x in target_max - targets.size():
if possible_enemies.size() == 0:
return
var chosen = possible_enemies.pick_random()
possible_enemies.erase(chosen)
targets.append(chosen)

View File

@ -0,0 +1,24 @@
[gd_scene load_steps=4 format=3 uid="uid://br3bd1jmi235x"]
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/RocketLauncher/rockettower.gd" id="1_8hb2v"]
[ext_resource type="PackedScene" uid="uid://hr0dw2533tsl" path="res://PCs/Universal/ClassCards/RocketLauncher/rocket.tscn" id="2_by0gu"]
[ext_resource type="Resource" uid="uid://duofn25nuu84q" path="res://Resources/TurretStats/rocketlauncher.tres" id="3_ynh7l"]
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model")]
script = ExtResource("1_8hb2v")
rocket_scene = ExtResource("2_by0gu")
stats = ExtResource("3_ynh7l")
model = NodePath("Model")
[node name="Model" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.97939, 0)
[node name="CSGBox3D" type="CSGBox3D" parent="Model"]
[node name="CSGBox3D2" type="CSGBox3D" parent="Model"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.65)
size = Vector3(0.805859, 0.771887, 1.04243)
[node name="CSGBox3D3" type="CSGBox3D" parent="Model"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1.20204)
size = Vector3(0.597715, 0.561942, 0.242169)

View File

@ -0,0 +1,79 @@
[gd_scene load_steps=10 format=3 uid="uid://cbmoi73hquaer"]
[ext_resource type="Texture2D" uid="uid://clr6kfyci5jqb" path="res://Assets/TextureAtlases/g_rocket_launcher.tres" id="1_67vj1"]
[ext_resource type="Script" path="res://PCs/Universal/ClassCards/RocketLauncher/rocket_weapon.gd" id="2_rfuq6"]
[ext_resource type="Resource" uid="uid://dtfgyt85mp1ar" path="res://Resources/WeaponStats/rocketlauncher.tres" id="3_7mndo"]
[ext_resource type="PackedScene" uid="uid://hr0dw2533tsl" path="res://PCs/Universal/ClassCards/RocketLauncher/rocket.tscn" id="3_xn783"]
[ext_resource type="PackedScene" uid="uid://csufsbi64asau" path="res://Scenes/target_icon.tscn" id="4_ptwpb"]
[ext_resource type="Texture2D" uid="uid://bgeu8dnqaxq7v" path="res://Assets/TextureAtlases/target_list.tres" id="5_nbrvn"]
[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="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)]
}
[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_67vj1")
script = ExtResource("2_rfuq6")
rocket_scene = ExtResource("3_xn783")
target_icon_scene = ExtResource("4_ptwpb")
stats = ExtResource("3_7mndo")
[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("5_nbrvn")

View File

@ -0,0 +1,19 @@
[gd_resource type="Resource" script_class="Card" load_steps=7 format=3 uid="uid://cvf5bxtu6er17"]
[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"]
[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")

View File

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

View File

@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=3 uid="uid://ryhc48vl36fc"]
[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"]
[node name="Node3D" type="Node3D" node_paths=PackedStringArray("model")]
script = ExtResource("1_tmpm5")
stats = ExtResource("2_opda8")
model = NodePath("Model")
[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)

View File

@ -0,0 +1,85 @@
[gd_scene load_steps=8 format=3 uid="uid://v21rc7vtqp8l"]
[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"]
[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="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)]
}
[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_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
visible = false
[node name="TextureRect" type="TextureRect" parent="CanvasLayer"]
clip_children = 1
visibility_layer = 2
texture_filter = 1
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)