//Property of Stan423321, all wrongs reversed.
#library "IfYouReadThisThenYourDumb"
#include "input.out"

script 718 (int pl_class) {
   int playerno = PlayerNumber();
   clear_combos(playerno);
   int k = 30*4;
   while(CheckWeapon("TreesFists") || CheckWeapon("Punchokrator") || CheckWeapon("Shooter")) {
      Delay(1);
	  int input = GetPlayerInput(-1, INPUT_BUTTONS) & ~GetPlayerInput(-1, INPUT_OLDBUTTONS);
	  int arrowinput = input & (BT_FORWARD | BT_BACK | BT_MOVELEFT | BT_MOVERIGHT);
	  int keyval = -1;
	  switch (arrowinput) {
	      default: break;
		  case BT_FORWARD: keyval = 0; break;
		  case BT_MOVELEFT: keyval = 1;  break;
		  case BT_BACK: keyval = 2; break;
		  case BT_MOVERIGHT: keyval = 3; break;
	  }
	  if (keyval!=-1) {
	     k = 0; insert_key(keyval, playerno);
	  } else if (k>=35*4) {
	     clear_combos(playerno); k = 0;
	  } else {
	     k++;
	  }
	  int triggerinput = input & (BT_ATTACK | BT_ALTATTACK);
	  int something = -1;
	  switch (triggerinput) {
	     default: break;
		 case BT_ATTACK: something = receive_string(0 + 2*pl_class, playerno); clear_combos(playerno); break;
		 case BT_ALTATTACK: something = receive_string(1 + 2*pl_class, playerno); clear_combos(playerno); break;
	  }
	  if (something!=-1) {
	     GiveInventory(seq_strdict[something], 1);
	  }
   }
}