Ejemplo n.º 1
0
    private void AllLeaksToWaterUIUpdate()
    {
        numLeaksAbove.CurrentValue = holesSurf.Count;
        numLeaksBelow.CurrentValue = holesSubm.Count;

        // "weightTotal.CurrentValue" is perfectly representative of where the water level is relative to the depth the boat can sink by buoyancy/weight.
        if (holesSurf.Count > 0)
        {
            distLeakAbove.CurrentValue = holesSurf[holesSurf.Count - 1].HeightByBuoyancy - weightTotal.CurrentValue;
        }
        // In this case, not a "Leak" above, but rather, the edge of that given boat level. When this hits zero, the entire floor is lost (game over if it's the last/only floor)
        else
        {
            distLeakAbove.CurrentValue = buoyancy.CurrentValue - weightTotal.CurrentValue;
            if (distLeakAbove.CurrentValue >= 0)
            {
                levelMsg.RaiseEvent("Level Flood Imminent!");
            }
            else
            {
                levelMsg.RaiseEvent("Level Lost!");
            }
        }

        if (holesSubm.Count > 0)
        {
            distLeakBelow.CurrentValue = weightTotal.CurrentValue - holesSubm[holesSubm.Count - 1].HeightByBuoyancy;
        }
        else
        {
            distLeakBelow.CurrentValue = -1;
        }
    }
Ejemplo n.º 2
0
    private void LevelEnd(int charLoss)
    {
        if (charLoss <= gameCtrl.GetLevelMaxCharLoss(3))
        {
            levelMsg.RaiseEvent("You a winner! 3 star play!");
        }
        else if (charLoss <= gameCtrl.GetLevelMaxCharLoss(2))
        {
            levelMsg.RaiseEvent("You a winner! 2 star play!");
        }
        else if (charLoss <= gameCtrl.GetLevelMaxCharLoss(1))
        {
            levelMsg.RaiseEvent("You a winner! 1 star play!");
        }
        else
        {
            levelMsg.RaiseEvent("Too many people died!");
        }

        levelActive = false;
    }