-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeath_functions.py
38 lines (29 loc) · 937 Bytes
/
death_functions.py
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
29
30
31
32
33
34
35
36
37
38
from game_messages import Message
from game_states import GameStates
from render_functions import RenderOrder
def kill_player(player, colors):
"""
Kills the player.
:param player: Entity
:param colors: tuple<int>(r, g, b)
:return: Message
"""
player.char = '%'
player.color = colors.get('dark_red')
return Message('You died!', colors.get('red')), GameStates.PLAYER_DEAD
def kill_monster(monster, colors):
"""
Kills the monster.
:param monster: Entity
:param colors: tuple<int>(r, g, b)
:return: Message
"""
death_message = Message('{0} is dead!'.format(monster.name.capitalize()), colors.get('orange'))
monster.char = '%'
monster.color = colors.get('dark_red')
monster.blocks = False
monster.fighter = None
monster.ai = None
monster.name = 'remains of ' + monster.name
monster.render_order = RenderOrder.CORPSE
return death_message