core/ConCmdManager.cpp
changeset 1902 ce912ad912a5
parent 1584 8158e9eafff5
child 1925 61d7a244b641
     1.1 --- a/core/ConCmdManager.cpp	Sat Mar 01 05:18:26 2008 +0000
     1.2 +++ b/core/ConCmdManager.cpp	Sat Mar 01 05:42:25 2008 +0000
     1.3 @@ -914,12 +914,11 @@
     1.4  	{
     1.5  		const char *text = command.Arg(2);
     1.6  
     1.7 -		int id = atoi(text);
     1.8 -		CPlugin *pPlugin = g_PluginSys.GetPluginByOrder(id);
     1.9 +		CPlugin *pPlugin = g_PluginSys.FindPluginByConsoleArg(text);
    1.10  
    1.11  		if (!pPlugin)
    1.12  		{
    1.13 -			g_RootMenu.ConsolePrint("[SM] Plugin index %d not found.", id);
    1.14 +			g_RootMenu.ConsolePrint("[SM] Plugin \"%s\" was not found.", text);
    1.15  			return;
    1.16  		}
    1.17  
    1.18 @@ -946,7 +945,7 @@
    1.19  		g_RootMenu.ConsolePrint("  %-17.16s %-8.7s %s", "[Name]", "[Type]", "[Help]");
    1.20  		for (iter=pList->begin();
    1.21  			 iter!=pList->end();
    1.22 -			 iter++, id++)
    1.23 +			 iter++)
    1.24  		{
    1.25  			PlCmdInfo &cmd = (*iter);
    1.26  			if (cmd.type == Cmd_Server)
    1.27 @@ -978,140 +977,3 @@
    1.28  
    1.29  	g_RootMenu.ConsolePrint("[SM] Usage: sm cmds <plugin #>");
    1.30  }
    1.31 -
    1.32 -static int g_yam_state = 0;
    1.33 -void _YamState(int state)
    1.34 -{
    1.35 -	if (state == 0)
    1.36 -	{
    1.37 -		g_RootMenu.ConsolePrint("Welcome to the SourceMod Text Adventure.");
    1.38 -		g_RootMenu.ConsolePrint("Type sm_text to see the last message.");
    1.39 -		g_RootMenu.ConsolePrint("Type sm_text <word> to follow a capital word.");
    1.40 -		g_RootMenu.ConsolePrint("-------------------------------");
    1.41 -		g_RootMenu.ConsolePrint("You are at VALVE HEADQUARTERS.");
    1.42 -		g_RootMenu.ConsolePrint("To your LEFT is BAILOPAN, rearranging the letters to spell");
    1.43 -		g_RootMenu.ConsolePrint("\"A HARD VEAL QUEST\".  FORWARD is the entrance to the building.");
    1.44 -		g_RootMenu.ConsolePrint("To your RIGHT is your last chance to flee in terror.");
    1.45 -	} else if (state == 1) {
    1.46 -		g_RootMenu.ConsolePrint("BAILOPAN tells you that his name his pronounced");
    1.47 -		g_RootMenu.ConsolePrint("\"bye low pahn,\" not \"bay low pan.\"  Do you ");
    1.48 -		g_RootMenu.ConsolePrint("MOCK him, or NOD quietly?");
    1.49 -	} else if (state == 2) {
    1.50 -		g_RootMenu.ConsolePrint("You enter the Valve building.  You hear screams coming from within.");
    1.51 -		g_RootMenu.ConsolePrint("A grotesque figure lumbers up to greet you; it is Gabe Newell.");
    1.52 -		g_RootMenu.ConsolePrint("\"Welcome,\" he belches, \"to my lair.\"");
    1.53 -		g_RootMenu.ConsolePrint("Do you SHAKE Gaben's hand, WALK past him, or OFFER a donut?");
    1.54 -	} else if (state == 3) {
    1.55 -		g_RootMenu.ConsolePrint("You walk into the break room.  Alfred \"Alf is from Melmac\" Reynolds and");
    1.56 -		g_RootMenu.ConsolePrint("Yahn \"Yeti\" Bernier are discussing something (you overhear ");
    1.57 -		g_RootMenu.ConsolePrint("the phrase \"and next Steam update, here's what we should break\").");
    1.58 -		g_RootMenu.ConsolePrint("Should you DIE in a fire, REPORT a bug, REQUEST a feature, or ");
    1.59 -		g_RootMenu.ConsolePrint("SPRAY them with butter?");
    1.60 -	}
    1.61 -	g_yam_state = state;
    1.62 -}
    1.63 -
    1.64 -#if defined ORANGEBOX_BUILD
    1.65 -void _IntExt_CallYams(const CCommand &cmd)
    1.66 -{
    1.67 -#else
    1.68 -void _IntExt_CallYams()
    1.69 -{
    1.70 -	CCommand cmd;
    1.71 -#endif
    1.72 -	const char *arg = cmd.Arg(1);
    1.73 -
    1.74 -	/* should be impossible */
    1.75 -	if (!arg || arg[0] == '\0')
    1.76 -	{
    1.77 -		_YamState(g_yam_state);
    1.78 -	}
    1.79 -
    1.80 -	if (g_yam_state == 1)
    1.81 -	{
    1.82 -		if (strcasecmp(arg, "mock") == 0)
    1.83 -		{
    1.84 -			g_RootMenu.ConsolePrint("You mock BAILOPAN's pronunciation.  In a fit of rage, ");
    1.85 -			g_RootMenu.ConsolePrint("he sticks an INT 3 call into your chest, rendering you broken.");
    1.86 -			g_RootMenu.ConsolePrint("YOU HAVE DIED.  GAME OVER.");
    1.87 -			g_yam_state = 0;
    1.88 -		} else if (strcasecmp(arg, "nod") == 0) {
    1.89 -			g_RootMenu.ConsolePrint("You nod quietly, and then slowly back away into the Valve headquarters.");
    1.90 -			_YamState(2);
    1.91 -		} else {
    1.92 -			g_RootMenu.ConsolePrint("Commands are MOCK and NOD.");
    1.93 -		}
    1.94 -	} else if (g_yam_state == 3) {
    1.95 -		if (strcasecmp(arg, "report") == 0)
    1.96 -		{
    1.97 -			g_RootMenu.ConsolePrint("You report a bug to Alfred and Yeti.  Immediately, both fall asleep.");
    1.98 -			g_RootMenu.ConsolePrint("You decay in the break room for two years while they sleep.");
    1.99 -			g_RootMenu.ConsolePrint("YOU HAVE DIED.  GAME OVER.");
   1.100 -			g_yam_state = 0;
   1.101 -		} else if (strcasecmp(arg, "request") == 0) {
   1.102 -			g_RootMenu.ConsolePrint("You request a feature to Alfred and Yeti.  They both mutter something");
   1.103 -			g_RootMenu.ConsolePrint("about it being implemented \"soon.\"  Then, by accident, someone sends");
   1.104 -			g_RootMenu.ConsolePrint("a message over \"Friends.\"  The entire building catches fire.");
   1.105 -			g_RootMenu.ConsolePrint("YOU HAVE DIED.  GAME OVER.");
   1.106 -			g_yam_state = 0;
   1.107 -		} else if (strcasecmp(arg, "die") == 0) {
   1.108 -			g_RootMenu.ConsolePrint("For no reason, you suddenly catch fire.  Alfred and Yeti find this");
   1.109 -			g_RootMenu.ConsolePrint("deeply disturbing, and cover your flaming corpse with Episode 2");
   1.110 -			g_RootMenu.ConsolePrint("advertisements.  Coming soon, with Team Fortress 2, and Portal!");
   1.111 -			g_RootMenu.ConsolePrint("YOU HAVE DIED.  GAME OVER.");
   1.112 -			g_yam_state = 0;
   1.113 -		} else if (strcasecmp(arg, "spray") == 0) {
   1.114 -			g_RootMenu.ConsolePrint("You spray Alfred and Yeti with butter.  Like Jack Thompson to an");
   1.115 -			g_RootMenu.ConsolePrint("ambulance, Gabe Newell instantly appears and devours them both.");
   1.116 -			g_RootMenu.ConsolePrint("You run away, just in time, as Gabe Newell explodes, registering ");
   1.117 -			g_RootMenu.ConsolePrint("a 5.6 earthquake.  Outside, world peace is achieved.");
   1.118 -			g_RootMenu.ConsolePrint("YOU HAVE WON.");
   1.119 -			g_yam_state = 0;
   1.120 -		}
   1.121 -	} else if (g_yam_state == 2) {
   1.122 -		if (strcasecmp(arg, "shake") == 0)
   1.123 -		{
   1.124 -			g_RootMenu.ConsolePrint("You shake Gaben's hand.  It is a terrifying and disgusting experience.");
   1.125 -			g_RootMenu.ConsolePrint("However, you survive, and continue on.");
   1.126 -			_YamState(3);
   1.127 -		} else if (strcasecmp(arg, "offer") == 0) {
   1.128 -			g_RootMenu.ConsolePrint("You offer Gabe Newell one (1) donut.  With a gleam in his eyes, ");
   1.129 -			g_RootMenu.ConsolePrint("he picks you up and devours you whole.");
   1.130 -			g_RootMenu.ConsolePrint("YOU HAVE DIED.  GAME OVER.");
   1.131 -			g_yam_state = 0;
   1.132 -		} else if (strcasecmp(arg, "walk") == 0) {
   1.133 -			g_RootMenu.ConsolePrint("You walk past Gabe Newell.  He can't keep up with your pace!");
   1.134 -			_YamState(3);
   1.135 -		} else {
   1.136 -			g_RootMenu.ConsolePrint("Commands are SHAKE, OFFER, and WALK.");
   1.137 -		}
   1.138 -	} else if (g_yam_state == 0) {
   1.139 -		if (strcasecmp(arg, "left") == 0)
   1.140 -		{
   1.141 -			_YamState(1);
   1.142 -		} else if (strcasecmp(arg, "right") == 0) {
   1.143 -			g_RootMenu.ConsolePrint("You run away from the Valve headquarters in sheer terror.");
   1.144 -			g_RootMenu.ConsolePrint("While running, you smash into an unknown person, who turns out to be your soul mate.");
   1.145 -			g_RootMenu.ConsolePrint("You marry and raise a family of 3 kids.");
   1.146 -			g_RootMenu.ConsolePrint("Many years later, you look back, and realize this was your best choice.");
   1.147 -			g_RootMenu.ConsolePrint("YOU HAVE WON.");
   1.148 -			g_yam_state = 0;
   1.149 -		} else if (strcasecmp(arg, "forward") == 0) {
   1.150 -			_YamState(2);
   1.151 -		} else if (arg[0] != '\0') {
   1.152 -			g_RootMenu.ConsolePrint("Commands are FORWARD, LEFT, and RIGHT.");
   1.153 -		}
   1.154 -	}
   1.155 -}
   1.156 -
   1.157 -void _IntExt_EnableYams()
   1.158 -{
   1.159 -	static ConCommand *pCmd = NULL;
   1.160 -	if (!pCmd)
   1.161 -	{
   1.162 -		pCmd = new ConCommand("sm_text", _IntExt_CallYams, "Fountain of Yams Adventure Game", FCVAR_GAMEDLL);
   1.163 -		g_RootMenu.ConsolePrint("Something is now enabled...");
   1.164 -	} else {
   1.165 -		g_RootMenu.ConsolePrint("Something is already enabled...");
   1.166 -	}
   1.167 -}