/////////////////////////DRONE CUSTOMIZATION SCRIPT BY DANGER ROSS///////////////////////////////////////

/*//////////WHAT YOU ARE TRYING TO SHOOT GOES IN BETWEEN THE QUOTATION MARKS BELOW,////////////////////////
/////////////SHOULD BE LIKE IT IS IN THE MAP EDITOR. CAN BE A PROJECTILE OR OBJECT/////////////////////////*/ string ID = 


						"WpnShurikenThrown"






;/*///////////OPTIONAL, PUT IN A PROJECTILE POWERUP (None Bouncing OR Fire)//////////////////////////////////////*/ ProjectilePowerup power = ProjectilePowerup.


						
						
						None
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
						
;/////////////////////////////////////////CODE DO NOT CHANGE PAST THIS POINT///////////////////////////////////////////


bool IsAProjectile = false;
ProjectileItem pitem = ProjectileItem.NONE;
public void OnStartup(){
	switch(ID){
		case "NONE" : pitem = ProjectileItem.NONE;IsAProjectile = true;break;
		case "PISTOL" : pitem = ProjectileItem.PISTOL;IsAProjectile = true;break;
		case "MAGNUM" : pitem = ProjectileItem.MAGNUM;IsAProjectile = true;break;
		case "SHOTGUN" : pitem = ProjectileItem.SHOTGUN;IsAProjectile = true;break;
		case "TOMMYGUN" : pitem = ProjectileItem.TOMMYGUN;IsAProjectile = true;break;
		case "SUB_MACHINEGUN" : pitem = ProjectileItem.SUB_MACHINEGUN;IsAProjectile = true;break;
		case "M60" : pitem = ProjectileItem.M60;IsAProjectile = true;break;
		case "SNIPER" : pitem = ProjectileItem.SNIPER;IsAProjectile = true;break;
		case "SAWED_OFF" : pitem = ProjectileItem.SAWED_OFF;IsAProjectile = true;break;
		case "UZI" : pitem = ProjectileItem.UZI;IsAProjectile = true;break;
		case "BAZOOKA" : pitem = ProjectileItem.BAZOOKA;IsAProjectile = true;break;
		case "ASSAULT" : pitem = ProjectileItem.ASSAULT;IsAProjectile = true;break;
		case "CARBINE" : pitem = ProjectileItem.CARBINE;IsAProjectile = true;break;
		case "FLAREGUN" : pitem = ProjectileItem.FLAREGUN;IsAProjectile = true;break;
		case "REVOLVER" : pitem = ProjectileItem.REVOLVER;IsAProjectile = true;break;
		case "GRENADE_LAUNCHER" : pitem = ProjectileItem.GRENADE_LAUNCHER;IsAProjectile = true;break;
		case "SMG" : pitem = ProjectileItem.SMG;IsAProjectile = true;break;
		case "SILENCEDPISTOL" : pitem = ProjectileItem.SILENCEDPISTOL;IsAProjectile = true;break;
		case "SILENCEDUZI" : pitem = ProjectileItem.SILENCEDUZI;IsAProjectile = true;break;
		case "MACHINE_PISTOL" : pitem = ProjectileItem.MACHINE_PISTOL;IsAProjectile = true;break;
		case "DARK_SHOTGUN" : pitem = ProjectileItem.DARK_SHOTGUN;IsAProjectile = true;break;
		case "MP50" : pitem = ProjectileItem.MP50;IsAProjectile = true;break;
		case "FLAKCANNON" : pitem = ProjectileItem.FLAKCANNON;IsAProjectile = true;break;
		case "PISTOL45" : pitem = ProjectileItem.PISTOL45;IsAProjectile = true;break;
		case "BOW" : pitem = ProjectileItem.BOW;IsAProjectile = true;break;


	}
CreateTimer(10,0,"update","0");
	
}

public void update(TriggerArgs args){//WpnShurikenThrown
	//if(Game.GetMissileObjects().Count() > 0)Game.RunCommand("/msg " + Game.GetMissileObjects()[0].Name);

	int prjctls = Game.GetProjectiles().Count();

	if (prjctls > 0 ) foreach(IProjectile prjctl in Game.GetProjectiles()) if(prjctl.ProjectileItem == ProjectileItem.SILENCEDUZI && prjctl.InitialOwnerPlayerID == 0 && prjctl.BounceCount == 0){
		prjctl.FlagForRemoval();
		if(!IsAProjectile){
			IObject throwing = Game.CreateObject(ID,prjctl.Position , (float)Math.Atan2(prjctl.Direction.X, prjctl.Direction.Y) , prjctl.Velocity/50 + new Vector2(0,3), 50f * (int)(prjctl.Direction.X % 1), (int)(prjctl.Direction.X % 1));
			throwing.TrackAsMissile(true);
		} else {
			Game.SpawnProjectile(pitem, prjctl.Position, prjctl.Direction, power);
					
				
			
		}
	}
}
public void CreateTimer(int interval, int count, string method, string id) {
	IObjectTimerTrigger timerTrigger = (IObjectTimerTrigger)Game.CreateObject("TimerTrigger"); 
	timerTrigger.SetIntervalTime(interval);
	timerTrigger.SetRepeatCount(count);
	timerTrigger.SetScriptMethod(method);
	timerTrigger.CustomId = id;
	timerTrigger.Trigger();
}