All pastes #202009 Raw Edit

Stuff

public cpp v1 · immutable
#202009 ·published 2006-10-14 02:28 UTC
rendered paste body
void test_doublebacks(){     printf("\n*Starting Double Back Testing #4.\n");   Game game;   int hunter0Life  = INITIAL_LIFE;   int hunter3Life = INITIAL_LIFE;   printf("  #4.00 New Game.\n");   game = newGameWrap(87);   printf("   Passed!\n");   //round 0, initialise, let go of encounter   moveHunterWrap (game, AMSTERDAM, "");   moveHunterWrap (game, HAMBURG, "");   moveHunterWrap (game, BERLIN, "");   moveHunterWrap (game, LEIPZIG, "");   moveDraculaWrap (game, COLOGNE, 8, "Mwahahahahah");   //round 1, hunter 4 is on trail, he gets hurt   moveHunterWrap (game, BRUSSELS, "");   moveHunterWrap (game, BERLIN, "");   moveHunterWrap (game, PRAGUE, "");   moveHunterWrap (game, COLOGNE, "");   //hunter 3 got hurt!   //but took on dracula!   hunter3Life = hunter3Life - 4; //encounter   hunter3Life = hunter3Life - 4; //dracula      printf("  #4.01 Mina Harker encounters Minion #8 and Dracula, she loses 8 health.\n");   assert(moveIsKnownWrap(game, 0) == TRUE);   assert(getLifeWrap(game, 3) == hunter3Life);   printf("   Passed!\n");   printf("  #4.02 Mina Harker also encountered Dracula!\n");   assert(getBloodWrap(game) == INITIAL_BLOOD - BLOOD_PER_ENCOUNTER);   printf("   Passed!\n");   moveDraculaWrap (game, FRANKFURT, 20, "Mwahahahahah");   printf("  #4.03 A move to Dracula's trail should make Dracula's move known\n.");   assert(moveIsKnownWrap(game, 0) == TRUE);   printf("   Passed!\n");   //round 2!   moveHunterWrap (game, BRUSSELS, "");   moveHunterWrap (game, BERLIN, "");   moveHunterWrap (game, PRAGUE, "");   moveHunterWrap (game, LEIPZIG, "");   moveDraculaWrap (game, DOUBLE_BACK_2, 12, "Mwahahahahah");   //dracula using a double back, should be back in cologne   printf("  #4.04 Dracula uses double back, so hunters should know some information.\n");   assert(moveIsKnownWrap(game, 2) == TRUE);   printf("   Passed!\n");   //round 3, hunter1 moves to cologne! should attack dracula !   moveHunterWrap (game, COLOGNE, "");   //should have found encounter 12 and dracula   //lose 3 health for encounter + 4 for dracula   printf("  #4.05 Encounter dracula after a double back, Lord Godalming should lose health.\n");   hunter0Life = hunter0Life - 4;   //4 points lost for dracula, he should be on 5   assert(getLifeWrap(game, 0) == hunter0Life);   printf("   Passed!\n");   moveHunterWrap (game, BERLIN, "");   moveHunterWrap (game, PRAGUE, "");   moveHunterWrap (game, LEIPZIG, ""); //stayed in leipzig, health+3   hunter3Life = hunter3Life + 3;   moveDraculaWrap (game, HIDE, 12, "Mwahahahahah");   assert(moveIsKnownWrap(game, 10) == FALSE);   printf("  #4.06 Dracula can hide and leave another minion.\n");   assert(getEncounterWrap(game, 3) == 12);   printf("   Passed!\n");   //round 4, hunter stays in cologne, he rests so regain +3!   moveHunterWrap (game, COLOGNE, "");   //should get attacked again!   printf("  #4.07 Encounter Dracula on a hide.\n");   assert(getBloodWrap(game) == INITIAL_BLOOD - BLOOD_PER_ENCOUNTER * 3);   printf("   Passed!\n");   printf("  #4.07 Lose health fighting minion but regain health from rest.\n");   printf("%d %d\n", hunter0Life, getLife(game, 0));   hunter0Life = hunter0Life - 3 - 4; //for encounter + dracula   hunter0Life = hunter0Life + 3; //for resting   printf("%d %d\n", hunter0Life, getLife(game, 0));   assert(getLifeWrap(game, 0) == hunter0Life);   printf("   Passed!\n");   moveHunterWrap (game, BERLIN, "");   moveHunterWrap (game, PRAGUE, "");   moveHunterWrap (game, LEIPZIG, ""); //still in leipzig! + 3!   hunter3Life = hunter3Life + 3;   moveDraculaWrap (game, LEIPZIG, 12, "Mwahahahahah");   //round 5    printf("  #4.08 Kill encounter left in round 1.\n");   moveHunterWrap (game, FRANKFURT, "");   assert(getBloodWrap(game) == INITIAL_BLOOD - BLOOD_PER_ENCOUNTER * 3);   hunter0Life = hunter0Life - 4; //for encounter, no dracula      //he loses 4 health as he is facing encounter from      //round 1, where dracula left 20!   assert(getLifeWrap(game, 0) == hunter0Life);   printf("   Passed!\n");      moveHunterWrap (game, BERLIN, "");   moveHunterWrap (game, PRAGUE, "");      printf("  #4.09 Kill dracula! And rest afterwards\n");   //move him to where dracula is   moveHunterWrap (game, LEIPZIG, "");   //he is on hunter3Life   //he loses 4 health   hunter3Life = hunter3Life - 4; //for encounter 12   hunter3Life = hunter3Life - 4; //for dracula facing   hunter3Life = hunter3Life + 3; //for resting still   assert(getLifeWrap(game, 3) == hunter3Life);   assert(getBloodWrap(game) == INITIAL_BLOOD - BLOOD_PER_ENCOUNTER * 4);   printf("   Passed.\n");   printf("*Passed Hospital Tests #4.\n");   //dracula is dead!}