Exemple #1
0
        private void DoEquip(Creature wearer, UseItemCallbackSafe <ArmorBase> postItemCallback, bool enabled)
        {
            active            = enabled;
            this.userPrompted = true;

            ArmorBase retVal = ChangeEquipment(wearer, out string resultsOfUse);

            postItemCallback(true, resultsOfUse, Author(), retVal);
        }
Exemple #2
0
        private StandardDisplay BuildMenu(Creature wearer, UseItemCallbackSafe <ArmorBase> postItemCallback)
        {
            var display = new StandardDisplay();

            display.OutputText(WearBimboSkirt(wearer));

            display.AddButtonWithToolTip(0, GlobalStrings.ENABLE(), () => DoEquip(wearer, postItemCallback, true), BimboText(true), BimboTitle(true));
            display.AddButtonWithToolTip(1, GlobalStrings.DISABLE(), () => DoEquip(wearer, postItemCallback, false), BimboText(false), BimboTitle(false));

            return(display);
        }
Exemple #3
0
 //you can now give this a menu if you really want. for a valid example, see bimbo skirt.
 protected virtual DisplayBase AttemptToUse(Creature creature, UseItemCallbackSafe <LowerGarmentBase> useItemCallback)
 {
     if (!CanUse(creature, false, out string whyNot))
     {
         useItemCallback(false, whyNot, Author(), this);
         return(null);
     }
     else
     {
         LowerGarmentBase retVal = ChangeEquipment(creature, out string resultsOfUse);
         useItemCallback(true, resultsOfUse, Author(), retVal);
         return(null);
     }
 }
Exemple #4
0
 //safe variant that ensures T->T when item is used. this allows us to enforce inventories that require a certain Base Item Type.
 //for example: the weapon rack will always have weapons; you can't pull a fast one and swap in a non-weapon when equipping a weapon off the rack.
 private protected virtual DisplayBase AttemptToUseSafe(Creature target, UseItemCallbackSafe <T> postItemUseCallbackSafe)
 {
     if (!CanUse(target, false, out string whyNot))
     {
         postItemUseCallbackSafe(false, whyNot, Author(), (T)this);
         return(null);
     }
     else
     {
         T retVal = UseItemSafe(target, out string resultsOfUse);
         postItemUseCallbackSafe(true, resultsOfUse, Author(), retVal);
         return(null);
     }
 }
Exemple #5
0
        //we're going way tf buck to give this a menu when you equip it.

        protected override DisplayBase AttemptToUse(Creature target, UseItemCallbackSafe <ArmorBase> postItemUseCallbackSafe)
        {
            if (!CanUse(target, false, out string whyNot))
            {
                postItemUseCallbackSafe(false, whyNot, Author(), this);
                return(null);
            }
            else
            {
                if (target.intelligence > 20)
                {
                    return(BuildMenu(target, postItemUseCallbackSafe));
                }
                else
                {
                    active = true;
                    ArmorBase retVal = ChangeEquipment(target, out string resultsOfUse);
                    postItemUseCallbackSafe(true, resultsOfUse, Author(), retVal);
                    return(null);
                }
            }
        }
Exemple #6
0
 private protected override DisplayBase AttemptToUseSafe(Creature target, UseItemCallbackSafe <LowerGarmentBase> postItemUseCallbackSafe)
 {
     return(AttemptToUse(target, postItemUseCallbackSafe));
 }
Exemple #7
0
 public DisplayBase UseItemSafe(Creature target, UseItemCallbackSafe <T> postItemUseCallback)
 {
     return(AttemptToUseSafe(target, postItemUseCallback));
 }