Exemplo n.º 1
0
 public void open(int l)
 {
     if (l == 1)
     {
         setEnableLevel0(true);
         targetX1 = x1Showing;
         levelRef.blockPlayerControls();
     }
     else if (l == 2)
     {
         setEnableLevel1(true);
         targetX2 = x2Showing;
     }
     else if (l == 3)
     {
         setEnableLevel2(true);
         targetX3 = x3Showing;
     }
     level = l;
 }
    public void _wm_checkFerfufloAccess()
    {
        level.blockPlayerControls();

        int correct   = level.retrieveIntValue("FerfufloCorrect");
        int completed = level.retrieveIntValue("FerfufloCompleted");

        Debug.Log("Correct answers: " + correct);
        Debug.Log("Completed answers: " + completed);

        if (correct >= numberOfFerfufloTests)
        {
            level.playSound(openSound);
            level.player.blockControls();
            level.storeBoolValue("FerfuflosDone", true);
            level._wm_alert("Puerta abierta");
            state = 1;
        }
        else
        {
            if (completed >= numberOfFerfufloTests)
            {
                level.playSound(noOpenSound);
                level.player.blockControls();
                level._wm_alert("El código configurado en las tarjetas no es válido. Como medida de seguridad, se han reiniciado las tarjetas.");
                state = 2;
            }
            else
            {
                percent = (int)(((float)level.retrieveIntValue("FerfufloCompleted") / 41.0f) * 100.0f);
                percent = percent > 100 ? 100 : percent;
                level.player.blockControls();
                level.playSound(noOpenSound);
                state = 3;
            }
        }
    }