LVPWB/lvpwb/promos.py

206 lines
9.3 KiB
Python

from __future__ import annotations
import re
from typing import Any
import lvpwb as app
PROMO_OPENERS = [
"The crowd may be watching, but I only have eyes for this fight.",
"You have had your moment. Now the spotlight is mine.",
"All the talking ends when that bell rings.",
"I came here to prove that I belong at the top.",
]
PROMO_CHALLENGES = [
"Bring your best, because I will not make this easy.",
"You will have to do more than make promises tonight.",
"I know exactly what you can do, and I am still not impressed.",
"One mistake is all I need to turn this match around.",
]
PROMO_RETORTS = [
"Keep that confidence. You will need something to hold onto.",
"I have heard it all before. Show me something new in the ring.",
"You can take the last word. I will take the win.",
"When the match is over, everyone will know who meant it.",
]
PROMO_PROFILES: dict[str, dict[str, list[str]]] = {
"rock": {
"openers": [
"Listen up, jabroni {opponent}—The Rock is ready to layeth the smackdown.",
"Finally, {opponent}, The Rock has come back to this ring.",
"The Rock is standing across from {opponent}, and the millions are watching.",
],
"challenges": [
"Know your role and shut your mouth, {opponent}, because The Rock is taking over.",
"Bring it, {opponent}, and The Rock will bring the thunder.",
"Jabroni, you can bring your very best. The Rock will still be better.",
],
"retorts": [
"The Rock says {opponent} is about to get checked into the SmackDown Hotel.",
"The Rock has one thing left to say—know your role, jabroni.",
"The millions have spoken, and they are chanting for The Rock.",
],
},
"austin": {
"openers": [
"Stone Cold is here, and {opponent} can like it or lump it.",
"Austin has one plan for {opponent}—open up a can and get to work.",
"The glass breaks, {opponent} looks nervous, and Stone Cold likes that.",
],
"challenges": [
"That's the bottom line, because Stone Cold said so.",
"You want a fight, {opponent}? Stone Cold doesn't do negotiations.",
"Austin doesn't care about your excuses, {opponent}. Ring the bell.",
],
"retorts": [
"Stone Cold will leave {opponent} seeing stars and hearing that bell.",
"Austin has heard enough. It's time to raise a little hell.",
"And that's the bottom line—{opponent} is in for a rough night.",
],
},
"tripleh": {
"openers": [
"I am the Game, {opponent}, and you are standing on my board.",
"The Game has arrived. {opponent}, you know how this ends.",
"I built my place at the top one victory at a time, {opponent}.",
],
"challenges": [
"You can play your part, {opponent}, while I decide how the story ends.",
"The Game doesn't hand out victories. It takes them.",
"Step into my ring, {opponent}, and find out why they call me the Game.",
],
"retorts": [
"I am the Game, and this is where your luck runs out.",
"When the dust settles, {opponent}, I will still be standing on top.",
"The Game is over when I say it's over.",
],
},
"mankind": {
"openers": ["{opponent} gets the spotlight, and the little guy gets blamed again."],
"challenges": ["{opponent}, they keep persecuting the little guy—but the little guy keeps getting back up."],
"retorts": ["Pain can knock all it wants; I keep getting up before it finds the right door."],
"sayings": [
"People say the early bird gets the worm. I say the worm gets the bird, the bird gets a clock, and the clock gets confused.",
"You can't have your cake and eat it too—so I gave the cake the fork and told the fork to find its way home.",
"A stitch in time saves nine; I lost the needle, tripped over time, and still made it to the ring.",
"They say every cloud has a silver lining. Mine had a receipt, and the rain returned it upside down.",
],
"pain": [
"Pain hit me like a ton of bricks; I apologized to the bricks and kept walking.",
"My body says stop, but I think the sign is facing the other way.",
"The hurt is loud. Little guys learn to sleep through the noise.",
],
},
"undertaker": {
"openers": [
"{opponent}, the lights will fade, and the bell will toll for you.",
"The Undertaker has walked through darkness far worse than this ring.",
],
"challenges": [
"You can run from the shadow, {opponent}, but you cannot outrun it.",
"When the bell tolls, {opponent}, there will be nowhere left to hide.",
],
"retorts": [
"Rest in peace, {opponent}—if you can.",
"The darkness is patient. So am I.",
],
},
"kane": {
"openers": ["The Big Red Machine has been unleashed, {opponent}."],
"challenges": ["You hear the flames, {opponent}? They are calling your name."],
"retorts": ["Kane doesn't back down. Kane brings the fire."],
},
"jericho": {
"openers": ["Welcome to the highlight reel, {opponent}. Chris Jericho is starring."],
"challenges": ["You are looking at the best in the world at what he does."],
"retorts": ["Now take a good look at the first-ever undisputed problem in your way."],
},
"kurtangle": {
"openers": ["I won an Olympic gold medal, {opponent}. What have you got?"],
"challenges": ["It's true, it's true—excellence is about to beat you."],
"retorts": ["You may cheer now, but you will be tapping soon enough."],
},
"vince": {
"openers": ["You are looking at the chairman, {opponent}, and this is my show."],
"challenges": ["You are one bad decision away from hearing, 'You're fired!'"],
"retorts": ["The boss always gets the last word."],
},
"edge": {
"openers": ["{opponent}, this is my chance to steal the spotlight."],
"challenges": ["I will take every shortcut and every opening you leave me."],
"retorts": ["You had your chance. I am taking the moment."],
},
"jeffhardy": {
"openers": ["{opponent}, I will take the risk nobody else dares to take."],
"challenges": ["I will fly, fall, and get right back up if that's what it takes."],
"retorts": ["The risk is worth it when the crowd is on its feet."],
},
"alsnow": {
"openers": ["Head says {opponent} is in trouble. Head is usually right."],
"challenges": ["I have talked this over with Head, and we're ready for you."],
"retorts": ["Head says that went exactly as planned."],
},
}
PROMO_PROFILE_ALIASES = {
"therock": "rock", "rock": "rock",
"stonecoldsteveaustin": "austin", "steveaustin": "austin", "austin": "austin",
"tripleh": "tripleh", "hunterhearsthelmsley": "tripleh",
"mankind": "mankind", "mickfoley": "mankind",
"undertaker": "undertaker", "theundertaker": "undertaker",
"kane": "kane",
"chrisjericho": "jericho", "jericho": "jericho",
"kurtangle": "kurtangle",
"vincemcmahon": "vince",
"edge": "edge",
"jeffhardy": "jeffhardy",
"alsnow": "alsnow",
}
def normalized_wrestler_name(name: str) -> str:
return re.sub(r"[^a-z0-9]", "", name.casefold())
def promo_line_for(wrestler: str, opponent: str, moment: str) -> str:
"""Return a short line shaped by a wrestler's voice, or use the generic bank."""
profile_key = app.PROMO_PROFILE_ALIASES.get(app.normalized_wrestler_name(wrestler))
if profile_key == "mankind":
profile = app.PROMO_PROFILES[profile_key]
parts = [
app.random.choice(profile["openers"]).format(opponent=opponent),
app.random.choice(profile["sayings"]),
app.random.choice(profile["pain"]),
]
return " ".join(parts)
if profile_key:
line = app.random.choice(app.PROMO_PROFILES[profile_key][moment])
else:
generic = {"openers": app.PROMO_OPENERS, "challenges": app.PROMO_CHALLENGES,
"retorts": app.PROMO_RETORTS}[moment]
line = app.random.choice(generic)
return line.format(opponent=opponent, wrestler=wrestler)
def generate_promo(card: dict[str, Any]) -> None:
pending = app.pending_indices(card)
if not pending:
print("Finish another match before adding an in-between promo.")
return
index = pending[0]
match = card["matches"][index]
if len(match["sides"]) < 2:
print("This match does not have two sides for a face-off promo.")
return
first = app.random.choice(match["sides"][0])
second = app.random.choice(match["sides"][1])
match["promo"] = (f"{first}: {app.promo_line_for(first, second, 'openers')}\n"
f"{second}: {app.promo_line_for(second, first, 'challenges')}\n"
f"{first}: {app.promo_line_for(first, second, 'retorts')}")
app.save_card(card)
print(f"Promo added before Match {index + 1} and saved.")
__all__ = ['PROMO_CHALLENGES', 'PROMO_OPENERS', 'PROMO_PROFILES', 'PROMO_PROFILE_ALIASES', 'PROMO_RETORTS', 'generate_promo', 'normalized_wrestler_name', 'promo_line_for']