|
|
|
@ -44,16 +44,11 @@ class AmbiencePlugin(Plugin):
|
|
|
|
|
def get_reply(self, event, target=None):
|
|
|
|
|
reply = ""
|
|
|
|
|
num_chunks = random.randint(2, 3)
|
|
|
|
|
for i in range(num_chunks):
|
|
|
|
|
reply += self.get_chunk()
|
|
|
|
|
if target is not None or proc(self.config["effect_rate"]):
|
|
|
|
|
effect_index = random.randint(0, num_chunks - 1)
|
|
|
|
|
effect_word = (target or event.source.nick).upper()
|
|
|
|
|
else:
|
|
|
|
|
effect_index = -1
|
|
|
|
|
for i in range(num_chunks):
|
|
|
|
|
chunk = self.get_chunk()
|
|
|
|
|
if i == effect_index:
|
|
|
|
|
chunk = self.apply_effect(chunk, effect_word)
|
|
|
|
|
reply += chunk
|
|
|
|
|
reply = self.apply_effect(reply, effect_word)
|
|
|
|
|
return reply
|
|
|
|
|
|
|
|
|
|
def get_chunk(self):
|
|
|
|
|