Calculate Damage For UI

main
Luna Brovchuk 2023-10-02 21:51:08 +02:00
parent 602c9a26f2
commit 11e0430bcd
5 changed files with 15 additions and 6 deletions

View File

@ -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]

View File

@ -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 )

View File

@ -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()

View File

@ -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