Mercurial > molko
comparison libmlk-adventure/adventure/character/black-cat.c @ 286:3991779aaba9
adventure: initial test of spawn
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 23 Dec 2020 15:37:48 +0100 |
parents | |
children | d01e83210ca2 |
comparison
equal
deleted
inserted
replaced
285:c43e39745cd8 | 286:3991779aaba9 |
---|---|
1 /* | |
2 * black-cat.c -- Black Cat enemy | |
3 * | |
4 * Copyright (c) 2020 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 }; |