Meldewesen stops following in pill level is high enough
adjusted pill level
This commit is contained in:
parent
3cfd698276
commit
c1a0d5672d
@ -16,12 +16,21 @@ func _ready():
|
||||
_visibility.connect("body_exited", self, "_on_body_exited_visibility")
|
||||
|
||||
|
||||
func _process(_delta):
|
||||
# stop following player if pill level is high enough
|
||||
if current_target and Pills.get_round_level() > _player_follow_pill_level:
|
||||
current_target = null
|
||||
|
||||
|
||||
func _on_body_entered_visibility(body: PhysicsBody):
|
||||
#Logger.trace("Meldewesen seeing %s" % [body])
|
||||
|
||||
if body.is_in_group("Player"):
|
||||
Logger.info("Seeing player!")
|
||||
|
||||
# TODO: check if player is in illegal area
|
||||
#var player = get_node("")
|
||||
|
||||
# If the player didn't take enough pills lately, they're suspicious -> Run towards them!
|
||||
if Pills.get_round_level() <= _player_follow_pill_level:
|
||||
Logger.info("The player's pill level is too low - following!")
|
||||
|
@ -211,3 +211,7 @@ func _reset_scene ():
|
||||
_animationFadeOut.seek(0, true)
|
||||
get_tree().reload_current_scene()
|
||||
Pills._set_level(Pills.get_max())
|
||||
|
||||
|
||||
func Is_in_Illegal_Area ():
|
||||
return _is_in_illegal_area
|
||||
|
@ -34,4 +34,4 @@ func add_item (name):
|
||||
|
||||
func _process(_delta):
|
||||
_labelPillLevel.text = "curLevel: " + String(Pills._level)
|
||||
_pillLevel.value = Pills._level
|
||||
_pillLevel.value = Pills._level - 1
|
@ -3,7 +3,7 @@ extends Node
|
||||
|
||||
var _level: float setget _set_level, get_level
|
||||
var _min: float = 1.0
|
||||
var _max: float = 10.0
|
||||
var _max: float = 7.0
|
||||
var _decrease_per_second: float = 0.2
|
||||
var _pill_add_amount: float = 2.0
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user