Exemplo n.º 1
0
 private protected virtual DisplayBase AttemptToUseItemInCombat(CombatCreature user, CombatCreature opponent, UseItemCombatCallback postItemUseCallback)
 {
     if (!CanUse(user, true, out string whyNot))
     {
         postItemUseCallback(false, whyNot, Author(), this);
         return(null);
     }
     else
     {
         CapacityItem retVal = UseItemInCombat(user, opponent, out string resultsOfUse);
         postItemUseCallback(true, resultsOfUse, Author(), retVal);
         return(null);
     }
 }
Exemplo n.º 2
0
 public DisplayBase UseItemInCombat(CombatCreature user, CombatCreature opponent, UseItemCombatCallback postItemUseCallback)
 {
     return(AttemptToUseItemInCombat(user, opponent, postItemUseCallback));
 }
Exemplo n.º 3
0
 private protected override DisplayBase AttemptToUseItemInCombat(CombatCreature user, CombatCreature opponent, UseItemCombatCallback postItemUseCallback)
 {
     return(AttemptToUseInCombatSafe(user, opponent, (v, x, y, z) => postItemUseCallback(v, x, y, z)));
 }
Exemplo n.º 4
0
        private protected override DisplayBase AttemptToUseItemInCombat(CombatCreature user, CombatCreature opponent, UseItemCombatCallback postItemUseCallback)
        {
            if (!CanUse(user, true, out string whyNot))
            {
                postItemUseCallback(false, whyNot, Author(), this);
                return(null);
            }
            else
            {
                CapacityItem retVal = CombatConsumeItem(user, opponent, out string resultsOfUse, out bool isBadEnd);

                if (!isBadEnd)
                {
                    postItemUseCallback(true, resultsOfUse, Author(), retVal);
                    return(null);
                }
                else
                {
                    throw new System.NotImplementedException();
                }
            }
        }
 protected virtual DisplayBase BuildCombatAwareMenu(CombatCreature consumer, CombatCreature opponent, UseItemCombatCallback postItemUseCallback)
 {
     return(BuildMenu(consumer, (success, results, author, replacement) => postItemUseCallback(success, results, author, replacement)));
 }
 private protected override DisplayBase AttemptToUseItemInCombat(CombatCreature user, CombatCreature opponent, UseItemCombatCallback postItemUseCallback)
 {
     return(BuildCombatAwareMenu(user, opponent, postItemUseCallback));
 }