event better

This commit is contained in:
jeremy
2020-04-26 18:16:48 +02:00
parent 02c063fa55
commit 393517ada5
3 changed files with 18 additions and 21 deletions
+2
View File
@@ -6,6 +6,7 @@ import sys
from term_utils import Term
from command_helper import CommandHelper
from trick import Trick
from tricks.scenario import Scenario
class AnonymousGoose:
@@ -56,6 +57,7 @@ class AnonymousGoose:
if __name__ == "__main__":
disable_x = len(sys.argv) == 2 and sys.argv[1] == '-x'
Scenario().run()
goose = AnonymousGoose()
goose.run(disable_x)
goose.stop()
+9 -1
View File
@@ -1,6 +1,14 @@
intro_text = "\n>$ You have been hacked\n>$ try to escape from the bad virus\n>$ "
event1_text = "try to ESCAPE"
event1_text = "I'm hackeGoose, your computer is mine"
event2_text = "If only you knew the tricks......."
event3_text = "Dont try to stop me, you're to bad"
event4_text = "you can stop me but you don't know how..."
event = [intro_text, event1_text, event2_text, event3_text, event4_text]
random_text = [
"All your base are belong to us",
+7 -20
View File
@@ -1,24 +1,16 @@
from trick import Trick
from tricks.data.scenario_resource import intro_text
from tricks.data.scenario_resource import event1_text
from tricks.data.scenario_resource import event
from term_utils import Term
import time
class Scenario(Trick):
id_scenario = 1
nb_of_scenario = 2
@staticmethod
def intro():
intro_terminal = Term()
intro_terminal.print_creepy(intro_text)
time.sleep(2)
id_scenario = 0
@staticmethod
def event1():
Term()
Term.print_all(event1_text)
def event(text_event):
intro_terminal = Term()
intro_terminal.print_creepy(text_event)
time.sleep(2)
@property
@@ -37,13 +29,8 @@ class Scenario(Trick):
pass
def run(self):
if not Scenario.id_scenario == -1:
if Scenario.id_scenario == 1:
Scenario.intro()
if Scenario.id_scenario == 2:
Scenario.event1()
if not Scenario.id_scenario > len(event):
Scenario.event(event[Scenario.id_scenario])
Scenario.id_scenario += 1
if Scenario.id_scenario > Scenario.nb_of_scenario:
Scenario.id = -1