Specific respawning/pill time behavior when player is in labyrinth
This commit is contained in:
parent
d8f6ba5979
commit
2135ce6f4a
@ -38,9 +38,10 @@ var _inventory: Control
|
|||||||
|
|
||||||
# public properties
|
# public properties
|
||||||
#var IsSuspicios # not needed > Meldewesen handles themselves
|
#var IsSuspicios # not needed > Meldewesen handles themselves
|
||||||
var IsHunted # player is beeing flagged if one Meldewesen sees an illegal action
|
export(bool) var IsHunted # player is beeing flagged if one Meldewesen sees an illegal action
|
||||||
var IsOutside = true # active while player is not in factory
|
export(bool) var IsOutside = true # active while player is not in factory
|
||||||
var IsInFactory = false # only active in factory scene
|
export(bool) var IsInFactory = false # only active in factory scene
|
||||||
|
export(bool) var IsInLabyrinth = false
|
||||||
|
|
||||||
func is_in_illegalzone ():
|
func is_in_illegalzone ():
|
||||||
return _illegal_areas > 0
|
return _illegal_areas > 0
|
||||||
@ -78,6 +79,11 @@ func _ready():
|
|||||||
|
|
||||||
_inventory = get_node("HUD")
|
_inventory = get_node("HUD")
|
||||||
|
|
||||||
|
# Set special fast time when in labyrinth
|
||||||
|
if IsInLabyrinth:
|
||||||
|
Daytime.increase_per_second = 100
|
||||||
|
Pills._decrease_per_second = 0.8
|
||||||
|
|
||||||
# setup collisions with Meldewesen
|
# setup collisions with Meldewesen
|
||||||
var area = get_node("InteractArea") as Area
|
var area = get_node("InteractArea") as Area
|
||||||
assert(null != area)
|
assert(null != area)
|
||||||
@ -240,17 +246,21 @@ func _on_respawn ():
|
|||||||
Logger.info("respawning")
|
Logger.info("respawning")
|
||||||
# fade to black and restart scene
|
# fade to black and restart scene
|
||||||
_inventory.hide() # disable hud for the time of respawn animation
|
_inventory.hide() # disable hud for the time of respawn animation
|
||||||
|
|
||||||
|
if not IsInLabyrinth:
|
||||||
_animationFadeOut.play("FadeOut")
|
_animationFadeOut.play("FadeOut")
|
||||||
yield(_animationFadeOut, "animation_finished")
|
yield(_animationFadeOut, "animation_finished")
|
||||||
_animationFadeOut.seek(0, true)
|
_animationFadeOut.seek(0, true)
|
||||||
|
|
||||||
# reset values
|
# reset values
|
||||||
Pills._set_level(Pills.get_max())
|
|
||||||
Daytime._set_time(0)
|
Daytime._set_time(0)
|
||||||
|
|
||||||
Logger.info("save areas: " + String(_save_areas))
|
Logger.info("save areas: " + String(_save_areas))
|
||||||
if _save_areas < 1:
|
|
||||||
|
if _save_areas < 1 and not IsInLabyrinth:
|
||||||
Logger.info("reload scene")
|
Logger.info("reload scene")
|
||||||
|
|
||||||
|
Pills._set_level(Pills.get_max())
|
||||||
get_tree().reload_current_scene()
|
get_tree().reload_current_scene()
|
||||||
|
|
||||||
_inventory.show() # enable hud again
|
_inventory.show() # enable hud again
|
||||||
|
Loading…
x
Reference in New Issue
Block a user