-
Notifications
You must be signed in to change notification settings - Fork 1
/
AchievementGiver.gd
28 lines (25 loc) · 979 Bytes
/
AchievementGiver.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
extends Node
func _process(delta: float) -> void:
var dead :bool = get_parent().dead
var was_dead :bool = get_parent().was_dead
var health :Flesh = get_parent().health
if dead and not was_dead:
Config.give_achievement("first_of_many")
if health.cause_of_death != Flesh.DEATH_TYPES.BLED and health.cause_of_death != -1:
if health.last_damaged_by_side_effect:
get_parent().died_from_own_cast = true
Config.give_achievement("fun1")
elif health.last_damaged_by == self:
get_parent().died_from_own_spell = true
Config.give_achievement("fun2")
# elif health.cause_of_death != -1:
# if health.bleeding_from_side_effect:
# get_parent().died_from_own_cast = true
# Config.give_achievement("fun1")
# elif health.bleeding_by == self:
# get_parent().died_from_own_spell = true
# Config.give_achievement("fun2")
was_dead = true
if health.body_module:
if health.body_module.broken_legs_total >= 4:
Config.give_achievement("oof_ouch")