Update capitalization

This commit is contained in:
Howard Abrams 2025-05-18 22:10:09 -07:00
parent 3e22ea83df
commit eea40a2e7c
3 changed files with 13 additions and 3 deletions

View file

@ -205,7 +205,7 @@ class CmdSay(MuxCommand):
targets = [item for item in self.caller.location.contents if item != self.caller]
to_whom = chars_list(self.lhs, verb) if 'to' in self.switches else ''
full_speech = f"/Me {adverb}{verb}s{to_whom}, \"{for_others}\""
full_speech = f"/me {adverb}{verb}s{to_whom}, \"{for_others}\""
send_emote(self.caller, targets, full_speech, msg_type="say", anonymous_add=None)

View file

@ -96,8 +96,18 @@ class Character(Object, GenderCharacter, ContribRPCharacter):
Capitalizes messages sent to the user.
This just looks better to me.
"""
def capitalize_line(line):
if match(r"^\|[bm][a-z].*", line):
return "The " + line
elif match(r"^\|[A-z][a-z].*", line):
return line[0:1] + line[2].upper() + line[3:]
else:
return line[0].upper() + line[1:]
if text and isinstance(text, str) and len(text) > 0:
text = text[0].upper() + text[1:]
text = capitalize_line(text)
elif text and isinstance(text, tuple):
text = (capitalize_line(text[0]), text[1])
super().msg(text, from_obj=from_obj, session=session, **kwargs)
def create_letter(self):

View file

@ -661,7 +661,7 @@ Nope. Too tall, and just as well. It does not smell very good.
#
@set beast/pet_interested_response = "It keeps its distance, but seems curious about <you>."
#
@set beast/pet_friendly_response = "The << big, ^ huge, ^ large, ^ tremendous, ^ >> << hairy ^ slobbery ^ horned ^ clawed ^ >> << brute ^ beast ^ monster>> << flops ^ rolls >> over << in the grass ^>> as <(you ^ {0} )> <( give ^ gives )> it belly rubs.. ;; The << big, ^ huge, ^ large, ^ tremendous, ^ >> << hairy ^ slobbery ^ horned ^ clawed ^ >> << brute ^ beast ^ monster>> << flops ^ rolls >> over << in the grass ^>> as <(you ^ {0} )> <( rub ^ rubs )> its belly.. ;; <(You ^ {0} )> <( pet ^ pets )> the << big, ^ huge, ^ large, ^ tremendous, ^ >> << hairy ^ slobbery ^ horned ^ clawed ^ >> << brute ^ beast ^ monster>> .. ;; <(You ^ {0} )> <( scratch ^ scratches )> the << nose ^ ears >> of the << big, ^ huge, ^ large, ^ tremendous, ^ >> << hairy ^ slobbery ^ horned ^ clawed ^ >> << brute ^ beast ^ monster>> .. ;; The << big, ^ huge, ^ large, ^ tremendous, ^ >> << hairy ^ slobbery ^ horned ^ clawed ^ >> << brute ^ beast ^ monster>> leans forward as <(you ^ {0} )> <( scratch ^ scratches )> its nose.."
@set beast/pet_friendly_response = "The << big, ^ huge, ^ large, ^ tremendous, ^ >> << hairy ^ slobbery ^ horned ^ clawed ^ >> << brute ^ beast ^ monster>> << flops ^ rolls >> over << in the grass ^>> as <(you ^ {0} )> <( give ^ gives )> it belly rubs.. ;; The << big, ^ huge, ^ large, ^ tremendous, ^ >> << hairy ^ slobbery ^ horned ^ clawed ^ >> << brute ^ beast ^ monster>> << flops ^ rolls >> over << in the grass ^>> as <(you ^ {0} )> <( rub ^ rubs )> its belly.. ;; <(You ^ {0} )> <( pet ^ pets )> the << big, ^ huge, ^ large, ^ tremendous, ^ >> << hairy ^ slobbery ^ horned ^ clawed ^ >> << brute ^ beast ^ monster>> .. ;; <(You ^ {0} )> <( scratch ^ scratches )> the << nose ^ ears >> of the << big, ^ huge, ^ large, ^ tremendous, ^ >> << hairy ^ slobbery ^ horned ^ clawed ^ >> << brute ^ beast ^ monster>> .. ;; The << big, ^ huge, ^ large, ^ tremendous, ^ >> << hairy ^ slobbery ^ horned ^ clawed ^ >> << brute ^ beast ^ monster>> leans forward as <(you ^ {0} )> <( scratch ^ scratches )> its nose."
#
@set beast/pet_ecstatic_response = "While << excited ^ ecstatic ^ squirmy >>, the << big, ^ huge, ^ large, ^ tremendous, ^ >> << hairy ^ slobbery ^ horned ^ clawed ^ >> << brute ^ beast ^ monster>> << lays ^ gets >> down so you can << pet ^ scratch >> << the top of its head ^ the back of its neck ^ its nose ^ the sides of its face >>. It closes its eyes and purrs.. ;; << The squirmy little devil. ^ >> <( You ^ {0} )> << can ^ >> << barely ^ hardly >> scratch the << nose ^ ears ^ neck ^ top of the head >> of the << big, ^ huge, ^ large, ^ tremendous, ^ >> << hairy ^ slobbery ^ horned ^ clawed ^ >> << brute ^ beast ^ monster>> as it << squirms around ^ wriggles it backend >>. It << can hardly ^ can't >> contain its excitement. ;; The << big, ^ huge, ^ large, ^ tremendous, ^ >> << hairy ^ slobbery ^ horned ^ clawed ^ >> << brute ^ beast ^ monster>> wriggles around before << flopping ^ rolling >> over << in the grass ^>> as <(you ^ {0} )> <( give ^ gives )> it belly rubs. ;; The << big, ^ huge, ^ large, ^ tremendous, ^ >> << hairy ^ slobbery ^ horned ^ clawed ^ >> << brute ^ beast ^ monster>> wriggles and squirms excitedly before it << flops ^ rolls >> over << in the grass ^>> as <(you ^ {0} )> <( rub ^ rubs )> its belly."
# Beast:21 ends here