Mercurial > molko
comparison examples/example-battle/main.c @ 235:fb304a94a05c
rpg: prepare equipment
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 26 Nov 2020 18:00:45 +0100 |
parents | 86b71e1f9dd5 |
children | 76afe639fd72 |
comparison
equal
deleted
inserted
replaced
234:c89e2f7dbc01 | 235:fb304a94a05c |
---|---|
92 .level = 1, | 92 .level = 1, |
93 .hp = 120, | 93 .hp = 120, |
94 .mp = 50, | 94 .mp = 50, |
95 .reset = adventurer_reset, | 95 .reset = adventurer_reset, |
96 .sprites = { | 96 .sprites = { |
97 [CHARACTER_SPRITE_WALK] = ®istry_sprites[REGISTRY_TEXTURE_JOHN_WALK], | 97 [CHARACTER_SPRITE_NORMAL] = ®istry_sprites[REGISTRY_TEXTURE_JOHN_WALK], |
98 [CHARACTER_SPRITE_SWORD] = ®istry_sprites[REGISTRY_TEXTURE_JOHN_SWORD], | 98 [CHARACTER_SPRITE_SWORD] = ®istry_sprites[REGISTRY_TEXTURE_JOHN_SWORD], |
99 }, | 99 }, |
100 .spells = { | 100 .spells = { |
101 &spell_fire | 101 &spell_fire |
102 } | 102 } |
125 .name = "Haunted Wood", | 125 .name = "Haunted Wood", |
126 .type = "Wood", | 126 .type = "Wood", |
127 .level = 30, | 127 .level = 30, |
128 .reset = haunted_wood_reset, | 128 .reset = haunted_wood_reset, |
129 .sprites = { | 129 .sprites = { |
130 [CHARACTER_SPRITE_WALK] = ®istry_sprites[REGISTRY_TEXTURE_HAUNTED_WOOD], | 130 [CHARACTER_SPRITE_NORMAL] = ®istry_sprites[REGISTRY_TEXTURE_HAUNTED_WOOD], |
131 }, | 131 }, |
132 .exec = haunted_wood_strat | 132 .exec = haunted_wood_strat |
133 }; | 133 }; |
134 | 134 |
135 static struct character black_cat = { | 135 static struct character black_cat = { |
136 .name = "Black Cat", | 136 .name = "Black Cat", |
137 .type = "Cat", | 137 .type = "Cat", |
138 .level = 6, | 138 .level = 6, |
139 .reset = black_cat_reset, | 139 .reset = black_cat_reset, |
140 .sprites = { | 140 .sprites = { |
141 [CHARACTER_SPRITE_WALK] = ®istry_sprites[REGISTRY_TEXTURE_BLACK_CAT], | 141 [CHARACTER_SPRITE_NORMAL] = ®istry_sprites[REGISTRY_TEXTURE_BLACK_CAT], |
142 }, | 142 }, |
143 .exec = black_cat_strat | 143 .exec = black_cat_strat |
144 }; | 144 }; |
145 | 145 |
146 static void | 146 static void |
169 //bt->team[1].ch = &team[1]; | 169 //bt->team[1].ch = &team[1]; |
170 | 170 |
171 /* Positionate the single ennemy to the left. */ | 171 /* Positionate the single ennemy to the left. */ |
172 align(ALIGN_LEFT, | 172 align(ALIGN_LEFT, |
173 &bt->enemies[0].x, &bt->enemies[0].y, | 173 &bt->enemies[0].x, &bt->enemies[0].y, |
174 haunted_wood.sprites[0]->cellw, | 174 haunted_wood.sprites[CHARACTER_SPRITE_NORMAL]->cellw, |
175 haunted_wood.sprites[0]->cellh, | 175 haunted_wood.sprites[CHARACTER_SPRITE_NORMAL]->cellh, |
176 0, 0, window.w, window.h); | 176 0, 0, window.w, window.h); |
177 | 177 |
178 /* Black cat is near the previous monster. */ | 178 /* Black cat is near the previous monster. */ |
179 bt->enemies[1].ch = &black_cat; | 179 bt->enemies[1].ch = &black_cat; |
180 bt->enemies[1].x = 500; | 180 bt->enemies[1].x = 500; |