diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2022-11-27 00:55:22 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2022-11-27 00:55:22 -0800 |
commit | 9c29781b182ddb911cb7ce07e42ea7b9f2f3628b (patch) | |
tree | bd2a0872d6215bda0f985fef76192327344a8069 /src/game.c | |
parent | e45dc10c42c607d4b6629b3fd992ef434a30a3e3 (diff) |
game: flash some entities
- flash masked adult when hit by virus
- flash held baby and teepee when teepee pickup blocked by held
baby (and block teepee pickup when holding a baby)
Diffstat (limited to 'src/game.c')
-rw-r--r-- | src/game.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -396,6 +396,15 @@ static void flash_entity(game_t *game, entity_any_t *any, unsigned count) static void more_teepee(game_t *game, teepee_t *teepee) { + + if (game->adult->holding) { + /* disallow picking up teepee if holding something, flash what's held and the teepee we missed */ + flash_entity(game, &teepee->entity, 5); + flash_entity(game, &game->adult->holding->any, 5); + + return; + } + for (unsigned i = 0; i < teepee->quantity; i++) { teepee_icon_t *tp; @@ -607,6 +616,8 @@ static ix2_search_status_t virus_search(void *cb_context, ix2_object_t *ix2_obje if (!--entity->adult.masked) (void) adult_node_new(&(stage_conf_t){ .stage = search->game->adult->entity.node, .replace = 1, .name = "adult-masked", .active = 1, .alpha = 1.f }, &search->game->sars->projection_x, &search->game->adult->entity.model_x); + flash_entity(search->game, &entity->any, 4); + return IX2_SEARCH_STOP_MISS; } @@ -797,6 +808,7 @@ static ix2_search_status_t adult_search(void *cb_context, ix2_object_t *ix2_obje if (!--game->adult->masked) (void) adult_node_new(&(stage_conf_t){ .stage = game->adult->entity.node, .replace = 1, .name = "adult-masked", .active = 1, .alpha = 1.f }, &game->sars->projection_x, &game->adult->entity.model_x); + flash_entity(game, &game->adult->entity, 4); reset_virus(&entity->virus); return IX2_SEARCH_MORE_MISS; @@ -880,7 +892,7 @@ static void game_move_adult(game_t *game, v2f_t *dir) game->adult->holding->any.position.x = randf(); game->adult->holding->any.position.y = randf(); entity_update_x(game, &game->adult->holding->any); - + game->adult->holding->any.flashes_remaining = 0; game->adult->holding = NULL; game->adult->rescues++; } |