Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int getScore (GameView gv)
- {
- {
- if (strcmp(gv->pastP, "\0") == 0){
- return GAME_START_SCORE;
- }
- int result = GAME_START_SCORE;
- int turnInt = 0;
- int i = 0;
- int vampCount = 0;
- int vampTimer = 0;//once it reaches 6 vamp falls off trail
- int maxLength = pastPlaysLength(gv);//just added.
- maxLength -= PLAY_LEN;
- while(i <= maxLength){
- if(gv->pastP[i] == 'G'){
- turnInt++;
- } else if(gv->pastP[i] == 'S'){
- turnInt++;
- } else if(gv->pastP[i] == 'H'){
- turnInt++;
- } else if(gv->pastP[i] == 'M'){
- turnInt++;
- } else /*gv->pastP[i] == 'D'*/{
- turnInt++;
- //checking for vampires
- if(gv->pastP[i+5] == 'V') vampCount++;
- if(vampCount > 0) vampTimer++;
- }
- if(turnInt % 5 == 0){
- result -= SCORE_LOSS_DRACULA_TURN;
- } else {//not Draculas turn
- if(gv->pastP[i+1] == 'J' && gv->pastP[i+2] == 'M'){
- result -= SCORE_LOSS_HUNTER_HOSPITAL;//hunter taken to hospital
- }
- }
- if(vampTimer > TRAIL_SIZE) result -= SCORE_LOSS_VAMPIRE_MATURES;
- i++;
- }
- gv->currScore = result;
- return gv->currScore;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement