Reworked weapons and projectiles
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
||||
class_name MinelayerProjectile
|
||||
extends BlastProjectile
|
||||
class_name AbstractMinelayerProjectile
|
||||
extends AbstractBlastProjectile
|
||||
|
||||
|
||||
enum SpriteState {
|
||||
+5
-5
@@ -1,10 +1,10 @@
|
||||
[gd_scene load_steps=12 format=3 uid="uid://4mkklqt1g14f"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://betr5ry5tc75e" path="res://game/entities/weapons/blast_projectile.tscn" id="1_ufc4r"]
|
||||
[ext_resource type="Script" uid="uid://76swcukelnii" path="res://game/entities/weapons/minelayer/minelayer_projectile.gd" id="2_hwwfa"]
|
||||
[ext_resource type="Script" uid="uid://dftb7hg5f06b5" path="res://game/health_system/damage/explosion_damage.gd" id="3_hll7s"]
|
||||
[ext_resource type="PackedScene" uid="uid://betr5ry5tc75e" path="res://game/entities/weapons/abstract_blast_projectile.tscn" id="1_ufc4r"]
|
||||
[ext_resource type="Script" uid="uid://76swcukelnii" path="res://game/entities/weapons/minelayer/abstract_minelayer_projectile.gd" id="2_hwwfa"]
|
||||
[ext_resource type="Script" uid="uid://dftb7hg5f06b5" path="res://game/data/damage/explosion_damage.gd" id="3_hll7s"]
|
||||
[ext_resource type="Texture2D" uid="uid://oj86smpsipw4" path="res://images/projectiles.png" id="4_px1i2"]
|
||||
[ext_resource type="PackedScene" uid="uid://bhxib2ltpkcbf" path="res://game/entities/other/explosion_particles.tscn" id="5_ckqco"]
|
||||
[ext_resource type="PackedScene" uid="uid://bhxib2ltpkcbf" path="res://game/entities/explosions/explosion_particles.tscn" id="5_ckqco"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ckqco"]
|
||||
atlas = ExtResource("4_px1i2")
|
||||
@@ -37,7 +37,7 @@ gravity = Vector3(0, 0, 0)
|
||||
turbulence_enabled = true
|
||||
turbulence_noise_speed = Vector3(0.1, 0.1, 0.1)
|
||||
|
||||
[node name="MinelayerProjectile" instance=ExtResource("1_ufc4r")]
|
||||
[node name="AbstractMinelayerProjectile" instance=ExtResource("1_ufc4r")]
|
||||
collision_layer = 0
|
||||
collision_mask = 0
|
||||
script = ExtResource("2_hwwfa")
|
||||
+5
-7
@@ -1,24 +1,22 @@
|
||||
class_name AbstractMinelayerWeapon
|
||||
extends AbstractWeapon
|
||||
|
||||
|
||||
@onready var sprite : AnimatedSprite2D = $AnimatedSprite2D
|
||||
|
||||
|
||||
func set_belonging(belonging: Belonging) -> void:
|
||||
super.set_belonging(belonging)
|
||||
|
||||
sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX)
|
||||
func _ready() -> void:
|
||||
sprite.play(IDLE_ANIMATION)
|
||||
|
||||
|
||||
func shoot(ship_velocity: Vector2) -> bool:
|
||||
var is_shot := super.shoot(ship_velocity)
|
||||
if is_shot:
|
||||
_can_shoot = false
|
||||
sprite.play(PREFIXES[_belonging] + SHOT_POSTFIX)
|
||||
sprite.play(SHOT_ANIMATION)
|
||||
|
||||
return is_shot
|
||||
|
||||
|
||||
func _on_animated_sprite_2d_animation_finished() -> void:
|
||||
sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX)
|
||||
sprite.play(IDLE_ANIMATION)
|
||||
_can_shoot = true
|
||||
+3
-5
@@ -1,8 +1,7 @@
|
||||
[gd_scene load_steps=20 format=3 uid="uid://j3yht6q4ru4e"]
|
||||
[gd_scene load_steps=19 format=3 uid="uid://j3yht6q4ru4e"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://1o2ta17yc5bp" path="res://game/entities/weapons/abstract_weapon.tscn" id="1_12l3k"]
|
||||
[ext_resource type="PackedScene" uid="uid://4mkklqt1g14f" path="res://game/entities/weapons/minelayer/minelayer_projectile.tscn" id="2_7y446"]
|
||||
[ext_resource type="Script" uid="uid://c3ckkpjaef5jn" path="res://game/entities/weapons/minelayer/minelayer_weapon.gd" id="2_mmhtn"]
|
||||
[ext_resource type="Script" uid="uid://c3ckkpjaef5jn" path="res://game/entities/weapons/minelayer/abstract_minelayer_weapon.gd" id="2_mmhtn"]
|
||||
[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="6_ais8e"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ais8e"]
|
||||
@@ -126,10 +125,9 @@ animations = [{
|
||||
"speed": 10.0
|
||||
}]
|
||||
|
||||
[node name="MinelayerWeapon" instance=ExtResource("1_12l3k")]
|
||||
[node name="AbstractMinelayerWeapon" instance=ExtResource("1_12l3k")]
|
||||
script = ExtResource("2_mmhtn")
|
||||
sector_angle = 10
|
||||
Projectile = ExtResource("2_7y446")
|
||||
type = 5
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="0"]
|
||||
@@ -0,0 +1,2 @@
|
||||
class_name EnemyMinelayerProjectile
|
||||
extends AbstractMinelayerProjectile
|
||||
@@ -0,0 +1 @@
|
||||
uid://fyoiuye4fvk3
|
||||
@@ -0,0 +1,14 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bs3wo34es7q10"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://4mkklqt1g14f" path="res://game/entities/weapons/minelayer/abstract_minelayer_projectile.tscn" id="1_uiwyj"]
|
||||
[ext_resource type="Script" uid="uid://fyoiuye4fvk3" path="res://game/entities/weapons/minelayer/enemy_minelayer_projectile.gd" id="2_2o7sx"]
|
||||
|
||||
[node name="EnemyMinelayerProjectile" instance=ExtResource("1_uiwyj")]
|
||||
collision_layer = 16
|
||||
collision_mask = 2
|
||||
script = ExtResource("2_2o7sx")
|
||||
direction = Vector2(-1, 0)
|
||||
|
||||
[node name="Blast" parent="." index="4"]
|
||||
collision_layer = 16
|
||||
collision_mask = 2
|
||||
@@ -0,0 +1,2 @@
|
||||
class_name EnemyMinelayerWeapon
|
||||
extends AbstractMinelayerWeapon
|
||||
@@ -0,0 +1 @@
|
||||
uid://dmnqjbog6df2x
|
||||
@@ -0,0 +1,76 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://bjbfi6vvikk15"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://j3yht6q4ru4e" path="res://game/entities/weapons/minelayer/abstract_minelayer_weapon.tscn" id="1_8qj2c"]
|
||||
[ext_resource type="Script" uid="uid://dmnqjbog6df2x" path="res://game/entities/weapons/minelayer/enemy_minelayer_weapon.gd" id="2_n3m0w"]
|
||||
[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="3_jx7o2"]
|
||||
[ext_resource type="PackedScene" uid="uid://bs3wo34es7q10" path="res://game/entities/weapons/minelayer/enemy_minelayer_projectile.tscn" id="3_nkog1"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ais8e"]
|
||||
atlas = ExtResource("3_jx7o2")
|
||||
region = Rect2(0, 144, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_a7h2a"]
|
||||
atlas = ExtResource("3_jx7o2")
|
||||
region = Rect2(32, 144, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5u2pu"]
|
||||
atlas = ExtResource("3_jx7o2")
|
||||
region = Rect2(64, 144, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_iwxdg"]
|
||||
atlas = ExtResource("3_jx7o2")
|
||||
region = Rect2(96, 144, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_oyt37"]
|
||||
atlas = ExtResource("3_jx7o2")
|
||||
region = Rect2(128, 144, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_fvahc"]
|
||||
atlas = ExtResource("3_jx7o2")
|
||||
region = Rect2(160, 144, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_c2np6"]
|
||||
atlas = ExtResource("3_jx7o2")
|
||||
region = Rect2(192, 144, 32, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_nkog1"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ais8e")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 10.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_a7h2a")
|
||||
}, {
|
||||
"duration": 9.0,
|
||||
"texture": SubResource("AtlasTexture_5u2pu")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_iwxdg")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_oyt37")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_fvahc")
|
||||
}, {
|
||||
"duration": 2.0,
|
||||
"texture": SubResource("AtlasTexture_c2np6")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"shot",
|
||||
"speed": 10.0
|
||||
}]
|
||||
|
||||
[node name="EnemyMinelayerWeapon" instance=ExtResource("1_8qj2c")]
|
||||
script = ExtResource("2_n3m0w")
|
||||
projectile_scene = ExtResource("3_nkog1")
|
||||
|
||||
[node name="AnimatedSprite2D" parent="." index="0"]
|
||||
sprite_frames = SubResource("SpriteFrames_nkog1")
|
||||
animation = &"shot"
|
||||
@@ -1,17 +0,0 @@
|
||||
[gd_resource type="Resource" script_class="WeaponData" load_steps=3 format=3 uid="uid://40sshnf6g80k"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/world/data/weapon_data.gd" id="1_152qt"]
|
||||
[ext_resource type="PackedScene" uid="uid://j3yht6q4ru4e" path="res://game/entities/weapons/minelayer/minelayer_weapon.tscn" id="1_fh5qv"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_152qt")
|
||||
id = "minelayer"
|
||||
name = "Minelayer"
|
||||
group = "explosion"
|
||||
description = "High damage (explosion)
|
||||
Low firerate
|
||||
Low velocity
|
||||
Medium explosion radius
|
||||
Short range"
|
||||
scene = ExtResource("1_fh5qv")
|
||||
metadata/_custom_type_script = "uid://870r1efinhqd"
|
||||
@@ -0,0 +1,2 @@
|
||||
class_name PlayerMinelayerProjectile
|
||||
extends AbstractMinelayerProjectile
|
||||
@@ -0,0 +1 @@
|
||||
uid://cw25lysow3qad
|
||||
@@ -0,0 +1,14 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://dnculk5rcfxly"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://4mkklqt1g14f" path="res://game/entities/weapons/minelayer/abstract_minelayer_projectile.tscn" id="1_c222g"]
|
||||
[ext_resource type="Script" uid="uid://cw25lysow3qad" path="res://game/entities/weapons/minelayer/player_minelayer_projectile.gd" id="2_5gcsg"]
|
||||
|
||||
[node name="PlayerMinelayerProjectile" instance=ExtResource("1_c222g")]
|
||||
collision_layer = 8
|
||||
collision_mask = 4
|
||||
script = ExtResource("2_5gcsg")
|
||||
direction = Vector2(1, 0)
|
||||
|
||||
[node name="Blast" parent="." index="4"]
|
||||
collision_layer = 8
|
||||
collision_mask = 4
|
||||
@@ -0,0 +1,2 @@
|
||||
class_name PlayerMinelayerWeapon
|
||||
extends AbstractMinelayerWeapon
|
||||
@@ -0,0 +1 @@
|
||||
uid://c5txlsof4wtk2
|
||||
@@ -0,0 +1,76 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://dxh4m1upio4fx"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://j3yht6q4ru4e" path="res://game/entities/weapons/minelayer/abstract_minelayer_weapon.tscn" id="1_j3u5v"]
|
||||
[ext_resource type="Script" uid="uid://c5txlsof4wtk2" path="res://game/entities/weapons/minelayer/player_minelayer_weapon.gd" id="2_mvhh7"]
|
||||
[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="3_mvhh7"]
|
||||
[ext_resource type="PackedScene" uid="uid://dnculk5rcfxly" path="res://game/entities/weapons/minelayer/player_minelayer_projectile.tscn" id="3_u0als"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6718t"]
|
||||
atlas = ExtResource("3_mvhh7")
|
||||
region = Rect2(0, 128, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wwpdh"]
|
||||
atlas = ExtResource("3_mvhh7")
|
||||
region = Rect2(32, 128, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_m6clj"]
|
||||
atlas = ExtResource("3_mvhh7")
|
||||
region = Rect2(64, 128, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_tqqar"]
|
||||
atlas = ExtResource("3_mvhh7")
|
||||
region = Rect2(96, 128, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mq3tp"]
|
||||
atlas = ExtResource("3_mvhh7")
|
||||
region = Rect2(128, 128, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8yhut"]
|
||||
atlas = ExtResource("3_mvhh7")
|
||||
region = Rect2(160, 128, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xddqm"]
|
||||
atlas = ExtResource("3_mvhh7")
|
||||
region = Rect2(192, 128, 32, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_u0als"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_6718t")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 10.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wwpdh")
|
||||
}, {
|
||||
"duration": 9.0,
|
||||
"texture": SubResource("AtlasTexture_m6clj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_tqqar")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_mq3tp")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_8yhut")
|
||||
}, {
|
||||
"duration": 2.0,
|
||||
"texture": SubResource("AtlasTexture_xddqm")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"shot",
|
||||
"speed": 10.0
|
||||
}]
|
||||
|
||||
[node name="PlayerMinelayerWeapon" instance=ExtResource("1_j3u5v")]
|
||||
script = ExtResource("2_mvhh7")
|
||||
projectile_scene = ExtResource("3_u0als")
|
||||
|
||||
[node name="AnimatedSprite2D" parent="." index="0"]
|
||||
sprite_frames = SubResource("SpriteFrames_u0als")
|
||||
animation = &"shot"
|
||||
Reference in New Issue
Block a user