Bottles reduce stamina
This commit is contained in:
parent
ba841c2eb2
commit
d021fff64b
|
@ -96,12 +96,19 @@ func _on_stamina_empty():
|
||||||
|
|
||||||
func ouch():
|
func ouch():
|
||||||
$Sprite2D.texture = ducking_texture
|
$Sprite2D.texture = ducking_texture
|
||||||
|
var bottle_joke = Joke.get_bottle_joke()
|
||||||
_start_joke_for_audience()
|
_start_joke_for_audience()
|
||||||
|
stamina -= bottle_joke.required_stamina
|
||||||
|
|
||||||
await get_tree().create_timer(1).timeout
|
await get_tree().create_timer(1).timeout
|
||||||
|
|
||||||
$Sprite2D.texture = default_texture
|
$Sprite2D.texture = default_texture
|
||||||
_tell_joke_for_audience(Joke.get_bottle_joke(), true)
|
_tell_joke_for_audience(bottle_joke, true)
|
||||||
_finish_joke_for_audience()
|
_finish_joke_for_audience()
|
||||||
|
|
||||||
|
if stamina <= 0:
|
||||||
|
_on_stamina_empty()
|
||||||
|
|
||||||
func _on_animation_player_animation_finished(anim_name):
|
func _on_animation_player_animation_finished(anim_name):
|
||||||
_tell_joke_for_audience(last_joke, false)
|
_tell_joke_for_audience(last_joke, false)
|
||||||
_finish_joke_for_audience()
|
_finish_joke_for_audience()
|
||||||
|
|
|
@ -19,7 +19,7 @@ var required_stamina: int
|
||||||
var effectiveness: float
|
var effectiveness: float
|
||||||
|
|
||||||
static func get_bottle_joke():
|
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):
|
static func get_random_joke(type):
|
||||||
var stamina = STAMINA_CATEGORIES[randi_range(0, STAMINA_CATEGORIES.size() - 1)]
|
var stamina = STAMINA_CATEGORIES[randi_range(0, STAMINA_CATEGORIES.size() - 1)]
|
||||||
|
|
Loading…
Reference in New Issue