public void onClick() { if (this.CellButton.ActiveType == CellButtonType.Drink) { Player player = GameLogic.Binder.GameState.Player; CharacterInstance activeCharacter = player.ActiveCharacter; switch (this.PotionType) { case GameLogic.PotionType.Frenzy: if (activeCharacter.Inventory.FrenzyPotions > 0) { CmdGainPotions.ExecuteStatic(activeCharacter, GameLogic.PotionType.Frenzy, -1); GameLogic.Binder.FrenzySystem.activateFrenzy(); this.m_remaining = Mathf.Max(this.m_remaining - 1, 0); this.refresh(this.m_remaining, false); } break; case GameLogic.PotionType.Boss: if (activeCharacter.Inventory.BossPotions > 0) { CmdGainPotions.ExecuteStatic(activeCharacter, GameLogic.PotionType.Boss, -1); CmdStartBossTrain.ExecuteStatic(GameLogic.Binder.GameState.ActiveDungeon, player, App.Binder.ConfigMeta.BOSS_POTION_NUM_BOSSES); this.m_remaining = Mathf.Max(this.m_remaining - 1, 0); this.refresh(this.m_remaining, false); } break; } } }
public override bool onMainButtonClicked() { if (PlayerView.Binder.MenuSystem.InTransition) { return(false); } Player player = GameLogic.Binder.GameState.Player; CmdGainPotions.ExecuteStatic(player.ActiveCharacter, PotionType.Boss, -1); CmdStartBossTrain.ExecuteStatic(GameLogic.Binder.GameState.ActiveDungeon, player, App.Binder.ConfigMeta.BOSS_POTION_NUM_BOSSES); PlayerView.Binder.MenuSystem.returnToPreviousMenu(true); return(true); }