Static text table for the Rampage HUD. Holds the news ticker headlines (smashed, flung, idle), tier-up headlines and escalation lines, grades, combo adjectives, milestones, and the silly-word list, with helpers to pick a random non-repeating line, template in a label, strip bracketed notes, and format numbers with commas.
using System;
using System.Collections.Generic;
/// <summary>
/// Every word the Rampage's HUD says that is not a number: the news ticker's headlines, the
/// tier-up headlines and announcements, the combo adjectives, the grades and the milestones.
/// All of it is plain tables, so it can be rewritten without touching the rules.
/// In a template, {0} is the label of what was just hit, in capitals ("TAX OFFICE").
/// The voice: a small-town paper that has seen the lizard's club and cannot print the word.
/// </summary>
public static class RampageNews
{
/// <summary>Headlines for a thing that was smashed.</summary>
public static readonly string[] Smashed =
{
"{0} 'NEVER SAW IT COMING', SAYS NEIGHBOURING {0}",
"LOCAL {0} TWATTED. LIZARD 'NOT EVEN SORRY'.",
"EXPERTS: {0} 'WELL AND TRULY BUGGERED'",
"INSURERS REDEFINE 'ACT OF GOD' TO EXCLUDE {0}",
"{0} LAST SEEN HEADING NORTH, AT ALTITUDE",
"COUNCIL TO REPLACE {0} WITH SMALLER, HUMBLER {0}",
"WITNESS: 'IT WAS A PERFECTLY GOOD {0}'",
"{0} SURVIVED TWO WARS AND A ROUNDABOUT. NOT THIS.",
"OPINION: DID THE {0} HAVE IT COMING? (YES)",
"{0} NOW 'OPEN PLAN', SAYS ESTATE AGENT",
"BREAKING: {0}. LITERALLY.",
"MAYOR VOWS TO REBUILD {0}, IS HIT BY {0}",
"{0} NOW IN SEVERAL POSTCODES",
"SCIENTISTS: {0} CANNOT FLY, DESPITE NEW EVIDENCE",
"{0} SLAPPED FLAT BY SOMETHING THIS PAPER WILL NOT DRAW",
"LIZARD ISSUES NO STATEMENT ON {0}. LIZARD IS BUSY.",
"{0} WAS INSURED FOR FIRE, FLOOD AND THEFT. NOT THAT.",
"TRAFFIC: AVOID THE {0}. IT IS ON THE ROAD. ALL OF IT.",
"'WE LOVED THAT {0}', LIES TOWN",
"PARISH NEWSLETTER DEVOTES WHOLE ISSUE TO {0}, SWEARING",
"{0} REVIEWED: ONE STAR. 'WAS FLAT WHEN WE ARRIVED.'",
"WEATHER: SCATTERED {0}, CLEARING BY EVENING",
"POLICE APPEAL FOR WITNESSES TO {0}. WITNESSES ALSO AIRBORNE.",
"COMMITTEE FORMED TO DISCUSS {0}. COMMITTEE ROOM IS NEXT.",
"{0} 'WAS DUE AN INSPECTION ANYWAY'",
"HOUSE PRICES NEAR FORMER {0} 'SURPRISINGLY STABLE'",
"LOCAL MAN 'COULD HAVE SAVED THE {0}'. HE COULD NOT. HE HID.",
"{0} JOINS LIST OF THINGS THIS TOWN USED TO HAVE",
"CHILD DRAWS WHAT HIT THE {0}. TEACHER CONFISCATES DRAWING.",
"TOURIST BOARD REBRANDS REMAINS OF {0} AS 'AN INSTALLATION'",
"BUSINESS: {0} SECTOR DOWN 100%",
"FOUND: ONE {0}, SLIGHTLY EVERYWHERE",
"VICAR SAW WHAT DID FOR THE {0}. VICAR IS HAVING A LIE DOWN.",
"'IT WAS A {0}, THEN IT WAS A NOISE', SAYS WITNESS",
"PLANNING PERMISSION FOR {0} REVOKED, RETROACTIVELY AND PHYSICALLY",
"{0} NOMINATED FOR 'BEST LOSER' AT TOWN AWARDS",
"OFFICIAL ADVICE REGARDING {0}: 'DO NOT BE ONE'",
"HELPLINE OPENED FOR THOSE AFFECTED BY {0}. HELPLINE SMASHED.",
"{0} DOWNGRADED FROM 'LANDMARK' TO 'SKIP'",
"OBITUARY: {0}. IT STOOD THERE. IT DOES NOT NOW.",
"{0} FOUND GUILTY OF BEING IN THE WAY",
"ARCHAEOLOGISTS OF THE FUTURE 'WILL BLUSH AT THE {0}'",
"LAB THAT STARTED ALL THIS 'DEEPLY REGRETS THE {0}', NOTHING ELSE",
"MOMENT OF SILENCE FOR {0} INTERRUPTED BY SECOND {0}",
"{0} CLOBBERED. COUNCIL BLAMES 'A LONG, RUDE OBJECT'.",
"OWNER OF {0}: 'I HAVE SEEN THINGS. ONE THING. A BIG ONE.'",
};
/// <summary>Headlines for a person sent flying.</summary>
public static readonly string[] Flung =
{
"{0} ACHIEVES LIFELONG DREAM OF FLIGHT, BRIEFLY",
"{0} 'ABSOLUTELY FINE', SAYS {0}, FROM ROOF",
"AIR TRAFFIC CONTROL REPORTS UNSCHEDULED {0}",
"{0} LANDS IN NEXT PARISH, ASKS FOR NEW TROUSERS",
"{0} DESCRIBES LIZARD: 'BIG. RUDE. SWINGING.'",
"{0} SETS COUNTY DISTANCE RECORD, HAD NOT ENTERED",
"{0} REGRETS POKING ALIENS, 'IN HINDSIGHT'",
"'I WAS ONLY HOLDING THE NET', SAYS AIRBORNE {0}",
"{0} SEEN OVER CHURCH. CHURCH LATER SEEN OVER {0}.",
"{0} TO SUE. LIZARD TO COUNTERSUE, WITH CLUB.",
"GEESE REPORT NEAR MISS WITH {0}",
"{0} BOUNCES TWICE, GIVES THUMBS UP, FAINTS",
"{0} FOUND UP TREE WITH MAYOR. 'WE ARE DISCUSSING IT.'",
"{0} 'DID NOT EVEN WORK AT THE LAB'. LIZARD UNMOVED.",
"KARMA 'REAL', CONFIRMS {0}, MID-AIR",
"{0} WISHES TO APOLOGISE TO ALL ALIENS, EFFECTIVE IMMEDIATELY",
"HAT OF {0} STILL RISING",
"MISSING: ONE {0}. LAST SEEN: GOING UP, SWEARING.",
"{0} EXPERIENCES WHAT TALK SHOW ONCE CALLED 'A BIT OF FUN'",
"{0} DISCOVERS BEING ON THE OTHER END OF IT",
"{0} COMPLETES FIRST ORBIT OF THE POST OFFICE",
"'TELL MY FAMILY I WAS RIGHT ABOUT THE LIZARD', CALLS PASSING {0}",
"{0} RECLASSIFIED AS 'MIGRATORY'",
"{0} ASKS TO SPEAK TO MANAGER. MANAGER ALSO AIRBORNE.",
"{0} WALLOPED INTO NEXT WEEK. NEXT WEEK DOES NOT WANT HIM.",
"{0} REFUSES TO SAY WHAT HIT HIM. 'MY MOTHER READS THIS.'",
"{0} LEAVES TOWN ARSE FIRST, AT SPEED",
};
/// <summary>Headlines for when nothing has been hit for a while.</summary>
public static readonly string[] Idle =
{
"LIZARD PAUSES FOR A SCRATCH. TOWN HOLDS BREATH.",
"MAYOR URGES CALM FROM UNDISCLOSED TREE",
"SUMP RESIDENTS 'LISTENING ON THE RADIO, CHEERING'",
"HISTORIANS ADMIT ALIENS 'DID COME IN PEACE THE FIRST TIME'",
"TOWN MOTTO CHANGED TO 'WE ARE SORRY'",
"SPORT: ALL FIXTURES CANCELLED. PITCH NOW ELSEWHERE.",
"FARMER WHO SHOT FIRST NOW ASKING QUESTIONS, FROM HEDGE",
"TALK SHOW HOST 'UNAVAILABLE FOR COMMENT', UNDER DESK",
"LAB ISSUES RECALL NOTICE FOR 'ALL OF IT'",
"HOROSCOPES: EVERY SIGN, 'DUCK'",
"LIZARD 'JUST GETTING WARMED UP', SAYS LIZARD'S WHOLE DEMEANOUR",
"SCHOOLS CLOSED. CHILDREN 'THRILLED, FRANKLY'.",
"PETITION TO BE NICER TO ALIENS REACHES ONE SIGNATURE, LATE",
"COMING UP: IS YOUR GARDEN SHED NEXT? (YES)",
"LIZARD 'JUST LETTING IT DANGLE'. TOWN CANNOT LOOK AWAY.",
"PUBLIC REMINDED NOT TO STARE AT IT. PUBLIC STARING AT IT.",
};
/// <summary>The headline under the tier-up stamp, by the tier reached. They get sillier.</summary>
public static readonly string[] TierHeadlines =
{
"LOCAL LIZARD 'A NUISANCE', SAYS MAYOR",
"LOCAL LIZARD 'A BIT BLOODY MUCH', SAYS MAYOR",
"LIZARD 'WAVING IT ABOUT IN PUBLIC', SAYS MAYOR FROM TREE",
"LIZARD UPGRADED TO 'WEATHER'. MAYOR UPGRADED TO TALLER TREE.",
"GEOLOGISTS CLAIM LIZARD AS THEIRS. THEOLOGIANS CONTEST.",
"TOWN FORMALLY APOLOGISES TO ALL ALIENS. LIZARD 'STILL SWINGING'.",
"INSURERS LEAVE PLANET",
"NEWS DESK HIT BY NEWS DESK. THIS IS THE LAST HEADL",
};
/// <summary>What the town tries next, announced a moment after each tier-up, by the tier reached.</summary>
public static readonly string[] TierEvents =
{
"",
"THE POLICE HAVE BEEN CALLED. BOTH OF THEM.",
"MORE POLICE. THE FIRST ONES ARE STILL IN THE AIR.",
"THE ARMY HAS SENT A STRONGLY WORDED TANK.",
"MORE TANKS. THEY ARE PARKED VERY BRAVELY.",
"THE TOWN HAS OFFERED YOU THE TOWN.",
"THERE IS NOTHING LEFT TO ESCALATE. ESCALATE ANYWAY.",
};
/// <summary>The grade on the results screen, by the tier reached.</summary>
public static readonly (string Grade, string Line)[] Grades =
{
("D", "A STERN LOOK WOULD HAVE DONE MORE"),
("C", "MILD INCONVENIENCE. THEY WILL TUT ABOUT THIS."),
("B", "LOCAL NEWS. SECOND ITEM, AFTER THE FETE."),
("A", "NATIONAL NEWS. SCHOOLS ARE SHUT. SO ARE CURTAINS."),
("A+", "THEY WILL NAME THE CRATER AFTER YOU. NOT POLITELY."),
("S", "BIBLICAL. THE SUMP HEARD IT FROM DOWN THERE."),
("S+", "BEYOND INSURANCE. BISCUITS ALL ROUND IN THE SUMP."),
};
/// <summary>The word beside the combo counter, from this many hits up.</summary>
public static readonly (int From, string Word)[] ComboWords =
{
(2, "DOUBLE"), (3, "TRIPLE"), (4, "RUDE"), (6, "UNCALLED FOR"), (8, "TAKING THE PISS"),
(11, "UNNEIGHBOURLY"), (15, "LITIGIOUS"), (20, "BIBLICAL"), (27, "UNINSURABLE"),
(35, "GEOLOGICAL"), (45, "A WAR CRIME IN CROQUET"), (60, "LEGENDARY PETTINESS"), (80, "THE FULL COMEUPPANCE"),
};
/// <summary>Combo lengths that pay a bonus.</summary>
public static readonly int[] ComboMilestones = { 5, 10, 20, 35, 50, 75, 100, 150, 200 };
/// <summary>People sent flying: at each count, a title and a bonus.</summary>
public static readonly (int Count, string Title)[] HumanMilestones =
{
(10, "FREQUENT FLYERS"), (25, "AIR SHOW"), (50, "MASS TRANSIT"), (100, "BUDGET AIRLINE"),
(200, "THE GREAT MIGRATION"), (400, "THE RAPTURE (UNOFFICIAL)"), (800, "NOBODY LEFT ON THE GROUND"),
};
/// <summary>Things smashed: at each count, a title and a bonus.</summary>
public static readonly (int Count, string Title)[] ThingMilestones =
{
(10, "CLUMSY"), (25, "REDECORATING"), (50, "URBAN PLANNING"), (100, "DEMOLITION PERMIT (FORGED)"),
(250, "TOWN-SHAPED HOLE"), (500, "GEOGRAPHY TEACHER'S NIGHTMARE"),
};
/// <summary>How much of the town is still standing: at each percent or under, an announcement.</summary>
public static readonly (int Percent, string Text)[] TownMilestones =
{
(75, "A QUARTER OF THE TOWN IS NOW A VIEW"), (50, "HALF A TOWN. THE WORSE HALF."),
(25, "MOSTLY SKY NOW"), (10, "A HAMLET, AT BEST"), (0, "THE TOWN IS FLAT. THE MAP IS WRONG."),
};
/// <summary>Words that make a smashed thing funnier to have smashed, for "silliest thing" on the results.</summary>
static readonly string[] SillyWords =
{
"TAX", "MAYOR", "STATUE", "FOUNTAIN", "GNOME", "PORTALOO", "TOILET", "BOUNCY", "ICE CREAM", "HOT DOG", "CHURCH", "LAB",
"STUDIO", "TALK", "BANK", "GOLF", "DUCK", "COW", "TROPHY", "MUSEUM", "CLOCK", "PIGEON", "BINGO", "HAT", "WIG", "PARKING",
};
/// <summary>How silly it was to smash this, higher is sillier: a silly word in it counts for most, then a long name.</summary>
public static int Silliness( string label )
{
if ( string.IsNullOrEmpty( label ) ) return 0;
int score = Math.Min( label.Length, 30 );
foreach ( var word in SillyWords )
if ( label.Contains( word, StringComparison.OrdinalIgnoreCase ) ) score += 100;
return score;
}
public static string ComboWord( int combo )
{
string word = "";
foreach ( var (from, text) in ComboWords )
if ( combo >= from ) word = text;
return word;
}
static readonly Dictionary<string[], int> _last = new();
/// <summary>A random line from a table, never the same one twice running.</summary>
public static string Pick( string[] table )
{
if ( table is null || table.Length == 0 ) return "";
int index = Game.Random.Int( 0, table.Length - 1 );
if ( _last.TryGetValue( table, out int last ) && index == last ) index = (index + 1) % table.Length;
_last[table] = index;
return table[index];
}
/// <summary>A label without its note in brackets: "TAX OFFICE (ONE FLOOR OF)" is the TAX OFFICE.</summary>
public static string Plain( string label )
{
if ( string.IsNullOrEmpty( label ) ) return "";
int bracket = label.IndexOf( '(' );
return (bracket > 0 ? label.Substring( 0, bracket ) : label).Trim();
}
/// <summary>A headline about what was just hit.</summary>
public static string Headline( string label, bool human )
{
label = Plain( label );
if ( label.Length == 0 ) return Pick( Idle );
return Pick( human ? Flung : Smashed ).Replace( "{0}", label.ToUpperInvariant() );
}
public static string TierHeadline( int tier ) => TierHeadlines[Math.Clamp( tier, 0, TierHeadlines.Length - 1 )];
public static string TierEvent( int tier ) => TierEvents[Math.Clamp( tier, 0, TierEvents.Length - 1 )];
public static (string Grade, string Line) Grade( int tier ) => Grades[Math.Clamp( tier, 0, Grades.Length - 1 )];
/// <summary>A whole number with commas ("12,340"), whatever the machine's locale.</summary>
public static string Number( float value )
{
long n = (long)MathF.Max( value, 0f );
if ( n < 1000 ) return n.ToString();
string digits = n.ToString();
for ( int i = digits.Length - 3; i > 0; i -= 3 ) digits = digits.Insert( i, "," );
return digits;
}
}