Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int select_atacker( const Banda *const b ) {
- int pula = 3;
- for( int i=0 ; i<CNT_POSTACI ; i++ ) {
- const Postac *const p = b->postaci + i;
- if( p->live > 0 )
- pula += p->evil * (p->spirit + p->strength);
- }
- for( int i=2 ; 1 ; i++ ) {
- const Postac *const p = b->postaci + i%CNT_POSTACI;
- if( p->live > 0 )
- if( p->evil * (p->spirit + p->strength) > my_rand()%pula )
- return i;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement