home *** CD-ROM | disk | FTP | other *** search
/ Quake 'em / QUAKEEM.BIN / quake / programs / tf1_1src / tforthlp.qc < prev    next >
Encoding:
Text File  |  1996-08-30  |  11.6 KB  |  315 lines

  1. /* 
  2.     TeamFortress 1.1    -    27/8/96
  3.  
  4.     Robin Walker, John Cook, Ian Caughley.
  5.  
  6.     Functions handling all the help displaying for TeamFortress. 
  7. */
  8. // Prototypes
  9. // Help Functions
  10. void(float helpindex) TeamFortress_Help;
  11. void() TeamFortress_MOTD;
  12. void() TeamFortress_HelpIndex;
  13. void() TeamFortress_HelpWeapon;
  14. void() TeamFortress_HelpClass;
  15. void() TeamFortress_HelpItem;
  16. void() TeamFortress_HelpGeneral;
  17. void() TeamFortress_HelpPreImp;
  18. void() TeamFortress_HelpShowPreImp;
  19. void() TeamFortress_HelpShowImp;
  20. void() TeamFortress_HelpSkin;
  21.  
  22. //=========================================================================
  23. // HELP FUNCTIONS
  24. //=========================================================================
  25. //=========================================================================
  26. // Help for the Impulse commands in TeamFortress
  27. void(float helpindex) TeamFortress_Help =
  28. {
  29.     // prevent help pre-impulse from triggering anything else
  30.     self.impulse = 0;
  31.     self.last_impulse = 0;
  32.  
  33.     if (helpindex == TF_HELP)
  34.         TeamFortress_HelpIndex();
  35.     if (helpindex == TF_HELP_GENERAL)
  36.         TeamFortress_HelpGeneral();
  37.     if (helpindex == TF_HELP_CLASS)
  38.         TeamFortress_HelpClass();
  39.     if (helpindex == TF_HELP_WEAPON)
  40.         TeamFortress_HelpWeapon();
  41.     if (helpindex == TF_HELP_ITEM)
  42.         TeamFortress_HelpItem();
  43.     if (helpindex == TF_HELP_PREIMP)
  44.         TeamFortress_HelpPreImp();
  45.     if (helpindex == TF_HELP_PREIMP_SHOW)
  46.         TeamFortress_HelpShowPreImp();
  47.     if (helpindex == TF_HELP_IMP_SHOW)
  48.         TeamFortress_HelpShowImp();
  49.     if (helpindex == TF_HELP_SKIN)
  50.         TeamFortress_HelpSkin();
  51. };
  52.  
  53. void() TeamFortress_MOTD =
  54. {
  55.     if (self.motd == 0)
  56.     {
  57.         // If you run this is a server, you're welcome to change to initial
  58.         // message here, but _please_ leave in the first line.
  59.         // display welcome
  60.         // sprint this bit so it gets put into the console log
  61.         sprint(self,"Type helpme for Help. :)\n");
  62.         centerprint(self, "Welcome to TeamFortress! v1.0\nRobin Walker, John Cook, Ian Caughley.\n======================================\nType helpme for Help. :)\n");
  63.  
  64.         // Stuff Aliases
  65.         // Help
  66.         TeamFortress_Alias("helpme",TF_HELP, TF_HELP);
  67.         TeamFortress_Alias("generalhelp",TF_HELP,TF_HELP_GENERAL);
  68.         TeamFortress_Alias("classhelp",TF_HELP,TF_HELP_CLASS);
  69.         TeamFortress_Alias("weaponhelp",TF_HELP,TF_HELP_WEAPON);
  70.         TeamFortress_Alias("itemhelp",TF_HELP,TF_HELP_ITEM);
  71.         TeamFortress_Alias("preimphelp",TF_HELP,TF_HELP_PREIMP);
  72.         TeamFortress_Alias("showpreimp",TF_HELP,TF_HELP_PREIMP_SHOW);
  73.         TeamFortress_Alias("showimp",TF_HELP,TF_HELP_IMP_SHOW);
  74.         TeamFortress_Alias("skinhelp",TF_HELP,TF_HELP_SKIN);
  75.  
  76.         // General
  77.         TeamFortress_Alias("inv",TF_INVENTORY,0);
  78.  
  79.         // Class Changing
  80.         TeamFortress_Alias("scout",(TF_CHANGEPC+PC_SCOUT),0);
  81.         TeamFortress_Alias("sniper",(TF_CHANGEPC+PC_SNIPER),0);
  82.         TeamFortress_Alias("soldier",(TF_CHANGEPC+PC_SOLDIER),0);
  83.         TeamFortress_Alias("demoman",(TF_CHANGEPC+PC_DEMOMAN),0);
  84.         TeamFortress_Alias("medic",(TF_CHANGEPC+PC_MEDIC),0);
  85.         TeamFortress_Alias("hwguy",(TF_CHANGEPC+PC_HVYWEAP),0);
  86.  
  87.         // Grenades
  88.         TeamFortress_Alias("primeone", TF_GRENADE_1,0);
  89.         TeamFortress_Alias("primetwo", TF_GRENADE_2,0);
  90.         TeamFortress_Alias("throwgren", TF_GRENADE_T,0);
  91.  
  92.         // Pipebombs
  93.         TeamFortress_Alias("detpipe", TF_PB_DETONATE,0);
  94.  
  95.         // Sample aliases for the Scanner
  96.         TeamFortress_Alias("scan10", TF_SCAN, 10);
  97.         TeamFortress_Alias("scan50", TF_SCAN, 50);
  98.         TeamFortress_Alias("scan250", TF_SCAN, 250);
  99.         TeamFortress_Alias("scanf", TF_SCAN, TF_SCAN_FRIENDLY);
  100.         TeamFortress_Alias("scane", TF_SCAN, TF_SCAN_ENEMY);
  101.  
  102.         // Sample aliases for the Detpack
  103.         TeamFortress_Alias("det5", TF_DETPACK, 5);
  104.         TeamFortress_Alias("det20", TF_DETPACK, 20);
  105.         TeamFortress_Alias("det250", TF_DETPACK, 250);
  106.  
  107.         // Toggleable Game Settings
  108.         TeamFortress_Alias("t_skin", TF_TOGGLE, TF_TOGGLE_SKIN);
  109.         TeamFortress_Alias("t_classpersist", TF_TOGGLE, TF_TOGGLE_CLASS_PERSIST);
  110.         TeamFortress_Alias("t_cheatcheck", TF_TOGGLE, TF_TOGGLE_CHEATCHECK);
  111.         TeamFortress_Alias("t_fortressmap", TF_TOGGLE, TF_TOGGLE_FORTRESSMAP);
  112.  
  113.         // Skin handlers
  114.         TeamFortress_Alias("nextskin", TF_SKIN_NEXT, 0);
  115.         TeamFortress_Alias("prevskin", TF_SKIN_PREV, 0);
  116.         TeamFortress_Alias("skin10", TF_MULTISKIN, 10);
  117.         TeamFortress_Alias("skin20", TF_MULTISKIN, 20);
  118.  
  119.         // Team handlers
  120.         TeamFortress_Alias("imin1",TF_TEAM, 1);
  121.         TeamFortress_Alias("imin2",TF_TEAM, 2);
  122.         TeamFortress_Alias("imin3",TF_TEAM, 3);
  123.         TeamFortress_Alias("imin4",TF_TEAM, 4);
  124.  
  125.         self.motd = 1;
  126.     }
  127. };
  128.  
  129. //=========================================================================
  130. // Help displayed when someone types the alais "classhelp"
  131. void() TeamFortress_HelpClass =
  132. {
  133.     sprint(self, "Commands to choose Playerclass:\n");
  134.     sprint(self, "scout   : Scout\n");
  135.     sprint(self, "sniper  : Sniper\n");
  136.     sprint(self, "soldier : Soldier\n");
  137.     sprint(self, "demoman : Demolitions Man\n");
  138.     sprint(self, "medic   : Combat Medic\n");
  139.     sprint(self, "hwguy   : Heavy Weapons Guy\n");
  140. };
  141.  
  142. //=========================================================================
  143. // Help displayed when someone types the alais "itemhelp"
  144. void() TeamFortress_HelpItem =
  145. {
  146.     sprint(self, "Commands to use new items:\n");
  147.     sprint(self, "det5    : Set detpack for 5 sec\n");
  148.     sprint(self, "det20   : Set detpack for 20 sec\n");
  149.     sprint(self, "det250  : Set detpack for 250 sec\n");
  150.     sprint(self, "scan10  : Scan using 10 energy\n");
  151.     sprint(self, "scan50  : Scan using 50 energy\n");
  152.     sprint(self, "scan250 : Scan using 250 energy\n");
  153.     sprint(self, "scanf   : Toggle scanning of Friendlies\n");
  154.     sprint(self, "scane   : Toggle scanning of Enemies\n");
  155. };
  156.  
  157. //=========================================================================
  158. // Help displayed when someone types the alais "weaponhelp"
  159. void() TeamFortress_HelpWeapon =
  160. {
  161.     sprint(self, "Commands to use new weapons:\n");
  162.     sprint(self, "primeone   : Prime a Grenade of Type 1\n");
  163.     sprint(self, "primetwo   : Prime a Grenade of Type 2\n");
  164.     sprint(self, "throwgren  : Throw the primed Grenade\n");
  165.     sprint(self, "detpipe    : Detonate pipebombs\n");
  166. };
  167.  
  168. //=========================================================================
  169. // Help displayed when someone types the alais "preimphelp"
  170. void() TeamFortress_HelpPreImp =
  171. {
  172.     local string imp;
  173.  
  174.     sprint(self, "This is fairly advanced. If you don't know how to make aliases ");
  175.     sprint(self, "then just ignore this section. You can play the game just fine without it.\n");
  176.     sprint(self, "Pre-impulses are impulses that are used before another impulse that ");
  177.     sprint(self, "change the interpretation of the second impulse. ");
  178.     sprint(self, "e.g. The scanner uses a Pre-Impulse. The impulse that is given _after_ ");
  179.     sprint(self, "the Pre-Impulse is interpreted by the scanner to be the amount of energy ");
  180.     sprint(self, "you wish to spend on the scan.\n");
  181.     sprint(self, "There are already aliases bound which use the Scanner, and other Pre-Impulse ");
  182.     sprint(self, "items, but you may wish to make your own using different times//energy//etc.\n");
  183.     sprint(self, "If so, you want to make an alias which does the Pre-Impulse, then does a Wait, ");
  184.     sprint(self, "then does the impulse specifying time//energy//etc. Then bind the alias to a key.\n");
  185.     sprint(self, "e.g. alias scan56 \"impulse ");
  186.     imp = ftos(TF_SCAN);
  187.     sprint(self, imp);
  188.     sprint(self, ";wait; impulse 56\"\n");
  189.     sprint(self, "See the readme.txt for more help on Pre-Impulses.\n");
  190.     sprint(self, "To see a list of all Pre-Impulses being used at the moment, type showpreimp.\n");
  191.     sprint(self, "Use pageup in the console to see all of the above :)\n");
  192. };
  193.  
  194. //=========================================================================
  195. // Help displayed when someone types the alais "showpreimp"
  196. void() TeamFortress_HelpShowPreImp =
  197. {
  198.     local string imp;
  199.  
  200.     sprint(self, "Pre-Impulses being used:\n");
  201.     sprint(self, "Scanner Pre-Imp   : ");
  202.     imp = ftos(TF_SCAN);
  203.     sprint(self, imp);
  204.     sprint(self, "\nDetpack Pre-Imp   : ");
  205.     imp = ftos(TF_DETPACK);
  206.     sprint(self, imp);
  207.     sprint(self, "\nMultiskin Pre-Imp : ");
  208.     imp = ftos(TF_MULTISKIN);           
  209.     sprint(self, imp);
  210.     sprint(self, "\nToggle Pre-Imp    : ");
  211.     imp = ftos(TF_TOGGLE);
  212.     sprint(self, imp);
  213.     sprint(self, "\nHelp Pre-Imp      : ");
  214.     imp = ftos(TF_HELP);
  215.     sprint(self, imp);
  216.     sprint(self, "\n");
  217. };
  218.  
  219. //=========================================================================
  220. // Help displayed when someone types the alias "helpme"
  221. void() TeamFortress_HelpIndex =
  222. {
  223.     sprint(self, "Help Index\n");
  224.     sprint(self, "==========\n");
  225.     sprint(self, "generalhelp : General Command Help.\n");
  226.     sprint(self, "classhelp   : Player Classes Help.\n");
  227.     sprint(self, "weaponhelp  : Weapon Command Help.\n");
  228.     sprint(self, "itemhelp    : Item Command Help.\n");
  229.     sprint(self, "skinhelp    : Skin Selection Help.\n");
  230.     sprint(self, "togglehelp  : Option Toggling Help.\n");
  231.     sprint(self, "preimphelp  : Pre-Impulse Summary.\n");
  232.     sprint(self, "showpreimp  : Show all Pre-Impulses.\n");
  233.     sprint(self, "showimp     : Show all Impulses.\n");
  234.     sprint(self, "===================================\n");
  235.     sprint(self, "Comments : walker@netspace.net.au\n");
  236.     sprint(self, "Full command descriptions in Readme.txt\n");
  237.     sprint(self, "Use pageup in the console to see all the help :)\n");
  238. };
  239.  
  240. //=========================================================================
  241. // Help displayed when someone types the alias "generalhelp"
  242. void() TeamFortress_HelpGeneral =
  243. {
  244.     sprint(self, "inv       : Display your inventory.\n");
  245.     sprint(self, "==\n");
  246.     sprint(self, "Comments : walker@netspace.net.au\n");
  247.     sprint(self, "Full command descriptions in Readme.txt\n");
  248.     sprint(self, "Use pageup in the console to see all the impulses above :)\n");
  249.  
  250. };
  251.  
  252. //=========================================================================
  253. // Help displayed when someone types the alais "skinhelp"
  254. void() TeamFortress_HelpSkin =
  255. {
  256.     sprint(self, "Commands for skin selection are:\n");
  257.     sprint(self, "nextskin  : See if you can guess :)\n");
  258.     sprint(self, "prevskin  : See above.\n");
  259.     sprint(self, "skin10    : Set your skin to no 10\n");
  260.     sprint(self, "skin20    : Set your skin to no 20\n");
  261.     sprint(self, "These all have no effect if Classkin is On. Instead,");
  262.     sprint(self, "your skin will be assigned to you based on your class.");
  263. };
  264.  
  265.  
  266. //=========================================================================
  267. // Help displayed when someone types the alais "showimp"
  268. void() TeamFortress_HelpShowImp =
  269. {
  270.     local string imp;
  271.  
  272.     sprint(self, "Impulses being used:\n");
  273.     sprint(self, "Inventory       : ");
  274.     imp = ftos(TF_INVENTORY);
  275.     sprint(self, imp);
  276.     sprint(self, "\nPrime Grenade 1 : ");
  277.     imp = ftos(TF_GRENADE_1);
  278.     sprint(self, imp);
  279.     sprint(self, "\nPrime Grenade 2 : ");
  280.     imp = ftos(TF_GRENADE_2);
  281.     sprint(self, imp);
  282.     sprint(self, "\nThrow Grenade   : ");
  283.     imp = ftos(TF_GRENADE_T);
  284.     sprint(self, imp);
  285.     sprint(self, "\nDet.Pipebombs   : ");
  286.     imp = ftos(TF_PB_DETONATE);
  287.     sprint(self, imp);
  288.     sprint(self, "\nScout           : ");
  289.     imp = ftos(TF_CHANGEPC + PC_SCOUT);
  290.     sprint(self, imp);
  291.     sprint(self, "\nSniper          : ");
  292.     imp = ftos(TF_CHANGEPC + PC_SNIPER);
  293.     sprint(self, imp);
  294.     sprint(self, "\nSoldier         : ");
  295.     imp = ftos(TF_CHANGEPC + PC_SOLDIER);
  296.     sprint(self, imp);
  297.     sprint(self, "\nDemolitions Man : ");
  298.     imp = ftos(TF_CHANGEPC + PC_DEMOMAN);
  299.     sprint(self, imp);
  300.     sprint(self, "\nCombat Medic    : ");
  301.     imp = ftos(TF_CHANGEPC + PC_MEDIC);
  302.     sprint(self, imp);
  303.     sprint(self, "\nHeavy WeaponGuy : ");
  304.     imp = ftos(TF_CHANGEPC + PC_HVYWEAP);
  305.     sprint(self, imp);
  306.     sprint(self, "\nNext Skin       : ");
  307.     imp = ftos(TF_SKIN_NEXT);
  308.     sprint(self, imp);
  309.     sprint(self, "\nPrevious Skin   : ");
  310.     imp = ftos(TF_SKIN_PREV);
  311.     sprint(self, imp);
  312.  
  313.     sprint(self, "\nPre-Impulses are used for more advanced uses.\n");
  314.     sprint(self, "Type preimphelp to see the Pre-Impulse Summary.\n");
  315. };