Example #1
0
    public override void Apply(AllManagers bman)
    {
        Player.AddGenerationCompanyCash(BalanceGain);
        Debug.Log("AddBalance from BalanceReward::Apply -> " + BalanceGain);

        StatsCollector.Instance[Stats.REWARDS_UNLOCKED]++;
    }
Example #2
0
 void Awake()
 {
     if (instance == null)
     {
         DontDestroyOnLoad(gameObject);
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Example #3
0
    private void Claim()
    {
        if (_claimed)
        {
            return;
        }

        var q    = GameObject.Find("LocalEventManager");
        var bman = q.GetComponent <LocalEventManager>();

        var _allManRef = new AllManagers()
        {
            GameManager = bman.GameManager,
            UIManager   = bman.UIManager
        };

        _reward.Apply(_allManRef);
        _claimed = true;
    }
Example #4
0
    public override void Start()
    {
        _allManRef = new AllManagers()
        {
            GameManager = GameManager,
            //IAPManager = IAPManager,
            UIManager = UIManager
        };

        foreach (var x in Events)
        {
            x.AllManagers = _allManRef;
        }

        if (Services.GameModeService.IsFirstTimeLaunch)
        {
            return;
        }


        var gameSvc = ServiceLocator.Instance.Resolve <IGameService>();

        var serverDT = gameSvc.GetServerDateTime();

        if (IsEventActive)
        {
            var evt     = Events[ActiveEventIndex];
            var evtDiff = serverDT - LastEventUpdate;

            if (evtDiff.TotalSeconds < evt.DurationInSeconds)
            {
                evt.EventStay();
                return;
            }

            IsEventActive    = false;
            ActiveEventIndex = -1;

            evt.EventExit();
            //return; // TODO: check if pass throgh or skip this session
        }
    }
Example #5
0
    public override void Apply(AllManagers bman)
    {
        //Services.GenerationService.Generators.AddX2Time(Services.TimeService.Now.AddMinutes(10));
        //Services.GenerationService.Generators.AddX2Profit(Services.TimeService.Now.AddMinutes(10));

        if (Profit > 1)
        {
            Services.GenerationService.Generators.AddProfitBoost(
                BoostInfo.CreateTimed(BoostIds.RewardTempProfit(), Profit, Services.TimeService.UnixTimeInt + 10 * 60));
        }

        if (Speed > 1)
        {
            Services.GenerationService.Generators.AddTimeBoost(
                BoostInfo.CreateTimed(BoostIds.RewardTempTime(), Speed, Services.TimeService.UnixTimeInt + 10 * 60));
        }
        Player.LegacyPlayerData.Save();

        StatsCollector.Instance[Stats.REWARDS_UNLOCKED]++;
    }
Example #6
0
 public override void Apply(AllManagers bman)
 {
     Services.ManagerService.HireManagerFree(GeneratorIDToManage);
     StatsCollector.Instance[Stats.REWARDS_UNLOCKED]++;
 }
Example #7
0
 public override void Apply(AllManagers bman)
 {
     Services.TransportService.AddLiveUnits(GeneratorID, Count);
     Player.LegacyPlayerData.Save();
     StatsCollector.Instance[Stats.REWARDS_UNLOCKED]++;
 }
Example #8
0
 public override void Apply(AllManagers bman)
 {
     Player.AddCoins(Coins, isFree: true);
     StatsCollector.Instance[Stats.REWARDS_UNLOCKED]++;
 }
Example #9
0
 public abstract void Apply(AllManagers bman);
 public override void Apply(AllManagers bman)
 {
     Player.AddGenerationCompanyCash(Result());
     //Debug.Log("AddBalance from LifetimeBalanceReward::Apply -> " + PercentGain * Services.PlayerService.CompanyCash.Value);
     StatsCollector.Instance[Stats.REWARDS_UNLOCKED]++;
 }