diff --git a/typeclasses/pets.py b/typeclasses/pets.py index 3f84293..0ca4558 100755 --- a/typeclasses/pets.py +++ b/typeclasses/pets.py @@ -382,21 +382,25 @@ class Friendly(Pet): self.do_action() def do_action(self): - # Do something based on the highest friendly level is the same area! + # Do something based on the highest friendly level is the same + # area! + msg = None (level, chars) = self.friendly_reaction() - focus = random.choice(chars) + if chars and len(chars) > 0: + focus = random.choice(chars) - if level == Reaction.SCARED: - msg = choices(self.db.scared_actions) - elif level == Reaction.CONCERNED: - msg = choices(self.db.concerned_actions) - elif level == Reaction.INTERESTED: - msg = choices(self.db.interested_actions) - elif level == Reaction.FRIENDLY: - msg = choices(self.db.friendly_actions) - else: - # If we have an ecstatic message, use it otherwise, grab the friendly: - msg = choices(self.db.ecstatic_actions or self.db.friendly_actions) + if level == Reaction.SCARED: + msg = choices(self.db.scared_actions) + elif level == Reaction.CONCERNED: + msg = choices(self.db.concerned_actions) + elif level == Reaction.INTERESTED: + msg = choices(self.db.interested_actions) + elif level == Reaction.FRIENDLY: + msg = choices(self.db.friendly_actions) + else: + # If we have an ecstatic message, use it otherwise, + # grab the friendly: + msg = choices(self.db.ecstatic_actions or self.db.friendly_actions) if msg and msg not in self.db.last_actions: self.db.last_actions.append(msg)