annotate libmlk-rpg/mlk/rpg/spell.h @ 445:773a082f0b91

misc: update copyright years
author David Demelier <markand@malikania.fr>
date Wed, 01 Feb 2023 13:08:54 +0100
parents 4e78f045e8c0
children 5729efd23286
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
192
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 /*
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
2 * spell.h -- magic spells
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 *
445
773a082f0b91 misc: update copyright years
David Demelier <markand@malikania.fr>
parents: 434
diff changeset
4 * Copyright (c) 2020-2023 David Demelier <markand@malikania.fr>
192
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 *
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 * Permission to use, copy, modify, and/or distribute this software for any
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 * purpose with or without fee is hereby granted, provided that the above
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 * copyright notice and this permission notice appear in all copies.
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 *
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
17 */
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
18
366
19782ea1cf4a misc: start rebranding
David Demelier <markand@malikania.fr>
parents: 320
diff changeset
19 #ifndef MLK_RPG_SPELL_H
19782ea1cf4a misc: start rebranding
David Demelier <markand@malikania.fr>
parents: 320
diff changeset
20 #define MLK_RPG_SPELL_H
192
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
21
431
8f59201dc76b core: cleanup hierarchy
David Demelier <markand@malikania.fr>
parents: 378
diff changeset
22 #include <mlk/core/core.h>
292
08ab73b32832 misc: add extern "C" {} blocks for C++ friends
David Demelier <markand@malikania.fr>
parents: 289
diff changeset
23
192
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
24 #include "selection.h"
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
25
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
26 struct character;
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
27 struct battle;
289
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
28 struct selection;
192
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
29
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
30 enum spell_type {
289
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
31 SPELL_TYPE_NEUTRAL,
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
32 SPELL_TYPE_FIRE,
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
33 SPELL_TYPE_WIND,
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
34 SPELL_TYPE_WATER,
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
35 SPELL_TYPE_EARTH,
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
36 SPELL_TYPE_CHAOS,
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
37 SPELL_TYPE_HOLY,
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
38 SPELL_TYPE_TIME
192
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
39 };
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
40
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
41 struct spell {
289
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
42 const char *name;
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
43 const char *description;
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
44 unsigned int mp;
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
45 enum spell_type type;
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
46 enum selection_kind select_kind;
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
47 enum selection_side select_side;
192
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
48
289
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
49 void (*select)(const struct battle *, struct selection *);
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
50 void (*action)(struct battle *, struct character *, const struct selection *);
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
51 void (*use)(struct character *, const struct selection *);
192
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
52 };
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
53
292
08ab73b32832 misc: add extern "C" {} blocks for C++ friends
David Demelier <markand@malikania.fr>
parents: 289
diff changeset
54 CORE_BEGIN_DECLS
08ab73b32832 misc: add extern "C" {} blocks for C++ friends
David Demelier <markand@malikania.fr>
parents: 289
diff changeset
55
289
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
56 void
298
196264679079 misc: remove usage of bool
David Demelier <markand@malikania.fr>
parents: 292
diff changeset
57 spell_select(const struct spell *, const struct battle *, struct selection *);
289
63d9fb56c609 rpg: rework selection
David Demelier <markand@malikania.fr>
parents: 243
diff changeset
58
192
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
59 void
298
196264679079 misc: remove usage of bool
David Demelier <markand@malikania.fr>
parents: 292
diff changeset
60 spell_action(const struct spell *, struct battle *, struct character *, const struct selection *);
192
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
61
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
62 void
298
196264679079 misc: remove usage of bool
David Demelier <markand@malikania.fr>
parents: 292
diff changeset
63 spell_use(struct spell *, struct character *, const struct selection *);
192
4ad7420ab678 rpg: add minimalist battle system, continue #2477 @60h
David Demelier <markand@malikania.fr>
parents:
diff changeset
64
292
08ab73b32832 misc: add extern "C" {} blocks for C++ friends
David Demelier <markand@malikania.fr>
parents: 289
diff changeset
65 CORE_END_DECLS
08ab73b32832 misc: add extern "C" {} blocks for C++ friends
David Demelier <markand@malikania.fr>
parents: 289
diff changeset
66
366
19782ea1cf4a misc: start rebranding
David Demelier <markand@malikania.fr>
parents: 320
diff changeset
67 #endif /* !MLK_RPG_SPELL_H */