Пример #1
0
/* loads the city level */
void resurrect_guards(void)
{
    int i,j;
    char site;

    FILE *fd;

    strcpy(Str3,Omegalib);
    strcat(Str3,"city.dat");
    fd = checkfopen(Str3,"rb");
    site = cryptkey("city.dat");
    for(j=0; j<Level->level_length; j++) {
        for(i=0; i<Level->level_width; i++) {
            site = getc(fd)^site;
            if (site == 'G') {
                make_site_monster(i,j,GUARD);
                Level->site[i][j].creature->monstring = "undead guardsman";
                Level->site[i][j].creature->meleef = M_MELEE_SPIRIT;
                Level->site[i][j].creature->movef = M_MOVE_SPIRIT;
                Level->site[i][j].creature->strikef = M_STRIKE_MISSILE;
                Level->site[i][j].creature->immunity = EVERYTHING-pow2(NORMAL_DAMAGE);
                Level->site[i][j].creature->hp *= 2;
                Level->site[i][j].creature->hit *= 2;
                Level->site[i][j].creature->dmg *= 2;
                Level->site[i][j].creature->ac *= 2;
                m_status_set(Level->site[i][j].creature,HOSTILE);
                m_status_set(Level->site[i][j].creature,AWAKE);
            }
        }
        site = getc(fd)^site;
    }
    fclose(fd);
}
Пример #2
0
int main(int argc, char *argv[])
{
    char key;
    int c;

    if(argc == 2) {
        key = cryptkey(argv[1]);
        c = getchar();

        while(c != EOF) {
            key = c ^ key;
            putchar(key);
            c = getchar();
        }
    }
    else {
        fprintf(stderr, "Usage: %s (key) < (infile) > (outfile)\nwhere (key) happens to be the name of the file, without any preceding path.\n", argv[0]);
    }

    return 0;
}