Schlüssel, verschlüsselte Dokumente.
[hackover2013-badge-firmware.git] / badge / jumpnrun / items.c
1 #include "items.h"
2 #include "jumpnrun.h"
3
4 static void on_collect_win(jumpnrun_item *self,
5 jumpnrun_game_state *state,
6 jumpnrun_level *lv) {
7 (void) lv;
8 self->flags |= JUMPNRUN_ITEM_COLLECTED;
9 state->status = JUMPNRUN_WON;
10 }
11
12 static void on_collect_checkpoint(jumpnrun_item *self,
13 jumpnrun_game_state *state,
14 jumpnrun_level *lv) {
15 (void) state;
16 self->flags |= JUMPNRUN_ITEM_COLLECTED;
17 lv->start_pos = (vec2d) { self->pos.x,
18 fixed_point_sub(fixed_point_add(self->pos.y, FIXED_INT(self->type->sprite.height)), hacker_extents().y)
19 };
20 }
21
22 static void on_collect_key(jumpnrun_item *self,
23 jumpnrun_game_state *state,
24 jumpnrun_level *lv) {
25 (void) lv;
26 self->flags |= JUMPNRUN_ITEM_COLLECTED;
27 ++state->keys;
28 }
29
30 static void on_collect_encrypted(jumpnrun_item *self,
31 jumpnrun_game_state *state,
32 jumpnrun_level *lv) {
33 if(state->keys != 0) {
34 on_collect_win(self, state, lv);
35 }
36 }
37
38 jumpnrun_item_type const jumpnrun_item_type_data[JUMPNRUN_ITEM_TYPE_COUNT] = {
39 { { 6, 7, (uint8_t const *) "\x7c\x61\xb5\x1a\xfc\x03" }, on_collect_win },
40 { { 9, 12, (uint8_t const *) "\xff\x1f\x04\x49\x10\x05\x49\x50\x04\x51\x10\x04\x7f" }, on_collect_checkpoint },
41 { { 3, 7, (uint8_t const *) "\xa7\xfe\x01" }, on_collect_key },
42 { { 9, 10, (uint8_t const *) "\xfc\x0b\x98\x65\xbd\x1d\x06\x98\x6a\x80\xff\x03" }, on_collect_encrypted }
43 };
This page took 0.054538 seconds and 5 git commands to generate.