Beispiel #1
0
void World_remove_cannon(cannon_t *cannon)
{
    blkpos_t blk = Clpos_to_blkpos(cannon->pos);
    int i;

    cannon->dead_ticks = options.cannonDeadTicks;
    cannon->conn_mask = 0;

    World_set_block(blk, SPACE);

    for (i = 0; i < num_polys; i++) {
	poly_t *poly = &pdata[i];

	if (poly->group == cannon->group) {
	    poly->current_style = poly->destroyed_style;
	    poly->update_mask = ~0;
	    poly->last_change = frame_loops;
	}
    }

    P_set_hitmask(cannon->group, Cannon_hitmask(cannon));
}
Beispiel #2
0
void World_restore_cannon(cannon_t *cannon)
{
    blkpos_t blk = Clpos_to_blkpos(cannon->pos);
    int i;

    World_set_block(blk, CANNON);

    for (i = 0; i < num_polys; i++) {
	poly_t *poly = &pdata[i];

	if (poly->group == cannon->group) {
	    poly->current_style = poly->style;
	    poly->update_mask = ~0;
	    poly->last_change = frame_loops;
	}
    }

    cannon->conn_mask = 0;
    cannon->last_change = frame_loops;
    cannon->dead_ticks = 0;

    P_set_hitmask(cannon->group, Cannon_hitmask(cannon));
}
Beispiel #3
0
// clear the world form any obstacles
void World_clear() {
    int i;
    for (i=0; i<MAX_BLOCKS; i++)
        World_set_block(i,0x00);
}