summaryrefslogtreecommitdiff
path: root/apps/plugins/xrick/e_bonus.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/xrick/e_bonus.c')
-rw-r--r--apps/plugins/xrick/e_bonus.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/apps/plugins/xrick/e_bonus.c b/apps/plugins/xrick/e_bonus.c
new file mode 100644
index 0000000000..cc45bbfc99
--- /dev/null
+++ b/apps/plugins/xrick/e_bonus.c
@@ -0,0 +1,60 @@
1/*
2 * xrick/e_bonus.c
3 *
4 * Copyright (C) 1998-2002 BigOrno (bigorno@bigorno.net).
5 * Copyright (C) 2008-2014 Pierluigi Vicinanza.
6 * All rights reserved.
7 *
8 * The use and distribution terms for this software are contained in the file
9 * named README, which can be found in the root of this distribution. By
10 * using this software in any fashion, you are agreeing to be bound by the
11 * terms of this license.
12 *
13 * You must not remove this notice, or any other, from this software.
14 */
15
16#include "xrick/e_bonus.h"
17
18#include "xrick/game.h"
19#include "xrick/ents.h"
20
21#include "xrick/e_rick.h"
22#include "xrick/maps.h"
23
24
25/*
26 * Entity action
27 *
28 * ASM 242C
29 */
30void
31e_bonus_action(U8 e)
32{
33#define seq c1
34
35 if (ent_ents[e].seq == 0) {
36 if (e_rick_boxtest(e)) {
37 game_score += 500;
38#ifdef ENABLE_SOUND
39 syssnd_play(soundBonus, 1);
40#endif
41 map_marks[ent_ents[e].mark].ent |= MAP_MARK_NACT;
42 ent_ents[e].seq = 1;
43 ent_ents[e].sprite = 0xad;
44 ent_ents[e].front = true;
45 ent_ents[e].y -= 0x08;
46 }
47 }
48
49 else if (ent_ents[e].seq > 0 && ent_ents[e].seq < 10) {
50 ent_ents[e].seq++;
51 ent_ents[e].y -= 2;
52 }
53
54 else {
55 ent_ents[e].n = 0;
56 }
57}
58
59
60/* eof */