public void OnOfferPurchased() { offerState = SpecialOfferState.Completed; Player.AddPlayerCash(new CurrencyNumber(PlayerCashReward)); Player.AddCompanyCash(ComplanyCashReward); Player.AddCoins(CoinsReward); }
private void UpdateOfferState() { if (IsLoaded && GameMode.IsGame) { switch (offerState) { case SpecialOfferState.NotStarted: { if (Planets.CurrentPlanetId.Id != PlanetConst.EARTH_ID) { if (PlanetStartInterval > FiveMinutes) { StartOffer(); } } } break; case SpecialOfferState.Started: { if (IsExpired) { offerState = SpecialOfferState.Expired; } } break; case SpecialOfferState.Expired: { } break; case SpecialOfferState.Completed: { } break; } } }
private void OnPlanetStateChanged(PlanetState oldState, PlanetState newState, PlanetInfo planet) { if (IsLoaded) { if (newState == PlanetState.Opened && planet.Id != PlanetConst.EARTH_ID) { planetStartTime = Services.TimeService.UnixTimeInt; offerState = SpecialOfferState.NotStarted; } } }
public override void LoadSave(object obj) { SpecialOfferServiceSave save = obj as SpecialOfferServiceSave; if (save != null) { expireTime = save.expireTime; planetStartTime = save.planetStartTime; offerState = save.offerState; IsLoaded = true; } else { LoadDefaults(); } }
public override void LoadDefaults() { StartCoroutine(LoadDefaultPlanetStartTime()); offerState = SpecialOfferState.NotStarted; IsLoaded = true; }
private void StartOffer() { offerState = SpecialOfferState.Started; expireTime = Services.TimeService.UnixTimeInt + 600; StartCoroutine(ShowOfferViewImpl()); }