way too many changes to list, oops. big rewrite.
This commit is contained in:
BIN
Weapons/Gatling/accelerator.png
Normal file
BIN
Weapons/Gatling/accelerator.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
34
Weapons/Gatling/accelerator.png.import
Normal file
34
Weapons/Gatling/accelerator.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dkb8e0uu5vikw"
|
||||
path="res://.godot/imported/accelerator.png-4c158c4ff4c604bf3c46c9349d25da93.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Weapons/Gatling/accelerator.png"
|
||||
dest_files=["res://.godot/imported/accelerator.png-4c158c4ff4c604bf3c46c9349d25da93.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
|
43
Weapons/Gatling/weapon_gatling.gd
Normal file
43
Weapons/Gatling/weapon_gatling.gd
Normal file
@ -0,0 +1,43 @@
|
||||
class_name GatlingWeapon extends HitscanWeapon
|
||||
|
||||
var time_since_firing_started: float = 0.0
|
||||
var time_to_reach_max_speed: float = 0.0
|
||||
var max_speed_multiplier: float = 0.0
|
||||
var current_time_between_shots: float = 0.0
|
||||
var final_time_between_shots: float = 0.0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
super._ready()
|
||||
time_to_reach_max_speed = stats.get_attribute("Speed Time")
|
||||
max_speed_multiplier = stats.get_attribute("Speed Multiplier")
|
||||
final_time_between_shots = time_between_shots / max_speed_multiplier
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
super._process(delta)
|
||||
if trigger_held:
|
||||
if stats.energy_type == Data.EnergyType.CONTINUOUS:
|
||||
current_energy -= delta
|
||||
energy_spent.emit(delta, stats.energy_type)
|
||||
time_since_firing_started += delta
|
||||
var progress: float = clamp(time_since_firing_started / time_to_reach_max_speed, 0.0, 1.0)
|
||||
current_time_between_shots = lerpf(time_between_shots, final_time_between_shots, progress)
|
||||
if current_energy < energy_cost:
|
||||
time_since_firing_started = 0.0
|
||||
current_time_between_shots = time_between_shots
|
||||
|
||||
|
||||
func _physics_process(_delta: float) -> void:
|
||||
if trigger_held and current_energy >= energy_cost and time_since_firing >= current_time_between_shots:
|
||||
time_since_firing -= current_time_between_shots
|
||||
#current_energy -= energy_cost
|
||||
#energy_spent.emit(current_energy)
|
||||
shoot()
|
||||
networked_shoot.rpc()
|
||||
|
||||
|
||||
func release_trigger() -> void:
|
||||
super.release_trigger()
|
||||
time_since_firing_started = 0.0
|
||||
current_time_between_shots = time_between_shots
|
1
Weapons/Gatling/weapon_gatling.gd.uid
Normal file
1
Weapons/Gatling/weapon_gatling.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://iajcv516mpcg
|
27
Weapons/Gatling/weapon_gatling.tscn
Normal file
27
Weapons/Gatling/weapon_gatling.tscn
Normal file
@ -0,0 +1,27 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://dkxi1ssoa44jn"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://difwo7wlyqr3h" path="res://Scenes/Weapons/hitscan_weapon.tscn" id="1_fwlu5"]
|
||||
[ext_resource type="Resource" uid="uid://cj2x1jvo8l4ot" path="res://Weapons/Gatling/weapon_stats.tres" id="2_fnyjd"]
|
||||
[ext_resource type="Script" uid="uid://iajcv516mpcg" path="res://Weapons/Gatling/weapon_gatling.gd" id="2_wm4al"]
|
||||
[ext_resource type="Texture2D" uid="uid://dkb8e0uu5vikw" path="res://Weapons/Gatling/accelerator.png" id="4_gi42y"]
|
||||
[ext_resource type="AudioStream" uid="uid://dknygn5eyuhxt" path="res://Audio/shot1.wav" id="5_gelfi"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0im1y"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("4_gi42y")
|
||||
region = Rect2(0, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_778e1"]
|
||||
random_pitch = 1.1
|
||||
streams_count = 1
|
||||
stream_0/stream = ExtResource("5_gelfi")
|
||||
|
||||
[node name="WeaponGatling" instance=ExtResource("1_fwlu5")]
|
||||
script = ExtResource("2_wm4al")
|
||||
stats = ExtResource("2_fnyjd")
|
||||
|
||||
[node name="Sprite3D" parent="." index="0"]
|
||||
texture = SubResource("AtlasTexture_0im1y")
|
||||
|
||||
[node name="AudioStreamPlayer3D" parent="." index="5"]
|
||||
stream = SubResource("AudioStreamRandomizer_778e1")
|
43
Weapons/Gatling/weapon_stats.tres
Normal file
43
Weapons/Gatling/weapon_stats.tres
Normal file
@ -0,0 +1,43 @@
|
||||
[gd_resource type="Resource" script_class="CardText" load_steps=9 format=3 uid="uid://cj2x1jvo8l4ot"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://yjb0uv6og430" path="res://Scripts/Resources/stat_attribute.gd" id="1_7oh83"]
|
||||
[ext_resource type="Script" uid="uid://dg7gxxqfqxcmc" path="res://Scripts/Resources/card_text.gd" id="2_y36gr"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_fi7tc"]
|
||||
script = ExtResource("1_7oh83")
|
||||
key = "Fire Delay"
|
||||
value = 0.4
|
||||
|
||||
[sub_resource type="Resource" id="Resource_r6h5d"]
|
||||
script = ExtResource("1_7oh83")
|
||||
key = "Damage"
|
||||
value = 2.0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_gwg1i"]
|
||||
script = ExtResource("1_7oh83")
|
||||
key = "Range"
|
||||
value = 20.0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ogk1x"]
|
||||
script = ExtResource("1_7oh83")
|
||||
key = "Speed Multiplier"
|
||||
value = 3.0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_wdp3h"]
|
||||
script = ExtResource("1_7oh83")
|
||||
key = "Speed Time"
|
||||
value = 4.0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_d1lvi"]
|
||||
script = ExtResource("1_7oh83")
|
||||
key = "Energy"
|
||||
value = 100.0
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_y36gr")
|
||||
target_type = 0
|
||||
energy_type = 2
|
||||
attributes = Array[ExtResource("1_7oh83")]([SubResource("Resource_fi7tc"), SubResource("Resource_r6h5d"), SubResource("Resource_gwg1i"), SubResource("Resource_ogk1x"), SubResource("Resource_wdp3h"), SubResource("Resource_d1lvi")])
|
||||
text = "Fires a shot every /Fire Delay\\ seconds dealing /Damage\\ damage at a range of /Range\\m
|
||||
|
||||
While held, gradually accelerates to /Speed Multiplier\\x the fire rate over /Speed Time\\s"
|
Reference in New Issue
Block a user