Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Constants for AdjacentCombo()
- //const int CMB_UPLEFT = 0;
- //const int CMB_UP = 1;
- //const int CMB_UPRIGHT = 2;
- //const int CMB_RIGHT = 3;
- //const int CMB_DOWNRIGHT = 4;
- //const int CMB_DOWN = 5;
- //const int CMB_DOWNLEFT = 6;
- //const int CMB_LEFT = 7;
- //const int CMB_LEFTUP = 0; //Not 8, as those are dir + shield
- //Returns the Nth combo index of a combo based on a central point, and a direction.
- //For example, combo 22 + COMBO_UPRIGHT returns '7',
- //as combo 7 is to the upper-right of combo 22.
- int AdjacentCombo(int cmb, int dir){
- int combooffsets[13]={-0x11,-0x10,-0x0F,1,0x11,0x10,0x0F,-1,-0x10};
- if ( cmb % 16 == 0 ) combooffsets[9] = 1;
- if ( (cmb & 15) == 1 ) combooffsets[10] = 1;
- if ( cmb < 0x10 ) combooffsets[11] = 1; //if it's the top row
- if ( cmb > 0x9F ) combooffsets[12] = 1; //if it's on the bottom row
- if ( combooffsets[9] && ( dir == CMB_LEFT || dir == CMB_UPLEFT || dir == CMB_DOWNLEFT || dir == CMB_LEFTUP ) ) return 0; //if the left columb
- if ( combooffsets[10] && ( dir == CMB_RIGHT || dir == CMB_UPRIGHT || dir == CMB_DOWNRIGHT ) ) return 0; //if the right column
- if ( combooffsets[11] && ( dir == CMB_UP || dir == CMB_UPRIGHT || dir == CMB_UPLEFT || dir == CMB_LEFTUP ) ) return 0; //if the top row
- if ( combooffsets[12] && ( dir == CMB_DOWN || dir == CMB_DOWNRIGHT || dir == CMB_DOWNLEFT ) ) return 0; //if the bottom row
- else if ( cmb >= 0 && cmb <= 176 ) return cmb + combooffsets[dir];
- else return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement