Ejemplo n.º 1
0
def chance_card_attack(player, poketer, is_cpu, live):
    attack_bonus = 20
    if is_cpu:
        cities = get_cities()
        city = random.choice(cities)
        emotions = get_emotions()
        emotion = random.choice(emotions)
        x = f"{player.name} chooses a chancecard - attack!"
        if emotion == 'sad':
            y = f"""{player.name} is guessing that people in {city.capitalize()} are sad."""
        else:
            y = f"""{player.name} is guessing that people in {city.capitalize()} are {emotion}."""
        print_frame([x, y], poketer.color, 15)
    else:
        x = f"""
        Chancecard - attack! Choose a city and guess which mood is the most common among its inhabitants. If your guess is
        correct, your Poketers attack-power is incressed by {attack_bonus} p. If your guess is incorrect, your Poketer 
        will loss attack-power by {attack_bonus} p. Good luck!

        """

        print_frame([x], 'white', 15)
        city = choose_city()
        emotion = choose_emotion(city)

    print("\nThis may take a while. Hang on! :)")
    most_frequent_emotions = mood_analysis(city=city, live=live)

    if emotion in most_frequent_emotions:
        poketer.add_attack(attack_bonus)
        w = f"""Correct! In {city.capitalize()} are people mostly {emotion}."""
        x = f"""{poketer.name} recives {attack_bonus} p incressed attack-power!"""
    else:
        poketer.add_attack(-attack_bonus)
        if poketer.get_attack() < 0:
            poketer.set_attack(0)
        w = f"Wrong! In {city.capitalize()} are people mostly {most_frequent_emotions[0]}, not {emotion}!"
        x = f"{poketer.name} loses {attack_bonus} p attack-power."
    y = ""
    z = poketer.get_stats()

    print_frame([w, x, y, z], poketer.color, 15)
    input("\nPress Enter to continue")
Ejemplo n.º 2
0
def intro_card(poketer, is_cpu, live):
    if is_cpu:
        cities = get_cities()
        city = random.choice(cities)
    else:
        x = """
        
        Your Poketer has a certain mood. You now have the opportunity to increase your Poketer's health
        by searching for a city in Sweden where you think the inhabitants are in the same mood as your Poketer.
        The residents' mood is based on what they tweet. The more emotional they are, the more they increase
        your Poketer's health. Good luck!
        
        """
        print_frame([x], 'white', 15)
        city = choose_city()

    print("This may take a while. Hang on! :)")

    mood_score = calc_mood_score(poketer.mood, city, live=live)

    if mood_score is None:
        poketer.add_health(20)
        poketer.add_max_health(20)
    else:
        poketer.add_health(mood_score)
        poketer.add_max_health(mood_score)

    if is_cpu:
        w = f"{poketer.name} selected {city.capitalize()}. Tweet, tweet!"
    else:
        w = f"... Tweet, tweet! Calculates mood for the inhabitants of {city.capitalize()} ..."

    x = f"{poketer.name} increased its health by {mood_score} p! {poketer.catchword}"
    if mood_score is None:
        x = f"Something went wrong but {poketer.name} increased its health by 20 p! {poketer.catchword}"

    y = ""
    z = poketer.get_stats()
    print_frame([w, x, y, z], poketer.color, 15)

    input("\nPress Enter to continue")
Ejemplo n.º 3
0
def chance_card_attack(player, poketer, is_cpu, live):
    attack_bonus = 20
    if is_cpu:
        cities = get_cities()
        city = random.choice(cities)
        emotions = get_emotions()
        emotion = random.choice(emotions)
        x = f"{player.name} valde chanskort - attack!"
        if emotion == 'ledsen':
            y = f"""{player.name} gissar att invånarna i {city.capitalize()} är ledsna."""
        else:
            y = f"""{player.name} gissar att invånarna i {city.capitalize()} är {emotion}a."""
        print_frame([x, y], poketer.color, 15)
    else:
        x = f"""
        Chanskort - attack! Välj en stad och gissa vilket humör som är mest förekommande bland invånarna.
        Gissar du rätt belönas din Poketer1 med {attack_bonus} p i ökad attack-styrka. Gissar du fel bestraffas din Poketer1
        och förlorar {attack_bonus} p i attack-styrka. Lycka till!"""
        print_frame([x], 'white', 15)
        city = choose_city()
        emotion = choose_emotion(city)

    print("\nDet här kan ta en liten stund. Häng kvar! :)")
    most_frequent_emotions = mood_analysis(city=city, live=live)

    if emotion in most_frequent_emotions:
        poketer.add_attack(attack_bonus)
        w = f"""Det var rätt! I {city.capitalize()} är man {emotion}."""
        x = f"""{poketer.name} får {attack_bonus} p i ökad attack-styrka!"""
    else:
        poketer.add_attack(-attack_bonus)
        if poketer.get_attack() < 0:
            poketer.set_attack(0)
        w = f"Det var fel! I {city.capitalize()} är man {most_frequent_emotions[0]}, inte {emotion}!"
        x = f"{poketer.name} bestraffas med {attack_bonus} p i minskad attack-styrka."
    y = ""
    z = poketer.get_stats()

    print_frame([w, x, y, z], poketer.color, 15)
    input("\nTryck enter för att fortsätta")
Ejemplo n.º 4
0
def intro_card(poketer, is_cpu, live):
    if is_cpu:
        cities = get_cities()
        city = random.choice(cities)
    else:
        x = """
        Din Poketer1 har ett visst humör. Du har nu möjligheten att öka din Poketers hälsa
        genom att söka efter en stad i Sverige där du tror att invånarna är på samma humör som din Poketer1.
        Invånarnas humör baseras på vad de twittrar. Ju mer känslosamma de är desto mer ökar
        din Poketers hälsa. Lycka till!"""
        print_frame([x], 'white', 15)
        city = choose_city()

    print("Det här kan ta en liten stund. Häng kvar! :)")

    mood_score = calc_mood_score(poketer.mood, city, live=live)

    if mood_score is None:
        poketer.add_health(20)
        poketer.add_max_health(20)
    else:
        poketer.add_health(mood_score)
        poketer.add_max_health(mood_score)

    if is_cpu:
        w = f"{poketer.name} valde {city.capitalize()}. Tweet, tweet!"
    else:
        w = f"... Tweet, tweet! Beräknar humör för invånarna i {city.capitalize()} ..."

    x = f"{poketer.name} fick {mood_score} p i ökad hälsa! {poketer.catchword}"
    if mood_score is None:
        x = f"Något gick fel men {poketer.name} får 20 p i ökad hälsa! {poketer.catchword}"
    y = ""
    z = poketer.get_stats()
    print_frame([w, x, y, z], poketer.color, 15)

    input("\nTryck enter för att fortsätta")