protected override void OnCalculate() { if (DayClass.Hour == 1) { //Jauni darbi AvailableWorks = 5; } if (GameManager.PlayerStatus != PlayerStatus.FREELANCER || Work == null) { return; } if (DayClass.Time >= Work.DueDate) { //TODO: Neizpildīja darbu laikā jāsamazina peļņa Work.Money -= Mathf.CeilToInt(Work.Money * 0.05f); if (Work.Money < 0) { Work.Money = 0; } } Work.DueHours -= Parameters.get(ParamsKind.IQ).Value / Work.IQ; if (Work.DueHours <= 0) { //Darbs izpildīts GameManager.AddMoney(Work.Money); Work = null; GameManager.PlayerStatus = PlayerStatus.NONE; GameManager.GamePaused = true; GUImain.CloseAllDialogs(); } }
public void OtherWork() { if (AvailableWorks < 1) { NoWorks(); return; } AvailableWorks--; Work = FreelancerWork.Create(); RedrawData(); }
public override void OpenWorkDialog() { if (Work == null && AvailableWorks > 0) { Work = FreelancerWork.Create(); } if (Work == null) { NoWorks(); return; } RedrawData(); GUImain.ShowDialog(DialogKind.FREELANCER); }
public static FreelancerWork Create() { int iq = Random.Range(-10, 10) + (int)Parameters.get(ParamsKind.IQ).Value; int hours = Random.Range(100, 300); int money = Random.Range(10, 20) * (iq / 18) * hours ; money = (money/100)*100; FreelancerWork work = new FreelancerWork() { Name = WorkNames.Random(), Hours = hours, Money = money, IQ = iq }; return work; }
public static FreelancerWork Create() { int iq = Random.Range(-10, 10) + (int)Parameters.get(ParamsKind.IQ).Value; int hours = Random.Range(100, 300); int money = Random.Range(10, 20) * (iq / 18) * hours; money = (money / 100) * 100; FreelancerWork work = new FreelancerWork() { Name = WorkNames.Random(), Hours = hours, Money = money, IQ = iq }; return(work); }
protected override void OnCalculate() { if (DayClass.Hour == 1) { //Jauni darbi AvailableWorks = 5; } if (GameManager.PlayerStatus != PlayerStatus.FREELANCER || Work == null) { return; } if (DayClass.Time >= Work.DueDate) { //TODO: Neizpildīja darbu laikā jāsamazina peļņa Work.Money -= Mathf.CeilToInt(Work.Money*0.05f); if (Work.Money < 0) Work.Money = 0; } Work.DueHours -= Parameters.get(ParamsKind.IQ).Value/Work.IQ; if (Work.DueHours <= 0) { //Darbs izpildīts GameManager.AddMoney(Work.Money); Work = null; GameManager.PlayerStatus = PlayerStatus.NONE; GameManager.GamePaused = true; GUImain.CloseAllDialogs(); } }
public void OtherWork() { if (AvailableWorks < 1) { NoWorks(); return; } AvailableWorks --; Work = FreelancerWork.Create(); RedrawData(); }