Example #1
0
        public override void ProcessTriggers(TriggersSet triggersSet)
        {
            if (OrchidMod.AlchemistCatalystHotKey.JustPressed && player.itemAnimation == 0)
            {
                for (int i = 0; i < Main.maxInventory; i++)
                {
                    Item item = Main.LocalPlayer.inventory[i];
                    if (item.type != 0)
                    {
                        OrchidModGlobalItem orchidItem = item.GetGlobalItem <OrchidModGlobalItem>();
                        if (orchidItem.alchemistCatalyst)
                        {
                            this.originalSelectedItem   = player.selectedItem;
                            this.autoRevertSelectedItem = true;
                            player.selectedItem         = i;
                            player.controlUseItem       = true;
                            player.ItemCheck(player.whoAmI);
                            return;
                        }
                    }
                }
            }

            if (OrchidMod.AlchemistReactionHotKey.JustPressed)
            {
                if (this.alchemistNbElements < 2 || player.FindBuffIndex(mod.BuffType("ReactionCooldown")) > -1)
                {
                    return;
                }
                else
                {
                    AlchemistHiddenReactionHelper.triggerAlchemistReaction(mod, player, this);
                }
            }
        }
Example #2
0
        public override bool UseItem(Player player)
        {
            OrchidModPlayer modPlayer = player.GetModPlayer <OrchidModPlayer>();

            AlchemistHiddenReactionHelper.triggerAlchemistReaction(mod, player, modPlayer);
            return(true);
        }