コード例 #1
0
ファイル: ArmorBase.cs プロジェクト: JustSomeGuy6561/CoCSharp
        //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
        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);
            }
        }