static bool flow (struct anim *g) { if (g->oaction != guard_die) { /* place_frame (&g->f, &g->f, guard_die_frameset[0].frame, */ /* &g->p, (g->f.dir == LEFT) */ /* ? +13 : +21, (g->type == SHADOW) ? +18 : +17); */ g->i = -1, g->j = 0; if (g->type == SKELETON) play_audio (&skeleton_audio, NULL, g->id); if (! g->glory_sample) { play_audio (&glory_audio, NULL, g->id); g->glory_sample = true; } g->xf.b = NULL; } g->current_lives = 0; g->i = g->i < 5 ? g->i + 1 : 5; struct frameset *frameset = get_guard_die_frameset (g->type); select_frame (g, frameset, g->i); if (g->j >= 1) g->fo.dx = g->fo.dy = 0; if (g->i == 5) g->j = 1; if (g->j == 1) g->j++; return true; }
void guard_die_suddenly (struct anim *g) { if (con (&g->p)->fg == SPIKES_FLOOR || con (&g->p)->fg == CHOPPER) { guard_die_properly (g); return; } g->oaction = g->action; g->action = guard_die_suddenly; g->f.flip = (g->f.dir == RIGHT) ? ALLEGRO_FLIP_HORIZONTAL : 0; struct frameset *frameset = get_guard_die_frameset (g->type); int dy = (g->type == SKELETON) ? +44 : +47; place_frame (&g->f, &g->f, frameset[5].frame, &g->p, (g->f.dir == LEFT) ? +9 : +4, dy); if (g->oaction != guard_die_suddenly) { struct anim *ke = get_anim_by_id (g->enemy_id); if (! ke) ke = get_anim_by_id (g->oenemy_id); if (ke && ke->id == current_kid_id && ! g->glory_sample && g->death_reason != SHADOW_FIGHT_DEATH) { play_sample (glory_sample, NULL, ke->id); g->glory_sample = true; } g->oenemy_id = -1; if (ke) upgrade_skill (&ke->skill, &g->skill); } g->current_lives = 0; g->xf.b = NULL; g->hit_by_loose_floor = false; /* fall */ struct pos pm; survey (_m, pos, &g->f, NULL, &pm, NULL); if (is_strictly_traversable (&pm)) { guard_fall (g); return; } /* depressible floors */ update_depressible_floor (g, -12, -28); }
void guard_die_suddenly (struct anim *g) { enum confg f = fg (&g->p); if ( f == SPIKES_FLOOR || f == CHOPPER) { guard_die_properly (g); return; } g->oaction = g->action; g->action = guard_die_suddenly; g->f.flip = (g->f.dir == RIGHT) ? ALLEGRO_FLIP_HORIZONTAL : 0; struct frameset *frameset = get_guard_die_frameset (g->type); int dy = (g->type == SKELETON) ? +44 : +47; place_frame (&g->f, &g->f, frameset[5].frame, &g->p, (g->f.dir == LEFT) ? +9 : +4, dy); if (g->oaction != guard_die_suddenly && ! g->glory_sample) { play_audio (&glory_audio, NULL, g->id); g->glory_sample = true; } g->current_lives = 0; g->xf.b = NULL; g->hit_by_loose_floor = false; /* fall */ struct pos pm; survey (_m, pos, &g->f, NULL, &pm, NULL); if (is_strictly_traversable (&pm)) { guard_fall (g); return; } /* depressible floors */ update_depressible_floor (g, -12, -28); }
static bool flow (struct anim *g) { if (g->oaction != guard_die) { place_frame (&g->f, &g->f, guard_die_frameset[0].frame, &g->p, (g->f.dir == LEFT) ? +13 : +21, (g->type == SHADOW) ? +18 : +17); g->i = -1, g->j = 0; if (g->type == SKELETON) play_sample (skeleton_sample, NULL, g->id); struct anim *ke = get_anim_by_id (g->enemy_id); if (! ke) ke = get_anim_by_id (g->oenemy_id); if (ke && ke->id == current_kid_id && ! g->glory_sample && g->death_reason != SHADOW_FIGHT_DEATH) { play_sample (glory_sample, NULL, ke->id); g->glory_sample = true; } g->oenemy_id = -1; if (ke) upgrade_skill (&ke->skill, &g->skill); g->xf.b = NULL; } g->current_lives = 0; g->i = g->i < 5 ? g->i + 1 : 5; struct frameset *frameset = get_guard_die_frameset (g->type); select_frame (g, frameset, g->i); if (g->j >= 1) g->fo.dx = g->fo.dy = 0; if (g->i == 5) g->j = 1; if (g->j == 1) g->j++; return true; }