Part 4 - Scoring
The File of Scoring is called "ifdb2achieves".
The File of Deaths is called "ifdb2deaths".
The File of Bandnames is called "ifdb2bands".
The File of Popstars is called "ifdb2stars".
The File of Bathrooms is called "ifdb2toilets".
[I'm not, at present, supporting multiple-playthrough achievements. In fact, the only thing we're dealing with for now are deaths, which are far and away the most likely thing to be ruined by UNDO.]
[To do: popcount, bandname, bathcount]
When play begins:
write File of Deaths from Table of Deaths;
write File of Bandnames from Table of Awesome Band Names;
write File of Popstars from Table of Popstar Counting;
write File of Bathrooms from Table of Visited Bathrooms;
write File of Scoring from Table of Stable Triumph;
To deathify (N - a number):
if there is an count of N in the Table of Deaths begin;
choose a row with a count of N in the Table of Deaths;
now the achieved entry is true;
end if;
To accomplish (N - an accomplishment):
now N is activated;
A thing can be valuable. A thing is usually not valuable.
A thing has some text called epilogue.
This is the scorekeeper rule:
let fin be false;
let Z be 10 - number of games in startroom;
if Z is 10, now fin is true;
say "You have explored [the number of played games in words] game[if the number of played games is not 1]s[end if], and have finished or dismissed [Z in words].[br]";
if the player encloses a safe valuable thing or fin is true begin;
say "[br][b]You have salvaged [the number of safe valuable things] of 12 treasures:[/b]";
repeat with N running through safe valuable things begin;
say "[br][a N][if fin is true], [the epilogue of N][end if]";
end repeat;
let XPQ be the number of safe valuable things;
choose a row with a count of XPQ in the Table of Score Ranks;
let fiddledee be the scorerank entry;
say "[br]This gives you the rank of [fiddledee].";
end if;
if there is an achieved of true in the Table of Deaths begin;
say "[b]Deaths and failures:[/b]";
repeat through the Table of Deaths begin;
if the achieved entry is true begin;
say "[br]";
say the death entry;
end if;
end repeat;
say "[br]";
end if;
if there is an activated accomplishment begin;
say "[br][b]Triumphs and accomplishments:[/b]";
repeat with X running through activated accomplishments begin;
say "[br][the description of X]";
end repeat;
say "[br]";
end if;
The scorekeeper rule is listed instead of the print final score rule in for printing the player's obituary.
The scorekeeper rule is listed instead of the announce the score rule in the carry out requesting the score rules.
Table of Score Ranks
count | scorerank |
0 | "Boundaries-of-Art Definition Warrior" |
1 | "Noob with a Kickstarter" |
2 | "80s Revanchist" |
3 | "Honorary Faceless-American" |
4 | "Database Stalwart" |
5 | "Twine Crusader" |
6 | "Rugged Mimesis Herder" |
7 | "Fourth-Wall Freerunner" |
8 | "Forking Paths Gardener" |
9 | "Time Caver" |
10 | "Muse of the Tight Spot" |
11 | "High Lord Guardian of the Unbounded Holdall" |
12 | "Compulsive Completist" |
Table of Popstar Counting
count | popstar (indexed text) | achieved |
1 | "Jewel" | false |
2 | "Nick Cave" | false |
3 | "Tori Amos" | false |
4 | "Bjork" | false |
5 | "Ozzy Osbourne" | false |
6 | "Britney Spears" | false |
To say popstar (N - a number):
choose a row with a count of N in the Table of Popstar Counting;
let popcount be 0;
if the achieved entry is false begin;
now popcount is popcount + 1;
accomplish accomp2;
now the achieved entry is true;
end if;
To say bathe (N - a number):
let bathcount be 0;
choose a row with a count of N in the Table of Visited Bathrooms;
if the achieved entry is false begin;
now bathcount is bathcount + 1;
accomplish accomp5;
now the achieved entry is true;
end if;
Table of Visited Bathrooms
count | achieved |
1 | false |
2 | false |
3 | false |
4 | false |
To bandname (X - a number):
if X is count listed in the Table of Awesome Band Names begin;
choose a row with a count of X in the Table of Awesome Band Names;
if the achieved entry is false begin;
say "[br][co][one of]Coincidentally, [or]As it happens, [or]Actually, [or][or][at random][the band entry] is the name of your new [one of]indie[or]post-rock[or]underground hip-hop[or]ambient heavy metal[or]nu-trad folk[or]bluegrass[or]atheist gospel[or]grindcore[or]queer edge[or]acoustic trance[at random] band.[/co]";
accomplish accomp4;
now the achieved entry is true;
end if;
end if;
Table of Awesome Band Names
count | band (indexed text) | achieved |
1 | "Canto Fatal" | false |
2 | "The Avaricious Mitts" | false |
3 | "Designated Victim" | false |
4 | "Lovely Cranny" | false |
5 | "Dude Says Brusquely" | false |
6 | "Deep Yoghurt" | false |
7 | "A Beaver Falls" | false |
Table of Stable Triumph
count |
a number |
with 15 blank rows |
An accomplishment is a kind of thing.
An accomplishment has a number called backup. The backup of an accomplishment is usually 0.
An accomplishment can be activated. An accomplishment is usually not activated.
accomp1 is an accomplishment. The description of accomp1 is "your very first murder".
The backup of accomp1 is 1.
accomp2 is an accomplishment. The description of accomp2 is "encountered [poppy]".
The backup of accomp2 is 2.
To say poppy:
let popcount be 0;
repeat through the Table of Popstar Counting begin;
if the achieved entry is true, now popcount is popcount + 1;
end repeat;
say "[popcount in words] popular musician[if popcount > 1]s[end if]";
accomp3 is an accomplishment. The description of accomp3 is "avoided slavery without bloodshed".
The backup of accomp3 is 3.
accomp4 is an accomplishment. The description of accomp4 is "[allbands]".
The backup of accomp4 is 4.
To say allbands:
let X be a list of indexed text;
repeat through the Table of Awesome Band Names begin;
if the achieved entry is true, add the band entry to X;
end repeat;
let N be the number of entries in X;
say "discovered [N in words] band name[if N > 1]s[end if]: [X]";
accomp5 is an accomplishment. The description of accomp5 is "discovered [confound], thus fulfilling your week's quota".
The backup of accomp5 is 5.
To say confound:
let bathcount be 0;
repeat through the Table of Visited Bathrooms begin;
if the achieved entry is true, now bathcount is bathcount + 1;
end repeat;
say "[if bathcount > 1][bathcount in words][otherwise]a[end if] pointless bathroom[if bathcount > 1]s[end if][if bathcount > 0]";
accomp6 is an accomplishment. The description of accomp6 is "escaped the Gremlin's Futile Maze".
The backup of accomp6 is 6.
accomp7 is an accomplishment. The description of accomp7 is "suffered amnesia".
The backup of accomp7 is 7.
accomp8 is an accomplishment. The description of accomp8 is "the Library of Alexandria Award for crimes against literature".
The backup of accomp8 is 8.
accomp9 is an accomplishment. The description of accomp9 is "healed at least one of Britney's ills".
The backup of accomp9 is 9.
Before undoing an action:
write File of Deaths from Table of Deaths;
write File of Bandnames from Table of Awesome Band Names;
write File of Popstars from Table of Popstar Counting;
write File of Bathrooms from Table of Visited Bathrooms;
blank out the whole of Table of Stable Triumph;
repeat with N running through accomplishments begin;
if N is activated begin;
let Q be the backup of N;
choose a blank row in the Table of Stable Triumph;
now the count entry is Q;
end if;
end repeat;
write File of Scoring from Table of Stable Triumph;
After undoing an action:
read File of Deaths into Table of Deaths;
read File of Bandnames into Table of Awesome Band Names;
read File of Scoring into Table of Stable Triumph;
read File of Popstars into Table of Popstar Counting;
read File of Bathrooms into Table of Visited Bathrooms;
repeat with N running through accomplishments begin;
let Q be the backup of N;
if Q is a count listed in the Table of Stable Triumph begin;
now N is activated;
otherwise;
now N is not activated;
end if;
end repeat;
Table of Deaths
count | death (indexed text) | achieved |
1 | "fled in ignominy from a shotgun-wielding parent" | false |
2 | "shotgun fired point-blank into genitalia" | false |
3 | "sword-thrust through the back, as punishment for preferring beer over bureaucracy" | false |
4 | "slain by a goblin guard" | false |
5 | "lynched as a pervert by irate villagers" | false |
6 | "multiple shotgun slugs centre-mass, courtesy Nova Tilland" | false |
7 | "caught by a CGI demon" | false |
8 | "overwrought asphyxiation (?) caused by looking an old woman in the eye" | false |
9 | "drowned in an underground lake" | false |
10 | "eaten by the tentacle monster of the underground lake" | false |
11 | "slain by a Mad Monk while stealing religious relics" | false |
12 | "eaten by a dragon" | false |
13 | "fell hundreds of feet onto rocks" | false |
14 | "thunderbolted by a minor deity" | false |
15 | "crushed by Delphia's ogre bodyguard" | false |
16 | "musically headsploded by Björk, in self-defence" | false |
17 | "the electric chair, for murdering Björk" | false |
18 | "head bitten off by Ozzy Osbourne" | false |
19 | "shotgun decapitation" | false |
20 | "food poisoning from dinosaur meat" | false |
21 | "kidnapped by fetishy slave-driver, then mindwiped by some kind of evil mist" | false |
22 | "fatally knifed by fetishy slave-driver, while attempting escape" | false |
23 | "stoned to death by superstitious cavemen" | false |
To say frustration:
say "[one of]This is why the IF Archive is a really important thing. And why people should use it, not just link to their own site from IFDB[run paragraph on].[or]Oh for fuck's sake. Archive your games, people[run paragraph on].[or]NNNRGH. Jesus pigfrottage Christ, WHAT IS SO DIFFICULT TO UNDERSTAND HERE[run paragraph on].[stopping]";