Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct STAT
- {
- int exp; // expee;
- int lvl; // 99
- int hp; // hors powah!
- int atk; // atttakkk
- int def; //sens defens
- int agl; // agility
- int luk; // luck
- } STAT;
- void attack(STAT* off,STAT* def)
- {
- // WHAT DO I PUT HERE HELP!!!
- ////// EDIT:
- // ok let's try this!
- int atk,def,diff,bonus,luck;
- atk=off->atk;
- def=def->def;
- diff=atk-def;
- if (diff<0) diff=0;
- luck = def->luck-off->luck;
- if (luck<0) luck=0;
- bonus = 1+LUCK(luck,1+rand(8));
- diff*=bonus;
- diff+=(rand()%luck)+1;
- def->hp-=diff;
- /////////////
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement