コード例 #1
0
    public void UpdateTurtle(TurtleUpgradeValues value, int upgradeLevel)
    {
        switch (value)
        {
        case TurtleUpgradeValues.Armor1:
            armorStrength += armorUpgradeAmount;
            break;

        case TurtleUpgradeValues.Armor2:
            break;

        case TurtleUpgradeValues.Armor3:
            break;

        case TurtleUpgradeValues.Movement:
            break;

        case TurtleUpgradeValues.Strength:
            break;

        case TurtleUpgradeValues.Health:
            currentHealth  += healthUpgradeAmount;
            startingHealth += healthUpgradeAmount;
            break;

        case TurtleUpgradeValues.Shield:
            shieldStrength += shieldUpgradeAmount;
            break;
        }
    }
コード例 #2
0
ファイル: GameManager_W.cs プロジェクト: JBWD/LudumDare46
 public int GetCurrentUpgradeLevel(TurtleUpgradeValues upgrade)
 {
     if (turtleUpgrades.ContainsKey(upgrade))
     {
         return(turtleUpgrades[upgrade]);
     }
     return(0);
 }
コード例 #3
0
 public void TurnOffItem(TurtleUpgradeValues turtleUpgrade)
 {
     foreach (EquippedItems item in items)
     {
         if (item.upgradeEnum == turtleUpgrade)
         {
             item.equippedObject.SetActive(false);
         }
     }
 }
コード例 #4
0
ファイル: GameManager_W.cs プロジェクト: JBWD/LudumDare46
 public bool SubtractTurtleUpgrade(TurtleUpgradeValues upgrade, int cost)
 {
     if (turtleUpgrades.ContainsKey(upgrade) && turtleUpgrades[upgrade] > 0)
     {
         turtleUpgrades[upgrade] = turtleUpgrades[upgrade] - 1;
         currency += cost;
         UpdateTurtle(upgrade, turtleUpgrades[upgrade]);
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #5
0
ファイル: GameManager_W.cs プロジェクト: JBWD/LudumDare46
 public bool AddTurtleUpgrade(TurtleUpgradeValues upgrade, int cost)
 {
     if (currency < cost)
     {
         return(false);
     }
     if (turtleUpgrades.ContainsKey(upgrade))
     {
         turtleUpgrades[upgrade] = turtleUpgrades[upgrade] + 1;
     }
     else
     {
         turtleUpgrades.Add(upgrade, 1);
     }
     currency -= cost;
     UpdateTurtle(upgrade, turtleUpgrades[upgrade]);
     Debug.Log("Upgraded Turtle");
     return(true);
 }
コード例 #6
0
ファイル: GameManager_W.cs プロジェクト: JBWD/LudumDare46
 public void UpdateTurtle(TurtleUpgradeValues upgrade, int level)
 {
     turtle.UpdateTurtle(upgrade, level);
 }