bool Scene_Inca_Passage::ObjectClicked(const char *szObjectName, float x, float y)
{
   /* Cartouches */
   if (strcmp(szObjectName, "inca_cartouche1_ground") == 0) {
      PickupSimple(szObjectName, "inv_inca_cartouche1");
   }
   if (strcmp(szObjectName, "inca_cartouche2_ground") == 0) {
      if (TaskResolved("task_inca_fillhole")) {
         PickupSimple(szObjectName, "inv_inca_cartouche2");
      }
      else {
         _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("INCA_YUMANCO_HOLE"), "", true, false);
         AddTask("task_inca_fillhole");
      }
   }
   
   /* Artefacts */
   if (strcmp(szObjectName, "inca_artefact3") == 0) {
      PickupSimple(szObjectName, "inv_inca_artefact3");
      ResolveTask("task_inca_getartefact3");
      TestTaskArtefacts();
   }
   if (strcmp(szObjectName, "inca_artefact4") == 0) {
      PickupSimple(szObjectName, "inv_inca_artefact4");
      ResolveTask("task_inca_getartefact4");
      TestTaskArtefacts();
   }
   return false;
}
void Scene_Middleage_Mainscreen::MiniGameDone(const char *szGameName, bool bIsRevolved)
{
   if (!bIsRevolved) {
      _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("MIDDLEAGE_MONK_GATHERFAILED"), "", true, false);
      return;
   }
   if (strcmp(szGameName, "ginkgo") == 0 && bIsRevolved) {
      PickupSimple("middleage_ginkgo_img", "inv_middleage_ginkgo");
      ResolveTask("task_middleage_gather_ginkgo");
      SetVisible("middleage_ginkgo_zone", false);
      return;
   }
   if (strcmp(szGameName, "rue") == 0 && bIsRevolved) {
      PickupSimple("middleage_rue_img", "inv_middleage_rue");
      ResolveTask("task_middleage_gather_rue");
      SetVisible("middleage_rue_zone", false);
      return;
   }
   if (strcmp(szGameName, "ail") == 0 && bIsRevolved) {
      PickupSimple("middleage_ail_img", "inv_middleage_garlic");
      ResolveTask("task_middleage_gather_garlic");
      SetVisible("middleage_ail_zone", false);
      return;
   }
   if (strcmp(szGameName, "pavot") == 0 && bIsRevolved) {
      PickupSimple("middleage_pavot_img", "inv_middleage_poppy");
      ResolveTask("task_middleage_gather_poppy");
      SetVisible("middleage_pavot_zone", false);
      return;
   }
}
bool Scene_House_Out::ObjectClicked(const char *szObjectName, float x, float y)
{
   if ( strcmp(szObjectName, "out_car_zone") == 0)
   {
      _lpSceneDirector->getSequencer()->PlaySound(NULL, "cardoor");
      _lpSceneDirector->getSequencer()->GoToScene(NULL, "house_out_car", "", false);
      return true;
   }
   if ( strcmp(szObjectName, "out_house_zeps") == 0)
   {
      ResolveTask("task_out_zeps");
      GetObjectImageByName("out_house_zeps")->EnableGlitch(false);
      _lpSceneDirector->getSequencer()->GotoVideo(szObjectName, "videos/zeppelins.ogv", "zeppelins");
      _lpSceneDirector->getSequencer()->Talk("zeps", CHARACTER_POSX, CHARACTER_POSY, KStr("HOUSE_OUT_ASHLEY_ZEPS"), "", true);
      if (!TaskResolved("task_out_zeps_page")) {
         ResolveTask("task_out_zeps_page");
         _lpSceneDirector->getDiaryPtr()->beginCreatePage();
         _lpSceneDirector->getDiaryPtr()->addImageToPage("diary_zeps.png");
         _lpSceneDirector->getDiaryPtr()->addStringToPage("DIARY_ZEPPELINS", FONT_DIARY_1, 0, 0);
         _lpSceneDirector->getDiaryPtr()->endCreatePage();
      }
      return true;
   }
   if ( strcmp(szObjectName, "out_house_zone") == 0)
   {
      if (ObjectiveResolved("house","getmap")) {
         _lpSceneDirector->getSequencer()->GoToScene(NULL, "parvis", "", false);
      }
      else {
         _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("HOUSE_OUT_ASHLEY_NEEDMAP"), "", true);
         if (TestGlobal("__tutorial__")) {
            _lpSceneDirector->getSequencer()->Tutobox(NULL, KStr("HOUSE_OUT_TUTO_CAR"), 913, 504, -45, 200);         
         }
      }
      return true;
   }
   if (strcmp(szObjectName, "house_out_isaac_quiet") == 0) {
      ESoundBank::getSound("isaac_bark")->playSample();
      if (!ObjectiveResolved("house","getmap")) {
         _lpSceneDirector->getSequencer()->Talk(szObjectName, CHARACTER_POSX, CHARACTER_POSY, KStr("HOUSE_OUT_ASHLEY_ISAAC1"), "", true);
      }
      else {
         _lpSceneDirector->getSequencer()->Talk(szObjectName, CHARACTER_POSX, CHARACTER_POSY, KStr("HOUSE_OUT_ASHLEY_ISAAC2"), "", true);
      }
   }
   
   return false;
}
void Scene_House_Out::Init()
{
   _lpSceneDirector->ChangeMusic(DIRECTOR_MUSIC_NONE, true);
   _lpSceneDirector->ShowIHM(true);

   // Glit sur la portière
   if (TaskResolved("car_box_map") && TaskResolved("car_box_key")) {
      GetObjectImageByName("out_car_zone")->EnableGlitch(false);
   }
   
   if (!TaskResolved("task_out_firstvisit")) {
      ResolveTask("task_out_firstvisit");
      AddObjective("house","getmap");
      AddHint("house","getmap","how");
      _lpSceneDirector->getSequencer()->Callback(NULL, "tutoask");
      _lpSceneDirector->getDiaryPtr()->beginCreatePage();
      _lpSceneDirector->getDiaryPtr()->addImageToPage("diary_out.png");
      _lpSceneDirector->getDiaryPtr()->addStringToPage("DIARY_OUT", FONT_DIARY_1, 0, 0);
      _lpSceneDirector->getDiaryPtr()->endCreatePage();
   }
   
   if (TaskResolved("out_house_zeps")) {
      GetObjectImageByName("out_house_zeps")->EnableGlitch(false);
   }
         
   if (getAdditionalName() == "gotohouse") {
      AddObjective("house","enterhouse");
      AddHint("house","enterhouse","how");
      if (TestGlobal("__tutorial__")) {
         _lpSceneDirector->getSequencer()->Tutobox(NULL, KStr("HOUSE_OUT_TUTO_ENTERHOUSE"), 273, 204, 180, 200);
      }
   }

   _lpSceneDirector->getSequencer()->PreloadVideo("videos/zeppelins.ogv");
}
void Scene_House_Hall::Check()
{
   EScene::Check();
#ifdef SCENE_SHORTCUT
   if (KInput::isPressed(K_VK_F5))
   {
      ResetTask("task_meetnathan2");
      ResolveTask("task_inca_universeresolved");
      Init();
   }
   if (KInput::isPressed(K_VK_F6))
   {
      SetVisible("house_hall_livingdooropen", true, true);
   }
   if (KInput::isPressed(K_VK_F7))
   {
      SetVisible("diningroom", false);
      SetVisible("house_hall_diningdooropen", true);
   }
   if (KInput::isPressed(K_VK_F8))
   {
      ResolveGroundFloor();
   }
#endif
}
void Scene_House_Basement_Grid::Init()
{
   // 1ère visite de la grille
   if (!TaskResolved("task_house_basement_visitgrid")) {
      ResolveTask("task_house_basement_visitgrid");
      AddObjective("house","basementgrid");
      AddHint("house","basementgrid","how");
   }
   
   // Grille ouverte ?
   if (TaskResolved("task_house_basement_opengrid")) {
      SetVisible("basement_grid_gridclosed", false, true);
      SetVisible("basement_grid_gridopen", true, true);
      // La vis
      SetVisible("basement_grid_bolt", TestGlobal("basement_grid_bolt") == false, true);
   } else {
      SetVisible("basement_grid_gridclosed", true, true);
      SetVisible("basement_grid_gridopen", false, true);
   }

   // Le charbon
   if (TaskResolved("task_house_basement_reversecoal")) {
      SetVisible("basement_grid_coal", true, true);
      // Le fusain
      SetVisible("basement_grid_charcoal", TestGlobal("basement_grid_charcoal") == false, true);
   }
}
void EInventory::ValidateTravellingItem()
{
   if (!_lpTravellingItem) {
      K_LOG("ValidateTravellingItem -> No travellingitem - End ValidateTravellingItem");
      return;
   }
   K_LOG("ValidateTravellingItem -> Create new item _szItemName=%s _nNbPartNeeded=%d",_lpTravellingItem->_szItemName,_lpTravellingItem->_nNbPartNeeded);   
   // On crée un item tout neuf
   AddItem(_lpTravellingItem);

   // Tutorial sur les objets à combiner
   if (TestGlobal("__mode_casual__")) {
      if (_lpTravellingItem->_nNbPartNeeded == -1) {
         if (!TaskResolved("__tuto_combineitem__")) {
            ResolveTask("__tuto_combineitem__");
            int xitem,yitem;
            xitem = _lpTravellingItem->_X + (INVENTORY_CELLWIDTH/2);
            yitem = _lpTravellingItem->_Y;
            if (TestGlobal("__tutorial__")) {
               _lpSceneDirector->getSequencer()->Tutobox(NULL, KStr("GLOBAL_TUTO_COMBINEITEM"), xitem, yitem, -90, 0);
            }
         }
      }
   }
   
   _lpTravellingItem = NULL;
   K_LOG("Travellingitem added - End ValidateTravellingItem");
   _lpSceneDirector->UpdateInventoryButtons();
}
void Scene_House_Out::Callback(const char *szParam)
{
   if (strcmp(szParam, "tutoask") == 0) {
      if (!TaskResolved("__reply_tutorial__")) {
         ResolveTask("__reply_tutorial__");
         _lpSceneDirector->OpenDialogboxYN(KStr("HOUSE_OUT_TUTOASK"), &_nYesForTutorial);
      }
   }
}
void Scene_Inca_Mainscreen::Init()
{
   StartAnimation("bg2_anim");
   StartAnimation("clouds_anim");

   if (!TaskResolved("inca_ashleytalkintro")) {
      ResolveTask("inca_ashleytalkintro");
      _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_DIALOG, true);
      _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("INCA_DIALOGBOX_INTRO1"), "", false, true);
      _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("INCA_DIALOGBOX_INTRO2"), "", false, true);
      _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("INCA_DIALOGBOX_INTRO3"), "", false, true);
      _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_DIALOG, false);
      AddTask("task_inca_findspear");
      AddObjective("inca","spear");
      AddHint("inca","spear","where");
   }
   
   // Ajout de la statuette à l'inventaire si elle n'y est pas déjà
   if (_lpSceneDirector->getInventory()->getItemFromInventory("inv_inca_statuette") == NULL) {
      _lpSceneDirector->getInventory()->AddItem("inca","inv_inca_statuette");
   }
   
   // Morceaux de lance
   SetupItem("inca_spear[1]");
   SetupItem("inca_spear[2]");
   SetupItem("inca_spear[3]");
   SetupItem("inca_spear[4]");   
   SetupItem("inca_spear[5]");
   if (TaskResolved("task_inca_opencube")) {
      SetupItem("inca_spear[6]");
   }
   
   // Bloc de pierre
   if (TaskResolved("task_inca_opencube")) {
      SetVisible("inca_main_cubesclosed", false, true);
      SetVisible("inca_main_cubesopen", true, true);
   }
   else {
      SetVisible("inca_main_cubesclosed", true, true);
      SetVisible("inca_main_cubesopen", false, true);
   }
   
   // Le garde
   // Il n'a pas encore sa lance
   if (!TaskResolved("task_inca_givespear")) {
      SetVisible("inca_main_guard_nospear", true);
   }
   // Il a eu sa lance
   else {
      SetVisible("inca_main_guard_spear", true);
   }
   
   // La porte est ouverte
   if (TaskResolved("task_inca_opendoor")) {
      SetVisible("inca_main_door", false, false);
   }
}
void Scene_House_IncaBook::Init()
{
   if (!TaskResolved("task_house_incabook_discover")) {
      ResolveTask("task_house_incabook_discover");
      AddObjective("house","living_buildbase");
      AddHint("house","living_buildbase","fire");
   }
   
	PageSet(_nCurrentPage);
}
void Scene_House_Basement_Grid::MiniGameDone(const char *szGameName, bool bIsRevolved)
{
   if (strcmp(szGameName, "grid")==0 && bIsRevolved) {
      ResolveObjective("house","basementgrid");
      ResolveTask("task_house_basement_opengrid");
      ESoundBank::getSound("reveal")->playSample();
      // On peut maintenant retirer l'objet de l'inventaire
      _lpSceneDirector->DropItem("inv_house_basement_screwdriver");
      Init();
   }
}
void SceneBasement::MiniGameDone(const char *szGameName, bool bIsRevolved)
{
   if (strcmp(szGameName, "bonzai")==0 && bIsRevolved) {
      _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_LOCKMOUSE, true);
      _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_CINEMATIC, true);
      _lpSceneDirector->getSequencer()->ShowEmitter(NULL, "creeping_glow", true);
      _lpSceneDirector->getSequencer()->SwitchImage(NULL, "basement_bonzai", "basement_bonzairesolved");
      ResolveTask("task_house_basement_bonzai");
      ResolveTask("task_japan_prologcompleted");
      ResolveObjective("house","bonzai");
      ResolveObjective("house","helpnatsumi");
      ESoundBank::getSound("success")->playSample();
      // On peut maintenant retirer l'objet de l'inventaire
      _lpSceneDirector->DropItem("inv_house_basement_grip");
      _lpSceneDirector->DropItem("inv_house_basement_sketch");
      // Lance l'épilogue de la cave
      _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_CINEMATIC, false);
      setAdditionalName("completed");
      Init();
   }
}
// Attention : copier le même code dans Scene_Inca_Stairs
void Scene_Inca_Passage::TestTaskArtefacts()
{
   if (TaskResolved("task_inca_getartefact1") &&
       TaskResolved("task_inca_getartefact2") &&
       TaskResolved("task_inca_getartefact3") &&
       TaskResolved("task_inca_getartefact4")
       ) {
      ResolveTask("task_inca_getartefacts");
      ResolveObjective("inca","4artefacts");
      _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("INCA_YUMANCO_GOTALL"), "", true, false);
   }
}
void Scene_Inca_Passage::MiniGameDone(const char *szGameName, bool bIsRevolved)
{
   if (strcmp(szGameName, "fresco3") == 0 && bIsRevolved) {
      // Artefact 1
      _lpSceneDirector->getSequencer()->ShowEmitter(NULL, "creeping_glow1", true);
      ESoundBank::getSound("reveal")->playSample();
      _lpSceneDirector->DropItem("inv_inca_cartouche1");
      ResolveTask("task_inca_repairfresco3");
      SetVisible("inca_cartouche1_wall", true);
      SetVisible("inca_artefact3", true);
      SetVisible("inca_stairsfresco3_zone", false);
      _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("INCA_ARTEFACT_APPEAR"), "", true, false);
   }

   if (strcmp(szGameName, "fresco4") == 0 && bIsRevolved) {
      // Artefact 2
      _lpSceneDirector->getSequencer()->ShowEmitter(NULL, "creeping_glow2", true);
      ESoundBank::getSound("reveal")->playSample();
      _lpSceneDirector->DropItem("inv_inca_cartouche2");
      ResolveTask("task_inca_repairfresco4");
      SetVisible("inca_cartouche2_wall", true);
      SetVisible("inca_artefact4", true);
      SetVisible("inca_stairsfresco4_zone", false);
      _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("INCA_ARTEFACT_APPEAR"), "", true, false);
   }

   if (!bIsRevolved) {
      
      if (strcmp(szGameName, "fresco3") == 0)
         _lpSceneDirector->getSequencer()->ShowImage(NULL, "inca_cartouche1_wall", false, true);
      if (strcmp(szGameName, "fresco4") == 0)
         _lpSceneDirector->getSequencer()->ShowImage(NULL, "inca_cartouche2_wall", false, true);

      _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("MIDDLEAGE_MONK_GATHERFAILED"), "", true, false);
      Init();
      return;
   }
}
/* Un objet de l'inventaire est utilisé sur un objet de la scène */
bool Scene_House_Hall::ItemUsed(const char *szItemName, const char *szObjectName)
{
   int x,y;
   
   // Le joueur coupe des brindilles avec le couteau
   if (strcmp(szItemName, "inv_house_knife") == 0) {
      if (strcmp(szObjectName, "house_hall_plant") == 0) {
         _lpSceneDirector->getSequencer()->PlaySound(NULL, "mg_cut");
         _lpSceneDirector->getSequencer()->PlaySound(NULL, "success");
         _lpSceneDirector->DropItem(szItemName);
         GetObjectPosition("house_hall_plant", x, y, true, true);
         _lpSceneDirector->getSequencer()->PickupItem(NULL, "inv_house_brushwood", x, y, -1);
         _lpSceneDirector->getSequencer()->SwitchImage(NULL, "house_hall_plant", "house_hall_plant_done");
         ResolveTask("task_house_getbrushwood");
         return true;
      }
   }
   
   // Le joueur utilise L'échelle
   if ( strcmp(szItemName, "inv_house_ropehook") == 0 &&
       ( strcmp(szObjectName, "hall_isaac_waiting") == 0) ) {
      ResolveTask("task_house_useropeladder");
      ESoundBank::getSound("success")->playSample();
      ResolveGroundFloor();
      // On n'a plus besoin de la corde
      _lpSceneDirector->DropItem(szItemName);
      return true;
   }

   // Le joueur utilise la corde ou le grappin seul
   if ( (strcmp(szItemName, "inv_house_rope") == 0 || strcmp(szItemName, "inv_house_hook") == 0) &&
       ( strcmp(szObjectName, "hall_isaac_waiting") == 0) ) {
      _lpSceneDirector->getSequencer()->Talk("incomplete", CHARACTER_POSX, CHARACTER_POSY, KStr("HALL_ASHLEY_INCOMPLETEROPE") ,"",true);
      return true;
   }
   return false;
}
void Scene_Inca_Mainscreen::MiniGameDone(const char *szGameName, bool bIsRevolved)
{
   if (strcmp(szGameName, "cubes") == 0 && bIsRevolved) {
      _lpSceneDirector->getSequencer()->ShowEmitter(NULL, "creeping_glow", true);
      ResolveTask("task_inca_opencube");
      ESoundBank::getSound("reveal")->playSample();
      SetupItem("inca_spear[6]");
      SetVisible("inca_main_cubesclosed", false);
      SetVisible("inca_main_cubesopen", true);
      _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("INCA_MAIN_YUMANCO_MGDONE"), "", true, false);
   }
   
   if (!bIsRevolved) {
      _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("MIDDLEAGE_MONK_GATHERFAILED"), "", true, false);
      return;
   }
}
void Scene_Inca_Passage::Init()
{
   if (!_bEffect) {
      if (!TaskResolved("__say_deathpassage__")) {
         ResolveTask("__say_deathpassage__");
         _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("INCA_YUMANCO_DEATHPASSAGE"), "", true, false);
         AddHint("inca","4artefacts","cross");
      }
   }
   SetupItem("inca_cartouche1_ground");
   SetupItem("inca_cartouche2_ground");
   
   // Blocs au plafond ou au sol ?
   if (!_bEffect) {
      if (TaskResolved("task_inca_fillhole")) {
         SetVisible("inca_passage_blocks_ground", true, true);
         SetVisible("inca_final_zone", true, true);
      }
      else {
         AddTask("task_inca_fillhole");
         SetVisible("inca_passage_blocks_ceiling", true, true);
      }
   }
   
   // Artefacts
   if (!TaskResolved("task_inca_repairfresco3")) {
      AddTask("task_inca_repairfresco3");
   }
   if (!TaskResolved("task_inca_repairfresco4")) {
      AddTask("task_inca_repairfresco4");
   }
   
   // artefact découverts
   if (TaskResolved("task_inca_repairfresco3")) {
      SetupItem("inca_artefact3");
      SetVisible("inca_stairsfresco3_zone", false);
      SetVisible("inca_cartouche1_wall", true, true);
   }
   if (TaskResolved("task_inca_repairfresco4")) {
      SetupItem("inca_artefact4");
      SetVisible("inca_stairsfresco4_zone", false);
      SetVisible("inca_cartouche2_wall", true, true);
   }
}
void Scene_Inca_Mainscreen::Draw()
{
   double fElapsed = MyGame::getGame()->getKWindow()->getFrameTime();
   if (_bAnimDoor) {
      _lpAnimDoor->move(fElapsed);
      // Déplace la porte
      RestorePosition("inca_main_door");
      MovePosition("inca_main_door", GetRandom(-1.0, 1.0), _lpAnimDoor->getCurrentValue());
      if (_lpAnimDoor->isCompleted()) {
         _bAnimDoor = false;
         ResolveTask("task_inca_opendoor");
         AddObjective("inca","4artefacts");
         AddHint("inca","4artefacts","where");
         AddHint("inca","4artefacts","light");
         _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_CINEMATIC, false);
      }
   }
   
   EScene::Draw();
}
void Scene_Hell_Vale::SoulCheck(int nSoul)
{
   int x,y;
   bool bDone = true;
   switch (nSoul) {
      case 1:
         GetObjectPosition("hell_vale_soul_1", x, y, true, false);
         // Demande les objets non encore distribués
         if (!TaskResolved("task_hell_soul1_give1")) {
            bDone = false;
         }
         if (!TaskResolved("task_hell_soul1_give2")) {
            bDone = false;
         }
         if (!TaskResolved("task_hell_soul1_give3")) {
            bDone = false;
         }
         if (!bDone) {
            _lpSceneDirector->getSequencer()->PlaySound(NULL, "success");
            _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("HELL_SOUL_MORE"), "", true);
         }
         else {
            _lpSceneDirector->getSequencer()->PlaySound(NULL, "success");
            _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("HELL_SOUL_DONE"), "", false);
            _lpSceneDirector->getSequencer()->PlaySound(NULL, "ghostcreep");
            _lpSceneDirector->getSequencer()->ShowImage(NULL, "hell_vale_soul_1", false);
            ResolveTask("task_hell_savesoul_1");
         }
         return;
         break;
      case 2:
         GetObjectPosition("hell_vale_soul_2", x, y, true, false);
         // Demande les objets non encore distribués
         if (!TaskResolved("task_hell_soul2_give1")) {
            bDone = false;
         }
         if (!TaskResolved("task_hell_soul2_give2")) {
            bDone = false;
         }
         if (!TaskResolved("task_hell_soul2_give3")) {
            bDone = false;
         }
         if (!bDone) {
            _lpSceneDirector->getSequencer()->PlaySound(NULL, "success");
            _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("HELL_SOUL_MORE"), "", true);
         }
         else {
            _lpSceneDirector->getSequencer()->PlaySound(NULL, "success");
            _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("HELL_SOUL_DONE"), "", false);
            _lpSceneDirector->getSequencer()->PlaySound(NULL, "ghostcreep");
            _lpSceneDirector->getSequencer()->ShowImage(NULL, "hell_vale_soul_2", false);
            ResolveTask("task_hell_savesoul_2");
         }
         return;
         break;
      case 3:
         GetObjectPosition("hell_vale_soul_3", x, y, true, false);
         // Demande les objets non encore distribués
         if (!TaskResolved("task_hell_soul3_give1")) {
            bDone = false;
         }
         if (!TaskResolved("task_hell_soul3_give2")) {
            bDone = false;
         }
         if (!TaskResolved("task_hell_soul3_give3")) {
            bDone = false;
         }
         if (!bDone) {
            _lpSceneDirector->getSequencer()->PlaySound(NULL, "success");
            _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("HELL_SOUL_MORE"), "", true);
         }
         else {
            _lpSceneDirector->getSequencer()->PlaySound(NULL, "success");
            _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("HELL_SOUL_DONE"), "", false);
            _lpSceneDirector->getSequencer()->PlaySound(NULL, "ghostcreep");
            _lpSceneDirector->getSequencer()->ShowImage(NULL, "hell_vale_soul_3", false);
            ResolveTask("task_hell_savesoul_3");
         }
         return;
         break;
      default:
         break;
   }
}
bool SceneBasement::ItemUsed(const char *szItemName, const char *szObjectName)
{
   // Le joueur donne quelque chose au fantôme debout
   if (strcmp(szObjectName, "basement_ghostup") == 0)
   {
      int x,y;
      bool bGiven = false;
      GetObjectPosition("basement_ghostup", x, y);
      if (strcmp(szItemName, "inv_house_basement_paper") == 0) {
         ResolveTask("task_house_basement_givepaper");
         RemoveHint("house","helpnatsumi","nextpaper");
         // On peut maintenant retirer l'objet de l'inventaire
         _lpSceneDirector->DropItem("inv_house_basement_paper");
         _lpSceneDirector->getSequencer()->PlaySound(NULL, "success");
         _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("HOUSE_BASEMENT_NATSUMI_THANKYOU"), "", true, false, _lpGhostVoice);
         if (!TaskResolved("task_house_basement_givecharcoal")) {
            AddHint("house","helpnatsumi","nextcharcoal");
         }
         bGiven = true;
      }
      else
      if (strcmp(szItemName, "inv_house_basement_grid_charcoal") == 0) {
         ResolveTask("task_house_basement_givecharcoal");
         RemoveHint("house","helpnatsumi","nextcharcoal");
         // On peut maintenant retirer l'objet de l'inventaire
         _lpSceneDirector->DropItem("inv_house_basement_grid_charcoal");
         _lpSceneDirector->getSequencer()->PlaySound(NULL, "success");
         _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("HOUSE_BASEMENT_NATSUMI_THANKYOU"), "", true, false, _lpGhostVoice);
         bGiven = true;
      }
      else {
         _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("HOUSE_BASEMENT_NATSUMI_IDONTNEED"), "", true, false, _lpGhostVoice);
      }
      
      // On teste si on a donné les 2 objets attendus par le fantôme
      if (bGiven) {
         if (TaskResolved("task_house_basement_givepaper") && TaskResolved("task_house_basement_givecharcoal")) {
            _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_DIALOG, true);
            _lpSceneDirector->getSequencer()->ShowEmitter(NULL, "creeping_static_up", false);
            _lpSceneDirector->getSequencer()->ShowImage(NULL,"basement_ghostup",false);
            _lpSceneDirector->getSequencer()->ShowImage(NULL,"basement_ghostdrawing1",true);
            _lpSceneDirector->getSequencer()->SwitchImage(NULL, "basement_ghostdrawing1", "basement_ghostdrawing2");
            _lpSceneDirector->getSequencer()->SwitchImage(NULL, "basement_ghostdrawing2", "basement_ghostdrawing1");
            _lpSceneDirector->getSequencer()->SwitchImage(NULL, "basement_ghostdrawing1", "basement_ghostdrawing2");
            _lpSceneDirector->getSequencer()->SwitchImage(NULL, "basement_ghostdrawing2", "basement_ghostdrawing1");
            _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("HOUSE_BASEMENT_ASHLEY_SHEDRAW"), "", false, true);
            _lpSceneDirector->getSequencer()->SwitchImage(NULL, "basement_ghostdrawing1", "basement_ghostdrawing2");
            _lpSceneDirector->getSequencer()->SwitchImage(NULL, "basement_ghostdrawing2", "basement_ghostdrawing1");
            _lpSceneDirector->getSequencer()->ShowImage(NULL,"basement_ghostdrawing1",false);
            _lpSceneDirector->getSequencer()->ShowEmitter(NULL, "creeping_static_hidden", true);
            _lpSceneDirector->getSequencer()->ShowImage(NULL,"basement_ghosthidden",true);
            _lpSceneDirector->getSequencer()->PlaySound(NULL, "success");
            _lpSceneDirector->getSequencer()->ShowImage(NULL,"basement_sketch",true);
            _lpSceneDirector->getSequencer()->Animation(NULL, "sketchanimp2p", true);
            _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_DIALOG, false);
            _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("HOUSE_BASEMENT_ASHLEY_SHEDRAW2"), "", true);
            ResolveTask("task_house_basement_natsumineed");
            AddTask("task_house_basement_bonzai");
            RemoveHint("house","helpnatsumi","what");
            AddObjective("house","bonzai");
            AddHint("house","bonzai","how");
            AddHint("house","bonzai","grip");
         }
      }
      return true;
   }
   // Le joueur donne quelque chose au fantôme caché
   if (strcmp(szObjectName, "basement_ghosthidden") == 0)
   {
      _lpSceneDirector->getSequencer()->PlaySound(NULL, "ghostappear");
      int x,y;
      GetObjectPosition("basement_ghostup", x, y);
      _lpSceneDirector->getSequencer()->ShowImage(NULL,"basement_ghosthidden",false);
      _lpSceneDirector->getSequencer()->ShowEmitter(NULL, "creeping_static_hidden", false);
      _lpSceneDirector->getSequencer()->ShowEmitter(NULL, "creeping_static_up", true);
      _lpSceneDirector->getSequencer()->ShowImage(NULL,"basement_ghostup",true);
      _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("HOUSE_BASEMENT_NATSUMI_DOYOUWANT2GIVE"), "", false, false, _lpGhostVoice);
      _lpTimerGhost->startCounter(0.0f, 1.0f, 0, 10000, K_COUNTER_LINEAR);
      return true;
   }
   // Le joueur utilise l'ampoule sur le bulbe cassé
   if ( strcmp(szItemName, "inv_house_basement_bulb") == 0 ) {
      if (strcmp(szObjectName, "bulbbroken") == 0)
      {
         _lpSceneDirector->getSequencer()->VoiceOver(NULL, KStr("HOUSE_BASEMENT_ASHLEY_IMPOBULB"),"");
         return true;
      }
   }
   // Le joueur utilise le torchon sur le bulbe cassé
   if ( strcmp(szItemName, "inv_house_basement_rag") == 0 ) {
      if (strcmp(szObjectName, "bulbbroken") == 0)
      {
         ESoundBank::getSound("success")->playSample();
         // On peut maintenant retirer l'objet de l'inventaire
         _lpSceneDirector->DropItem("inv_house_basement_rag");
         // On enlève la douille cassée
         SetVisible("bulbbroken", false);
         SetVisible("nobulb", true);
         // Tache résolue : enlever le bulbe brisé
         ResolveTask("task_house_basement_removebulb");
         return true;
      }
   }
   // Le joueur utilise l'ampoule neuve sur la douille vide
   if ( strcmp(szItemName, "inv_house_basement_bulb") == 0 ) {
      if (strcmp(szObjectName, "nobulb") == 0)
      {
         ESoundBank::getSound("success")->playSample();
         // On peut maintenant retirer l'objet de l'inventaire
         _lpSceneDirector->DropItem("inv_house_basement_bulb");
         // On met l'ampoule
         SetVisible("bulboff", true);
         SetVisible("nobulb", false);
         // Tache résolue : enlever le bulbe brisé
         ResolveTask("task_house_basement_changebulb");
         return true;
      }
   }
   // Le joueur utilise le marteau sur le vase
   if ( strcmp(szItemName, "inv_house_basement_hammer") == 0 ) {
      if (strcmp(szObjectName, "basement_vase") == 0)
      {
         ESoundBank::getSound("success")->playSample();
         // On peut maintenant retirer l'objet de l'inventaire
         _lpSceneDirector->DropItem("inv_house_basement_hammer");
         SetVisible("basement_vase", false);
         SetVisible("basement_vasebroken", true);
         SetVisible("basement_paper", true);
         _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("HOUSE_BASEMENT_VASEBROKEN_INFO"), "", true);
         // Tache résolue
         ResolveTask("task_house_basement_brokevase");
         return true;
      }
   }
   
   // Le joueur utilise la pince cassée sur le bonzai
   if ( strcmp(szItemName, "inv_house_basement_gripbroken") == 0 ) {
      _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("HOUSE_BASEMENT_ASHLEY_CANNOTWRIST"), "", true);
   }
   // Le joueur utilise la pince sur le bonzai
   if ( strcmp(szItemName, "inv_house_basement_grip") == 0 ) {
      // On doit avoir le modèle pour faire le mini jeu !
      if (_lpSceneDirector->getInventory()->getItemFromInventory("inv_house_basement_sketch")) {
         if (strcmp(szObjectName, "basement_bonzai") == 0)
         {
            EMiniJeuBase *lpMiniJeu = new EMinijeuBonzai();
            _lpSceneDirector->GoToMiniGame("bonzai", lpMiniJeu);
            return true;
         }
      }
      else {
         _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("HOUSE_BASEMENT_ASHLEY_INEEDMODEL"), "", true);
         return true;
      }
   }
   return false;
}
bool Scene_Hell_Vale::ItemUsed(const char *szItemName, const char *szObjectName)
{
   int x,y;

   // Le joueur extrait l'oeil avec le couteau
   if (strcmp(szItemName, "inv_hell_knife") == 0) {
      if (strcmp(szObjectName, "hell_item_eyeball") == 0) {
         _lpSceneDirector->DropItem(szItemName);
         PickupSimple("hell_item_eyeball", "inv_hell_item_eyeball");
         return true;
      }
   }
   // Le joueur utilise le citron sur la fumée
   if (strcmp(szItemName, "inv_hell_lemon") == 0) {
      if (strcmp(szObjectName, "hell_smoke") == 0) {
         ESoundBank::getSound("success")->playSample();
         _lpSceneDirector->DropItem(szItemName);
         _lpSceneDirector->getInventory()->AddItem("hell", "inv_hell_item_fruit");
         return true;
      }
   }
   
   // Distribution des cadeaux !
   
   // Distribution à l'âme n°1
   if (strcmp(szObjectName, "hell_vale_soul_1") == 0) {
      GetObjectPosition("hell_vale_soul_1", x, y, true, false);
      // Le coeur
      if (strcmp(szItemName, "inv_hell_item_heart") == 0) {
         _lpSceneDirector->DropItem(szItemName);
         ResolveTask("task_hell_soul1_give1");
         SoulCheck(1);
         return true;
      }
      // Le trefle
      else if (strcmp(szItemName, "inv_hell_item_clover") == 0) {
         _lpSceneDirector->DropItem(szItemName);
         ResolveTask("task_hell_soul1_give2");
         SoulCheck(1);
         return true;
      }
      // Le scarabée
      else if (strcmp(szItemName, "inv_hell_item_beetle") == 0) {
         _lpSceneDirector->DropItem(szItemName);
         ResolveTask("task_hell_soul1_give3");
         SoulCheck(1);
         return true;
      }
      else {
         _lpSceneDirector->getSequencer()->Talk(szObjectName, x, y, KStr("HELL_SOUL_NOTHKS"), "", false);
         return true;
      }

   }

   // Distribution à l'âme n°2
   if (strcmp(szObjectName, "hell_vale_soul_2") == 0) {
      GetObjectPosition("hell_vale_soul_2", x, y, true, false);
      // L'oeil
      if (strcmp(szItemName, "inv_hell_item_eyeball") == 0) {
         _lpSceneDirector->DropItem(szItemName);
         ResolveTask("task_hell_soul2_give1");
         SoulCheck(2);
         return true;
      }
      // Le corbeau
      else if (strcmp(szItemName, "inv_hell_item_crow") == 0) {
         _lpSceneDirector->DropItem(szItemName);
         ResolveTask("task_hell_soul2_give2");
         SoulCheck(2);
         return true;
      }
      // Le sablier plein
      else if (strcmp(szItemName, "inv_hell_item_hourglass_full") == 0) {
         _lpSceneDirector->DropItem(szItemName);
         ResolveTask("task_hell_soul2_give3");
         SoulCheck(2);
         return true;
      }
      // Le sablier vide
      else if (strcmp(szItemName, "inv_hell_item_hourglass_empty") == 0) {
         _lpSceneDirector->getSequencer()->Talk(szObjectName, x, y, KStr("HELL_SOUL2_EMPTY"), "", false);
         return true;
      }
      else {
         _lpSceneDirector->getSequencer()->Talk(szObjectName, x, y, KStr("HELL_SOUL_NOTHKS"), "", false);
         return true;
      }
   }
   
   // Distribution à l'âme n°3
   if (strcmp(szObjectName, "hell_vale_soul_3") == 0) {
      GetObjectPosition("hell_vale_soul_3", x, y, true, false);
      // L'aile de papillon
      if (strcmp(szItemName, "inv_hell_item_butterfly") == 0) {
         _lpSceneDirector->DropItem(szItemName);
         ResolveTask("task_hell_soul3_give1");
         SoulCheck(3);
         return true;
      }
      // Le fruit pourri
      else if (strcmp(szItemName, "inv_hell_item_fruit") == 0) {
         _lpSceneDirector->DropItem(szItemName);
         ResolveTask("task_hell_soul3_give2");
         SoulCheck(3);
         return true;
      }
      // Le fruit non pourri
      else if (strcmp(szItemName, "inv_hell_lemon") == 0) {
         _lpSceneDirector->getSequencer()->Talk(szObjectName, x, y, KStr("HELL_SOUL3_ROTEN"), "", false);
         return true;
      }
      // La canne
      else if (strcmp(szItemName, "inv_hell_item_cane_full") == 0) {
         _lpSceneDirector->DropItem(szItemName);
         ResolveTask("task_hell_soul3_give3");
         SoulCheck(3);
         return true;
      }
      else {
         _lpSceneDirector->getSequencer()->Talk(szObjectName, x, y, KStr("HELL_SOUL_NOTHKS"), "", false);
         return true;
      }
   }

   return false;
}
bool Scene_Hell_Vale::ObjectClicked(const char *szObjectName, float x, float y)
{
   // Le joueur pioche dans les âmes
   if (strcmp(szObjectName, "hell_vale_hands_zone") == 0) {
      // Il y a déjà une âme
      if (isVisible("hell_vale_soul_1")
          || isVisible("hell_vale_soul_2")
          || isVisible("hell_vale_soul_3")
          ) {
         _lpSceneDirector->getSequencer()->Talk(szObjectName, CHARACTER_POSX, CHARACTER_POSY, KStr("HELL_ASHLEY_ENOUGHSOUL"), "", true, false);
         return true;
      }
      else if (isVisible("hell_vale_soul_richard"))
      {
         _lpSceneDirector->getSequencer()->Talk(szObjectName, CHARACTER_POSX, CHARACTER_POSY, KStr("HELL_ASHLEY_ENDSOUL"), "", true, false);
         return true;
      }
      // On pioche une âme
      else if (TaskResolved("task_hell_foundrichard")) {
         _lpSceneDirector->getSequencer()->Talk(szObjectName, CHARACTER_POSX, CHARACTER_POSY, KStr("HELL_ASHLEY_ENDSOUL"), "", true, false);
      }
      else if (TaskResolved("task_hell_savesoul_3")) {
         RemoveHint("hell","escape","soul");
         ResolveTask("task_hell_meetsoul_richard");
         AddTask("task_hell_reassureseth");
         StartAnimation("soul4anim");
         StartAnimation("soul4rot");
         _lpSceneDirector->getSequencer()->PlaySound(NULL, "ghostcreep");
         _lpSceneDirector->getSequencer()->ShowImage(NULL, "hell_vale_soul_richard", true);
         SoulRequest(4);
      }
      else if (TaskResolved("task_hell_savesoul_2")) {
         ResolveTask("task_hell_meetsoul_3");
         AddTask("task_hell_savesoul_3");
         StartAnimation("soul3anim");
         StartAnimation("soul3rot");
         _lpSceneDirector->getSequencer()->PlaySound(NULL, "ghostcreep");
         _lpSceneDirector->getSequencer()->ShowImage(NULL, "hell_vale_soul_3", true);
         _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_DIALOG, true);
         _lpSceneDirector->getSequencer()->Talk(szObjectName, CHARACTER_POSX, CHARACTER_POSY, KStr("HELL_ASHLEY_NEWSOUL"), "", false, true);
         SoulRequest(3);
      }
      else if (TaskResolved("task_hell_savesoul_1")) {
         ResolveTask("task_hell_meetsoul_2");
         AddTask("task_hell_savesoul_2");
         StartAnimation("soul2anim");
         StartAnimation("soul3rot");
         _lpSceneDirector->getSequencer()->PlaySound(NULL, "ghostcreep");
         _lpSceneDirector->getSequencer()->ShowImage(NULL, "hell_vale_soul_2", true);
         _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_DIALOG, true);
         _lpSceneDirector->getSequencer()->Talk(szObjectName, CHARACTER_POSX, CHARACTER_POSY, KStr("HELL_ASHLEY_NEWSOUL"), "", false, true);
         SoulRequest(2);
      }
      else {
         ResolveTask("task_hell_meetsoul_1");
         AddTask("task_hell_savesoul_1");
         StartAnimation("soul1anim");
         StartAnimation("soul1rot");
         _lpSceneDirector->getSequencer()->PlaySound(NULL, "ghostcreep");
         _lpSceneDirector->getSequencer()->ShowImage(NULL, "hell_vale_soul_1", true);
         _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_DIALOG, true);
         _lpSceneDirector->getSequencer()->Talk(szObjectName, CHARACTER_POSX, CHARACTER_POSY, KStr("HELL_ASHLEY_NEWSOUL"), "", false, true);
         SoulRequest(1);
      }
   }
   
   // Clic sur une âme : rappel
   if (strcmp(szObjectName, "hell_vale_soul_1") == 0) {
      SoulRequest(1);
   }
   else if (strcmp(szObjectName, "hell_vale_soul_2") == 0) {
      SoulRequest(2);
   }
   else if (strcmp(szObjectName, "hell_vale_soul_3") == 0) {
      SoulRequest(3);
   }
   else if (strcmp(szObjectName, "hell_vale_soul_richard") == 0) {
      _lpSceneDirector->getSequencer()->Talk(szObjectName, CHARACTER_POSX, CHARACTER_POSY, KStr("HELL_ASHLEY_ENDSOUL"), "", true, false);
   }
   
   // Objets à ramasser
   if (strcmp(szObjectName, "hell_item_heart") == 0)
   {
      PickupSimple(szObjectName, "inv_hell_item_heart");
      return true;
   }
   if (strcmp(szObjectName, "hell_item_eyeball") == 0)
   {
      _lpSceneDirector->getSequencer()->Talk(szObjectName, CHARACTER_POSX, CHARACTER_POSY, KStr("HELL_ASHLEY_EYEBALL"), "", true, false);
      return true;
   }
   if (strcmp(szObjectName, "hell_item_butterfly") == 0)
   {
      PickupSimple(szObjectName, "inv_hell_item_butterfly");
      return true;
   }
   if (strcmp(szObjectName, "hell_sling_stick") == 0)
   {
      PickupMultiple(szObjectName, "inv_hell_sling_stick",-1);
      return true;
   }
   if ( strncmp(szObjectName, "hell_item_cane[", strlen("hell_item_cane[")) == 0 )
   {
      PickupMultiple(szObjectName, "inv_hell_item_cane_part", 3);
   }
   
   return false;
}
bool Scene_Inca_Passage::ItemUsed(const char *szItemName, const char *szObjectName)
{
   // Le joueur utilise la statuette
   if (strcmp(szItemName, "inv_inca_statuette") == 0) {
      if (strcmp(szObjectName, "inca_passage_blocks_ceiling") == 0) {
         // Ouverture de la vignette
         ESoundBank::getSound("success")->playSample();
         _lpSceneDirector->GoToVignette("vignette_inca_statuette", szObjectName, true);
         return true;
      }
   }
   
   // Le joueur utilise un effet de la statuette
   if (strcmp(szItemName, "statuette_effect_earthquake") == 0) {
      if (strcmp(szObjectName, "inca_passage_blocks_ceiling") == 0) {
         // Lancement de l'effet
         _bEffect = true;
         _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_CINEMATIC, true);
         _lpSceneDirector->getSequencer()->PlaySound(NULL, "rockfall");
         _lpSceneDirector->getSequencer()->EarthQuake(NULL, true);
         _lpSceneDirector->getSequencer()->Wait(NULL, 4000);
         _lpSceneDirector->getSequencer()->SwitchImage(NULL, "inca_passage_blocks_ceiling", "inca_passage_blocks_ground");
         _lpSceneDirector->getSequencer()->EarthQuake(NULL, false);
         ResolveTask("task_inca_fillhole");
         RemoveHint("inca","4artefacts","cross");
         SetVisible("inca_final_zone", true);
         _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_CINEMATIC, false);
         return true;
      }
   }

   char *effectprefix = "statuette_effect_";
   if (strncmp(szItemName, effectprefix,strlen(effectprefix)) == 0) {
         _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("INCA_MAIN_YUMANCO_STATUETTE_NOEFFECT"), "", true, false);
		 return true;
   }

   // Le joueur recompose la fresque3
   if (strcmp(szObjectName, "inca_stairsfresco3_zone") == 0) {
      if (strcmp(szItemName, "inv_inca_cartouche1") == 0) {
         ESoundBank::getSound("success")->playSample();
         _lpSceneDirector->getSequencer()->ShowImage(NULL, "inca_cartouche1_wall", true, true);
         // Mini jeu
         EMiniJeuBase *lpMiniJeu = new EMiniJeuPhotoComp("mg_photocomp_fresque1.png","mg_photocomp_bg_f1.jpg",79,129,"mg_photocomp_artefact_f1.png","mg_photocomp_cartouche_f1.png",458,225);
         _lpSceneDirector->getSequencer()->MiniGame(NULL, "fresco3", lpMiniJeu);
      }
      else {
         // Ca ne va pas ici
         _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("INCA_YUMANCO_NOTHERE"), "", true, false);
      }
      return true;
   }
   
   // Le joueur recompose la fresque4
   if (strcmp(szObjectName, "inca_stairsfresco4_zone") == 0) {
      if (strcmp(szItemName, "inv_inca_cartouche2") == 0) {
         if (TaskResolved("task_inca_fillhole")) {
            ESoundBank::getSound("success")->playSample();
            _lpSceneDirector->getSequencer()->ShowImage(NULL, "inca_cartouche1_wall", true, true);
            // Mini jeu
            EMiniJeuBase *lpMiniJeu = new EMiniJeuPhotoComp("mg_photocomp_fresque2.png","mg_photocomp_bg_f2.jpg",79,129,"mg_photocomp_artefact_f2.png","mg_photocomp_cartouche_f2.png",462,235);
            _lpSceneDirector->getSequencer()->MiniGame(NULL, "fresco4", lpMiniJeu);
         }
         else {
            _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("INCA_YUMANCO_HOLE"), "", true, false);
         }
      }
      else {
         // Ca ne va pas ici
         _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("INCA_YUMANCO_NOTHERE"), "", true, false);
      }
      return true;
   }
   
   return false;
}
Beispiel #24
0
int main(int argc, char *argv[]) {
	ResolveTask(argc, argv);
	return 0;
}
void Scene_Hell_Vale::SoulRequest(int nSoul)
{
   _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_DIALOG, true);
   int x,y;
   switch (nSoul) {
      case 1:
         GetObjectPosition("hell_vale_soul_1", x, y, true, false);
         y = 330; // En dur car comme l'âme est animée, on n'a pas sa position finale à ce stade
         _lpSceneDirector->getSequencer()->Talk("HELL_SOUL_IWOULDLIKE", x, y, KStr("HELL_SOUL_IWOULDLIKE"), "", false);
         // Demande les objets non encore distribués
         if (!TaskResolved("task_hell_soul1_give1")) {
            _lpSceneDirector->getSequencer()->Talk("HELL_SOUL1_GIVE1", x, y, KStr("HELL_SOUL1_GIVE1"), "", false);
         }
         if (!TaskResolved("task_hell_soul1_give2")) {
            _lpSceneDirector->getSequencer()->Talk("HELL_SOUL1_GIVE2", x, y, KStr("HELL_SOUL1_GIVE2"), "", false);
         }
         if (!TaskResolved("task_hell_soul1_give3")) {
            _lpSceneDirector->getSequencer()->Talk("HELL_SOUL1_GIVE3", x, y, KStr("HELL_SOUL1_GIVE3"), "", false);
         }
         break;
      case 2:
         GetObjectPosition("hell_vale_soul_2", x, y, true, false);
         y = 330; // En dur car comme l'âme est animée, on n'a pas sa position finale à ce stade
         _lpSceneDirector->getSequencer()->Talk("HELL_SOUL_IWOULDLIKE", x, y, KStr("HELL_SOUL_IWOULDLIKE"), "", false);
         // Demande les objets non encore distribués
         if (!TaskResolved("task_hell_soul2_give1")) {
            _lpSceneDirector->getSequencer()->Talk("HELL_SOUL2_GIVE1", x, y, KStr("HELL_SOUL2_GIVE1"), "", false);
         }
         if (!TaskResolved("task_hell_soul2_give2")) {
            _lpSceneDirector->getSequencer()->Talk("HELL_SOUL2_GIVE2", x, y, KStr("HELL_SOUL2_GIVE2"), "", false);
         }
         if (!TaskResolved("task_hell_soul2_give3")) {
            _lpSceneDirector->getSequencer()->Talk("HELL_SOUL2_GIVE3", x, y, KStr("HELL_SOUL2_GIVE3"), "", false);
         }
         break;
      case 3:
         GetObjectPosition("hell_vale_soul_3", x, y, true, false);
         y = 330; // En dur car comme l'âme est animée, on n'a pas sa position finale à ce stade
         _lpSceneDirector->getSequencer()->Talk("HELL_SOUL_IWOULDLIKE", x, y, KStr("HELL_SOUL_IWOULDLIKE"), "", false);
         // Demande les objets non encore distribués
         if (!TaskResolved("task_hell_soul3_give1")) {
            _lpSceneDirector->getSequencer()->Talk("HELL_SOUL3_GIVE1", x, y, KStr("HELL_SOUL3_GIVE1"), "", false);
         }
         if (!TaskResolved("task_hell_soul3_give2")) {
            _lpSceneDirector->getSequencer()->Talk("HELL_SOUL3_GIVE2", x, y, KStr("HELL_SOUL3_GIVE2"), "", false);
         }
         if (!TaskResolved("task_hell_soul3_give3")) {
            _lpSceneDirector->getSequencer()->Talk("HELL_SOUL3_GIVE3", x, y, KStr("HELL_SOUL3_GIVE3"), "", false);
         }
         break;
      case 4:
         GetObjectPosition("hell_vale_soul_richard", x, y, true, false);
         y = 330; // En dur car comme l'âme est animée, on n'a pas sa position finale à ce stade
         _lpSceneDirector->getSequencer()->Talk("HELL_SOUL4_IMOK", x, y, KStr("HELL_SOUL4_IMOK"), "", false);
         ResolveTask("task_hell_foundrichard");
         break;
      default:
         break;
   }
   _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_DIALOG, false);
}
void SceneMenu::Check()
{
   EScene::Check();
#ifndef DEBUG
   if (KInput::isPressed(K_VK_M)) {
      _nCheatCode = 1;
   }
   
   if (KInput::isPressed(K_VK_I) && _nCheatCode == 1) {
      _nCheatCode++;
   }

   if (KInput::isPressed(K_VK_L) && (_nCheatCode == 2 || _nCheatCode == 3)) {
      _nCheatCode++;
   }

   if (KInput::isPressed(K_VK_I) && _nCheatCode == 4) {
      _nCheatCode++;
   }

   if (KInput::isPressed(K_VK_O) && _nCheatCode == 5) {
      _nCheatCode++;
   }

   if (KInput::isPressed(K_VK_N) && _nCheatCode == 6) {
      _nCheatCode++;
   }
#else
   _nCheatCode = 7;
#endif
   if (_nCheatCode >= 7) {
      if (KInput::isPressed(K_VK_L_SHIFT))
      {
         if (KInput::isPressed(K_VK_1)) {
            _lpSceneDirector->getSequencer()->GoToScene(NULL, "vignette_hands", "island", false);
            return;
         }
      }
      if (KInput::isPressed(K_VK_L_SHIFT))
      {
         if (KInput::isPressed(K_VK_2)) {
            _lpSceneDirector->getSequencer()->GoToScene(NULL, "vignette_hands", "japan", false);
            return;
         }
      }
      if (KInput::isPressed(K_VK_L_SHIFT))
      {
         if (KInput::isPressed(K_VK_3)) {
            _lpSceneDirector->getSequencer()->GoToScene(NULL, "vignette_hands", "inca", false);
            return;
         }
      }
      if (KInput::isPressed(K_VK_L_SHIFT))
      {
         if (KInput::isPressed(K_VK_4)) {
            _lpSceneDirector->getSequencer()->GoToScene(NULL, "vignette_hands", "middleage", false);
            return;
         }
      }
      if (KInput::isPressed(K_VK_L_SHIFT))
      {
         if (KInput::isPressed(K_VK_5)) {
            _lpSceneDirector->getSequencer()->GoToScene(NULL, "vignette_hands", "egypt", false);
            return;
         }
      }
      
      if (KInput::isPressed(K_VK_0))
      {
         _lpSceneDirector->SetHexagramme(false);
         EInventoryItem::CleanUp(NULL);
         EGlobalBank::CleanUp();
         _lpSceneDirector->getDiaryPtr()->Clean();
         _lpSceneDirector->getMap()->Clean();
         _lpSceneDirector->OpenDialogbox("Clean up done");
      }
      if (KInput::isPressed(K_VK_1))
      {
         _lpSceneDirector->getSequencer()->GoToScene(NULL, "vignette_hands", "island", false);
      }
      if (KInput::isPressed(K_VK_2))
      {
         AddObjective("house","helpnatsumi");
         AddHint("house","helpnatsumi","where");
         if (!_lpSceneDirector->getInventory()->getItemFromInventory("inv_basementkey")) {
            _lpSceneDirector->getInventory()->AddItem("house","inv_basementkey");
         }
         _lpSceneDirector->GoToScene("corridor");
      }
      if (KInput::isPressed(K_VK_3))
      {
         _lpSceneDirector->getSequencer()->GoToScene(NULL, "vignette_hands", "japan", false);
      }
      if (KInput::isPressed(K_VK_4))
      {
         ResolveTask("task_gethexagramme");
         _lpSceneDirector->getSequencer()->GoToScene(NULL, "firstfloor", "house", false);      
      }
      if (KInput::isPressed(K_VK_5))
      {
         _lpSceneDirector->getSequencer()->GoToScene(NULL, "vignette_hands", "middleage", false);
      }
      if (KInput::isPressed(K_VK_6))
      {
         _lpSceneDirector->getSequencer()->GoToScene(NULL, "vignette_hands", "inca", false);
      }
      if (KInput::isPressed(K_VK_7))
      {
         _lpSceneDirector->getSequencer()->GoToScene(NULL, "vignette_hands", "egypt", false);
      }
      if (KInput::isPressed(K_VK_8))
      {
         _lpSceneDirector->getSequencer()->GoToScene(NULL, "hell_mainscreen", "", false);
      }
      if (KInput::isPressed(K_VK_9))
      {
         _lpSceneDirector->getSequencer()->GoToScene(NULL, "house_attic", "", false);
      }
      if (KInput::isPressed(K_VK_RIGHT))
      {
         ResolveTask("task_gethexagramme");
         ResolveObjective("house","helpnatsumi");
         ResolveTask("task_living_discover");
         _lpSceneDirector->getSequencer()->GoToScene(NULL, "house_diningroom", "", false);
      }
      if (KInput::isPressed(K_VK_LEFT))
      {
         _lpSceneDirector->getSequencer()->GoToScene(NULL, "debug_david", "", false);
      }
      if (KInput::isPressed(K_VK_UP))
      {
         _lpSceneDirector->getSequencer()->GoToScene(NULL, "debug_preload", "", false);
      }
   }   
}
void SceneBasement::Init()
{
   StartAnimation("basement_ghostup_anim");
   SetVisible("basement_ghostup", false, true);
   SetupItem("envelope_basement");
   
   // 1ère visite
   if (!TaskResolved("task_house_basementvisit")) {
      ResolveTask("task_house_basementvisit");
      AddObjective("house","basementlight");
      AddHint("house","basementlight","how");
      RemoveHint("house","helpnatsumi","where");
      AddHint("house","helpnatsumi","what");
      AddHint("house","helpnatsumi","nextpaper");
   }
   
   // Lumière éteinte
   if (!TaskResolved("task_house_basement_light")) {
      AddTask("task_house_basement_light");
      SetVisible("darkness", true);
      // Ampoule non réparée
      if (TaskResolved("task_house_basement_changebulb")) {
         SetVisible("bulboff", true);
      }
      else {
         // Bulbe cassé retiré ?
         if (TaskResolved("task_house_basement_removebulb")) {
            SetVisible("bulbbroken", false);
            SetVisible("nobulb", true);
         }else {
            SetVisible("bulbbroken", true);
         }
      }
   }
   else {
      SetVisible("darkness", false);
      SetVisible("lightning", true);
      SetVisible("bulboff", false, true);
      SetVisible("bulbon", true, true);
   }
   
   if (TaskResolved("task_japan_universeresolved")) {
      SetVisible("basement_ghosthidden", false, true);
      SetupItem("basement_rope");
      if (isVisible("basement_rope")) {
         StartEmitter("flake_rope");
      }
   }         

   // La clé
   SetVisible("basement_screwdriver", TestGlobal("basement_screwdriver") == false);
   // La pince
   SetVisible("basement_grip", TestGlobal("basement_grip") == false);
   // Le bonzaï
   if (TaskResolved("task_house_basement_bonzai")) {
      SetVisible("basement_bonzairesolved", true, true);
   } else {
      SetVisible("basement_bonzai", true, true);
   }
   
   // La grille
   if (TaskResolved("task_house_basement_opengrid")) {
      SetVisible("basement_gridopen", true);
   } else {
      SetVisible("basement_gridclosed", true);
   }
   
   // Le charbon
   if (!TaskResolved("task_house_basement_reversecoal")) {
      SetVisible("basement_coalbucketup", true, true);
   } else {
      SetVisible("basement_coalbucketdown", true, true);
   }
   
   // Le vase
   if (!TaskResolved("task_house_basement_brokevase")) {
      SetVisible("basement_vase", true, true);
   } else {
      SetVisible("basement_vasebroken", true, true);
      // Le papier
      SetVisible("basement_paper", TestGlobal("basement_paper") == false);
   }
   
   // La boite à outils
   if (!TaskResolved("task_house_basement_opentoolbox")) {
      SetVisible("basement_toolboxclosed", true, true);
   } else {
      SetVisible("basement_toolboxopen", true, true);
      // Le marteau
      SetVisible("basement_hammer", TestGlobal("basement_hammer") == false);
   }
   
   // Le fantôme
   if (!TaskResolved("task_house_basement_light")) {
      int x,y;
      GetObjectPosition("basement_ghostup", x, y);
      _lpSceneDirector->getSequencer()->ShowEmitter(NULL, "creeping_static_up", true);
      _lpSceneDirector->getSequencer()->PlaySound(NULL, "ghostcreep");
      _lpSceneDirector->getSequencer()->Wait(NULL, 2500);
      _lpSceneDirector->getSequencer()->PlaySound(NULL, "ghostappear");
      _lpSceneDirector->getSequencer()->ShowImage(NULL,"basement_ghostup",true);
      _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("HOUSE_BASEMENT_NATSUMI_LETME"), "", false, false, _lpGhostVoice);
      _lpSceneDirector->getSequencer()->ShowImage(NULL,"basement_ghostup",false);
      _lpSceneDirector->getSequencer()->ShowImage(NULL,"basement_ghosthidden",true);
      _lpSceneDirector->getSequencer()->ShowEmitter(NULL, "creeping_static_up", false);
      _lpSceneDirector->getSequencer()->ShowEmitter(NULL, "creeping_static_hidden", true);
   } else {
      if (!TaskResolved("task_japan_universeresolved")) {
         _lpSceneDirector->getSequencer()->ShowEmitter(NULL, "creeping_static_hidden", true);
         _lpSceneDirector->getSequencer()->ShowImage(NULL,"basement_ghosthidden",true);
      }
   }
   
   // Le croquis
   if (TaskResolved("task_house_basement_givepaper") && TaskResolved("task_house_basement_givecharcoal")) {
      SetVisible("basement_sketch", TestGlobal("basement_sketch") == false);
   }
   
   // On revient de l'univers
   if (getAdditionalName() == "backfrombeyond") {
      int x,y;
      x = 1024/2;
      y = 768/2;
      SetVisible("black", true, true);
      _lpSceneDirector->getSequencer()->ShowEmitter(NULL, "creeping_static_up", true);
      _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_CINEMATIC, true);
      _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("JAPAN_NATSUMI_HOUSEEPILOG1"), "", false, false, _lpGhostVoice);
      _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("JAPAN_NATSUMI_HOUSEEPILOG2"), "", false, false, _lpGhostVoice);
      _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("JAPAN_NATSUMI_HOUSEEPILOG3"), "", false, false, _lpGhostVoice);
      _lpSceneDirector->getSequencer()->PlaySound(NULL, "ghostgone");
      _lpSceneDirector->getSequencer()->GotoVideo(NULL, "videos/reveil.ogv","frombeyond");
      SetupItem("basement_rope");
      StartEmitter("flake_rope");
      _lpSceneDirector->getSequencer()->ShowImage(NULL, "black", false);
      _lpSceneDirector->getSequencer()->ShowEmitter(NULL, "creeping_static_up", false);
      _lpSceneDirector->getSequencer()->Wait(NULL, 2000);
      _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_CINEMATIC, false);
      ResolveTask("task_freeghost_done_japan");
      AddObjective("house","freemurray");
      AddHint("house","freemurray","where");
      _lpSceneDirector->getDiaryPtr()->beginCreatePage();
      _lpSceneDirector->getDiaryPtr()->addImageToPage("diary_basement2.png");
      _lpSceneDirector->getDiaryPtr()->addStringToPage("DIARY_BASEMENT2", FONT_DIARY_1, 0, 0);
      _lpSceneDirector->getDiaryPtr()->endCreatePage();
      return;
   }
   
   // Allumage
   if (getAdditionalName() == "light") {
      // On provoque l'apparition de Natsumi
      ObjectClicked("basement_ghosthidden", 0, 0);
      _lpSceneDirector->getDiaryPtr()->beginCreatePage();
      _lpSceneDirector->getDiaryPtr()->addImageToPage("diary_basement1.png");
      _lpSceneDirector->getDiaryPtr()->addStringToPage("DIARY_BASEMENT1", FONT_DIARY_1, 0, 0);
      _lpSceneDirector->getDiaryPtr()->endCreatePage();
   }
   
   if (getAdditionalName() == "completed") {
      BasementGoforUniverse();
      return;
   }   
   
   // On force le passage à l'univers, en cas de plantage/quit prématuré entre la scène et l'univers
   if (TaskResolved("task_japan_prologcompleted") && !TaskResolved("task_japan_universeresolved")) {
      BasementGoforUniverse();
      return;
   }
   
   // On a tout terminé
   if ( TaskResolved("task_japan_universeresolved") && TestGlobal("basement_rope")) {
      _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("GLOBAL_ASHLEY_FINISHED"), "", true);
      return;
   }
}
bool Scene_Middleage_Mainscreen::ItemUsed(const char *szItemName, const char *szObjectName)
{
   if (strcmp(szItemName, "inv_middleage_sickle") == 0) {
      if (strcmp(szObjectName, "middleage_oak_zone") == 0) {
         if (!TaskResolved("task_middleage_getcork")) {
            ResolveTask("task_middleage_getcork");
            PickupMultiple("middleage_oak_zone", "inv_middleage_cork",-1);
            SetVisible("middleage_oak_zone", false);
            return true;
         }
         else {
            _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("MIDDLEAGE_MONK_ALREADY"), "", true, false);
            return true;
         }
      }

      if (strcmp(szObjectName, "middleage_ginkgo_zone") == 0) {
         if (!TaskResolved("task_middleage_gather_ginkgo")) {
            EMiniJeuBase *lpMiniJeu = new EMiniJeuMemoryPlant();
			((EMiniJeuMemoryPlant *)lpMiniJeu)->SetVariation(0);
            _lpSceneDirector->GoToMiniGame("ginkgo", lpMiniJeu);
            return true;
         }
         else if (TaskResolved("task_middleage_gather_ginkgo")) {
            _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("MIDDLEAGE_MONK_ALREADY"), "", true, false);
            return true;
         }
      }

      if (strcmp(szObjectName, "middleage_rue_zone") == 0) {
         if (!TaskResolved("task_middleage_gather_rue")) {
            EMiniJeuBase *lpMiniJeu = new EMiniJeuMemoryPlant();
			((EMiniJeuMemoryPlant *)lpMiniJeu)->SetVariation(1);
            _lpSceneDirector->GoToMiniGame("rue", lpMiniJeu);
            return true;
         }
         else if (TaskResolved("task_middleage_gather_rue")) {
            _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("MIDDLEAGE_MONK_ALREADY"), "", true, false);
            return true;
         }      
      }

      if (strcmp(szObjectName, "middleage_aneth_zone") == 0) {
         if (!TaskResolved("task_middleage_gather_dill")) {
            SetVisible("middleage_aneth_zone", false);
            PickupSimple("middleage_aneth_img", "inv_middleage_dill");
            ResolveTask("task_middleage_gather_dill");
            return true;
         }
         else if (TaskResolved("task_middleage_gather_dill")) {
            _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("MIDDLEAGE_MONK_ALREADY"), "", true, false);
            return true;
         }
      }
      
      if (strcmp(szObjectName, "middleage_cerfeuil_zone") == 0) {
         if (!TaskResolved("task_middleage_gather_chervil")) {
            SetVisible("middleage_cerfeuil_zone", false);
            PickupSimple("middleage_cerfeuil_img", "inv_middleage_chervil");
            ResolveTask("task_middleage_gather_chervil");
            return true;
         }
         else if (TaskResolved("task_middleage_gather_chervil")) {
            _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("MIDDLEAGE_MONK_ALREADY"), "", true, false);
            return true;
         }      
      }
      
      if (strcmp(szObjectName, "middleage_ail_zone") == 0) {
         if (!TaskResolved("task_middleage_gather_garlic")) {
            EMiniJeuBase *lpMiniJeu = new EMiniJeuMemoryPlant();
			((EMiniJeuMemoryPlant *)lpMiniJeu)->SetVariation(1);
            _lpSceneDirector->GoToMiniGame("ail", lpMiniJeu);
            return true;
         }
         else if (TaskResolved("task_middleage_gather_garlic")) {
            _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("MIDDLEAGE_MONK_ALREADY"), "", true, false);
            return true;
         }      
      }
      
      if (strcmp(szObjectName, "middleage_pavot_zone") == 0) {
         if (!TaskResolved("task_middleage_gather_poppy")) {
            EMiniJeuBase *lpMiniJeu = new EMiniJeuMemoryPlant();
			((EMiniJeuMemoryPlant *)lpMiniJeu)->SetVariation(2);
            _lpSceneDirector->GoToMiniGame("pavot", lpMiniJeu);
            return true;
         }
         else if (TaskResolved("task_middleage_gather_poppy")) {
            _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("MIDDLEAGE_MONK_ALREADY"), "", true, false);
            return true;
         }
      }
      
      if (strcmp(szObjectName, "middleage_fenouil_zone") == 0) {
         if (!TaskResolved("task_middleage_gather_fennel")) {
            SetVisible("middleage_fenouil_zone", false);
            PickupSimple("middleage_fenouil_img", "inv_middleage_fennel");
            ResolveTask("task_middleage_gather_fennel");
            return true;
         }
         else if (TaskResolved("task_middleage_gather_fennel")) {
            _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("MIDDLEAGE_MONK_ALREADY"), "", true, false);
            return true;
         }
      }
      
      if (strcmp(szObjectName, "middleage_millepertuis_zone") == 0) {
         if (!TaskResolved("task_middleage_gather_wort")) {
            SetVisible("middleage_millepertuis_zone", false);
            PickupSimple("middleage_millepertuis_img", "inv_middleage_wort");
            ResolveTask("task_middleage_gather_wort");
            return true;
         }
         else if (TaskResolved("task_middleage_gather_wort")) {
            _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("MIDDLEAGE_MONK_ALREADY"), "", true, false);
            return true;
         }
      }
      
   }
   
   return false;
}
bool Scene_Inca_Mainscreen::ItemUsed(const char *szItemName, const char *szObjectName)
{
   // Le joueur donne la lance réparée au garde
   if (strcmp(szItemName, "inv_inca_spearrepaired") == 0) {
      if (strcmp(szObjectName, "inca_main_guard_nospear") == 0) {
         _lpSceneDirector->DropItem(szItemName);
         ESoundBank::getSound("success")->playSample();
         ResolveTask("task_inca_givespear");
         int x,y;
         GetObjectPosition("inca_main_guard_spear", x, y, true, false);
         // Le garde reçoit la lance
         _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_CINEMATIC, true);
         _lpSceneDirector->getSequencer()->SwitchImage(NULL, "inca_main_guard_nospear", "inca_main_guard_spear");
         if (TestGlobal("__mode_adventure__")) _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("INCA_GUARD_RITUAL1"), "", false);
         _lpSceneDirector->getSequencer()->SwitchImage(NULL, "inca_main_guard_spear", "inca_main_guard_prey");
         _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("INCA_GUARD_RITUAL2"), "", false);
         _lpSceneDirector->getSequencer()->SwitchImage(NULL, "inca_main_guard_prey", "inca_main_guard_spear");
         if (TestGlobal("__mode_adventure__")) _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_CINEMATIC, false);
         if (TestGlobal("__mode_adventure__")) _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_DIALOG, true);
         _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("INCA_GUARD_RITUAL3"), "", false);
         if (TestGlobal("__mode_adventure__")) _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("INCA_GUARD_RITUAL4"), "", false);
         if (TestGlobal("__mode_adventure__")) _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("INCA_GUARD_RITUAL5"), "", false);
         _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("INCA_GUARD_RITUAL6"), "", false);
         if (TestGlobal("__mode_adventure__")) _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("INCA_YUMANCO_HOWENTER"), "", false, true);
         if (TestGlobal("__mode_adventure__")) _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("INCA_GUARD_RITUAL7"), "", false);
         if (TestGlobal("__mode_adventure__")) _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("INCA_GUARD_RITUAL8"), "", false);
         if (TestGlobal("__mode_adventure__")) _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_DIALOG, false);
         _lpSceneDirector->getSequencer()->NarrationMode(NULL, SEQUENCE_NARRATION_CINEMATIC, false);
         AddTask("task_inca_opendoor");
         AddTask("task_inca_getartefacts");
         ResolveObjective("inca","spear");
         AddObjective("inca","enter");
         AddHint("inca","enter","how");
         return true;
      }
   }

   // Le joueur donne la lance réparée au garde
   if (strcmp(szItemName, "inv_inca_spearbroken") == 0) {
      if (strcmp(szObjectName, "inca_main_guard_nospear") == 0) {
         int x,y;
         GetObjectPosition("inca_main_guard_spear", x, y, true, false);
         // Le garde n'en veut pas
         _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("INCA_GUARD_SPEARBROKEN"), "", false);
         return true;
      }
   }

   // Le joueur utilise la statuette
   if (strcmp(szItemName, "inv_inca_statuette") == 0) {
      if (strcmp(szObjectName, "inca_main_door") == 0) {
         if (!TaskResolved("task_inca_givespear")) {
            int x,y;
            GetObjectPosition("inca_main_guard_nospear", x, y, true, false);
            _lpSceneDirector->getSequencer()->Talk(NULL, x, y, KStr("INCA_GUARD_REFUSE"), "", true);
         }
         else {
            // Ouverture de la vignette
            ESoundBank::getSound("success")->playSample();
            _lpSceneDirector->GoToVignette("vignette_inca_statuette", szObjectName, true);
         }
         return true;
      }
   }
   
   // Le joueur utilise un effet de la statuette
   if (strcmp(szItemName, "statuette_effect_raise") == 0) {
      if (strcmp(szObjectName, "inca_main_door") == 0) {
         // Lancement de l'effet
         StartEffect("raise_door");
         return true;
      }
   }

   char *effectprefix = "statuette_effect_";
   if (strncmp(szItemName, effectprefix,strlen(effectprefix)) == 0) {
         _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("INCA_MAIN_YUMANCO_STATUETTE_NOEFFECT"), "", true, false);
		 return true;
   }
   return false;
}
bool SceneBasement::ObjectClicked(const char *szObjectName, float x, float y)
{
   // Interrupteur
   if ( strcmp(szObjectName, "switch") == 0)
   {
      if (!TaskResolved("task_house_basement_changebulb")) {
         _lpSceneDirector->getSequencer()->VoiceOver(szObjectName, KStr("HOUSE_BASEMENT_ASHLEY_BULBBROK"),"");
      } else {
         if (TaskResolved("task_house_basement_light")) {
            _lpSceneDirector->getSequencer()->VoiceOver(szObjectName, KStr("HOUSE_BASEMENT_ASHLEY_LIGHT"),"");
         } else {
            ESoundBank::getSound("reveal")->playSample();
            ResolveObjective("house","basementlight");
            ResolveTask("task_house_basement_light");
            AddTask("task_house_basement_natsumineed");
            setAdditionalName("light");
            Init();
         }
      }

      return true;
   }
   if ( strcmp(szObjectName, "bulbbroken") == 0)
   {
      _lpSceneDirector->getSequencer()->Talk(szObjectName, CHARACTER_POSX, CHARACTER_POSY, KStr("HOUSE_BASEMENT_ASHLEY_CUT"), "", true);         
      return true;
   }
   if ( strcmp(szObjectName, "nobulb") == 0)
   {
      _lpSceneDirector->getSequencer()->Talk(szObjectName, CHARACTER_POSX, CHARACTER_POSY, KStr("HOUSE_BASEMENT_ASHLEY_MISSBULB"), "", true);         
      return true;
   }
   if ( strcmp(szObjectName, "basement_rope") == 0)
   {
      PickupMultiple(szObjectName, "inv_house_rope",-1);
      StopEmitter("flake_rope");
      return true;
   }
   if ( strcmp(szObjectName, "basement_screwdriver") == 0)
   {
      PickupSimple(szObjectName, "inv_house_basement_screwdriver");
      return true;
   }
   if ( strcmp(szObjectName, "basement_grip") == 0)
   {
      PickupMultiple(szObjectName, "inv_house_basement_gripbroken",-1);
//      _lpSceneDirector->getSequencer()->Talk(NULL, CHARACTER_POSX, CHARACTER_POSY, KStr("HOUSE_BASEMENT_ASHLEY_WRISTBROK"), "", true);         
      return true;
   }
   if ( strcmp(szObjectName, "basement_hammer") == 0)
   {
      PickupSimple(szObjectName, "inv_house_basement_hammer");
      return true;
   }
   if ( strcmp(szObjectName, "basement_paper") == 0)
   {
      PickupSimple(szObjectName, "inv_house_basement_paper");
      return true;
   }
   if ( strcmp(szObjectName, "basement_sketch") == 0)
   {
      PickupSimple(szObjectName, "inv_house_basement_sketch");
      _lpSceneDirector->getSequencer()->Talk(szObjectName, CHARACTER_POSX, CHARACTER_POSY, KStr("HOUSE_BASEMENT_ASHLEY_DRAWING"), "", true);         
      return true;
   }
   if ( strcmp(szObjectName, "basement_bonzai") == 0)
   {
      if (TaskResolved("task_house_basement_givepaper") && TaskResolved("task_house_basement_givecharcoal")) {
         _lpSceneDirector->getSequencer()->Talk(szObjectName, CHARACTER_POSX, CHARACTER_POSY, KStr("HOUSE_BASEMENT_ASHLEY_INEED2"), "", true);         
         return true;
      }
   }
   
   if ( strcmp(szObjectName, "envelope_basement") == 0)
   {
      PickupSimple(szObjectName, "ihm_envelope");
      _lpSceneDirector->getDiaryPtr()->beginCreatePage("letterpaper.png");
      _lpSceneDirector->getDiaryPtr()->addStringToPage("ENVELOPE_BASEMENT", FONT_DIARY_2, 0, 0);
      _lpSceneDirector->getDiaryPtr()->addImageToPage("logofraternity.png");
      _lpSceneDirector->getDiaryPtr()->endCreatePage();
      return true;
   }
   
   // Seau de charbon
   if ( strcmp(szObjectName, "basement_coalbucketup") == 0)
   {
      ResolveTask("task_house_basement_reversecoal");
      ESoundBank::getSound("success")->playSample();
      _lpSceneDirector->getSequencer()->ShowImage(NULL,"basement_coalbucketup",false);
      _lpSceneDirector->getSequencer()->ShowImage(NULL,"basement_coalbucketdown",true);
      _lpSceneDirector->getSequencer()->Talk(szObjectName, CHARACTER_POSX, CHARACTER_POSY, KStr("HOUSE_BASEMENT_ASHLEY_OUPSFALL"), "", true);         
   }

   // boite à outils
   if ( strcmp(szObjectName, "basement_toolboxclosed") == 0)
   {
      ResolveTask("task_house_basement_opentoolbox");
      ESoundBank::getSound("success")->playSample();
      _lpSceneDirector->getSequencer()->ShowImage(NULL,"basement_toolboxopen",true);
      _lpSceneDirector->getSequencer()->ShowImage(NULL,"basement_toolboxclosed",false);
      _lpSceneDirector->getSequencer()->ShowImage(NULL,"basement_hammer",true);
   }
   
   // Grille fermée
   if ( strcmp(szObjectName, "basement_gridclosed") == 0 || strcmp(szObjectName, "basement_gridopen") == 0)
   {
      _lpSceneDirector->GoToScene("basement_grid","",false);
      return true;
   }   
   
   // Fantome
   if ( strcmp(szObjectName, "basement_ghosthidden") == 0)
   {
      // 1ère communication
      if (!TaskResolved("task_house_meetnatsumi")) {
         ResolveTask("task_house_meetnatsumi");
      }
      
      int x,y;
      GetObjectPosition("basement_ghostup", x, y);
      _lpSceneDirector->getSequencer()->PlaySound(NULL, "ghostappear");
      _lpSceneDirector->getSequencer()->ShowImage(NULL,"basement_ghosthidden",false);
      _lpSceneDirector->getSequencer()->ShowEmitter(NULL, "creeping_static_hidden", false);
      _lpSceneDirector->getSequencer()->ShowEmitter(NULL, "creeping_static_up", true);
      _lpSceneDirector->getSequencer()->ShowImage(NULL,"basement_ghostup",true);
      // On a donné les 2 objets attendus
      if (TaskResolved("task_house_basement_givepaper") && TaskResolved("task_house_basement_givecharcoal")) {
         _lpSceneDirector->getSequencer()->Talk("canu", x, y, KStr("HOUSE_BASEMENT_NATSUMI_CANYOUBONZ"), "", false, false, _lpGhostVoice);
         _lpTimerGhost->startCounter(0.0f, 1.0f, 0, 10000, K_COUNTER_LINEAR);
      }
      else {
         if (!TaskToResolve("task_house_basement_givepaper")) {
            AddTask("task_house_basement_givepaper");
         }
         if (!TaskToResolve("task_house_basement_givecharcoal")) {
            AddTask("task_house_basement_givecharcoal");
         }
         _lpSceneDirector->getSequencer()->Talk("doyouhave", x, y, KStr("HOUSE_BASEMENT_NATSUMI_DOYOUHAVE"), "", true, false, _lpGhostVoice);
         _lpTimerGhost->startCounter(0.0f, 1.0f, 0, 10000, K_COUNTER_LINEAR);
      }
      return true;
   }   
   if ( strcmp(szObjectName, "basement_ghostup") == 0)
   {
      int x,y;
      GetObjectPosition("basement_ghostup", x, y);
      _lpSceneDirector->getSequencer()->Talk(szObjectName, x, y, KStr("HOUSE_BASEMENT_NATSUMI_DOYOUHAVE2"), "", true, false, _lpGhostVoice);
      return true;
   }
   
#ifdef BFG_TEASING
   if ( strcmp(szObjectName, "gotostairs") == 0 && TaskResolved("task_japan_universeresolved"))
   {
      _lpSceneDirector->getSequencer()->GoToScene(NULL, "teasing", "", false);
      return true;
   }
#endif
   
   return false;
}