Bottles reduce stamina

This commit is contained in:
Waldemar Tomme 2024-01-28 14:07:54 +01:00
parent ba841c2eb2
commit d021fff64b
2 changed files with 9 additions and 2 deletions

View File

@ -96,12 +96,19 @@ func _on_stamina_empty():
func ouch():
$Sprite2D.texture = ducking_texture
var bottle_joke = Joke.get_bottle_joke()
_start_joke_for_audience()
stamina -= bottle_joke.required_stamina
await get_tree().create_timer(1).timeout
$Sprite2D.texture = default_texture
_tell_joke_for_audience(Joke.get_bottle_joke(), true)
_tell_joke_for_audience(bottle_joke, true)
_finish_joke_for_audience()
if stamina <= 0:
_on_stamina_empty()
func _on_animation_player_animation_finished(anim_name):
_tell_joke_for_audience(last_joke, false)
_finish_joke_for_audience()

View File

@ -19,7 +19,7 @@ var required_stamina: int
var effectiveness: float
static func get_bottle_joke():
return Joke.new(JokeType.Bottle, 0, 1)
return Joke.new(JokeType.Bottle, 5, 1)
static func get_random_joke(type):
var stamina = STAMINA_CATEGORIES[randi_range(0, STAMINA_CATEGORIES.size() - 1)]