Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ - RPG

Name: Anonymous 2010-10-29 15:44

Lets program a roleplaying game together. Each post must contain either a new function or an edited version of an old function in psudocode. I will start:

int dealDamage(int hp, int damage){
    return hp - damage;
}

Name: Anonymous 2010-10-30 22:42

Final Fantasy I (NES) code:


short do_damage(btl_stat_t *attacker,
                btl_stat_t *defender,
                atk_t atk_type)
{
    if (defender->hp == 0)
    {
        /*
         * TODO: don't attack enemy if already dead
         * -- Nasir
         */
        return 0;
    }
    short dmg = attacker->atk_stat[atk_type] * rand(&LL)
                - defender->def_stat[atk_type];
    return dmg > 0 ? dmg : 0;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List