my easter egg. if you're wondering, this only took an hour.
authorDavid Anderson <dvander@alliedmods.net>
Thu Mar 15 04:23:46 2007 +0000 (2007-03-15)
changeset 6140e233cc5a711
parent 613 b2d326c6d46e
child 615 c4aa259cca88
my easter egg. if you're wondering, this only took an hour.
core/ConCmdManager.cpp
core/sm_srvcmds.cpp
     1.1 --- a/core/ConCmdManager.cpp	Wed Mar 14 15:32:28 2007 +0000
     1.2 +++ b/core/ConCmdManager.cpp	Thu Mar 15 04:23:46 2007 +0000
     1.3 @@ -790,3 +790,134 @@
     1.4  
     1.5  	g_RootMenu.ConsolePrint("[SM] Usage: sm cmds <plugin #>");
     1.6  }
     1.7 +
     1.8 +static int g_yam_state = 0;
     1.9 +void _YamState(int state)
    1.10 +{
    1.11 +	if (state == 0)
    1.12 +	{
    1.13 +		g_RootMenu.ConsolePrint("Welcome to the SourceMod Text Adventure.");
    1.14 +		g_RootMenu.ConsolePrint("Type sm_text to see the last message.");
    1.15 +		g_RootMenu.ConsolePrint("Type sm_text <word> to follow a capital word.");
    1.16 +		g_RootMenu.ConsolePrint("-------------------------------");
    1.17 +		g_RootMenu.ConsolePrint("You are at VALVE HEADQUARTERS.");
    1.18 +		g_RootMenu.ConsolePrint("To your LEFT is BAILOPAN, rearranging the letters to spell");
    1.19 +		g_RootMenu.ConsolePrint("\"A HARD VEAL QUEST\".  FORWARD is the entrance to the building.");
    1.20 +		g_RootMenu.ConsolePrint("To your RIGHT is your last chance to flee in terror.");
    1.21 +	} else if (state == 1) {
    1.22 +		g_RootMenu.ConsolePrint("BAILOPAN tells you that his name his pronounced");
    1.23 +		g_RootMenu.ConsolePrint("\"bye low pahn,\" not \"bay low pan.\"  Do you ");
    1.24 +		g_RootMenu.ConsolePrint("MOCK him, or NOD quietly?");
    1.25 +	} else if (state == 2) {
    1.26 +		g_RootMenu.ConsolePrint("You enter the Valve building.  You hear screams coming from within.");
    1.27 +		g_RootMenu.ConsolePrint("A grotesque figure lumbers up to greet you; it is Gabe Newell.");
    1.28 +		g_RootMenu.ConsolePrint("\"Welcome,\" he belches, \"to my lair.\"");
    1.29 +		g_RootMenu.ConsolePrint("Do you SHAKE Gaben's hand, WALK past him, or OFFER a donut?");
    1.30 +	} else if (state == 3) {
    1.31 +		g_RootMenu.ConsolePrint("You walk into the break room.  Alfred \"Adolf\" Reynolds and");
    1.32 +		g_RootMenu.ConsolePrint("Yahn \"Yeti\" Bernier are discussing something (you overhear ");
    1.33 +		g_RootMenu.ConsolePrint("the phrase \"and next Steam update, here's what we should break\").");
    1.34 +		g_RootMenu.ConsolePrint("Should you DIE in a fire, REPORT a bug, REQUEST a feature, or ");
    1.35 +		g_RootMenu.ConsolePrint("SPRAY them with butter?");
    1.36 +	}
    1.37 +	g_yam_state = state;
    1.38 +}
    1.39 +
    1.40 +void _IntExt_CallYams()
    1.41 +{
    1.42 +	const char *arg = engine->Cmd_Argv(1);
    1.43 +
    1.44 +	/* should be impossible */
    1.45 +	if (!arg || arg[0] == '\0')
    1.46 +	{
    1.47 +		_YamState(g_yam_state);
    1.48 +	}
    1.49 +
    1.50 +	if (g_yam_state == 1)
    1.51 +	{
    1.52 +		if (strcasecmp(arg, "mock") == 0)
    1.53 +		{
    1.54 +			g_RootMenu.ConsolePrint("You mock BAILOPAN's pronounciation.  In a fit of range, ");
    1.55 +			g_RootMenu.ConsolePrint("he sticks an INT 3 call into your chest, rendering you broken.");
    1.56 +			g_RootMenu.ConsolePrint("YOU HAVE DIED.  GAME OVER.");
    1.57 +			g_yam_state = 0;
    1.58 +		} else if (strcasecmp(arg, "nod") == 0) {
    1.59 +			g_RootMenu.ConsolePrint("You nod quietly, and then slowly back away into the Valve headquarters.");
    1.60 +			_YamState(2);
    1.61 +		} else {
    1.62 +			g_RootMenu.ConsolePrint("Commands are MOCK and NOD.");
    1.63 +		}
    1.64 +	} else if (g_yam_state == 3) {
    1.65 +		if (strcasecmp(arg, "report") == 0)
    1.66 +		{
    1.67 +			g_RootMenu.ConsolePrint("You report a bug to Alfred and Yeti.  Immediately, both fall asleep.");
    1.68 +			g_RootMenu.ConsolePrint("You decay in the break room for two years while they sleep.");
    1.69 +			g_RootMenu.ConsolePrint("YOU HAVE DIED.  GAME OVER.");
    1.70 +			g_yam_state = 0;
    1.71 +		} else if (strcasecmp(arg, "request") == 0) {
    1.72 +			g_RootMenu.ConsolePrint("You request a feature to Alfred and Yeti.  They both mutter something");
    1.73 +			g_RootMenu.ConsolePrint("about it being implemented \"soon.\"  Then, by accident, someone sends");
    1.74 +			g_RootMenu.ConsolePrint("a message over \"Friends.\"  The entire building catches fire.");
    1.75 +			g_RootMenu.ConsolePrint("YOU HAVE DIED.  GAME OVER.");
    1.76 +			g_yam_state = 0;
    1.77 +		} else if (strcasecmp(arg, "die") == 0) {
    1.78 +			g_RootMenu.ConsolePrint("For no reason, you suddenly catch fire.  Alfred and Yeti find this");
    1.79 +			g_RootMenu.ConsolePrint("deeply disturbing, and cover your flaming corpse with Episode 2");
    1.80 +			g_RootMenu.ConsolePrint("advertisments.  Coming soon, with Team Fortress 2, and Portal!");
    1.81 +			g_RootMenu.ConsolePrint("YOU HAVE DIED.  GAME OVER.");
    1.82 +			g_yam_state = 0;
    1.83 +		} else if (strcasecmp(arg, "spray") == 0) {
    1.84 +			g_RootMenu.ConsolePrint("You spray Alfred and Yeti with butter.  Like Jack Thompson to an");
    1.85 +			g_RootMenu.ConsolePrint("ambulance, Gabe Newell instantly appears and devours them both.");
    1.86 +			g_RootMenu.ConsolePrint("You run away, just in time, as Gabe Newell explodes, registering ");
    1.87 +			g_RootMenu.ConsolePrint("a 5.6 earthquake.  Outside, world peace is achieved.");
    1.88 +			g_RootMenu.ConsolePrint("YOU HAVE WON.");
    1.89 +			g_yam_state = 0;
    1.90 +		}
    1.91 +	} else if (g_yam_state == 2) {
    1.92 +		if (strcasecmp(arg, "shake") == 0)
    1.93 +		{
    1.94 +			g_RootMenu.ConsolePrint("You shake Gaben's hand.  It is a terrifying and disgusting experience.");
    1.95 +			g_RootMenu.ConsolePrint("However, you survive, and continue on.");
    1.96 +			_YamState(3);
    1.97 +		} else if (strcasecmp(arg, "offer") == 0) {
    1.98 +			g_RootMenu.ConsolePrint("You offer Gabe Newell one (1) donut.  With a gleam in his eyes, ");
    1.99 +			g_RootMenu.ConsolePrint("he picks you up and devours you whole.");
   1.100 +			g_RootMenu.ConsolePrint("YOU HAVE DIED.  GAME OVER.");
   1.101 +			g_yam_state = 0;
   1.102 +		} else if (strcasecmp(arg, "walk") == 0) {
   1.103 +			g_RootMenu.ConsolePrint("You walk past Gabe Newell.  He can't keep up with your pace!");
   1.104 +			_YamState(3);
   1.105 +		} else {
   1.106 +			g_RootMenu.ConsolePrint("Commands are SHAKE, OFFER, and WALK.");
   1.107 +		}
   1.108 +	} else if (g_yam_state == 0) {
   1.109 +		if (strcasecmp(arg, "left") == 0)
   1.110 +		{
   1.111 +			_YamState(1);
   1.112 +		} else if (strcasecmp(arg, "right") == 0) {
   1.113 +			g_RootMenu.ConsolePrint("You run away from the Valve headquarters in sheer terror.");
   1.114 +			g_RootMenu.ConsolePrint("While running, you smash into an unknown person, who turns out to be your soul mate.");
   1.115 +			g_RootMenu.ConsolePrint("You marry and raise a family of 3 kids.");
   1.116 +			g_RootMenu.ConsolePrint("Many years later, you look back, and realize this was your best choice.");
   1.117 +			g_RootMenu.ConsolePrint("YOU HAVE WON.");
   1.118 +			g_yam_state = 0;
   1.119 +		} else if (strcasecmp(arg, "forward") == 0) {
   1.120 +			_YamState(2);
   1.121 +		} else if (arg[0] != '\0') {
   1.122 +			g_RootMenu.ConsolePrint("Commands are FORWARD, LEFT, and RIGHT.");
   1.123 +		}
   1.124 +	}
   1.125 +}
   1.126 +
   1.127 +void _IntExt_EnableYams()
   1.128 +{
   1.129 +	static ConCommand *pCmd = NULL;
   1.130 +	if (!pCmd)
   1.131 +	{
   1.132 +		pCmd = new ConCommand("sm_text", _IntExt_CallYams, "Fountain of Yams Adventure Game", FCVAR_GAMEDLL);
   1.133 +		g_RootMenu.ConsolePrint("Something is now enabled...");
   1.134 +	} else {
   1.135 +		g_RootMenu.ConsolePrint("Something is already enabled...");
   1.136 +	}
   1.137 +}
     2.1 --- a/core/sm_srvcmds.cpp	Wed Mar 14 15:32:28 2007 +0000
     2.2 +++ b/core/sm_srvcmds.cpp	Thu Mar 15 04:23:46 2007 +0000
     2.3 @@ -166,6 +166,8 @@
     2.4  	}
     2.5  }
     2.6  
     2.7 +extern void _IntExt_EnableYams();
     2.8 +
     2.9  void RootConsoleMenu::GotRootCmd()
    2.10  {
    2.11  	unsigned int argnum = GetArgumentCount();
    2.12 @@ -173,6 +175,11 @@
    2.13  	if (argnum >= 2)
    2.14  	{
    2.15  		const char *cmd = GetArgument(1);
    2.16 +		if (strcmp(cmd, "text") == 0)
    2.17 +		{
    2.18 +			_IntExt_EnableYams();
    2.19 +			return;
    2.20 +		}
    2.21  		IRootConsoleCommand *pHandler;
    2.22  		if (sm_trie_retrieve(m_pCommands, cmd, (void **)&pHandler))
    2.23  		{