Mercurial > molko
comparison src/libmlk-adventure/adventure/character/black-cat.c @ 320:8f9937403749
misc: improve loading of data
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 01 Oct 2021 20:30:00 +0200 |
parents | libmlk-adventure/adventure/character/black-cat.c@d01e83210ca2 |
children |
comparison
equal
deleted
inserted
replaced
319:b843eef4cc35 | 320:8f9937403749 |
---|---|
1 /* | |
2 * black-cat.c -- Black Cat enemy | |
3 * | |
4 * Copyright (c) 2020-2021 David Demelier <markand@malikania.fr> | |
5 * | |
6 * Permission to use, copy, modify, and/or distribute this software for any | |
7 * purpose with or without fee is hereby granted, provided that the above | |
8 * copyright notice and this permission notice appear in all copies. | |
9 * | |
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
17 */ | |
18 | |
19 #include <rpg/battle.h> | |
20 #include <rpg/character.h> | |
21 | |
22 #include <adventure/adventure_p.h> | |
23 #include <adventure/assets.h> | |
24 | |
25 #include "black-cat.h" | |
26 | |
27 static void | |
28 reset(struct character *ch) | |
29 { | |
30 ch->hpmax = ch->hp = 126; | |
31 ch->mpmax = ch->mp = 12; | |
32 ch->atk = 10; | |
33 ch->def = 8; | |
34 ch->agt = 13; | |
35 } | |
36 | |
37 static void | |
38 exec(struct character *ch, struct battle *bt) | |
39 { | |
40 battle_attack(bt, ch, NULL); | |
41 } | |
42 | |
43 struct character character_black_cat = { | |
44 .name = N_("Black Cat"), | |
45 .level = 4, | |
46 .sprites = { | |
47 [CHARACTER_SPRITE_NORMAL] = &assets_sprites[ASSETS_SPRITE_CHARACTER_BLACK_CAT] | |
48 }, | |
49 .reset = reset, | |
50 .exec = exec | |
51 }; |