From adee9c86a45b974c74d8ddbc02900be35ebbfa63 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 5 Apr 2022 00:48:32 +0200 Subject: [PATCH] :boom: Fix arrow damage --- src/behaviours/damage/Damaging.gd | 1 - src/entities/bullets/Arrow.tscn | 2 +- src/entities/bullets/PiercingArrow.tscn | 2 +- src/entities/fire/Fire.gd | 2 +- src/levels/endings/BadEnding.tscn | 2 +- src/levels/endings/GoodEnding.tscn | 2 +- src/levels/mainmenu/MainMenu.tscn | 9 +++---- src/levels/ui/{ui => }/CrossbowBar.gd | 0 src/levels/ui/{ui => }/CrossbowBar.tscn | 6 ++--- src/levels/ui/LifeBarBg.png | 4 +-- src/levels/ui/LifeBarBg.png.import | 2 +- src/levels/ui/LifeBarFg.png | 4 +-- src/levels/ui/LifeBarFg.png.import | 2 +- src/levels/ui/Title.png | 4 +-- src/levels/ui/Title.png.import | 2 +- src/levels/ui/UIBar.png | 4 +-- src/levels/ui/UIBar.png.import | 2 +- src/levels/ui/UserInterface.tscn | 2 +- src/levels/ui/ui/LifeBarBg.png | 3 --- src/levels/ui/ui/LifeBarBg.png.import | 35 ------------------------- src/levels/ui/ui/LifeBarFg.png | 3 --- src/levels/ui/ui/LifeBarFg.png.import | 35 ------------------------- src/levels/ui/ui/Title.png | 3 --- src/levels/ui/ui/Title.png.import | 35 ------------------------- src/levels/ui/ui/UIBar.png | 3 --- src/levels/ui/ui/UIBar.png.import | 35 ------------------------- src/pickups/effects/BigArrow.gd | 4 +-- 27 files changed, 26 insertions(+), 182 deletions(-) rename src/levels/ui/{ui => }/CrossbowBar.gd (100%) rename src/levels/ui/{ui => }/CrossbowBar.tscn (69%) delete mode 100644 src/levels/ui/ui/LifeBarBg.png delete mode 100644 src/levels/ui/ui/LifeBarBg.png.import delete mode 100644 src/levels/ui/ui/LifeBarFg.png delete mode 100644 src/levels/ui/ui/LifeBarFg.png.import delete mode 100644 src/levels/ui/ui/Title.png delete mode 100644 src/levels/ui/ui/Title.png.import delete mode 100644 src/levels/ui/ui/UIBar.png delete mode 100644 src/levels/ui/ui/UIBar.png.import diff --git a/src/behaviours/damage/Damaging.gd b/src/behaviours/damage/Damaging.gd index d4ddff2..28aad8b 100644 --- a/src/behaviours/damage/Damaging.gd +++ b/src/behaviours/damage/Damaging.gd @@ -27,6 +27,5 @@ func do_damage(to, multiplier): parent.queue_free() - func _on_BulletMovement_collided(_origin, collision): do_damage(collision.collider, 1) diff --git a/src/entities/bullets/Arrow.tscn b/src/entities/bullets/Arrow.tscn index 3577bc0..a7606a8 100644 --- a/src/entities/bullets/Arrow.tscn +++ b/src/entities/bullets/Arrow.tscn @@ -16,7 +16,7 @@ script = ExtResource( 3 ) dim_texture = ExtResource( 2 ) dim_damage = -10.0 lit_texture = ExtResource( 7 ) -lit_damage = -10 +lit_damage = -10.0 lit_piercing = true [node name="Shape" type="CollisionShape2D" parent="." index="0"] diff --git a/src/entities/bullets/PiercingArrow.tscn b/src/entities/bullets/PiercingArrow.tscn index 3a971cd..68eb752 100644 --- a/src/entities/bullets/PiercingArrow.tscn +++ b/src/entities/bullets/PiercingArrow.tscn @@ -22,4 +22,4 @@ texture = ExtResource( 2 ) movement_per_second = 200.0 [node name="Damaging" parent="." index="2"] -damage = 50.0 +damage = -50.0 diff --git a/src/entities/fire/Fire.gd b/src/entities/fire/Fire.gd index ce1ef33..9e508ae 100644 --- a/src/entities/fire/Fire.gd +++ b/src/entities/fire/Fire.gd @@ -3,7 +3,7 @@ class_name Fire func _on_Flame_body_entered(body): - var flammable = body.get_node("Flammable") + var flammable = body.get_node_or_null("Flammable") if flammable != null: flammable.catch_fire() diff --git a/src/levels/endings/BadEnding.tscn b/src/levels/endings/BadEnding.tscn index 8f410d8..273983e 100644 --- a/src/levels/endings/BadEnding.tscn +++ b/src/levels/endings/BadEnding.tscn @@ -3,7 +3,7 @@ [ext_resource path="res://src/levels/ui/fonts/SourceSerifPro-Regular.ttf" type="DynamicFontData" id=1] [ext_resource path="res://src/ui/fonts/SourceSerifPro-Light.ttf" type="DynamicFontData" id=2] [ext_resource path="res://src/levels/ui/PlayButton.png" type="Texture" id=3] -[ext_resource path="res://src/levels/ui/ui/Title.png" type="Texture" id=4] +[ext_resource path="res://src/levels/ui/Title.png" type="Texture" id=4] [ext_resource path="res://src/levels/endings/Credits.tscn" type="PackedScene" id=5] [sub_resource type="DynamicFont" id=9] diff --git a/src/levels/endings/GoodEnding.tscn b/src/levels/endings/GoodEnding.tscn index 6d9f453..af0f42d 100644 --- a/src/levels/endings/GoodEnding.tscn +++ b/src/levels/endings/GoodEnding.tscn @@ -4,7 +4,7 @@ [ext_resource path="res://src/entities/fire/Fire.tscn" type="PackedScene" id=2] [ext_resource path="res://src/ui/fonts/SourceSerifPro-Light.ttf" type="DynamicFontData" id=3] [ext_resource path="res://src/levels/ui/PlayButton.png" type="Texture" id=4] -[ext_resource path="res://src/levels/ui/ui/Title.png" type="Texture" id=5] +[ext_resource path="res://src/levels/ui/Title.png" type="Texture" id=5] [ext_resource path="res://src/levels/endings/Credits.tscn" type="PackedScene" id=6] [sub_resource type="DynamicFont" id=4] diff --git a/src/levels/mainmenu/MainMenu.tscn b/src/levels/mainmenu/MainMenu.tscn index cc2acf5..34c0fc2 100644 --- a/src/levels/mainmenu/MainMenu.tscn +++ b/src/levels/mainmenu/MainMenu.tscn @@ -1,17 +1,17 @@ [gd_scene load_steps=10 format=2] [ext_resource path="res://src/ui/fonts/SourceSerifPro-Light.ttf" type="DynamicFontData" id=1] -[ext_resource path="res://src/levels/ui/ui/Title.png" type="Texture" id=2] +[ext_resource path="res://src/levels/ui/Title.png" type="Texture" id=2] [ext_resource path="res://src/levels/ui/PlayButton.png" type="Texture" id=3] [ext_resource path="res://src/entities/fire/Fire.tscn" type="PackedScene" id=4] [ext_resource path="res://src/levels/ui/fonts/SourceSerifPro-Regular.ttf" type="DynamicFontData" id=5] -[sub_resource type="DynamicFont" id=4] +[sub_resource type="DynamicFont" id=1] size = 22 font_data = ExtResource( 5 ) [sub_resource type="Theme" id=2] -default_font = SubResource( 4 ) +default_font = SubResource( 1 ) [sub_resource type="DynamicFont" id=3] size = 70 @@ -45,9 +45,6 @@ scale = Vector2( 4, 4 ) [node name="FlameSprite" parent="TheDarkNightUI/MenuFire/Flame/Shape" index="0"] frame = 0 -[node name="Damaging" parent="TheDarkNightUI/MenuFire" index="3"] -damage = -5.0 - [node name="Play" type="Button" parent="TheDarkNightUI"] anchor_left = 1.0 anchor_top = 1.0 diff --git a/src/levels/ui/ui/CrossbowBar.gd b/src/levels/ui/CrossbowBar.gd similarity index 100% rename from src/levels/ui/ui/CrossbowBar.gd rename to src/levels/ui/CrossbowBar.gd diff --git a/src/levels/ui/ui/CrossbowBar.tscn b/src/levels/ui/CrossbowBar.tscn similarity index 69% rename from src/levels/ui/ui/CrossbowBar.tscn rename to src/levels/ui/CrossbowBar.tscn index 9699dce..28a1029 100644 --- a/src/levels/ui/ui/CrossbowBar.tscn +++ b/src/levels/ui/CrossbowBar.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://src/levels/ui/ui/LifeBarBg.png" type="Texture" id=1] +[ext_resource path="res://src/levels/ui/LifeBarBg.png" type="Texture" id=1] [ext_resource path="res://src/pickups/WeaponCrossbow.png" type="Texture" id=2] -[ext_resource path="res://src/levels/ui/ui/LifeBarFg.png" type="Texture" id=3] -[ext_resource path="res://src/levels/ui/ui/CrossbowBar.gd" type="Script" id=4] +[ext_resource path="res://src/levels/ui/LifeBarFg.png" type="Texture" id=3] +[ext_resource path="res://src/levels/ui/CrossbowBar.gd" type="Script" id=4] [node name="CrossbowBar" type="Node"] script = ExtResource( 4 ) diff --git a/src/levels/ui/LifeBarBg.png b/src/levels/ui/LifeBarBg.png index 6eacdbc..79fa8a3 100644 --- a/src/levels/ui/LifeBarBg.png +++ b/src/levels/ui/LifeBarBg.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b243a9925328813a8760796fa5e14072d91573b9ed0728d0618792e92970aaac -size 5254 +oid sha256:3164fb79bd178f440bfbc4ece81250ecfded4918b67e05a54c63f8ce25c381a7 +size 824 diff --git a/src/levels/ui/LifeBarBg.png.import b/src/levels/ui/LifeBarBg.png.import index 7960083..603e146 100644 --- a/src/levels/ui/LifeBarBg.png.import +++ b/src/levels/ui/LifeBarBg.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=false +flags/filter=true flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/src/levels/ui/LifeBarFg.png b/src/levels/ui/LifeBarFg.png index fb5f87e..7979132 100644 --- a/src/levels/ui/LifeBarFg.png +++ b/src/levels/ui/LifeBarFg.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5dd30be1538773c916fa6350976a10cc1ecd325bd928896036a88cd840e134df -size 10200 +oid sha256:a58a31693420f803a92e8dd5f9744e1a9caf444c09324881d631b18f2ef8b372 +size 5981 diff --git a/src/levels/ui/LifeBarFg.png.import b/src/levels/ui/LifeBarFg.png.import index 2158b3d..9948823 100644 --- a/src/levels/ui/LifeBarFg.png.import +++ b/src/levels/ui/LifeBarFg.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=false +flags/filter=true flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/src/levels/ui/Title.png b/src/levels/ui/Title.png index 011df7b..711ac8d 100644 --- a/src/levels/ui/Title.png +++ b/src/levels/ui/Title.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9166dfac6cbc0cb2fc4bd877a88efd4414a0c515e7988725c8646679a8094b62 -size 220905 +oid sha256:46f2b8b4d0f8a16c0320ce55928d4f7df15c0e485541b0f31f1f79d6f0ae4b97 +size 1806758 diff --git a/src/levels/ui/Title.png.import b/src/levels/ui/Title.png.import index 19eb7d8..84377a8 100644 --- a/src/levels/ui/Title.png.import +++ b/src/levels/ui/Title.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=false +flags/filter=true flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/src/levels/ui/UIBar.png b/src/levels/ui/UIBar.png index ee2fcf7..86a0276 100644 --- a/src/levels/ui/UIBar.png +++ b/src/levels/ui/UIBar.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:abede14f1b7d7a9f1c10d0e41af3027e6b423d71a99ca9baf603b3af25ed4859 -size 85907 +oid sha256:2566fb7d2737a21fab84c32bad2a2e8135e4dd4bf70282aa892ed164fd0a88ae +size 83277 diff --git a/src/levels/ui/UIBar.png.import b/src/levels/ui/UIBar.png.import index f71d448..1b452da 100644 --- a/src/levels/ui/UIBar.png.import +++ b/src/levels/ui/UIBar.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=false +flags/filter=true flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/src/levels/ui/UserInterface.tscn b/src/levels/ui/UserInterface.tscn index 5dc1cb4..88fa81e 100644 --- a/src/levels/ui/UserInterface.tscn +++ b/src/levels/ui/UserInterface.tscn @@ -55,7 +55,7 @@ margin_bottom = 65.0 value = 100.0 texture_under = ExtResource( 5 ) texture_progress = ExtResource( 3 ) -texture_progress_offset = Vector2( 10, 5 ) +texture_progress_offset = Vector2( 2, 0 ) script = ExtResource( 9 ) [node name="MuteButton" type="Button" parent="TheDarkNightUI"] diff --git a/src/levels/ui/ui/LifeBarBg.png b/src/levels/ui/ui/LifeBarBg.png deleted file mode 100644 index 79fa8a3..0000000 --- a/src/levels/ui/ui/LifeBarBg.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3164fb79bd178f440bfbc4ece81250ecfded4918b67e05a54c63f8ce25c381a7 -size 824 diff --git a/src/levels/ui/ui/LifeBarBg.png.import b/src/levels/ui/ui/LifeBarBg.png.import deleted file mode 100644 index 9268b85..0000000 --- a/src/levels/ui/ui/LifeBarBg.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/LifeBarBg.png-d71b079c37d64cced487d360afc4c7ba.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://src/levels/ui/ui/LifeBarBg.png" -dest_files=[ "res://.import/LifeBarBg.png-d71b079c37d64cced487d360afc4c7ba.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 diff --git a/src/levels/ui/ui/LifeBarFg.png b/src/levels/ui/ui/LifeBarFg.png deleted file mode 100644 index 7979132..0000000 --- a/src/levels/ui/ui/LifeBarFg.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a58a31693420f803a92e8dd5f9744e1a9caf444c09324881d631b18f2ef8b372 -size 5981 diff --git a/src/levels/ui/ui/LifeBarFg.png.import b/src/levels/ui/ui/LifeBarFg.png.import deleted file mode 100644 index 0a9dae5..0000000 --- a/src/levels/ui/ui/LifeBarFg.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/LifeBarFg.png-b0ac7e8ba66eed8291352f0882a46c4e.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://src/levels/ui/ui/LifeBarFg.png" -dest_files=[ "res://.import/LifeBarFg.png-b0ac7e8ba66eed8291352f0882a46c4e.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 diff --git a/src/levels/ui/ui/Title.png b/src/levels/ui/ui/Title.png deleted file mode 100644 index 711ac8d..0000000 --- a/src/levels/ui/ui/Title.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:46f2b8b4d0f8a16c0320ce55928d4f7df15c0e485541b0f31f1f79d6f0ae4b97 -size 1806758 diff --git a/src/levels/ui/ui/Title.png.import b/src/levels/ui/ui/Title.png.import deleted file mode 100644 index 38007dc..0000000 --- a/src/levels/ui/ui/Title.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/Title.png-94ff37ec420aec401cb4863338e48dea.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://src/levels/ui/ui/Title.png" -dest_files=[ "res://.import/Title.png-94ff37ec420aec401cb4863338e48dea.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 diff --git a/src/levels/ui/ui/UIBar.png b/src/levels/ui/ui/UIBar.png deleted file mode 100644 index 86a0276..0000000 --- a/src/levels/ui/ui/UIBar.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2566fb7d2737a21fab84c32bad2a2e8135e4dd4bf70282aa892ed164fd0a88ae -size 83277 diff --git a/src/levels/ui/ui/UIBar.png.import b/src/levels/ui/ui/UIBar.png.import deleted file mode 100644 index f4bbc45..0000000 --- a/src/levels/ui/ui/UIBar.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/UIBar.png-115d86e0d213dad70a8a39ba5bb9e894.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://src/levels/ui/ui/UIBar.png" -dest_files=[ "res://.import/UIBar.png-115d86e0d213dad70a8a39ba5bb9e894.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 diff --git a/src/pickups/effects/BigArrow.gd b/src/pickups/effects/BigArrow.gd index ee51899..002de63 100644 --- a/src/pickups/effects/BigArrow.gd +++ b/src/pickups/effects/BigArrow.gd @@ -13,8 +13,8 @@ var previous_spawn func _on_picked_up(): previous_spawn = target.spawning target.spawning = new_spawning - target.connect("shot", self, "_on_shot") + target.connect("shot", self, "_on_shot", [], CONNECT_ONESHOT) -func _on_shot(): +func _on_shot(_origin, _whatever): target.spawning = previous_spawn