Пример #1
0
        //this is a generic text describing why you cannot equip an armor, based on the current upper and lower garments you have on.
        //This is modified to work with any cases, though it's highly likely you'll want more control than this if you have weird edge cases.
        protected string GenericCantWearWithUnderGarmentText(UpperGarmentBase upperGarment, LowerGarmentBase lowerGarment, bool allowsUpperGarment = false, bool allowsLowerGarment = false)
        {
            if (allowsUpperGarment && allowsLowerGarment)
            {
                return("");
            }
            bool both = !allowsLowerGarment && !allowsLowerGarment;

            StringBuilder sb = new StringBuilder();

            sb.Append("It would be awkward to put on the" + ItemDescription() + " when you're currently wearing ");

            if (!UpperGarmentBase.IsNullOrNothing(upperGarment) && !allowsUpperGarment)
            {
                sb.Append(upperGarment.ItemDescription(1, true));
            }

            if (!LowerGarmentBase.IsNullOrNothing(lowerGarment) && !allowsLowerGarment)
            {
                if (both)
                {
                    sb.Append(" and ");
                }
                sb.Append(lowerGarment.ItemDescription(1, true));
            }

            sb.Append(". You should consider removing " + (both ? "them" : "it") + ". You put the " + ItemDescription() + " back into your inventory.");

            return(sb.ToString());
        }
Пример #2
0
 public override bool CanWearWithUpperGarment(Creature wearer, UpperGarmentBase upperGarment, out string whyNot)
 {
     if (!UpperGarmentBase.IsNullOrNothing(upperGarment))
     {
         whyNot = GenericArmorIncompatText(upperGarment);
         return(false);
     }
     else
     {
         whyNot = null;
         return(true);
     }
 }
Пример #3
0
 public override bool CanWearWithUpperGarment(Creature wearer, UpperGarmentBase upperGarment, out string whyNot)
 {
     //means you're pure enough to pull it off, or you're not wearing any lower garments.
     if (SupportsUndergarment(wearer) || UpperGarmentBase.IsNullOrNothing(upperGarment))
     {
         whyNot = null;
         return(true);
     }
     else
     {
         whyNot = NotPureEnough(wearer, upperGarment.ItemName());
         return(false);
     }
 }
Пример #4
0
        //This is virtual in case you want to alter how the checks are done or provide some random text explaining why it fails so hard.
        public virtual bool CanWearWithUndergarments(Creature wearer, UpperGarmentBase upperGarment, LowerGarmentBase lowerGarment, out string whyNot)
        {
            bool allowsUpper = CanWearWithUpperGarment(wearer, upperGarment, out string _);
            bool allowsLower = CanWearWithLowerGarment(wearer, lowerGarment, out string _);

            if (allowsLower && allowsUpper)
            {
                whyNot = null;
                return(true);
            }
            else
            {
                whyNot = GenericCantWearWithUnderGarmentText(upperGarment, lowerGarment, allowsUpper, allowsLower);
                return(false);
            }
        }
Пример #5
0
        public override bool CanWearWithUndergarments(Creature wearer, UpperGarmentBase upperGarment, LowerGarmentBase lowerGarment, out string whyNot)
        {
            bool wornUpper = !UpperGarmentBase.IsNullOrNothing(upperGarment);
            bool wornLower = !LowerGarmentBase.IsNullOrNothing(lowerGarment);

            if (!wearer.IsPureEnough(10) && (wornUpper || wornLower))
            {
                string output = "";
                output = "You could put on your " + ItemName() + " when you're currently wearing your ";
                if (wornUpper)
                {
                    output   += wearer.upperGarment.ItemName();
                    wornUpper = true;
                }
                if (wornLower)
                {
                    if (wornUpper)
                    {
                        output += " and ";
                    }
                    output += wearer.lowerGarment.ItemName();
                }
                output += ", but you get the feeling it'd be like, super uncomfortable. What's the point of wearing such a sexy, " +
                          "revealing outfit if you're just gonna cover it all up? You're not a prude!";

                if (wearer.IsPureEnough(25))
                {
                    output += " Wait a minute, did you really think that? This place must really be getting to you.";
                }

                whyNot = output;
                return(false);
            }
            else
            {
                whyNot = null;
                return(true);
            }
        }
 public override bool Equals(UpperGarmentBase other)
 {
     return(other is GenericUpperGarment generic && generic.uniqueID == uniqueID);
 }
Пример #7
0
 public override bool CanWearWithUpperGarment(Creature wearer, UpperGarmentBase upperGarment, out string whyNot)
 {
     whyNot = GenericArmorIncompatText(upperGarment);
     return(false);
 }
Пример #8
0
 public virtual bool CanWearWithUpperGarment(Creature wearer, UpperGarmentBase upperGarment, out string whyNot)
 {
     whyNot = null;
     return(true);
 }
Пример #9
0
 //the following are provided as a sort of generic text describing why you cannot equip a lower or upper garment with this armor.
 //when can wear with upper/lower garment is overridden to return false, these can be used instead of writing your own, though if you have edge cases that forced you to
 //override the normal can use, you will likely want to not use these, either.
 protected string GenericArmorIncompatText(UpperGarmentBase upperGarment)
 {
     return("It would be awkward to wear this with the " + ItemDescription() + " you're already wearing. If you want to wear this, " +
            "you'll need to remove it first.");
 }