diff --git a/Dialogue/Timelines/laser_tutorial.dtl b/Dialogue/Timelines/laser_tutorial.dtl new file mode 100644 index 00000000..158d72f8 --- /dev/null +++ b/Dialogue/Timelines/laser_tutorial.dtl @@ -0,0 +1,6 @@ +ICE: The Laser is an energy weapon.\ +Shooting it will drain your shields. +ICE: However you can recharge your shield\ +by grazing enemy bullets +ICE: As long as you are able to avoid getting hit,\ +the laser can be a really powerful weapon! diff --git a/Dialogue/Timelines/laser_tutorial.dtl.uid b/Dialogue/Timelines/laser_tutorial.dtl.uid new file mode 100644 index 00000000..51d7e607 --- /dev/null +++ b/Dialogue/Timelines/laser_tutorial.dtl.uid @@ -0,0 +1 @@ +uid://cxfe0h87pr25s diff --git a/Resources/Bullets/player_laser.tres b/Resources/Bullets/player_laser.tres new file mode 100644 index 00000000..b25df22d --- /dev/null +++ b/Resources/Bullets/player_laser.tres @@ -0,0 +1,23 @@ +[gd_resource type="Resource" script_class="BulletResource" load_steps=4 format=3 uid="uid://sjrqf5xg6fek"] + +[ext_resource type="PackedScene" uid="uid://wsaxjt32sc06" path="res://Scenes/Weapons/Bullets/bullet_laser_player.tscn" id="1_k71c3"] +[ext_resource type="PackedScene" uid="uid://dfbmny3s4rili" path="res://Scenes/Particles/IceBulletParticle.tscn" id="2_x6hhy"] +[ext_resource type="Script" uid="uid://dslyrfcej3g2n" path="res://Scripts/Resources/BulletResource.cs" id="3_77nif"] + +[resource] +script = ExtResource("3_77nif") +BulletScene = ExtResource("1_k71c3") +DestructionParticlesScene = ExtResource("2_x6hhy") +BulletSpeed = 300.0 +Direction = Vector2(1, 0) +BulletDamage = 4.0 +LifeTime = 10.0 +DestroyOnCollision = true +Owner = 1 +DamageType = 3 +RotateSprite = true +Controllable = false +Freezable = false +Grazeable = false +GrazeValue = 1.0 +TimeModifiers = [] diff --git a/Resources/Weapons/Ice_Shotgun_T1.tres b/Resources/Weapons/Ice_Shotgun_T1.tres index fe98981f..5c70d063 100644 --- a/Resources/Weapons/Ice_Shotgun_T1.tres +++ b/Resources/Weapons/Ice_Shotgun_T1.tres @@ -8,6 +8,7 @@ script = ExtResource("2_6gv3a") Name = &"Ice Shotgun" BulletData = ExtResource("1_fi2vm") Priority = 10 +AmmoPerShot = 1 RateOfFire = 0.4 BulletCapacity = 4 ReloadTime = 0.8 diff --git a/Resources/Weapons/IcicleGun.tres b/Resources/Weapons/IcicleGun.tres index 8e8e6e24..95aeb431 100644 --- a/Resources/Weapons/IcicleGun.tres +++ b/Resources/Weapons/IcicleGun.tres @@ -10,6 +10,7 @@ script = ExtResource("2_m8dps") Name = &"Icicle Gun" BulletData = ExtResource("1_85ef1") Priority = 1 +AmmoPerShot = 1 RateOfFire = 0.3 BulletCapacity = 5 ReloadTime = 0.6 diff --git a/Resources/Weapons/LaserWeapon.tres b/Resources/Weapons/LaserWeapon.tres index 3209ad89..8da7f218 100644 --- a/Resources/Weapons/LaserWeapon.tres +++ b/Resources/Weapons/LaserWeapon.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="WeaponResource" load_steps=5 format=3 uid="uid://do0jwf5jhx1i5"] -[ext_resource type="Resource" uid="uid://eu6n6c5175y8" path="res://Resources/Bullets/simple_ice_bullet.tres" id="1_1h0tt"] +[ext_resource type="Resource" uid="uid://sjrqf5xg6fek" path="res://Resources/Bullets/player_laser.tres" id="1_1h0tt"] [ext_resource type="AudioStream" uid="uid://jsv3yjluv1au" path="res://SFX/Weapons/Reload_01.wav" id="2_h0bjj"] [ext_resource type="AudioStream" uid="uid://cjg8r7bthkfsy" path="res://SFX/Laser_shoot 11.wav" id="3_iquwk"] [ext_resource type="Script" uid="uid://b6fmrnipv88bk" path="res://Scripts/Resources/WeaponResource.cs" id="4_70v4a"] diff --git a/Scenes/Weapons/Bullets/bullet_laser_player.tscn b/Scenes/Weapons/Bullets/bullet_laser_player.tscn new file mode 100644 index 00000000..76bdfef8 --- /dev/null +++ b/Scenes/Weapons/Bullets/bullet_laser_player.tscn @@ -0,0 +1,29 @@ +[gd_scene load_steps=4 format=3 uid="uid://wsaxjt32sc06"] + +[ext_resource type="Script" uid="uid://dsa4b75hdig8p" path="res://Scripts/Bullet.cs" id="1_rjxyk"] +[ext_resource type="Texture2D" uid="uid://dpg67vdjmoy6t" path="res://Sprites/Bullets/player_laser_bullet.png" id="2_5ahps"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_jxptd"] +radius = 2.23607 + +[node name="Bullet" type="Area2D" groups=["bullets"]] +collision_layer = 8 +collision_mask = 85 +script = ExtResource("1_rjxyk") +Speed = 200.0 +metadata/_edit_group_ = true + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = ExtResource("2_5ahps") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_jxptd") + +[node name="Node2D" type="Node2D" parent="."] +editor_description = "Player Bullet" + +[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."] + +[connection signal="area_entered" from="." to="." method="_on_area_entered"] +[connection signal="body_entered" from="." to="." method="_on_body_entered"] +[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="_on_visible_on_screen_notifier_2d_screen_exited"] diff --git a/Scenes/test.tscn b/Scenes/test.tscn index e2357673..a2c8ffae 100644 --- a/Scenes/test.tscn +++ b/Scenes/test.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=166 format=4 uid="uid://bv451a8wgty4u"] +[gd_scene load_steps=167 format=4 uid="uid://bv451a8wgty4u"] [ext_resource type="Script" uid="uid://doxmbokehw8ci" path="res://Scripts/GameManager.cs" id="1_8tmoj"] [ext_resource type="PackedScene" uid="uid://c4pr2707hbeph" path="res://Scenes/Actors/fsm_player.tscn" id="2_ksslq"] @@ -53,7 +53,6 @@ [ext_resource type="PackedScene" uid="uid://d0yes7huiyisw" path="res://Scenes/Items/Blue_Keycard.tscn" id="35_rblsn"] [ext_resource type="PackedScene" uid="uid://r25rq6ijgm6m" path="res://Scenes/Items/Green_Keycard.tscn" id="36_f8fh1"] [ext_resource type="PackedScene" uid="uid://dnbtou2fklyvp" path="res://Scenes/Actors/alarm_sign.tscn" id="36_rd6f6"] -[ext_resource type="Script" uid="uid://epnwjptvks3t" path="res://Scripts/Resources/LootItem.cs" id="37_dferh"] [ext_resource type="PackedScene" uid="uid://dsbk2l40er2da" path="res://Scenes/Props/Box_Blue.tscn" id="37_gtga7"] [ext_resource type="PackedScene" uid="uid://c8lgk4wnyi1e6" path="res://Scenes/Actors/HealthStation.tscn" id="38_kuhg5"] [ext_resource type="PackedScene" uid="uid://cl4r3t4c1klv7" path="res://Scenes/Interactable/Switch_Box.tscn" id="38_qnbhd"] @@ -80,6 +79,7 @@ [ext_resource type="PackedScene" uid="uid://bqjcwxene73l2" path="res://Scenes/Actors/ActorEnemyTest.tscn" id="55_chha6"] [ext_resource type="Resource" uid="uid://bhllj7r3oxipf" path="res://Resources/Items/IceShotgun_T2.tres" id="56_w8skm"] [ext_resource type="Resource" uid="uid://btk4kojtepwv" path="res://Resources/Items/IceShotgun_Sawed_T1.tres" id="57_jm0wb"] +[ext_resource type="Resource" uid="uid://ckfqrq8a0uj1t" path="res://Resources/Items/LaserWeapon.tres" id="57_uh0gg"] [ext_resource type="Resource" uid="uid://c57od7cpn5kwf" path="res://Resources/Items/IceShotgun_Sawed_T2.tres" id="58_dfo5i"] [ext_resource type="PackedScene" uid="uid://bjskkeb3ppcs8" path="res://Scenes/Actors/Turret360.tscn" id="62_h0jm4"] [ext_resource type="Script" uid="uid://v57xjmhi28kw" path="res://Scripts/Resources/Events/ControlActorEvent.cs" id="64_rphi8"] @@ -176,6 +176,11 @@ script = ExtResource("99_j6vrf") Patterns = Array[Object]([SubResource("Resource_xhinl")]) metadata/_custom_type_script = "uid://bngko08ho85p6" +[sub_resource type="Resource" id="Resource_uh0gg"] +script = ExtResource("46_i0omr") +TimelineName = &"laser_tutorial" +WaitForCompletion = true + [sub_resource type="Resource" id="Resource_usuub"] script = ExtResource("49_0si7g") Target = NodePath("..") @@ -291,7 +296,7 @@ ActivationType = 0 Targets = Array[NodePath]([NodePath("../Rumia")]) WaitForCompletion = true -[sub_resource type="Resource" id="Resource_7lma1"] +[sub_resource type="Resource" id="Resource_ldb17"] resource_local_to_scene = true script = ExtResource("49_0si7g") Target = NodePath(".") @@ -680,7 +685,7 @@ position = Vector2(-1832, -99) [node name="Chest2" parent="Parallax2D/Factory Tilemaps/Debug Room" instance=ExtResource("25_4b2ed")] position = Vector2(-679, -408) -LootTable = Array[ExtResource("37_dferh")]([ExtResource("76_dskij"), ExtResource("77_wma5c"), ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("6_khabp"), ExtResource("6_khabp"), ExtResource("6_khabp"), ExtResource("6_khabp"), ExtResource("6_khabp"), ExtResource("77_wma5c"), ExtResource("77_wma5c"), ExtResource("77_wma5c"), ExtResource("77_wma5c"), ExtResource("76_dskij")]) +LootTable = [ExtResource("76_dskij"), ExtResource("77_wma5c"), ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("94_gd7x4"), ExtResource("6_khabp"), ExtResource("6_khabp"), ExtResource("6_khabp"), ExtResource("6_khabp"), ExtResource("6_khabp"), ExtResource("77_wma5c"), ExtResource("77_wma5c"), ExtResource("77_wma5c"), ExtResource("77_wma5c"), ExtResource("76_dskij")] [node name="Valve" parent="Parallax2D/Factory Tilemaps/Debug Room" node_paths=PackedStringArray("Target") instance=ExtResource("48_8usll")] position = Vector2(-666, -545) @@ -808,6 +813,12 @@ AutoSpawn = true [node name="Part2" type="Node2D" parent="Parallax2D/Factory Tilemaps"] y_sort_enabled = true +[node name="AmmoMarker10" type="Marker2D" parent="Parallax2D/Factory Tilemaps/Part2"] +position = Vector2(-1488, -296) +script = ExtResource("82_fuaed") +Item = ExtResource("57_uh0gg") +AutoSpawn = true + [node name="Mainframe" parent="Parallax2D/Factory Tilemaps/Part2" instance=ExtResource("13_acrmt")] position = Vector2(-1178, -370) @@ -820,6 +831,11 @@ position = Vector2(-1205, -432) [node name="Mainframe3" parent="Parallax2D/Factory Tilemaps/Part2" instance=ExtResource("13_acrmt")] position = Vector2(-1210, -370) +[node name="LaserTutorial" parent="Parallax2D/Factory Tilemaps/Part2" instance=ExtResource("43_kf3qc")] +position = Vector2(-1488, -298) +scale = Vector2(1.455, 1.455) +Events = Array[ExtResource("66_ldb17")]([SubResource("Resource_uh0gg")]) + [node name="LevelProps" type="Node2D" parent="Parallax2D/Factory Tilemaps"] y_sort_enabled = true @@ -973,7 +989,7 @@ position = Vector2(-1488, -544) [node name="Chest" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("25_4b2ed")] position = Vector2(-920, -424) -LootTable = Array[ExtResource("37_dferh")]([ExtResource("27_y1lom"), ExtResource("28_u0dff"), ExtResource("29_wb5l5"), ExtResource("30_0d2o6"), ExtResource("5_nqier")]) +LootTable = [ExtResource("27_y1lom"), ExtResource("28_u0dff"), ExtResource("29_wb5l5"), ExtResource("30_0d2o6"), ExtResource("5_nqier")] [node name="RedKeycard_Switch_2" parent="Parallax2D/Factory Tilemaps/LevelProps" node_paths=PackedStringArray("Target") instance=ExtResource("17_e3v0b")] position = Vector2(-1095, 132) @@ -1223,7 +1239,7 @@ Events = Array[ExtResource("66_ldb17")]([SubResource("Resource_068l7"), SubResou [node name="BossBattleStartScript" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("43_kf3qc")] position = Vector2(-1487, -396) -Events = Array[ExtResource("66_ldb17")]([SubResource("Resource_4f4id"), SubResource("Resource_s2o7m"), SubResource("Resource_b1dht"), SubResource("Resource_xrgpy"), SubResource("Resource_7lma1")]) +Events = Array[ExtResource("66_ldb17")]([SubResource("Resource_4f4id"), SubResource("Resource_s2o7m"), SubResource("Resource_b1dht"), SubResource("Resource_xrgpy"), SubResource("Resource_ldb17")]) [node name="Enemy13" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("47_u1ve6")] position = Vector2(-1657, -788) @@ -1352,7 +1368,7 @@ position = Vector2(-2000, -736) [node name="ControlPad8" parent="Parallax2D/Factory Tilemaps/LevelProps" node_paths=PackedStringArray("Targets") instance=ExtResource("12_hfkf1")] position = Vector2(-2027, -735) Targets = [NodePath("../HorizontalForceField")] -Requirements = Array[ExtResource("37_dferh")]([ExtResource("84_ma1ta")]) +Requirements = [ExtResource("84_ma1ta")] [node name="Ammo6" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("34_17pjh")] position = Vector2(-872, -220) @@ -1416,35 +1432,35 @@ position = Vector2(-1624, -813) [node name="Chest3" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("25_4b2ed")] position = Vector2(-376, 54) -LootTable = Array[ExtResource("37_dferh")]([ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")]) +LootTable = [ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")] [node name="Chest5" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("25_4b2ed")] position = Vector2(-1048, -139) -LootTable = Array[ExtResource("37_dferh")]([ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g"), ExtResource("4_swym2")]) +LootTable = [ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g"), ExtResource("4_swym2")] [node name="Chest6" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("25_4b2ed")] position = Vector2(-2104, -362) -LootTable = Array[ExtResource("37_dferh")]([ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g"), ExtResource("4_swym2")]) +LootTable = [ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g"), ExtResource("4_swym2")] [node name="Chest4" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("25_4b2ed")] position = Vector2(-823, 67) -LootTable = Array[ExtResource("37_dferh")]([ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")]) +LootTable = [ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")] [node name="Chest7" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("25_4b2ed")] position = Vector2(-1417, 326) -LootTable = Array[ExtResource("37_dferh")]([ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")]) +LootTable = [ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")] [node name="Chest10" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("25_4b2ed")] position = Vector2(-1515, 408) -LootTable = Array[ExtResource("37_dferh")]([ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")]) +LootTable = [ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")] [node name="Chest8" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("25_4b2ed")] position = Vector2(-1544, 552) -LootTable = Array[ExtResource("37_dferh")]([ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")]) +LootTable = [ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")] [node name="Chest9" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("25_4b2ed")] position = Vector2(-1384, 231) -LootTable = Array[ExtResource("37_dferh")]([ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")]) +LootTable = [ExtResource("6_khabp"), ExtResource("94_gd7x4"), ExtResource("95_srv0g")] [node name="Ammo13" parent="Parallax2D/Factory Tilemaps/LevelProps" instance=ExtResource("34_17pjh")] position = Vector2(-392, 52) diff --git a/Scripts/Activables/LevelTeleporter.cs b/Scripts/Activables/LevelTeleporter.cs index dbfefc30..3e78ab90 100644 --- a/Scripts/Activables/LevelTeleporter.cs +++ b/Scripts/Activables/LevelTeleporter.cs @@ -36,6 +36,10 @@ public partial class LevelTeleporter : Teleporter // Save inventory GlobalState.Instance.SessionSettings.Items = InventoryManager.Instance.Save(); } + else + { + GlobalState.Instance.SessionSettings.EquippedWeaponId = string.Empty; + } if (!string.IsNullOrWhiteSpace(LevelPath)) { diff --git a/Scripts/Components/Actors/PlayerWeaponProvider.cs b/Scripts/Components/Actors/PlayerWeaponProvider.cs index 360fb078..b9c8ff5c 100644 --- a/Scripts/Components/Actors/PlayerWeaponProvider.cs +++ b/Scripts/Components/Actors/PlayerWeaponProvider.cs @@ -139,6 +139,12 @@ public partial class PlayerWeaponProvider : Node2D // Remastered method private Weapon SpawnWeapon(LootItem startingItem) { + if (startingItem is null) + { + GD.Print($"Could not spawn weapon {startingItem.ItemKey} was not in the inventory."); + return null; + } + if (WeaponTemplate == null) { GD.Print("Could not spawn weapon because template is null"); diff --git a/Sprites/Bullets/player_laser_bullet.aseprite b/Sprites/Bullets/player_laser_bullet.aseprite new file mode 100644 index 00000000..86ab33bc --- /dev/null +++ b/Sprites/Bullets/player_laser_bullet.aseprite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d16bff235f57fdab23123c1a45738083846045af9b2231db1af19da9d652aad1 +size 454 diff --git a/Sprites/Bullets/player_laser_bullet.png b/Sprites/Bullets/player_laser_bullet.png new file mode 100644 index 00000000..07c559ae --- /dev/null +++ b/Sprites/Bullets/player_laser_bullet.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8c8898b948a4f9d694343a28063b46626ae635ff6925d043d557c968b478532 +size 113 diff --git a/Sprites/Bullets/player_laser_bullet.png.import b/Sprites/Bullets/player_laser_bullet.png.import new file mode 100644 index 00000000..b26cfcef --- /dev/null +++ b/Sprites/Bullets/player_laser_bullet.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dpg67vdjmoy6t" +path="res://.godot/imported/player_laser_bullet.png-8d682ab2556c88d479f00ba3cde8169c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Sprites/Bullets/player_laser_bullet.png" +dest_files=["res://.godot/imported/player_laser_bullet.png-8d682ab2556c88d479f00ba3cde8169c.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 diff --git a/project.godot b/project.godot index b4aafe25..a341945d 100644 --- a/project.godot +++ b/project.godot @@ -74,6 +74,7 @@ directories/dtl_directory={ "computer_goon_cave": "res://Dialogue/Timelines/computer_goon_cave.dtl", "computer_keycard_room": "res://Dialogue/Timelines/computer_keycard_room.dtl", "intro_story": "res://Dialogue/Timelines/intro_story.dtl", +"laser_tutorial": "res://Dialogue/Timelines/laser_tutorial.dtl", "rumia_defeat": "res://Dialogue/Timelines/rumia_defeat.dtl", "rumia_rebel_base_1": "res://Dialogue/Timelines/rumia_rebel_base_1.dtl", "testintro": "res://Dialogue/Timelines/testintro.dtl",