Esempio n. 1
0
 // Update is called once per frame
 void Click()
 {
     clicks++;
     if (clicks > 20 && HardMode.Mode && GameManager.gm.player.GetComponent <ModObject>().GetInstalledParts().Contains("PaintYellow"))
     {
         clicks = 0;
         SaveSystem.AddCash(100000);
     }
 }
Esempio n. 2
0
 // Update is called once per frame
 public void Sell()
 {
     if (SaveSystem.GetVehicles().Count > 1)
     {
         SaveSystem.AddCash(CalculatePrice(SaveSystem.GetVehicles()[ids]));
         SaveSystem.RemoveVehicle(ids);
         SellConfirmation.SetActive(false);
     }
 }
Esempio n. 3
0
 public void BuyButton()
 {
     if (CalculatePrice() <= SaveSystem.GetCash())
     {
         SaveSystem.AddCash(-CalculatePrice());
         SaveSystem.AddLog(new Save.LogEntry("ModEditor", $"Bought parts for {target.Name}, $ {CalculatePrice()}"));
         GarageManager.instance.SaveEditedVehicleWithoutExiting();
         BuyMenu.SetActive(false);
     }
 }
Esempio n. 4
0
    // Update is called once per frame
    void OnEnable()
    {
        switch (GameManager.gm.player.reason)
        {
        case DeathReason.Rammed:
            Reason.text = "You have been rammed by police";
            break;

        case DeathReason.Fall:
            Reason.text = "You fell out of map";
            break;

        case DeathReason.Crash:
            Reason.text = "You crashed";
            break;

        case DeathReason.Caught:
            Reason.text = "You have been caught by police";
            break;

        default:
            break;
        }
        highscore   = SaveSystem.GetHighscore(HardMode.Mode);
        Points.text = GameManager.gm.player.Points.ToString();
        if (((int)GameManager.gm.player.Points) > highscore)
        {
            highscore = (int)GameManager.gm.player.Points;

            SaveSystem.SetHighscore(highscore, HardMode.Mode);
            SaveSystem.AddLog(new Save.LogEntry("EndScreen", $"New highscore Hardmode={HardMode.Mode}, {highscore} pts"));
            Highscore.text = $"New highscore: {highscore}";
        }
        else
        {
            Highscore.text = $"Highscore: {highscore}";
        }

        if (HardMode.Mode)
        {
            Cash.text = $"{(int)GameManager.gm.player.Points /10} $";
            SaveSystem.AddCash((int)GameManager.gm.player.Points / 10);
            SaveSystem.AddLog(new Save.LogEntry("EndScreen", $"Added cash: $ {(int)GameManager.gm.player.Points / 10}"));
        }
        else
        {
            Cash.text = $"{(int)GameManager.gm.player.Points / 20} $";
            SaveSystem.AddCash((int)GameManager.gm.player.Points / 20);
            SaveSystem.AddLog(new Save.LogEntry("EndScreen", $"Added cash: $ {(int)GameManager.gm.player.Points / 20}"));
        }
    }
Esempio n. 5
0
    // Update is called once per frame
    public void BuyButton()
    {
        VehicleInfo vehicle = vehicleInfoList[view.SelectedIndex];

        if (SaveSystem.GetCash() >= vehicle.Price)
        {
            Save.Vehicle v = vehicle.GetSaveVehicle();
            SaveSystem.AddVehicle(v);
            SaveSystem.AddCash(-vehicle.Price);
            SaveSystem.AddLog(new Save.LogEntry("Dealer", $"Added car {v.Type}"));
            SaveSystem.SetSelectedVehicleIndex(SaveSystem.GetVehicles().Count - 1);
            GarageManager.instance.CloseDealerMenu();
        }
        else
        {
            Debug.Log("git gud fagit");
        }
    }
Esempio n. 6
0
 // Update is called once per frame
 void Add()
 {
     SaveSystem.AddCash(10000);
 }