Beispiel #1
0
 public void TryUserBonus(TryUseBonusEvent e, EnergyBonusNode bonus, [JoinAll] SingleNode <Dialogs60Component> dialogs)
 {
     if (e.AvailableBonusEnergy >= bonus.energyBonus.Bonus)
     {
         base.ScheduleEvent <UseBonusEvent>(bonus);
     }
     else if (e.AvailableBonusEnergy <= 0L)
     {
         dialogs.component.Get <FullEnergyDialog>().Show();
     }
     else
     {
         CantUseAllEnergyBonusDialog dialog2 = dialogs.component.Get <CantUseAllEnergyBonusDialog>();
         dialog2.SetEnergyCount(e.AvailableBonusEnergy);
         dialog2.Show(new List <Animator>());
     }
 }
Beispiel #2
0
 public void CountAvailableBonusEnergy(TryUseBonusEvent e, EnergyBonusNode bonus1, [JoinByUser] UserNode user, [JoinByLeague] LeagueNode league, EnergyBonusNode bonus2, [JoinByUser] EnergyUserItemNode energy)
 {
     e.AvailableBonusEnergy = league.leagueEnergyConfig.Capacity - energy.userItemCounter.Count;
 }