From 11e0430bcd302d9ce0279fe3b90a52b22ecf75f8 Mon Sep 17 00:00:00 2001 From: Luna Brovchuk Date: Mon, 2 Oct 2023 21:51:08 +0200 Subject: [PATCH] Calculate Damage For UI --- res/sounds/bat/{screem.wav => scream.wav} | Bin .../bat/{screem.wav.import => scream.wav.import} | 6 +++--- src/models/enemies/bat/Bat.tscn | 4 ++-- src/models/enemies/bat/bat.gd | 2 +- src/models/player/player.gd | 9 +++++++++ 5 files changed, 15 insertions(+), 6 deletions(-) rename res/sounds/bat/{screem.wav => scream.wav} (100%) rename res/sounds/bat/{screem.wav.import => scream.wav.import} (57%) diff --git a/res/sounds/bat/screem.wav b/res/sounds/bat/scream.wav similarity index 100% rename from res/sounds/bat/screem.wav rename to res/sounds/bat/scream.wav diff --git a/res/sounds/bat/screem.wav.import b/res/sounds/bat/scream.wav.import similarity index 57% rename from res/sounds/bat/screem.wav.import rename to res/sounds/bat/scream.wav.import index 3d71941..ff82bd0 100644 --- a/res/sounds/bat/screem.wav.import +++ b/res/sounds/bat/scream.wav.import @@ -2,12 +2,12 @@ importer="wav" type="AudioStreamSample" -path="res://.import/screem.wav-a312a8c51198eded3146287bc691f4b5.sample" +path="res://.import/scream.wav-17cb7aba6076631c29217742777e037e.sample" [deps] -source_file="res://res/sounds/bat/screem.wav" -dest_files=[ "res://.import/screem.wav-a312a8c51198eded3146287bc691f4b5.sample" ] +source_file="res://res/sounds/bat/scream.wav" +dest_files=[ "res://.import/scream.wav-17cb7aba6076631c29217742777e037e.sample" ] [params] diff --git a/src/models/enemies/bat/Bat.tscn b/src/models/enemies/bat/Bat.tscn index 4801736..8620912 100644 --- a/src/models/enemies/bat/Bat.tscn +++ b/src/models/enemies/bat/Bat.tscn @@ -4,7 +4,7 @@ [ext_resource path="res://src/models/enemies/bat/bat.gd" type="Script" id=2] [ext_resource path="res://src/models/shadow/shadow.png" type="Texture" id=3] [ext_resource path="res://res/sounds/bat/damaged.ogg" type="AudioStream" id=4] -[ext_resource path="res://res/sounds/bat/screem.wav" type="AudioStream" id=5] +[ext_resource path="res://res/sounds/bat/scream.wav" type="AudioStream" id=5] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 4, 3 ) @@ -44,5 +44,5 @@ texture = ExtResource( 3 ) [node name="AudioDamage" type="AudioStreamPlayer" parent="."] stream = ExtResource( 4 ) -[node name="AudioScreem" type="AudioStreamPlayer" parent="."] +[node name="AudioScream" type="AudioStreamPlayer" parent="."] stream = ExtResource( 5 ) diff --git a/src/models/enemies/bat/bat.gd b/src/models/enemies/bat/bat.gd index 588ed25..5d89c57 100644 --- a/src/models/enemies/bat/bat.gd +++ b/src/models/enemies/bat/bat.gd @@ -62,4 +62,4 @@ func _shoot(): get_parent().add_child(sonic_wave) sonic_wave.global_position.x = self.global_position.x + 8 sonic_wave.global_position.y = self.global_position.y + 8 - $AudioScreem.play() + $AudioScream.play() diff --git a/src/models/player/player.gd b/src/models/player/player.gd index 994588e..2265644 100644 --- a/src/models/player/player.gd +++ b/src/models/player/player.gd @@ -84,6 +84,15 @@ func get_recharge(): recharge /= 2.0 return recharge +func get_damage(): + var dmg = 5 + for modifier in spell_holder.modifiers: + match modifier: + "big_magic": dmg *= 1.5 + "fireball": dmg += 8 + "explode": dmg += 10 + "poison": dmg += 15 + func _shoot(): var ricochet_count = 0 var dmg_multiplier = 1