Class: CryptoMania

Inherits:
Object
  • Object
show all
Includes:
FancyText::InstanceMethods
Defined in:
lib/cryptomania.rb

Instance Method Summary collapse

Instance Method Details

#excited_messageObject



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/cryptomania.rb', line 140

def excited_message 
    sleep(2)
    type_writter("
        
        WOOOOOOAHHHHH....looks like a lot has
        changed 🧐🧐.
        
        You sit tight, while the calculations are
        being carried out.
        
        ")
    progressbar("Calculating the profits [:bar]", 
        "

    Calculations Successfull!!
    
        ")
end

#hello_nameObject



72
73
74
75
76
77
78
79
80
81
# File 'lib/cryptomania.rb', line 72

def hello_name
    type_writter("
        Hello, #{Player.all[0].name.upcase},
        Allow me to have the pleasure of choosing 
        the year for you actually...hehe

        Don't worry, you get to choose the month and day.

        ")    
end

#lets_check_on_rates_messageObject



131
132
133
134
135
136
137
138
# File 'lib/cryptomania.rb', line 131

def lets_check_on_rates_message 
    type_writter("
        
        Below is the list of those 15 coins
        from the past and their present rates.
        
        ")
end

#runObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/cryptomania.rb', line 7

def run
    welcome
    Player.new.set_name
    hello_name
    Player.all[0].
    Player.all[0].permission_to_past
    select_currencies_message
    CryptoList.new.list_past_data
    Player.all[0].permission_to_scrape
    InvestedCrypto.show_investments
    InvestedCrypto.add_to_player
    waiting_message
    Player.all[0].set_exit_date
    lets_check_on_rates_message
    CryptoList.new.list_future_data
    InvestedCrypto.set_exit_rate
    excited_message
    InvestedCrypto.set_and_show_total_amount
    Player.all[0].total_balance_message
    win_message
end

#select_currencies_messageObject



83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/cryptomania.rb', line 83

def select_currencies_message 
    type_writter("
        
        Now its time to choose cryptos 
        you want to invest on....
        Please, be mindful, you only have 10,000 AUD
        to change your fortune. 🤑🤑

        Below is a list of 15 top cryptocurrencies 
        of the time and their respective rates in AUD. 


        ")
end

#waiting_messageObject



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/cryptomania.rb', line 98

def waiting_message 
    sleep(2)
    type_writter("
        
        Phewwww....That was a heck of a thing we did.
        
        Now, we play WAITING GAME.......

        WAITING.....

        ....

        WAITING....
        
        ....
        
        Oh WAIT!!
        
        Did you forget we are in past time-line inside
        a simulation game ??
        
        We were allowed to time travel to the past,
        then don't worry, we can also
        time travel to the FUTURE...

        So, lets cut off all the waiting game 
        and see how much money our investments 
        made, SHALL WE??


        ")
end

#welcomeObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/cryptomania.rb', line 30

def welcome 
    pastel = Pastel.new
    puts pastel.red.on_white.bold"
        ==============================
        WELCOME TO THE CRYPTOMANIA
        ==============================
        "
    type_writter("
        Everyone wants to know about the future and travel 
        ahead of time.
        Its genuine, no one wants to to think about the
        past and bother themselves worrying about something
        that cannot be changed. 
        ")
    type_writter("
        But this time, lets take a moment to go back to the
        past and play a simulation game where at the end, 
        you could be either super-rich or not.
        ")
    type_writter("
        You are going to the past, any day between 2018 to 2021.

        At the start of the game, you will be given 10,000 AUD.
        And you will be given a list of Crypto Currencies you 
        can choose to invest on. You can choose as many currencies 
        you like to invest. 

        After that, you can skip to any day in the future between
        the day you chose at first to be on and last day of 2021.

        Then, all the total earnings you have made throughout
        the time through those cryptos you have invested are
        calculated and if you become able to double or more your 
        initial 10,000 AUD, YOU WIN !!


        OK, Lets Start.....


        ")
end

#win_messageObject



159
160
161
162
163
164
165
166
167
168
# File 'lib/cryptomania.rb', line 159

def win_message 
    font = TTY::Font.new(:starwars)
    pastel = Pastel.new

    if Player.all[0].total_balance > 20000
        puts pastel.green.bold(font.write("  YOU WIN!  "))
    else
        puts pastel.red.bold(font.write("  YOU LOSE!  ")) 
    end
end