Advertisement
Guest User

ZeldaOLB US texte.cpp corrigé

a guest
Oct 19th, 2013
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 65.36 KB | None | 0 0
  1. /*
  2.  
  3.     Zelda Oni Link Begins
  4.  
  5.     Copyright (C) 2006-2008  Vincent Jouillat
  6.  
  7.     Please send bugreports with examples or suggestions to www.zeldaroth.fr
  8.  
  9. */
  10.  
  11. #include <SDL/SDL.h>
  12. #include <SDL/SDL_image.h>
  13.  
  14. #include "Texte.h"
  15. #include "Menu.h"
  16. #include "Joueur.h"
  17. #include "Monde.h"
  18. #include "Projectile.h"
  19. #include "Jeu.h"
  20.  
  21. Texte::Texte(Jeu* jeu) : gpJeu(jeu), vitesse(40), av(0), x(0), y(0), w(0), h(0),
  22. id(0), idsuiv(0), def(false), cadre(false), texte(""), buffer("") {
  23.     lastAnimTime = SDL_GetTicks();
  24.     imageFont = IMG_Load("data/images/texte/font.png");
  25.     SDL_SetColorKey(imageFont,SDL_SRCCOLORKEY,SDL_MapRGB(imageFont->format,0,0,255));
  26.     imageCoeur = IMG_Load("data/images/menu/coeur.png");
  27.     SDL_SetColorKey(imageCoeur,SDL_SRCCOLORKEY,SDL_MapRGB(imageCoeur->format,0,0,255));
  28. }
  29.  
  30. Texte::~Texte() {
  31.     SDL_FreeSurface(imageFont);
  32.     SDL_FreeSurface(imageCoeur);
  33. }
  34.  
  35. void Texte::chercheText() {
  36.     ostringstream os;
  37.     int tmp;
  38.     switch (id) {
  39.         case 3  :
  40.             tmp = 4-(gpJeu->getJoueur()->nbQuarts()%4);
  41.             os << tmp;
  42.             texte = "You found a piece of heart!!!";
  43.             if (tmp<4) buffer = os.str()+" more for a new heart container!!!";
  44.             else buffer = "Your heart count just increased!!!";
  45.             break;
  46.         case 5 : texte = "Sealed portal cave.**No Entry."; break;
  47.         case 6 : texte = "Faron Temple**Save the trees, eat beaver!!!"; break;
  48.         case 7 : texte = "You found Pegasus Boots!!! *Hold Shift or press Caps lock to run."; break;
  49.         case 8 : texte = "N : East Field"; break;
  50.         case 9 : texte = "W : Lanayru Lake"; break;
  51.         case 10 : texte = "S : Forbidden Forest"; break;
  52.         case 11 : texte = "S : Lanayru Lake"; break;
  53.         case 12 : texte = "N : To Ordona Temple"; break;
  54.         case 13 : texte = "N : Ruto Village"; break;
  55.         case 14 : texte = "-Super Anti Monsters Ultimate Society- (S.A.M.U.S.)**Come in if you don't like monsters."; break;
  56.         case 15 : texte = "W : Rauru City"; break;
  57.         case 16 : texte = "You haven't learned any song yet.";
  58.             if (gpJeu->getJoueur()->hasMelodie(0)) {id=17; chercheText();break;}
  59.             if (gpJeu->getJoueur()->hasMelodie(1)) {id=26; chercheText();break;}
  60.             if (gpJeu->getJoueur()->hasMelodie(2)) {id=28; chercheText();break;}
  61.             break;
  62.         case 17 : texte = "- SONG OF SOARING*- Don't play";
  63.             if (gpJeu->getJoueur()->hasMelodie(1)) {id=19; chercheText();break;}
  64.             if (gpJeu->getJoueur()->hasMelodie(2)) {id=30; chercheText();break;}
  65.             break;
  66.         case 18 : texte = "- Song of Soaring*- DON'T PLAY"; break;
  67.         case 19 : texte = "- SONG OF SOARING*- Elegy of Emptiness*- Don't play";
  68.             if (gpJeu->getJoueur()->hasMelodie(2)) {id=22; chercheText();break;}
  69.             break;
  70.         case 20 : texte = "- Song of Soaring*- ELEGY OF EMPTINESS*- Don't play"; break;
  71.         case 21 : texte = "- Song of Soaring*- Elegy of Emptiness*- DON'T PLAY"; break;
  72.         case 22 : texte = "- SONG OF SOARING*- Elegy of Emptiness*- Song of Spirit*- Don't play"; break;
  73.         case 23 : texte = "- Song of Soaring*- ELEGY OF EMPTINESS*- Song of Spirit*- Don't play"; break;
  74.         case 24 : texte = "- Song of Soaring*- Elegy of Emptiness*- SONG OF SPIRIT*- Don't play"; break;
  75.         case 25 : texte = "- Song of Soaring*- Elegy of Emptiness*- Song of Spirit*- DON'T PLAY"; break;
  76.         case 26 : texte = "- ELEGY OF EMPTINESS*- Don't play";
  77.             if (gpJeu->getJoueur()->hasMelodie(2)) {id=33; chercheText();break;}
  78.             break;
  79.         case 27 : texte = "- Elegy of Emptiness*- DON'T PLAY"; break;
  80.         case 28 : texte = "- SONG OF SPIRIT*- Don't play"; break;
  81.         case 29 : texte = "- Song of Spirit*- DON'T PLAY"; break;
  82.         case 30 : texte = "- SONG OF SOARING*- Song of Spirit*- Don't play"; break;
  83.         case 31 : texte = "- Song of Soaring*- SONG OF SPIRIT*- Don't play"; break;
  84.         case 32 : texte = "- Song of Soaring*- Song of Spirit*- DON'T PLAY"; break;
  85.         case 33 : texte = "- ELEGY OF EMPTINESS*- Song of Spirit*- Don't play"; break;
  86.         case 34 : texte = "- Elegy of Emptiness*- SONG OF SPIRIT*- Don't play"; break;
  87.         case 35 : texte = "- Elegy of Emptiness*- Song of Spirit*- DON'T PLAY"; break;
  88.         case 36 : texte = "N : Ruto Village*S : East Field"; break;
  89.         case 37 : texte = "S : Ruto Village*E : To the desert"; break;
  90.         case 38 : texte = "Mine entrance"; break;
  91.         case 39 : texte = "W : To Ordona Temple*E : Ruto Village"; break;
  92.         case 40 : texte = "Sorry, that was my only bottle."; break;
  93.         case 41 : texte = "I am selling a bottle for 100 rupees, are you interested?*              YES ?            no  ";
  94.             if (gpJeu->getJoueur()->hasBouteille(0)) {id=40; chercheText();break;}
  95.             if (gpJeu->getJoueur()->getRubis() + gpJeu->getJoueur()->getBoostRubis()<100) idsuiv=44;
  96.             else idsuiv=45;
  97.             break;
  98.         case 42 : texte = "I am selling a bottle for 100 rupees, are you interested?*              yes              NO ?"; idsuiv=43; break;
  99.         case 43 : texte = "Come back if you change your mind."; break;
  100.         case 44 : texte = "You don't have enough rupees!"; break;
  101.         case 45 : texte = "Thanks!"; break;
  102.         case 46 : texte = "You found an empty bottle!!!**It will help you stock potions."; break;
  103.         case 47 : texte = "There is a secret passage to the west of the village which leads to Ordona Temple, but you will need bombs to take it."; break;
  104.         case 49 :
  105.             if (gpJeu->getJoueur()->getAvancement()>3 && !gpJeu->getJoueur()->hasObjet(O_SAC_BOMBES))
  106.                 texte = "If you are looking for a bomb bag, you should go to see the man working in the mine, he uses a lot of bombs.";
  107.             else texte = "Get out of my way!"; break;
  108.         case 50 :
  109.             if (gpJeu->getJoueur()->getAvancement()==5 || gpJeu->getJoueur()->getAvancement()==6)
  110.                 texte = "The mayor strictly forbade access to the mine ever since monsters started coming out of it.";
  111.             else if (gpJeu->getJoueur()->getAvancement()==7)
  112.                 texte = "You are saying that maybe someone is locked in the mine? So what?";
  113.             else if (gpJeu->getJoueur()->getAvancement()==8 || gpJeu->getJoueur()->getAvancement()==9)
  114.                 texte = "The mayor allowed you to pass? So move along!";
  115.             else texte = "..."; break;
  116.         case 54 : texte = "Welcome to the Ruto village.**And just between us, don't trust anyone here..."; break;
  117.         case 55 : texte = "Even if this village seems to be wealthy at first sight, it's actually the poorest in Termina... And we cannot rely on the mayor to change that..."; break;
  118.         case 56 : texte = "Tourists who come here used to be either lost, or totally mad.**For my part, I always have a map with me."; break;
  119.         case 57 : texte = "S : To East Field*W : To Ordona Temple*E : Ruto Village"; break;
  120.         case 58 : texte = "S : East Field"; break;
  121.         case 59 : texte = "Ordona Temple"; break;
  122.         case 60 : texte = "E : Forgotten Land"; break;
  123.         case 61 : texte = "S : Ruto Village*W : Sure Death"; break;
  124.         case 62 : texte = "Enchanting Oasis"; break;
  125.         case 63 : texte = "Fairy Cave"; break;
  126.         case 64 : texte = "Din Temple**Fairies' power will reward bravery!"; break;
  127.         case 65 : texte = "                     ???"; break;
  128.         case 66 : texte = "Lanayru Temple"; break;
  129.         case 67 : texte = "W : Witch's Swamp"; break;
  130.         case 68 : texte = "E : Forbidden Forest"; break;
  131.         case 69 : texte = "N : East Field*W : To Rauru City"; break;
  132.         case 70 : texte = "N : Rauru City"; break;
  133.         case 71 : texte = "O : West Field"; break;
  134.         case 72 : texte = "N : Forgotten Land*S : Rauru City"; break;
  135.         case 73 : texte = "N : Rauru City*S : Lanayru Lake*W : West Field*E : East Field"; break;
  136.         case 74 : texte = "E : East Field"; break;
  137.         case 75 :  texte = "Sorry, I have nothing in stock anymore."; break;
  138.         case 76 : texte = "I am selling a better shield for 250 rupees, are you interested?*              YES ?            no  ";
  139.             if (gpJeu->getJoueur()->getBouclier()>1) {id=75; chercheText();break;}
  140.             if (gpJeu->getJoueur()->getRubis() + gpJeu->getJoueur()->getBoostRubis()<250) idsuiv=44;
  141.             else idsuiv=45;
  142.             break;
  143.         case 77 : texte = "I am selling a better shield for 250 rupees, are you interested?*              yes              NO ?"; idsuiv=43; break;
  144.         case 78 : texte = "You found a new shield!!!*Your defense rises by one point; your resistance is stronger against the enemies' attacks!!!"; break;
  145.         case 79 : texte = "But why do I have to care for these hens again???"; break;
  146.         case 80 : texte = "I like to sweep!"; break;
  147.         case 81 : texte = "Rauru is the most beautiful city of the country. Many visitors come every day to visit it."; break;
  148.         case 82 : texte = "A magical instrument is said to be somewhere in Termina. *I wonder if I might see it some day..."; break;
  149.         case 83 : texte = "You found the magical instrument???**I hoped it was a saxophone..."; break;
  150.         case 84 : texte = "My parents got lost."; break;
  151.         case 85 : texte = "I like to take strolls!"; break;
  152.         case 86 : texte = "S : Rauru City*E : Haunted House"; break;
  153.         case 87 : texte = "Haunted House**Come to enrich our soul collection!"; break;
  154.         case 88 : texte = "E : To Ordona Temple"; break;
  155.         case 89 : texte = "Farore Temple**Fairies' power will reward bravery!"; break;
  156.         case 90 : texte = "W : Mido Village"; break;
  157.         case 91 : texte = "N : Destiny Mountains"; break;
  158.         case 92 : texte = "Zelda Temple"; break;
  159.         case 93 : texte = "W : Graveyard"; break;
  160.         case 94 : texte = "Desert's secret :*Lift the bird's stones clockwise, lifting the eye last to open the way."; break;
  161.         case 95 : texte = "S : Witch's Swamp"; break;
  162.         case 96 : texte = "E : Rauru City"; break;
  163.         case 97 : texte = "N : West Field*S : Witch's Hut"; break;
  164.         case 98 : texte = "W : Kasuto Village*E : Witch's Hut"; break;
  165.         case 99 : texte = "Potions Hut**Come trade your rupees for the most powerful potions of the country!!!"; break;
  166.         case 100 : texte = "E : Lanayru Lake"; break;
  167.         case 101 : texte = "N : Graveyard*S : Kasuto Village"; break;
  168.         case 102 : texte = "Kasuto Village**   -- Not for humans (alive) --"; break;
  169.         case 103 : texte = "Tip : Hold Ctrl to look around with the keyboard arrows."; break;
  170.         case 104 : texte = "N : Kasuto Village*E : Witch's Swamp"; break;
  171.         case 105 : texte = "Monsters' Colosseum**Come all!"; break;
  172.         case 106 : texte = "You look pretty strong; you should train in the arena at the South of the village. A very useful object is said to be hidden inside..."; break;
  173.         case 107 : texte = "Uh?*A new species?**Do you know how to speak?"; break;
  174.         case 108 : texte = "This village is the last rampart against humanity."; break;
  175.         case 109 : texte = "Hello, I am a dummy monster."; break;
  176.         case 110 : texte = "Stuck?***The solution is not so far, though."; break;
  177.         case 111 : texte = "S : Kasuto Village"; break;
  178.         case 112 : texte = "Xant Temple**""Dead men tell no tales..."; break;
  179.         case 113 : texte = "Did you ever try the hammer on skulls?"; break;
  180.         case 114 : texte = "E : West Field"; break;
  181.         case 115 : texte = "Mido Village"; break;
  182.         case 116 : texte = "Do all teenagers lack any fashion sense like you?"; break;
  183.         case 117 : texte = "Welcome in the Mido village, but don't feel obliged to stay here."; break;
  184.         case 118 : texte = "Grrr... I thought I could finally be alone here..."; break;
  185.         case 119 : texte = "Only the immeasurable emptiness can remove this stone."; break;
  186.         case 120 : texte = "Nayru Temple**Fairies' power will reward bravery!"; break;
  187.         case 121 : texte = "Destiny Way**Only an ally of Good and Evil will get over this cave."; break;
  188.         case 122 : texte = "S : Mido Village"; break;
  189.         case 123 : texte = "Eldin Temple"; break;
  190.         case 124 : texte = "S : West Field"; break;
  191.         case 125 : texte = "Titans' strength will go to the legendary hero..."; break;
  192.         case 126 : texte = "Destiny Tower*Hero of Hyrule, watch out. Here now stands the vile Ganon; the future of the world will be at stake here."; break;
  193.         case 127 : texte = "Congratulations!**You succeeded in climbing the Flatty Mountain!"; break;
  194.         case 128 : texte = "You must not transform yourself here!!!"; break;
  195.         case 129 : texte = "You cannot enter this village with this appearance !!!"; break;
  196.         case 130 : texte = "Link, it's Pit. I am talking with you via telepathy. You must, under no circumstances, transform yourself in a village!*I will teleport you outside."; break;
  197.         case 131 : texte = "You found a sword!!!**Press Z (or W) to attack or hold Z (or W) to charge a spin attack."; break;
  198.         case 132 : texte = "You found the Map!!!*Press P to see the map of the Dungeon."; break;
  199.         case 133 : texte = "You found the Compass!!!**The Boss and chests are now indicated on the map."; break;
  200.         case 134 : texte = "You found the Boss Key.**Use it to reach his haunt."; break;
  201.         case 135 : texte = "You found a small key.**Use it to unlock a door."; break;
  202.         case 136 : texte = "You found a Heart Container!!!**Your maximal energy rises by one heart!!!"; break;
  203.         case 137 : texte = "You found a Graal!!!"; break;
  204.         case 138 : texte = "You came to save me?*Thank you very much!";
  205.             if (gpJeu->getMonde()->regionValue(0)==160*16) {
  206.                 if (gpJeu->getJoueur()->getCoffre(1,25)) {id=50; chercheText();break;}
  207.                 else idsuiv = 139;}
  208.             if (gpJeu->getMonde()->regionValue(0)==180*16
  209.                 && gpJeu->getMonde()->regionValue(1)==15*16) {
  210.                 if (gpJeu->getJoueur()->getCoffre(1,26)) {id=50; chercheText();break;}
  211.                 else idsuiv = 140;}
  212.             if (gpJeu->getMonde()->regionValue(0)==180*16
  213.                 && gpJeu->getMonde()->regionValue(1)==45*16) {
  214.                 if (gpJeu->getJoueur()->getCoffre(1,27)) {id=50; chercheText();break;}
  215.                 else idsuiv = 141;}
  216.             break;
  217.         case 139 : texte = "Digging in these galleries, we discovered this hang-out of monsters..."; idsuiv=142; break;
  218.         case 140 : texte = "We all have been captured by the monsters living in these caverns."; idsuiv=142; break;
  219.         case 141 : texte = "Our chief is on the floor downstairs; quick, go save him!"; idsuiv=142; break;
  220.         case 142 : texte = "I found that in the mine; take it, it could help you!"; break;
  221.         case 143 :
  222.             if (gpJeu->getJoueur()->hasObjet(O_SAC_BOMBES)) {id=50; chercheText();break;}
  223.             texte = "You defeated the monster of the mine???*Congratulations!!!"; idsuiv=144; break;
  224.         case 144 : texte = "I am the chief of the workers, you're saying you were looking for me?"; idsuiv=145; break;
  225.         case 145 : texte = "Take this bag full of bombs, it may help you."; break;
  226.         case 146 : texte = "You found the Bomb Bag!!!*And it's full!!!*Press ENTER to equip them and X to put one down."; break;
  227.         case 147 : texte = "You found the Gloves!!!**You can now lift light stones by pressing C."; break;
  228.         case 148 :
  229.             if (gpJeu->getJoueur()->hasObjet(O_ARC)) {id=50; chercheText();break;}
  230.             texte = "I am the right hand of the mayor, he sent me to save his daughter...*But I've been had, there is nothing to do against these ghosts..."; idsuiv=149; break;
  231.         case 149 : texte = "Don't stay here, you can't do anything with your actual weapons..."; idsuiv=150; break;
  232.         case 150 : texte = "To continue your quest, follow the road at the west of the City. This bow will allow you to hit the sphere and open the way..."; break;
  233.         case 151 : texte = "You found the Bow!!!*You can now attack from a distance and hit distant targets!!!"; break;
  234.         case 152 :
  235.             if (gpJeu->getJoueur()->getAvancement()>64) {id=153; chercheText();break;}
  236.             texte = "You defeated the vampire and came to save me? Thank you so much! My father is the mayor of the City; go and see him, I'm sure he will reward you."; break;
  237.         case 153 : texte = "Don't worry about me, I can go back home by myself now that the vampire is dead."; break;
  238.         case 154 :
  239.             if (gpJeu->getJoueur()->getAvancement()==13)
  240.                 texte = "You received the mayor's authorization?*Be careful then; those who venture over there never come back...";
  241.             else if (gpJeu->getJoueur()->getAvancement()<13)
  242.                 texte = "Under orders from the mayor, access to this area is strictly forbidden.";
  243.             else texte = "..."; break;
  244.         case 155 : texte = "You cannot run away now!"; break;
  245.         case 156 : texte = "You found the Hammer!!!**Now you can squash impeding obstacles!!!"; break;
  246.         case 157 : texte = "You found the Hookshot!!!**Now you can cross over precipices!!!"; break;
  247.         case 158 : texte = "Colosseum Hall"; break;
  248.         case 159 : texte = "Arena 1"; break;
  249.         case 160 : texte = "Arena 2"; break;
  250.         case 161 : texte = "Arena 3"; break;
  251.         case 162 : texte = "Arena 4"; break;
  252.         case 163 : texte = "Prize giving"; break;
  253.         case 164 : texte = "Special Arena**Come and try the special prize!!!"; break;
  254.         case 165 : texte = "You found the Flippers!!!**You can now cross the spans of water!!!"; break;
  255.         case 166 : texte = "You found a Coat of Mail!!!**Your defense rises by one point!!!"; break;
  256.         case 167 : texte = "You found a better Coat of Mail!!!   *Your defense rises by one point!!!"; break;
  257.         case 168 : texte = "Hehehehehe!!!*Congratulations, Link! You succeeded in getting rid of your curse. And in the same way, you released me!!!"; idsuiv=169; break;
  258.         case 169 : texte = "In reward for your efforts, I shall not kill you today; I have a more important mission."; idsuiv=170; break;
  259.         case 170 : texte = "If you really want to stop me, meet me in the dead temple, if you are brave enough.*Farewell! Hahahahaha!!!"; break;
  260.         case 171 : texte = "Link, it's Zelda! I am talking with you via telepathy. I am with Pit; come back quickly, the situation is serious."; break;
  261.         case 172 : texte = "Good morning, Link! I was waiting for you.**My name is Pit, I have been charged by Princess Zelda to watch on this cave."; idsuiv=173; break;
  262.         case 173 : texte = "She warned me you were coming and asked me to help you.*My house is just here, we'll be more comfortable to talk. Follow me."; break;
  263.         case 174 : texte = "Pit told you not to go out of the forest."; break;
  264.         case 175 : texte = "You found the Fire Rod!!!**You can now throw powerful fireballs!!!"; break;
  265.         case 176 :
  266.             if ((gpJeu->getZone() == 23 && gpJeu->getJoueur()->getCoffre(8,19))
  267.             || (gpJeu->getZone() == 24 && gpJeu->getJoueur()->getCoffre(9,24))
  268.             || (gpJeu->getZone() == 25 && gpJeu->getJoueur()->getCoffre(10,21))) {
  269.                 id=50; chercheText();break;}
  270.             texte = "I was waiting for you Link.*I hand the power of the Goddness over to your sword to restore the strength of the Master Sword."; break;
  271.         case 177 :
  272.             if (gpJeu->getJoueur()->getEpee()==5) {id=178; chercheText();break;}
  273.             texte = "The power of the Master Sword increases! **Go quickly to the next temple!"; break;
  274.         case 178 : texte = "The Master Sword reached its maximal power!!!  *Even Oni-Link could not stand up to its blade!!!"; break;
  275.         case 179 : texte = "You found the Ice Rod!!!**Now you can freeze whatever you want!!!"; break;
  276.         case 180 : texte = "You found a new shield!!!*Your defense rises; your resistance is now stronger against the enemies' attacks!!!"; break;
  277.         case 181 : texte = "Link, it's Zelda! I am talking to you via telepathy. Do not go in this dungeon if you are not perfectly prepared, it's probably a trap by Oni-Link."; break;
  278.         case 182 : texte = "So you've come?*You probably want to die, it will be a pleasure to grant your wish.*Hehehehehe!!!"; break;
  279.         case 183 : texte = "The substance of Oni-Link has been locked in the Spirit Mask!!!*You succeed!!!"; break;
  280.         case 184 : texte = "Grrrr!!! I can't believe you defeated Oni-Link!!! Impressive...*I suppose you didn't expect to see me, though we are in the world of the dead."; idsuiv=185; break;
  281.         case 185 : texte = "Oni-Link gave me the energy I needed to rematerialize, so I am back earlier than I expected.*Gwahahahahaha !!!"; idsuiv=186; break;
  282.         case 186 : texte = "By the way, maybe you are wondering where Oni-Link is from? It's very easy; last time, I wanted to be sure you would never disturb me again, so I used"; idsuiv=187; break;
  283.         case 187 : texte = "the Triforce to change you into a monster in my legion. But there was not enough darkness in your heart, so this transformation was not dazzling..."; idsuiv=188; break;
  284.         case 188 : texte = "Enough said, I have a lot of plans...*It would be a great pleasure to eliminate you, but I don't think it would be useful..."; idsuiv=189; break;
  285.         case 189 : texte = "For your information, only creatures of the dark can get out of here.*So farewell! Gwahahahahaha !!!"; break;
  286.         case 190 :
  287.             if (!gpJeu->getJoueur()->getOni()) {id=184; chercheText();break;}
  288.             texte = "Onily? So where is my coffee???*What??? It's you Link???"; idsuiv=184; break;
  289.         case 191 : texte = "                   Dead World"; break;
  290.         case 192 : texte = "Link, it's Zelda! I am talking to you via telepathy. It's terrible, Ganon is back!!!"; idsuiv=193; break;
  291.         case 193 : texte = "He has recreated his army, which is getting ready to attack Rauru!*You can still stop them, go quickly to the West Field and intercept this army!"; break;
  292.         case 194 : texte = "You found the Great Fairy Bow!!!**Now you can shoot arrows with an incredible power!!!"; break;
  293.         case 195 : texte = "You found the Triforce !!!"; break;
  294.        
  295.         case 197 : texte = "Tutorial : Press SPACE to talk, read or open a chest, and ENTER to pass the texts on the screen on."; break;
  296.         case 198 : texte = "Press C to lift a light object."; break;
  297.         case 199 : texte = "Do you want to save your game?**                    ? YES ?*                      no  "; break;
  298.         case 200 : texte = "Do you want to save your game?**                      yes  *                    ? NO ?"; break;
  299.         case 201 : texte = "                    Level 1 :                                                                                   Faron Temple"; break;
  300.         case 202 : texte = "                    Level 2 :                                                                                     Ruto Mine"; break;
  301.         case 203 : texte = "                    Level 3 :                                                                                   Ordona Temple"; break;
  302.         case 204 :
  303.             if (gpJeu->getJoueur()->getEpee()>=2)
  304.                    texte = "                    Level 9 :                                                                                  Haunted Mansion";
  305.             else   texte = "                    Level 4 :                                                                                  Haunted Mansion"; break;
  306.         case 205 : texte = "                    Level 5 :                                                                                   Eldin Temple"; break;
  307.         case 206 : texte = "                    Level 6 :                                                                                Monsters' Colosseum"; break;
  308.         case 207 : texte = "                    Level 7 :                                                                                  Lanayru Temple"; break;
  309.         case 208 : texte = "                    Level 8 :                                                                                   Zelda Temple"; break;
  310.         case 209 : texte = "                   Level 10 :                                                                                    Din Temple"; break;
  311.         case 210 : texte = "                   Level 11 :                                                                                   Nayru Temple"; break;
  312.         case 211 : texte = "                   Level 12 :                                                                                   Farore Temple"; break;
  313.         case 212 :
  314.             if (gpJeu->getJoueur()->getX()>14*320) {id=191; chercheText();break;}
  315.                    texte = "                   Level 13 :                                                                                   Xant Temple"; break;
  316.         case 213 : texte = "                    Level ? :                                                                                   Secret Temple"; break;
  317.         case 214 : texte = "                  Level Final :                                                                                 Destiny Tower"; break;
  318.         case 215 : texte = "                 Already tired?                  ?                 CONTINUE                 ?                   Save and quit                               Quit without saving            "; break;
  319.         case 216 : texte = "                 Already tired?                                    Continue                     ?               SAVE AND QUIT              ?                Quit without saving            "; break;
  320.         case 217 : texte = "                 Already tired?                                    Continue                                     Save and quit                  ?            QUIT WITHOUT SAVING           ?"; break;
  321.         case 218 : texte = "After Ganon's defeat and Triforce's disappearing, the legend lets us believe that peace has lasted...*But beneath each legend, a darker reality is often hidden..."; idsuiv=402; break;
  322.         case 220 : texte = "Yes... It's this way... *We are very near..."; idsuiv=221; break;
  323.         case 221 : texte = "I'm sorry you can't bring weapons with you... But you see... You might transform yourself at any time...*It's too dangerous..."; idsuiv=222; break;
  324.         case 222 : texte = "Here we are! That's it!*Don't move anymore, I set the portal...**Are you ready?"; break;
  325.         case 223 : texte = "Having gotten rid of Ganon's curse, Link could return in Hyrule safely.**The Triforce, the Master Sword, and the Ocarina were handed over to the Royal Family of Hyrule, while Oni-Link's Mask was entrusted to the Fairies in order to be hidden over space and time...**The portal leading to Termina was sealed by Princess Zelda and Pit so that it could never be opened again, and this terrible chapter was erased from the legend..."; idsuiv=224; break;
  326.         case 224 : texte = "People of Hyrule never knew what happened in the mysterious land of Termina. Neither did they know that the formidable Ganon was already preparing his return...**But what everybody knew was the return to Hyrule of its hero, who will always be there to protect the Realm against the darkness."; break;
  327.         case 225 : texte = "You found a shield!!!*Your defense rises by one point, your resistance is now stronger against the enemies' attacks!!!"; break;
  328.         case 226 : texte = "Pit is waiting for you in the house just right here."; break;
  329.         case 227 :
  330.             if (gpJeu->getJoueur()->getMagieMax()>32) texte = "...";
  331.             else texte = "Congratulations for finding me, Link. I will raise the capabity of your magic container to reward you."; break;
  332.         case 228 : texte = "The capacity of your magic container doubled!!!"; break;
  333.         case 229 : texte = "You found the Ocarina of Time!!!**It has such a power that it can stop the time when you blow in it!"; break;
  334.         case 230 : texte = "You found the Lantern!!!**Now you can shoot up flames!!!"; break;
  335.         case 231 : texte = "You found the Spirit Mask!!!**A strange aura shrouds around it..."; break;
  336.         case 232 :
  337.             if (gpJeu->getJoueur()->getTutoriel()==3) {id=233; chercheText();break;}
  338.             gpJeu->getJoueur()->setTutoriel(3);
  339.             texte = "Congratulations for finding me!!!**I am the Big Fairy of the desert; I organize rupees collections!"; idsuiv=233; break;
  340.         case 233 : texte = "Give me 100 rupees quickly!!!**              YES ?            no  ";
  341.             if (gpJeu->getJoueur()->getRubis() + gpJeu->getJoueur()->getBoostRubis()<100) {idsuiv=236; break;}
  342.             if (gpJeu->getJoueur()->getFlecheMax()==70 && gpJeu->getJoueur()->getBombeMax()==30) {idsuiv=239; break;}
  343.             if (gpJeu->getJoueur()->getFlecheMax()==70) {idsuiv=237; break;}
  344.             if (gpJeu->getJoueur()->getBombeMax()==30) {idsuiv=238; break;}
  345.             idsuiv = 237 + (rand()%2); break;
  346.         case 234 : texte = "Give me 100 rupees quickly!!!**              yes              NO ?"; idsuiv=235; break;
  347.         case 235 : texte = "You make me lose my time, off you go!"; break;
  348.         case 236 : texte = "You don't have enough rupees!!!*You make me lose my time, off you go!"; break;
  349.         case 237 : texte = "I raised the maximum amount of bombs you can carry on, thanks who???"; break;
  350.         case 238 : texte = "I raised the maximum amount of arrows you can carry on, thanks who???"; break;
  351.         case 239 : texte = "I have enough rupees, disappear!"; break;
  352.         case 240 : texte = "You found the Golden Gloves!!!**Now you can lift heavy stones by pressing C."; break;
  353.         case 241 : texte = "I only let maleficent creatures through.";
  354.             if (gpJeu->getJoueur()->getOni()) idsuiv=243; break;
  355.         case 242 : texte = "I only let beneficent creatures through.";
  356.             if (!gpJeu->getJoueur()->getOni()) idsuiv=244; break;
  357.         case 243 : texte = "You look maleficent...*Ok, you can go!"; break;
  358.         case 244 : texte = "You look beneficent...*Ok, you can go!"; break;
  359.         case 245 :
  360.             if (gpJeu->getJoueur()->getAvancement()==2) {id=250; chercheText();break;}
  361.             texte = "You must wonder where you are.*This is Termina, and you don't need to know more than that..."; idsuiv=246; break;
  362.         case 246 : texte = "It's a secret land which should remain secret, Princess Zelda should have never sent you here..."; idsuiv=247;  break;
  363.         case 247 : texte = "More precisely, you are in the Termina Forest. In this forest, there is a temple, and in this temple there is a sacred object able to conjure any evil spell..."; idsuiv=248; break;
  364.         case 248 : texte = "Find this object, and come back to see me.*I will open the portal again for your departure."; idsuiv=249; break;
  365.         case 249 : texte = "A last thing, do not go out of the forest, under no circumstances! Your presence here is secret, and besides, in your state, you are a threat for anyone you come across..."; idsuiv=250; break;
  366.         case 250 : texte = "Good luck, Link!"; break;
  367.         case 251 :
  368.             if (gpJeu->getJoueur()->getAvancement()==3) {id=250; chercheText();break;}
  369.             texte = "What ??? The Graal didn't succeed in getting rid of the curse??? That's... unthinkable..."; idsuiv=252; break;
  370.         case 252 : texte = "This curse must be frightfully powerful... But on closer examination, all hope is not lost..."; idsuiv=253; break;
  371.         case 253 : texte = "The Graal had an effect on you, you probably noticed it.*From now on you take less time to transform yourself."; idsuiv=254; break;
  372.         case 254 : texte = "But it's double-edged... When you are transformed, you stay that way for a longer time..."; idsuiv=255; break;
  373.         case 255 : texte = "Listen to me carefully, Link. There are 4 other Graals in the temples of Termina...*It is said that the 5 combined have as much power as the Triforce itself."; idsuiv=256; break;
  374.         case 256 : texte = "Thanks to the Graal you found, you are a bit less dangerous, so I authorize you to explore Termina freely."; idsuiv=257; break;
  375.         case 257 : texte = "Venture out of this forest, search and find these graals, and you will be saved.*But you must not go in a village if you are transformed."; idsuiv=258; break;
  376.         case 258 : texte = "Take this map with you, it will probably be useful...*Good Luck!"; break;
  377.         case 259 :
  378.             if (gpJeu->getJoueur()->getEpee()>=2) {id=271; chercheText();break;}
  379.             texte = "I'm happy to see you safe and sound! Now that you don't risk being transformed anymore, I thought you would appreciate having this..."; break;
  380.         case 260 : texte = "You found the Master Sword!!!**Its amazing power seems to be palpable !!!"; break;
  381.         case 261 : texte = "Unfortunately you will need it...*Oni-Link has been liberated...*We could have seen it before..."; idsuiv=262; break;
  382.         case 262 : texte = "Each time you found a new graal, the frequency of your transformations diminished, but the length of Oni-Link's life has increased..."; idsuiv=263; break;
  383.         case 263 : texte = "Besides, Oni-Link's behavior is strange...*With his destructive temperament, he should have attacked a village..."; idsuiv=264; break;
  384.         case 264 : texte = "I should rejoice, but I'm afraid that he has more important projects which is absolutely not good news..."; idsuiv=265; break;
  385.         case 265 : texte = "However, we have drawn up a plan to vanquish him. Listen to me carefully..."; idsuiv=266; break;
  386.         case 266 : texte = "The Master Sword is a formidable weapon, but it won't be useful to face Oni-Link...*...for the moment..."; idsuiv=267; break;
  387.         case 267 : texte = "There are 3 secret temples hidden in Termina. In these temples are fairies whose powers will raise the strength of your sword. Find them all!"; idsuiv=268; break;
  388.         case 268 : texte = "Then you will be on equal footing with Oni-Link.*However, Oni-Link is only energy so he can't be killed..."; idsuiv=269; break;
  389.         case 269 : texte = "The Spirit Mask will allow you to lock him inside forever. To do this, you will have to find this mask, find the magical Ocarina and find the melody which may lock him..."; idsuiv=270; break;
  390.         case 270 : texte = "Your quest is just beginning..."; break;
  391.         case 271 : texte = "Find the 3 fairies, the mask, the Ocarina, and the song of spirit, and then go to face Oni-Link!"; break;
  392.         case 272 :
  393.             if (gpJeu->getJoueur()->getEpee()<2) {id=50; chercheText();break;}
  394.             texte = "As you know, the Master Sword can defeat ghosts, reflect magical attacks and destroy magical fences...*Put it to good use..."; break;
  395.         case 273 : texte = "There is no time to lose!*Go immediately to the West Field to intercept Ganon's army!"; break;
  396.         case 274 : texte = "Hurry up, Link! What are you waiting for?*Christmas ???"; idsuiv=275; break;
  397.         case 275 : texte = "Er... What about me ?*I... er... ...protect the princess, that's it! Who do you think has kept her from being kidnapped this time ? Huh ?"; break;
  398.         case 276 :
  399.             if (gpJeu->getJoueur()->getAvancement()==69) {id=282; chercheText();break;}
  400.             texte = "Link... there is a thing I should have told you since the beginning...*This world, Termina..."; idsuiv=277; break;
  401.         case 277 : texte = "This world is very new, it's a creation of the Triforce through a wish... People, their memories and their stories have also been created..."; idsuiv=278; break;
  402.         case 278 : texte = "Yes... as you guessed, it's me who asked the Triforce to create this world... It's a world built to contain all we might need."; idsuiv=279; break;
  403.         case 279 : texte = "You found there the graals, Oni-Link found his master, and Ganon found...*...the Triforce..."; idsuiv=280; break;
  404.         case 280 : texte = "I created this world to be used as a hideaway for the Triforce, but Ganon found it..."; idsuiv=281; break;
  405.         case 281 : texte = "Link! This land and these people have been created, but they are truly real now! If we don't do anything, this land will soon look like the ancient Dark World!"; idsuiv=282; break;
  406.         case 282 : texte = "I leave it to you once more. Link, save this world!"; break;
  407.         case 283 :
  408.             texte = "Welcome to the study house of all kind of monsters!";
  409.             if (gpJeu->getJoueur()->getOni()) {idsuiv=290; break;}
  410.             if (gpJeu->getJoueur()->hasObjet(O_ENCYCL)) {
  411.                 if (gpJeu->getJoueur()->getEpee()>1
  412.                 && gpJeu->getJoueur()->hasObjet(O_ENCYCL)==1) {
  413.                     gpJeu->getJoueur()->trouveObjet(O_ENCYCL,2);
  414.                     idsuiv=294; break;
  415.                 }
  416.                 if (gpJeu->getJoueur()->getEnnemi(19)
  417.                 && gpJeu->getJoueur()->getEnnemi(24)
  418.                 && gpJeu->getJoueur()->getEnnemi(35)
  419.                 && gpJeu->getJoueur()->hasObjet(O_ENCYCL)!=3) {
  420.                     gpJeu->getJoueur()->trouveObjet(O_ENCYCL,3);
  421.                     idsuiv=296; break;
  422.                 }
  423.                 if (gpJeu->getJoueur()->nbEnnemis()==62) {idsuiv=297; break;}
  424.                 if (gpJeu->getJoueur()->getSolde()>0) {idsuiv=291; break;}
  425.             }
  426.             else {idsuiv=284; gpJeu->getJoueur()->trouveObjet(O_ENCYCL);}
  427.             break;
  428.         case 284 : texte = "You probably remember me, you helped me a lot in Hyrule.*Uh... You wonder how I came in Termina? Uh... doesn't matter!"; idsuiv=285; break;
  429.         case 285 : texte = "This vast world has an abundance of monsters, so I had to be on the trip!"; idsuiv=286; break;
  430.         case 286 : texte = "I will list all monsters in a new encyclopedia!**With your help, of course."; idsuiv=287; break;
  431.         case 287 : texte = "Unfortunately, I don't have pieces of heart anymore, but currency is my new currency. *I will pay you a good price for each new monster added in the encyclopedia."; idsuiv=288; break;
  432.         case 288 : texte = "Come here regularly to get your winnings. If you can't carry it all, I will keep the surplus for your next visit."; idsuiv=289; break;
  433.         case 289 : texte = "You just have to defeat a new enemy to add him in the encyclopedia.*You can see it by pressing M!"; break;
  434.         case 290 :
  435.             texte = "Mmm... you are a curious specimen...";
  436.             if (gpJeu->getJoueur()->getEnnemi(75)
  437.             || !gpJeu->getJoueur()->hasObjet(O_ENCYCL)) break;
  438.             texte += "*I will add you to the encyclopedia!!!"; break;
  439.         case 291 :
  440.             os << gpJeu->getJoueur()->getSolde();
  441.             texte = "I owe you " + os.str() + " rupees.";
  442.             idsuiv=292; break;
  443.         case 292 : texte = "Do you want to be paid now?**              YES ?            no  "; break;
  444.         case 293 : texte = "Do you want to be paid now?**              yes              NO ?"; break;
  445.         case 294 : texte = "I have a scoop for you; monsters you defeated in Hyrule have been mysteriously brought to the life! They are supposed to wander in Termina..."; idsuiv=295; break;
  446.         case 295 : texte = "They are said to be three.*If you beat them all, I will give you a... special prize..."; break;
  447.         case 296 : texte = "You defeated the 3 rare monsters???*...*You reward is waiting for you downstairs..."; break;
  448.         case 297 : texte = "You defeated all monsters...*It's incredible..."; break;
  449.         case 298 : texte = "Hello Link, how are your bombs?"; break;
  450.         case 299 : texte = "I don't have anymore prizes to bring into play, sorry."; break;
  451.         case 300 : texte = "One of these chests contains a piece of heart, do you want to try for 10 rupees?*You will be allowed to open just one chest, ok?               YES ?            no  ";
  452.             if (gpJeu->getJoueur()->getRubis() + gpJeu->getJoueur()->getBoostRubis()<10) idsuiv=44; break;
  453.         case 301 : texte = "One of these chests contains a piece of heart, do you want to try for 10 rupees?*You will be allowed to open just one chest, ok?               yes              NO ?"; break;
  454.         case 302 : texte = "Choose a chest."; break;
  455.         case 303 : texte = "Hey! You have to pay before opening one of my chests!!!"; break;
  456.         case 304 : texte = "You lose! This chest is empty. Try again!"; break;
  457.         case 305 :
  458.             if (gpJeu->getJoueur()->getAsile()==2) {id=342; chercheText(); break;}
  459.             texte = "What would you like to drink?"; break;
  460.         case 306 : texte = "You are looking for the man who works in the mine? Nobody has seen him since they locked the mine... Maybe he is trapped inside..."; break;
  461.         case 307 : texte = "This saloon was very popular...*...before..."; break;
  462.         case 308 : texte = "I AM the mayor of this village, and I do NOT want to talk with you!"; break;
  463.         case 309 : texte = "You say that someone is perhaps locked in the mine?**... ... ...";
  464.             if (gpJeu->getJoueur()->getAvancement()==8) {id=308; chercheText();}
  465.             else idsuiv=310; break;
  466.         case 310 : texte = "Very well, give me 10 rupees and I will allow you to go into the mine. Ok?*              YES ?            no  ";
  467.             if (gpJeu->getJoueur()->getRubis() + gpJeu->getJoueur()->getBoostRubis()<10) idsuiv=44;
  468.             else idsuiv=312; break;
  469.         case 311 : texte = "Very well, give me 10 rupees and I will allow you to go into the mine. Ok?*              yes              NO ?"; break;
  470.         case 312 : texte = "That's a deal, go and talk to the guard, he will let you pass..."; break;
  471.         case 313 : texte = "One heart for 5 rupees, ok?**              YES ?            no  ";
  472.             if (gpJeu->getJoueur()->getVie() == gpJeu->getJoueur()->getVieMax()) {id=315; chercheText(); break;}
  473.             else if (gpJeu->getJoueur()->getRubis() + gpJeu->getJoueur()->getBoostRubis()<5) idsuiv=44; break;
  474.         case 314 : texte = "One heart for 5 rupees, ok?**              yes              NO ?"; break;
  475.         case 315 : texte = "You don't need this right now."; break;
  476.         case 316 : texte = "A little vial of magic for 15 rupees, ok?**              YES ?            no  ";
  477.             if (gpJeu->getJoueur()->getMagie() == gpJeu->getJoueur()->getMagieMax()) {id=315; chercheText(); break;}
  478.             else if (gpJeu->getJoueur()->getRubis() + gpJeu->getJoueur()->getBoostRubis()<15) idsuiv=44; break;
  479.         case 317 : texte = "A little vial of magic for 15 rupees, ok?**              yes              NO ?"; break;
  480.         case 318 : texte = "A big vial of magic for 25 rupees, ok?**              YES ?            no  ";
  481.             if (gpJeu->getJoueur()->getMagie() == gpJeu->getJoueur()->getMagieMax()) {id=315; chercheText(); break;}
  482.             else if (gpJeu->getJoueur()->getRubis() + gpJeu->getJoueur()->getBoostRubis()<25) idsuiv=44; break;
  483.         case 319 : texte = "A big vial of magic for 25 rupees, ok?**              yes              NO ?"; break;
  484.         case 320 : texte = "Choose what you want."; break;
  485.         case 321 : texte = "10 arrows for 20 rupees?**              YES ?            no  ";
  486.             if (gpJeu->getJoueur()->getFleche() == gpJeu->getJoueur()->getFlecheMax()
  487.             || !gpJeu->getJoueur()->hasObjet(O_ARC)) {id=315; chercheText(); break;}
  488.             else if (gpJeu->getJoueur()->getRubis() + gpJeu->getJoueur()->getBoostRubis()<20) idsuiv=44; break;
  489.         case 322 : texte = "10 arrows for 20 rupees?**              yes              NO ?"; break;
  490.         case 323 : texte = "5 bombs for 30 rupees?**              YES ?            no  ";
  491.             if (!gpJeu->getJoueur()->hasObjet(O_SAC_BOMBES)) {id=325; chercheText(); break;}
  492.             else if (gpJeu->getJoueur()->getBombe() == gpJeu->getJoueur()->getBombeMax()) {id=315; chercheText(); break;}
  493.             else if (gpJeu->getJoueur()->getRubis() + gpJeu->getJoueur()->getBoostRubis()<30) idsuiv=44; break;
  494.         case 324 : texte = "5 bombs for 30 rupees?**              yes              NO ?"; break;
  495.         case 325 : texte = "You need a bomb bag to buy this."; break;
  496.         case 326 : texte = "Come back when you have an empty bottle and I will sell you some potions."; break;
  497.         case 327 : texte = "Red potions restore energy and green potions restore magic.";
  498.             if (gpJeu->getJoueur()->hasBouteille(0)!=1
  499.             && gpJeu->getJoueur()->hasBouteille(1)!=1
  500.             && gpJeu->getJoueur()->hasBouteille(2)!=1) {id=326; chercheText(); break;}
  501.             idsuiv=328; break;
  502.         case 328 : texte = "What do you want?*                ?  RED POTION  ?*                ? green potion ?*                ?   nothing    ?"; idsuiv=331; break;
  503.         case 329 : texte = "What do you want?*                ?  red potion  ?*                ? GREEN POTION ?*                ?   nothing    ?";
  504.             if (!gpJeu->getJoueur()->hasObjet(O_LANTERNE)) idsuiv=315;
  505.             idsuiv=333; break;
  506.         case 330 : texte = "What do you want?*                ?  red potion  ?*                ? green potion ?*                ?   NOTHING    ?"; break;
  507.         case 331 : texte = "A red potion for 60 rupees?**              YES ?            no  ";
  508.             if (gpJeu->getJoueur()->getRubis() + gpJeu->getJoueur()->getBoostRubis()<60) idsuiv=44; break;
  509.         case 332 : texte = "A red potion for 60 rupees?**              yes              NO ?"; break;
  510.         case 333 : texte = "A green potion for 40 rupees?**              YES ?            no  ";
  511.             if (gpJeu->getJoueur()->getRubis() + gpJeu->getJoueur()->getBoostRubis()<40) idsuiv=44; break;
  512.         case 334 : texte = "A green potion for 40 rupees?**              yes              NO ?"; break;
  513.         case 335 : texte = "You found a red potion!!!**Drink it to restore all your energy!!!"; break;
  514.         case 336 : texte = "You found a green potion!!!**Drink it to restore all your magic!!!"; break;
  515.         case 337 : texte = "You found a blue potion!!!**Drink it to restore all your energy and all your magic!!!"; break;
  516.         case 338 : texte = "SANCTUARYYY!!!!!!!!"; break;
  517.         case 339 : texte = "Oh, you too... the hens? -hiccup- !*Terrible those beasties... -hiccup-!"; break;
  518.         case 340 :
  519.             if (gpJeu->getJoueur()->getAsile()==2) {id=339; chercheText(); break;}
  520.             if (gpJeu->getJoueur()->hasCristal(3)) {id=341; chercheText(); break;}
  521.             texte = "I used to be a fisherman a long time ago... -hiccup-! But since I saw IT... -hiccup-!*This terrible beast... -hiccup-!*In the lake... -hiccup-!"; break;
  522.         case 341 : texte = "You defeated the monster in the lake???*... ... ...*Anyway I fear water... -hiccup-!*(I prefer wine) -hiccup-!"; break;
  523.         case 342 : texte = "He-He-He!"; break;
  524.         case 343 :
  525.             if (gpJeu->getJoueur()->getAvancement()==11) {id=344; chercheText(); break;}
  526.             if (gpJeu->getJoueur()->getAsile()==3) {id=347; chercheText(); break;}
  527.             if (gpJeu->getJoueur()->getRaplaplat()) {id=348; chercheText(); break;}
  528.             texte = "Hello! I know everything about all that is said in the city; come to see me if you need information."; break;
  529.         case 344 :
  530.             if (gpJeu->getJoueur()->getAvancement()!=11) {id=343; chercheText(); break;}
  531.             texte = "You want to know why the mayor is so silent?*Okay, but I didn't say anything, huh?"; idsuiv=345; break;
  532.         case 345 : texte = "This city has a terrible secret...*During the night, young girls are captured; we never see them again... I don't dare even to go out..."; idsuiv=346; break;
  533.         case 346 : texte = "Last night, according to the rumours, the mayor's daughter would have disappeared..."; break;
  534.         case 347 :
  535.             if (gpJeu->getJoueur()->getRaplaplat()) idsuiv=348;
  536.             texte = "Hello! Mister-who-fears-the-hens,*He! He! He!"; break;
  537.         case 348 : texte = "You are said to have climbed the Flatty Mountain? Congratulations! He! He! He!"; break;
  538.         case 349 :
  539.             if (gpJeu->getJoueur()->getAvancement()==13) {id=50; chercheText(); break;}
  540.             texte = "You... you know about my daughter?*It's terrible... My dear daughter..."; idsuiv=350;break;
  541.         case 350 : texte = "According to the inquiry I conducted since the beginning of these events, the captured young girls seem to be brought into the mansion at the north village..."; idsuiv=351; break;
  542.         case 351 : texte = "I already sent the guards there, but no one came back..."; idsuiv=352; break;
  543.         case 352 : texte = "So this morning, when I discovered my own daughter was not here anymore, I begged my hired hand to bring her back... He is a perfect combatant, but he is abnormally slow..."; idsuiv=353; break;
  544.         case 353 : texte = "You seem to be a combatant too, do you want to go check what happened there?*You will have a great reward if you rescue my daughter."; idsuiv=354; break;
  545.         case 354 : texte = "Go to see the guard at the north-west of the city, he will let you pass."; break;
  546.         case 355 :
  547.             if (gpJeu->getJoueur()->hasMelodie(1)) {id=358; chercheText(); break;}
  548.             texte = "My daughter told me everything, I owe you so much!!!"; idsuiv=356; break;
  549.         case 356 : texte = "Listen carefully; I will teach you a song. It is a heirloom handed down from generations to generations:*The Elegy of Emptiness!"; break;
  550.         case 357 : texte = "You learned the Elegy of Emptiness!!!**Use the Ocarina to play it!"; break;
  551.         case 358 : texte = "The Elegy of Emptiness has mysterious powers...*...I think."; break;
  552.         case 359 : texte = "Hello mister-my-rescuer!"; break;
  553.         case 360 :
  554.             if (gpJeu->getJoueur()->hasBouteille(0)!=1
  555.             && gpJeu->getJoueur()->hasBouteille(1)!=1
  556.             && gpJeu->getJoueur()->hasBouteille(2)!=1) {id=326; chercheText(); break;}
  557.             texte = "One blue potion for 160 rupees?*You won't be disappointed...*              YES ?            no  ";
  558.             if (gpJeu->getJoueur()->getRubis() + gpJeu->getJoueur()->getBoostRubis()<160) idsuiv=44; break;
  559.         case 361 : texte = "One blue potion for 160 rupees?*You won't be disappointed...*              yes              NO ?"; break;
  560.         case 362 :
  561.             if (gpJeu->getJoueur()->hasObjet(O_GRAPPIN)) {id=364; chercheText(); break;}
  562.             texte = "Good morning! We can't see such a powerful monster every day; it's a honour..."; idsuiv=363; break;
  563.         case 363 : texte = "You should go to play in the Colosseum at the south-east village, there is an interesting prize to win..."; break;
  564.         case 364 : texte = "You won the prize of the Colosseum?*Impressive..."; break;
  565.         case 365 : texte = "If you think you are the most terrifying monster of Termina, that means you believe your dreams are reality, my poor friend..."; idsuiv=366; break;
  566.         case 366 : texte = "Take my word, the monster of the lake is by far the most terrifying of all monsters. Most of all, avoid fighting him, that's my advice."; break;
  567.         case 367 : texte = "The colosseum south of here is the principal entertainment of the village.*The goal is to go as far as possible before being killed."; idsuiv=368; break;
  568.         case 368 : texte = "But it's always very difficult to find volunteers, so the chief was forced to put a very high valued object inside."; break;
  569.         case 369 :
  570.             texte = "Do you want to listen to my story for 10 rupees?**              YES ?            no  ";
  571.             if (gpJeu->getJoueur()->getRubis() + gpJeu->getJoueur()->getBoostRubis()<10) idsuiv=44; break;
  572.         case 370 : texte = "Do you want to listen to my story for 10 rupees?**              yes              NO ?"; break;
  573.         case 371 : texte = "According to the chief, north of here is the Xant temple, also known as the temple of the dead..."; idsuiv=372; break;
  574.         case 372 : texte = "This temple is said to be a way from the world of living to the world of the dead... But to reach the world of the dead, you would have to go trough an impassable labyrinth..."; idsuiv=373; break;
  575.         case 373 : texte = "Pay me again if you want me to repeat."; break;
  576.         case 374 :
  577.             if (gpJeu->getJoueur()->hasObjet(O_MASQUE)==1) {id=376; chercheText(); break;}
  578.             if (gpJeu->getJoueur()->hasObjet(O_MASQUE)==2) {id=380; chercheText(); break;}
  579.             texte = "You are looking for the Spirit Mask?*... Fancy that..."; idsuiv=375; break;
  580.         case 375 : texte = "No, I don't know where it is, but I know how to use it.*Come back if you find it and I will help you."; break;
  581.         case 376 :
  582.             if (gpJeu->getJoueur()->hasMelodie(2)) {id=379; chercheText(); break;}
  583.             texte = "You found the Spirit Mask??? *...*Okay, listen carefully, I will teach you how to use it."; idsuiv=377; break;
  584.         case 377 : texte = "In the presence of a weakened spirit, you will have to play the Song of Spirit with your ocarina.*Listen to the Song of Spirit!"; break;
  585.         case 378 : texte = "You learned the Song of Spirit!!!**Use the Ocarina to play it!"; break;
  586.         case 379 : texte = "The Spirit Mask can only be used one time, put it to good use..."; break;
  587.         case 380 : texte = "You locked a terribly powerful spirit...*Make sure that he never falls into bad hands..."; break;
  588.         case 381 : texte = "Our village rarely receives visitors...*It might be related to the fact we blocked the entry..."; break;
  589.         case 382 :
  590.             if (gpJeu->getJoueur()->hasObjet(O_BFEU)) {id=386; chercheText(); break;}
  591.             if (gpJeu->getJoueur()->getAvancement()==66) {id=385; chercheText(); break;}
  592.             texte = "You are the only visitor I have seen since I started living here*I am an ancient adventurer, I was very talented as a treasure hunter..."; idsuiv=383;break;
  593.         case 383 : texte = "One day, I heard the story of the pyramid's treasure, a magical object...*But this desert caused my ruin, I could never cross over it. It is really too dangerous..."; idsuiv=384; break;
  594.         case 384 : texte = "You look as determined as I was in my youth... That's a deal! If you bring me the pyramid's treasure, I will give you my most precious treasure."; break;
  595.         case 386 :
  596.             if (gpJeu->getJoueur()->hasMelodie(0)) {id=389; chercheText(); break;}
  597.             texte = "You found the treasure???*A fire rod, huh?*...*..."; idsuiv=387; break;
  598.         case 387 : texte = "This rod will help you more than me...*You can keep it...*"; idsuiv=388; break;
  599.         case 388 : texte = "Accept this reward for showing an old man the treasure he searched for all his life...*The Song of Soaring!!!"; break;
  600.         case 389 : texte = "Played with a magical instrument, this song will teleport you. I had hoped I could cross over the desert with this, but I never found the good instrument..."; break;
  601.         case 390 : texte = "You learned the Song of Soaring!!!**Use the Ocarina to play it!"; break;
  602.         case 391 : texte = "Link, it's Pit!!!*What are you doing???*Get a move on to the West Field!!!"; break;
  603.         case 392 : texte = "Link, it's Zelda. Congratulations!!!*Rauru is safe, for the moment...*Go to the Destiny Tower at the peak of the mountain and stop Ganon!"; break;
  604.         case 393 : texte = "Tutorial : when the gauge of anger is full, you are transformed into Oni-Link.*Your weapon is extended and your strenght increases while your defense reduces."; idsuiv=394; break;
  605.         case 394 : texte = "As Oni-Link, you cannot use objects, but you can teleport yourself to the entry when you are in a dungeon by pressing T."; idsuiv=395; break;
  606.         case 395 : texte = "Each time Oni-Link defeats an enemy, your gauge decreases. When it's empty, Link regain his normal form."; break;
  607.         case 396 : texte = "Team leader, creator and programmer :                                                                         Vincent Jouillat"; break;
  608.         case 397 : texte = "Scriptwriter and translator:                                                                                      Lobalùz"; break;
  609.         case 398 : texte = "Help to the Graphics :                                                                                          Harvestland"; break;
  610.         case 399 : texte = "Help to the Graphics :                                                                                        Solène Jouillat"; break;
  611.         case 400 : texte = "Illustrator :                                                                                                      Raiden"; break;
  612.         case 401 : texte = "You found the Termina map!!!**Press P when you are outside to see it."; break;
  613.         case 402 : texte = "The legend forgets that after these events, the hero was brought down by a terrible curse..."; idsuiv=403; break;
  614.         case 403 : texte = "Day by day, Link was transforming into an uncontrollable and destructive-powered monster named Oni-Link..."; idsuiv=404; break;
  615.         case 404 : texte = "Banished from Hyrule, Link asked for advice from Princess Zelda."; idsuiv=405; break;
  616.         case 405 : texte = "She indicated to him his last hope : a portal to a secret world..."; break;
  617.         case 406 : texte = "Game saved."; break;
  618.         case 407 : texte = "You don't need to drink this potion now."; break;
  619.         case 408 : texte = "HELP : Press F1 to see the help."; break;
  620.         case 409 : texte = "Grrrr... But how could you escape from the world of the dead and arrive here???"; idsuiv=410; break;
  621.         case 410 : texte = "Why do you persist to challenge me? *Even if you strike me down I will always return to life."; idsuiv=411; break;
  622.         case 411 : texte = "Your quest is in vain, abandon all hope! **Let's rock, baby!"; break;
  623.     }
  624.    
  625.    
  626. }
  627.  
  628. void Texte::affiche(SDL_Surface* gpScreen, std::string s, int a, int b) {
  629.     for (int i = 0; i < (int)s.length(); i++) {
  630.         afficheLettre(gpScreen, s.at(i),a,b);
  631.         a+=6;
  632.     }
  633. }
  634.  
  635. void Texte::draw(SDL_Surface* gpScreen) {
  636.    
  637.     if (cadre) drawCadre(gpScreen);
  638.    
  639.     if (id==3 && texte == "You found a piece of heart!!!") {
  640.         SDL_Rect src; SDL_Rect dst;
  641.         src.x=16*(gpJeu->getJoueur()->nbQuarts()%4);
  642.         if(src.x==0)src.x=16*4;
  643.         src.y=0; src.w=16; src.h=16; dst.x=160-8; dst.y=120-8+16*5;
  644.         SDL_BlitSurface(imageCoeur, &src, gpScreen, &dst);
  645.     }
  646.    
  647.     int a = x+8; int b = y+8;
  648.     for (int i = 0; i < av; i++) {
  649.         afficheLettre(gpScreen, texte.at(i),a,b);
  650.         a+=6;
  651.         if (a > x+w-16) {a=x+8; b+=16;}
  652.     }
  653.    
  654.     if(SDL_GetTicks() > lastAnimTime + vitesse && def && av < (int)texte.length()) {
  655.         lastAnimTime = SDL_GetTicks();
  656.         do av++;
  657.         while (av < (int)texte.length() && texte.at(av-1) == ' ');
  658.         if (texte.at(av-1) != ' ') gpJeu->getAudio()->playSound(0,1);
  659.     }
  660. }
  661.  
  662. bool Texte::isFinished() {return (av==(int)texte.length());}
  663.  
  664. int Texte::getId() {return id;}
  665.  
  666. void Texte::changeId(int i) {
  667.     id=i; idsuiv=0; buffer="";
  668.     chercheText();
  669.     decoupeText();
  670.     if (av>(int)texte.length()) av=(int)texte.length();
  671. }
  672.  
  673. void Texte::drawCadre(SDL_Surface* gpScreen) {
  674.     SDL_Rect src;
  675.     SDL_Rect dst;
  676.    
  677.     src.w=8; src.h=8; src.x = 103; src.y = 100; dst.x = x; dst.y = y;
  678.     SDL_BlitSurface(imageFont, &src, gpScreen, &dst);
  679.    
  680.     src.x = 112;
  681.     for (int i = 8; i < w-8; i+=16) {
  682.         dst.x = x+i; src.w=16;
  683.         while (dst.x + src.w > x+w && src.w>0) src.w--;
  684.         if (src.w>0) SDL_BlitSurface(imageFont, &src, gpScreen, &dst);
  685.     }
  686.    
  687.     src.w=8; src.x = 129; dst.x = x+w-8;
  688.     SDL_BlitSurface(imageFont, &src, gpScreen, &dst);
  689.    
  690.     src.y = 109; src.w=8;
  691.     for (int j = 8; j < h-8; j+=16) {
  692.         dst.y = y + j;
  693.         src.x = 103; dst.x = x; src.h=16;
  694.         while (dst.y + src.h > y+h && src.h>0) src.h--;
  695.         if (src.h>0) SDL_BlitSurface(imageFont, &src, gpScreen, &dst);
  696.    
  697.         src.x = 129; dst.x = x+w-8;
  698.         if (src.h>0)SDL_BlitSurface(imageFont, &src, gpScreen, &dst);
  699.     }
  700.    
  701.     src.h=8; src.x = 103; src.y = 126; dst.x = x; dst.y = y+h-8;
  702.     SDL_BlitSurface(imageFont, &src, gpScreen, &dst);
  703.    
  704.     src.x = 112;
  705.     for (int i = 8; i < w-8; i+=16) {
  706.         dst.x = x+i; src.w=16;
  707.         while (dst.x + src.w > x+w && src.w>0) src.w--;
  708.         if (src.w>0) SDL_BlitSurface(imageFont, &src, gpScreen, &dst);
  709.     }
  710.    
  711.     src.w=8; src.x = 129; dst.x = x+w-8;
  712.     SDL_BlitSurface(imageFont, &src, gpScreen, &dst);
  713. }
  714.  
  715. void Texte::setTexte(int idTxt, int vx, int vy, int vw, int vh, bool cadr, bool defil, int vit) {
  716.     if (idTxt == 0) return;
  717.     id = idTxt;
  718.     idsuiv = 0;
  719.     buffer = "";
  720.     chercheText();
  721.    
  722.     x = vx; y = vy; w = vw; h = vh;
  723.     decoupeText();
  724.        
  725.     def=defil;
  726.     if (def) av = 0;
  727.     else av = texte.length();
  728.    
  729.     cadre = cadr;
  730.    
  731.     vitesse = vit;
  732. }
  733.  
  734. void Texte::decoupeText() {
  735.     //compte le nombre de caractères possibles et largeur et en hauteur
  736.     int nbcol = (w-16)/6 -1;
  737.     int nblig = (h-16)/16;
  738.     int tailleMax = nbcol * nblig;
  739.     int taille;
  740.    
  741.     //parcours du texte à afficher; à chaque début de mot,
  742.     //vérifie que le mot peut tenir sur la ligne
  743.     for (int i = 0; i < (int)texte.length(); i++) {
  744.        
  745.         //supprime les espaces isolés en début de ligne
  746.         if (texte.at(i)==' ' && texte.at(i+1)!=' ' && i%nbcol == 0) texte.erase(i,1);
  747.         //recherche du début du prochain mot
  748.         while(texte.at(i)==' ' && i < (int)texte.length()-1) i++;
  749.        
  750.         //saute une ligne si trouve une étoile
  751.         if (texte.at(i)=='*') {
  752.             texte.erase(i,1);//replace(i, 1, " ");
  753.             int nb = (nbcol)-(i%(nbcol));
  754.             for (int j = 0; j < nb; j++) texte.insert(i," ");
  755.             continue;
  756.         }
  757.        
  758.         //si le mot dépasse
  759.         taille = tailleMot(i);
  760.         if ((i%nbcol)+taille>nbcol) {
  761.             if  (i < tailleMax) {
  762.                 //si le mot ne tient pas sur une ligne, on le coupe avec des tirets
  763.                 if (taille>nbcol) {
  764.                     texte.insert(((i/nbcol)+1)*nbcol-1,"--");
  765.                     i = 1+((i/nbcol)+1)*nbcol;
  766.                 }
  767.                 //sinon, on ajoute des espaces pour faire commencer le mot à la ligne
  768.                 else while((i%nbcol) != 0) {texte.insert(i," "); i++;}
  769.             }
  770.         }
  771.        
  772.     }
  773.    
  774.     // si le texte est trop grand, on le coupe en deux
  775.     if ((int)texte.length() > tailleMax) {
  776.         buffer = texte.substr(tailleMax);
  777.         texte = texte.substr(0, tailleMax);
  778.     }
  779. }
  780.  
  781. int Texte::tailleMot(int deb) {
  782.     int i = deb;
  783.     int total = 0;
  784.     while (texte.at(i)!=' ') {total++; i++; if (i >= (int)texte.length()) return total;}
  785.     return total;
  786. }
  787.  
  788. void Texte::afficheLettre(SDL_Surface* gpScreen, char c, int vx, int vy) {
  789.     SDL_Rect src;
  790.     SDL_Rect dst;
  791.    
  792.     int val = (int)c;
  793.    
  794.     dst.x=vx; dst.y=vy;
  795.     src.h=16;src.w=8;
  796.    
  797.     if(val==32) return;
  798.    
  799.     // /
  800.     if(val==47) {src.x=52;src.y=151;}
  801.    
  802.     // @ hylien
  803.     if(val==64) {src.x=4;src.y=151;}
  804.            
  805.     // + hylien
  806.     if(val==43) {src.x=20;src.y=151;}
  807.            
  808.     // = hylien
  809.     if(val==61) {src.x=36;src.y=151;}
  810.            
  811.     //minuscules a-z
  812.     if(val>=97 && val<=122) {src.x=4+16*((val-97)%10); src.y=52+16*((val-97)/10);}
  813.            
  814.     //majuscules A-Z
  815.     if(val>=65 && val<=90) {src.x=6+16*((val-65)%10); src.y=2+16*((val-65)/10);}  
  816.     // ç
  817.     if(val==-25) {src.x=148;src.y=34;}
  818.     // é
  819.     if(val==-23) {src.x=100;src.y=84;}
  820.     // ê
  821.     if(val==-22) {src.x=116;src.y=84;}
  822.     // è
  823.     if(val==-24) {src.x=132;src.y=84;}
  824.     // ë
  825.     if(val==-21) {src.x=132;src.y=151;}
  826.     // à
  827.     if(val==-32) {src.x=148;src.y=84;}
  828.     // â
  829.     if(val==-30) {src.x=148;src.y=103;}
  830.     // ä
  831.     if(val==-28) {src.x=148;src.y=135;}
  832.     // î
  833.     if(val==-18) {src.x=84;src.y=119;}
  834.     // ï
  835.     if(val==-17) {src.x=116;src.y=151;}
  836.     // û
  837.     if(val==-5) {src.x=84;src.y=103;}
  838.     // ù
  839.     if(val==-7) {src.x=148;src.y=151;}
  840.     // ü
  841.     if(val==-4) {src.x=116;src.y=135;}
  842.     // ö
  843.     if(val==-10) {src.x=132;src.y=135;}
  844.     // ô
  845.     if(val==-12) {src.x=148;src.y=119;}
  846.            
  847.     //ponctuation
  848.     // -
  849.     if(val==45) {src.x=102;src.y=34;}
  850.     // .
  851.     if(val==46) {src.x=118;src.y=34;}
  852.     // ,
  853.     if(val==44) {src.x=134;src.y=34;}
  854.     // !
  855.     if(val==33) {src.x=3;src.y=135;}
  856.     // ?
  857.     if(val==63) {src.x=19;src.y=135;}
  858.     // (
  859.     if(val==40) {src.x=35;src.y=135;}
  860.     // )
  861.     if(val==41) {src.x=51;src.y=135;}            
  862.     // ' ( avec @ )
  863.     if(val==39) {src.x=67;src.y=135;}
  864.     // :
  865.     if(val==58) {src.x=83;src.y=135;}
  866.     // ... ( avec % )
  867.     if(val==37) {src.x=101;src.y=135;}
  868.     // >
  869.     if(val==62) {src.x=100;src.y=151;}
  870.     // <
  871.     if(val==60) {src.x=84;src.y=151;}
  872.            
  873.     //chiffres            
  874.     if(val>=48 && val<=57) {src.x=3+16*((val-48)%5); src.y=103+16*((val-48)/5);}
  875.    
  876.     SDL_BlitSurface(imageFont, &src, gpScreen, &dst);
  877. }
  878.  
  879. bool Texte::hasNext() {
  880.     return (buffer != "" || idsuiv > 0);
  881. }
  882.  
  883. bool Texte::suite() {
  884.     if (av < (int)texte.length()) {
  885.         av = texte.length();
  886.         return true;
  887.     }
  888.     if (!hasNext()) {
  889.         gpJeu->getAudio()->playSound(18);
  890.         return gpJeu->finTexte(id);
  891.     }
  892.     if (buffer != "") {
  893.         texte = buffer;
  894.         buffer = "";
  895.     }
  896.     else {
  897.         id = idsuiv;
  898.         idsuiv = 0;
  899.         chercheText();
  900.     }
  901.     decoupeText();
  902.     if (def) av = 0;
  903.     else av = texte.length();
  904.     gpJeu->getAudio()->playSound(17);
  905.     return true;
  906. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement