From fdd4bc0e45a5bacf34ca00e5bf6711d065b22ac3 Mon Sep 17 00:00:00 2001 From: jeremy Date: Sat, 25 Apr 2020 21:24:48 +0200 Subject: [PATCH] add class random massage --- main.py | 1 + trick.py | 4 +++- tricks/random_message.py | 24 ++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 tricks/random_message.py diff --git a/main.py b/main.py index 25ce2fc..1426436 100755 --- a/main.py +++ b/main.py @@ -7,6 +7,7 @@ from command_helper import CommandHelper from trick import Trick from scenario import intro + class AnonymousGoose: def __init__(self): self.should_exit = False diff --git a/trick.py b/trick.py index 7ff4d46..7a5c11c 100644 --- a/trick.py +++ b/trick.py @@ -34,12 +34,14 @@ class Trick(ABC): from tricks.anim_ascii import AnimAsciiTrick from tricks.reflection import ReflectionTrick from tricks.rotation import RotationTrick + from tricks.random_message import RandomMessage tricks = [ LaughingGooseTrick, GlorifyGooseTrick, AnimAsciiTrick, ReflectionTrick, - RotationTrick + RotationTrick, + RandomMessage ] return random.choice(tricks)() diff --git a/tricks/random_message.py b/tricks/random_message.py new file mode 100644 index 0000000..d036b7c --- /dev/null +++ b/tricks/random_message.py @@ -0,0 +1,24 @@ +from data.scenario_resource import random_text +from term_utils import Term +from trick import Trick +import random + +class RandomMessage(Trick): + @property + def name(self): + return "RandomMessage" + + @property + def delay(self): + return 5 + + @property + def is_reversible(self): + return False + + def revert(self): + pass + + def run(self): + randtext_term = Term() + randtext_term.print_creepy(random.choice(random_text))