enabled enforced static typing
This commit is contained in:
BIN
PCs/Mechanic/ClassCards/BombLauncher/bomb.png
Normal file
BIN
PCs/Mechanic/ClassCards/BombLauncher/bomb.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 799 B |
34
PCs/Mechanic/ClassCards/BombLauncher/bomb.png.import
Normal file
34
PCs/Mechanic/ClassCards/BombLauncher/bomb.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b54d5dc4jmlau"
|
||||
path="res://.godot/imported/bomb.png-2ced482db6410a133061cb96ae312d66.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://PCs/Mechanic/ClassCards/BombLauncher/bomb.png"
|
||||
dest_files=["res://.godot/imported/bomb.png-2ced482db6410a133061cb96ae312d66.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
|
19
PCs/Mechanic/ClassCards/BombLauncher/bomb_projectile.gd
Normal file
19
PCs/Mechanic/ClassCards/BombLauncher/bomb_projectile.gd
Normal file
@ -0,0 +1,19 @@
|
||||
class_name BombProjectile extends ExplosiveProjectile
|
||||
|
||||
var max_bounces: int = 1
|
||||
var bounces: int = 0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
apply_central_impulse(direction.normalized() * force)
|
||||
#print(direction.length())
|
||||
#print(force)
|
||||
if owner_id == 0:
|
||||
max_bounces = 0
|
||||
|
||||
|
||||
func _on_body_entered(_body: Node) -> void:
|
||||
bounces += 1
|
||||
var collided_body: bool = get_colliding_bodies()[0].get_collision_layer_value(3)
|
||||
if bounces > max_bounces or collided_body:
|
||||
explode()
|
27
PCs/Mechanic/ClassCards/BombLauncher/bomb_projectile.tscn
Normal file
27
PCs/Mechanic/ClassCards/BombLauncher/bomb_projectile.tscn
Normal file
@ -0,0 +1,27 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://c8oq5unisjqne"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://7f4dfphgiswr" path="res://Scenes/Projectiles/explosive_projectile.tscn" id="1_kf2wi"]
|
||||
[ext_resource type="Script" path="res://PCs/Mechanic/ClassCards/BombLauncher/bomb_projectile.gd" id="2_qvo4u"]
|
||||
[ext_resource type="Texture2D" uid="uid://b54d5dc4jmlau" path="res://PCs/Mechanic/ClassCards/BombLauncher/bomb.png" id="3_ilhep"]
|
||||
[ext_resource type="AudioStream" uid="uid://qeav4v23p0dd" path="res://PCs/Mechanic/ClassCards/BombLauncher/shot1.wav" id="4_uh8y6"]
|
||||
|
||||
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_bbpul"]
|
||||
bounce = 0.6
|
||||
|
||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_sy5qq"]
|
||||
random_pitch = 1.1
|
||||
streams_count = 1
|
||||
stream_0/stream = ExtResource("4_uh8y6")
|
||||
stream_0/weight = 1.0
|
||||
|
||||
[node name="Bomb" instance=ExtResource("1_kf2wi")]
|
||||
physics_material_override = SubResource("PhysicsMaterial_bbpul")
|
||||
gravity_scale = 1.0
|
||||
script = ExtResource("2_qvo4u")
|
||||
|
||||
[node name="Sprite3D" parent="." index="1"]
|
||||
pixel_size = 0.015
|
||||
texture = ExtResource("3_ilhep")
|
||||
|
||||
[node name="AudioStreamPlayer" parent="." index="2"]
|
||||
stream = SubResource("AudioStreamRandomizer_sy5qq")
|
BIN
PCs/Mechanic/ClassCards/BombLauncher/bombamod.glb
Normal file
BIN
PCs/Mechanic/ClassCards/BombLauncher/bombamod.glb
Normal file
Binary file not shown.
47
PCs/Mechanic/ClassCards/BombLauncher/bombamod.glb.import
Normal file
47
PCs/Mechanic/ClassCards/BombLauncher/bombamod.glb.import
Normal file
@ -0,0 +1,47 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://c7oec0i1k76et"
|
||||
path="res://.godot/imported/bombamod.glb-ec24c701df24ed2f5be5a049d326f0e0.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://PCs/Mechanic/ClassCards/BombLauncher/bombamod.glb"
|
||||
dest_files=["res://.godot/imported/bombamod.glb-ec24c701df24ed2f5be5a049d326f0e0.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=false
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path=""
|
||||
_subresources={
|
||||
"meshes": {
|
||||
"bombamod_Cube": {
|
||||
"generate/lightmap_uv": 0,
|
||||
"generate/lods": 0,
|
||||
"generate/shadow_meshes": 0,
|
||||
"lods/normal_merge_angle": 60.0,
|
||||
"lods/normal_split_angle": 25.0,
|
||||
"save_to_file/enabled": false,
|
||||
"save_to_file/make_streamable": "",
|
||||
"save_to_file/path": "res://bombamodel.res"
|
||||
}
|
||||
}
|
||||
}
|
||||
gltf/naming_version=0
|
||||
gltf/embedded_image_handling=0
|
BIN
PCs/Mechanic/ClassCards/BombLauncher/bombamodel.res
Normal file
BIN
PCs/Mechanic/ClassCards/BombLauncher/bombamodel.res
Normal file
Binary file not shown.
BIN
PCs/Mechanic/ClassCards/BombLauncher/bombatex.png
Normal file
BIN
PCs/Mechanic/ClassCards/BombLauncher/bombatex.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
34
PCs/Mechanic/ClassCards/BombLauncher/bombatex.png.import
Normal file
34
PCs/Mechanic/ClassCards/BombLauncher/bombatex.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cxwtwh2al18cb"
|
||||
path="res://.godot/imported/bombatex.png-11a28bcdce03a3a9cf1fd79845aeb32c.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://PCs/Mechanic/ClassCards/BombLauncher/bombatex.png"
|
||||
dest_files=["res://.godot/imported/bombatex.png-11a28bcdce03a3a9cf1fd79845aeb32c.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
|
17
PCs/Mechanic/ClassCards/BombLauncher/card_bomb_launcher.tres
Normal file
17
PCs/Mechanic/ClassCards/BombLauncher/card_bomb_launcher.tres
Normal file
@ -0,0 +1,17 @@
|
||||
[gd_resource type="Resource" script_class="Card" load_steps=6 format=3 uid="uid://blgngx360vff1"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scripts/Resources/card.gd" id="1_qtxcq"]
|
||||
[ext_resource type="Resource" uid="uid://8eaecilvan23" path="res://PCs/Mechanic/ClassCards/BombLauncher/tower_stats.tres" id="3_gknxe"]
|
||||
[ext_resource type="PackedScene" uid="uid://c3fqlkytyc62u" path="res://PCs/Mechanic/ClassCards/BombLauncher/weapon_bomb_launcher.tscn" id="3_s56j6"]
|
||||
[ext_resource type="Resource" uid="uid://co6eorobj1xuu" path="res://PCs/Mechanic/ClassCards/BombLauncher/weapon_stats.tres" id="4_s74ea"]
|
||||
[ext_resource type="PackedScene" uid="uid://d2cch7qrwocg8" path="res://PCs/Mechanic/ClassCards/BombLauncher/tower_bomb_launcher.tscn" id="4_vc8pe"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_qtxcq")
|
||||
rarity = 0
|
||||
faction = 0
|
||||
turret_scene = ExtResource("4_vc8pe")
|
||||
weapon_scene = ExtResource("3_s56j6")
|
||||
weapon_stats = ExtResource("4_s74ea")
|
||||
tower_stats = ExtResource("3_gknxe")
|
||||
display_name = "Bomb Launcher"
|
BIN
PCs/Mechanic/ClassCards/BombLauncher/grenade_launcher.png
Normal file
BIN
PCs/Mechanic/ClassCards/BombLauncher/grenade_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://3qcdx7n440sc"
|
||||
path="res://.godot/imported/grenade_launcher.png-233e235e73731bd49fc11367e78b190d.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://PCs/Mechanic/ClassCards/BombLauncher/grenade_launcher.png"
|
||||
dest_files=["res://.godot/imported/grenade_launcher.png-233e235e73731bd49fc11367e78b190d.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
|
BIN
PCs/Mechanic/ClassCards/BombLauncher/shot1.wav
Normal file
BIN
PCs/Mechanic/ClassCards/BombLauncher/shot1.wav
Normal file
Binary file not shown.
24
PCs/Mechanic/ClassCards/BombLauncher/shot1.wav.import
Normal file
24
PCs/Mechanic/ClassCards/BombLauncher/shot1.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://qeav4v23p0dd"
|
||||
path="res://.godot/imported/shot1.wav-6ef5a8f56db406930c5787ba0d90c212.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://PCs/Mechanic/ClassCards/BombLauncher/shot1.wav"
|
||||
dest_files=["res://.godot/imported/shot1.wav-6ef5a8f56db406930c5787ba0d90c212.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=0
|
20
PCs/Mechanic/ClassCards/BombLauncher/tower_bomb_launcher.gd
Normal file
20
PCs/Mechanic/ClassCards/BombLauncher/tower_bomb_launcher.gd
Normal file
@ -0,0 +1,20 @@
|
||||
class_name BombLauncherTower extends ProjectileTower
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
super._ready()
|
||||
force = sqrt((target_range * ProjectSettings.get_setting("physics/3d/default_gravity")) / sin(2 * 45))
|
||||
|
||||
|
||||
func aim() -> void:
|
||||
super.aim()
|
||||
var pos: Vector2 = Vector2(global_position.x, global_position.z)
|
||||
var t_pos: Vector2 = Vector2(targeted_enemy.global_position.x, targeted_enemy.global_position.z)
|
||||
var x: float = pos.distance_to(t_pos)
|
||||
var y: float = targeted_enemy.global_position.y - yaw_model.global_position.y
|
||||
var v: float = force
|
||||
var g: float = ProjectSettings.get_setting("physics/3d/default_gravity")
|
||||
var v2: float = pow(v, 2)
|
||||
var angle: float = atan((v2 + sqrt(pow(v, 4) - g * ((g * pow(x, 2)) + (2 * y * v2)))) / (g * x))
|
||||
yaw_model.look_at(Vector3(t_pos.x, yaw_model.global_position.y, t_pos.y))
|
||||
yaw_model.rotate(yaw_model.global_transform.basis.x.normalized(), angle)
|
@ -0,0 +1,29 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://d2cch7qrwocg8"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://t0b32qb8eub2" path="res://Scenes/Towers/projectile_tower.tscn" id="1_r8hbo"]
|
||||
[ext_resource type="Script" path="res://PCs/Mechanic/ClassCards/BombLauncher/tower_bomb_launcher.gd" id="2_vlaa6"]
|
||||
[ext_resource type="PackedScene" uid="uid://c8oq5unisjqne" path="res://PCs/Mechanic/ClassCards/BombLauncher/bomb_projectile.tscn" id="3_562if"]
|
||||
[ext_resource type="Resource" uid="uid://8eaecilvan23" path="res://PCs/Mechanic/ClassCards/BombLauncher/tower_stats.tres" id="4_xgwj1"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://cbuu5w43qins8" path="res://PCs/Mechanic/ClassCards/BombLauncher/bombamodel.res" id="5_yixga"]
|
||||
[ext_resource type="AudioStream" uid="uid://qeav4v23p0dd" path="res://PCs/Mechanic/ClassCards/BombLauncher/shot1.wav" id="6_mc58j"]
|
||||
|
||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_svy8m"]
|
||||
random_pitch = 1.1
|
||||
streams_count = 1
|
||||
stream_0/stream = ExtResource("6_mc58j")
|
||||
stream_0/weight = 1.0
|
||||
|
||||
[node name="BombLauncherTower" instance=ExtResource("1_r8hbo")]
|
||||
script = ExtResource("2_vlaa6")
|
||||
projectile_scene = ExtResource("3_562if")
|
||||
stats = ExtResource("4_xgwj1")
|
||||
|
||||
[node name="Pitch" parent="." index="1"]
|
||||
visible = false
|
||||
|
||||
[node name="Yaw" parent="." index="2"]
|
||||
transform = Transform3D(0.4, 0, 0, 0, 0.4, 0, 0, 0, 0.4, 0, 0.870628, 0)
|
||||
mesh = ExtResource("5_yixga")
|
||||
|
||||
[node name="AudioStreamPlayer3D" parent="Yaw" index="0"]
|
||||
stream = SubResource("AudioStreamRandomizer_svy8m")
|
25
PCs/Mechanic/ClassCards/BombLauncher/tower_stats.tres
Normal file
25
PCs/Mechanic/ClassCards/BombLauncher/tower_stats.tres
Normal file
@ -0,0 +1,25 @@
|
||||
[gd_resource type="Resource" script_class="CardText" load_steps=6 format=3 uid="uid://8eaecilvan23"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scripts/Resources/stat_attribute.gd" id="1_eglp5"]
|
||||
[ext_resource type="Script" path="res://Scripts/Resources/card_text.gd" id="2_1vuma"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_yb48y"]
|
||||
script = ExtResource("1_eglp5")
|
||||
key = "Fire Delay"
|
||||
value = 4.0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ewwvw"]
|
||||
script = ExtResource("1_eglp5")
|
||||
key = "Damage"
|
||||
value = 10.0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_qu5dv"]
|
||||
script = ExtResource("1_eglp5")
|
||||
key = "Range"
|
||||
value = 8.0
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_1vuma")
|
||||
target_type = 1
|
||||
attributes = Array[ExtResource("1_eglp5")]([SubResource("Resource_yb48y"), SubResource("Resource_ewwvw"), SubResource("Resource_qu5dv")])
|
||||
text = "Launch a bomb that deals /Damage\\ damage every /Fire Delay\\ seconds"
|
@ -0,0 +1,7 @@
|
||||
class_name BombLauncherWeapon extends ProjectileWeapon
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
super._ready()
|
||||
var launch_range: float = stats.get_attribute("Range")
|
||||
force = sqrt((launch_range * ProjectSettings.get_setting("physics/3d/default_gravity")) / sin(2.0 * 45.0))
|
@ -0,0 +1,29 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://c3fqlkytyc62u"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bqdllitxbbpyp" path="res://Scenes/Weapons/projectile_weapon.tscn" id="1_gbycb"]
|
||||
[ext_resource type="Script" path="res://PCs/Mechanic/ClassCards/BombLauncher/weapon_bomb_launcher.gd" id="2_g5ihb"]
|
||||
[ext_resource type="Resource" uid="uid://co6eorobj1xuu" path="res://PCs/Mechanic/ClassCards/BombLauncher/weapon_stats.tres" id="3_73ol1"]
|
||||
[ext_resource type="PackedScene" uid="uid://c8oq5unisjqne" path="res://PCs/Mechanic/ClassCards/BombLauncher/bomb_projectile.tscn" id="3_jxt6m"]
|
||||
[ext_resource type="Texture2D" uid="uid://3qcdx7n440sc" path="res://PCs/Mechanic/ClassCards/BombLauncher/grenade_launcher.png" id="5_iyrt8"]
|
||||
[ext_resource type="AudioStream" uid="uid://qeav4v23p0dd" path="res://PCs/Mechanic/ClassCards/BombLauncher/shot1.wav" id="6_rg62n"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_4fobv"]
|
||||
atlas = ExtResource("5_iyrt8")
|
||||
region = Rect2(0, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_l37cm"]
|
||||
random_pitch = 1.1
|
||||
streams_count = 1
|
||||
stream_0/stream = ExtResource("6_rg62n")
|
||||
stream_0/weight = 1.0
|
||||
|
||||
[node name="BombLauncherWeapon" instance=ExtResource("1_gbycb")]
|
||||
script = ExtResource("2_g5ihb")
|
||||
projectile_scene = ExtResource("3_jxt6m")
|
||||
stats = ExtResource("3_73ol1")
|
||||
|
||||
[node name="Sprite3D" parent="." index="0"]
|
||||
texture = SubResource("AtlasTexture_4fobv")
|
||||
|
||||
[node name="AudioStreamPlayer3D" parent="." index="3"]
|
||||
stream = SubResource("AudioStreamRandomizer_l37cm")
|
30
PCs/Mechanic/ClassCards/BombLauncher/weapon_stats.tres
Normal file
30
PCs/Mechanic/ClassCards/BombLauncher/weapon_stats.tres
Normal file
@ -0,0 +1,30 @@
|
||||
[gd_resource type="Resource" script_class="CardText" load_steps=7 format=3 uid="uid://co6eorobj1xuu"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scripts/Resources/stat_attribute.gd" id="1_vg7y2"]
|
||||
[ext_resource type="Script" path="res://Scripts/Resources/card_text.gd" id="2_fe8lx"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_yb48y"]
|
||||
script = ExtResource("1_vg7y2")
|
||||
key = "Fire Delay"
|
||||
value = 2.0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ewwvw"]
|
||||
script = ExtResource("1_vg7y2")
|
||||
key = "Damage"
|
||||
value = 10.0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_qu5dv"]
|
||||
script = ExtResource("1_vg7y2")
|
||||
key = "Range"
|
||||
value = 10.0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_67t30"]
|
||||
script = ExtResource("1_vg7y2")
|
||||
key = "Energy"
|
||||
value = 10.0
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_fe8lx")
|
||||
target_type = 0
|
||||
attributes = Array[ExtResource("1_vg7y2")]([SubResource("Resource_yb48y"), SubResource("Resource_ewwvw"), SubResource("Resource_qu5dv"), SubResource("Resource_67t30")])
|
||||
text = "Launch a bomb that deals /Damage\\ damage every /Fire Delay\\ seconds"
|
Reference in New Issue
Block a user