//==========EXO_SCRIPT_V_1.1=========//
//============BY_ARMADYL5============//
//===============ENJOY================//



// Welcome To EXO , This Script Gives Each Player //
// An Advanced Combat Gear , and Some Combat //
// Abilities To Help Players Survive many Situations //
// Also Some Battle Taunts To Help TeamWorking //


private const bool CL_ON = false;  // set to false to Disable Custom Loadout // 
private const bool RG_ON = true;  // set to false to Disable HP Regen // 
private const bool TIPS_ON = true;  // set to false to Disable Ingame Tips // 



// Feel Free To Use Any Script Or Method You Like //


List <IPlayer> SpeedON = new List<IPlayer>();
List <IPlayer> SpeedOFF = new List<IPlayer>();

List <IPlayer> Slow = new List<IPlayer>();

List <IPlayer> BoostDown = new List<IPlayer>();

List <IPlayer> Ground = new List<IPlayer>();

List <IPlayer> plyon = new List<IPlayer>();
List <IPlayer> plyoff = new List<IPlayer>();


float TotalDamageTaken = 0;


public void OnStartup(){
IObjectTimerTrigger Timer = (IObjectTimerTrigger)Game.CreateObject("TimerTrigger");
Timer.SetIntervalTime(100);
Timer.SetRepeatCount(0);
Timer.SetScriptMethod("EXO");
Timer.Trigger();
foreach(IPlayer ply in Game.GetPlayers()){
SpeedON.Add(ply);
}
if(CL_ON){
foreach(IPlayer ply in Game.GetPlayers()){
ply.GiveWeaponItem(WeaponItem.ASSAULT);
ply.GiveWeaponItem(WeaponItem.ASSAULT);
ply.GiveWeaponItem(WeaponItem.LAZER);
ply.GiveWeaponItem(WeaponItem.MAGNUM);
ply.GiveWeaponItem(WeaponItem.MAGNUM);
ply.GiveWeaponItem(WeaponItem.LAZER);
ply.GiveWeaponItem(WeaponItem.MACHETE);
ply.GiveWeaponItem(WeaponItem.GRENADES);
}
if(RG_ON){
IObjectTimerTrigger Timer1 = (IObjectTimerTrigger)Game.CreateObject("TimerTrigger");
Timer1.SetIntervalTime(1000);
Timer1.SetRepeatCount(0);
Timer1.SetScriptMethod("HPRegen");
Timer1.Trigger();
}
if(TIPS_ON){
IObjectTimerTrigger Timer2 = (IObjectTimerTrigger)Game.CreateObject("TimerTrigger");
Timer2.SetIntervalTime(6000);
Timer2.SetRepeatCount(0);
Timer2.SetScriptMethod("Tips");
Timer2.Trigger();
}
}
}





//============(EXO)============//


public void EXO(TriggerArgs args){
for (int i = Ground.Count-1;i>=0;i--){
IPlayer ply = Ground[i];
if(ply.IsOnGround){
Ground.Remove(ply);
SpeedON.Add(ply);
Slow.Remove(ply);
BoostDown.Add(ply);
}
}
for (int i = SpeedON.Count-1;i>=0;i--){
IPlayer ply = SpeedON[i];
Vector2 Here = ply.GetWorldPosition();
if(ply.IsWalking && !ply.IsBlocking && ply.FacingDirection == 1 && ply.IsInMidAir && !ply.IsLedgeGrabbing && !ply.IsDiving && !ply.IsClimbing && !ply.IsJumpAttacking){
Game.PlayEffect("H_T",Here);
Game.PlayEffect("H_T",Here);
Game.PlayEffect("TR_D",Here);
Game.PlayEffect("TR_D",Here);
Game.PlaySound("M60",Here,1f);
ply.SetLinearVelocity(ply.GetLinearVelocity() + new Vector2(8,1));
SpeedON.Remove(ply);
SpeedOFF.Add(ply);
Ground.Add(ply);
Slow.Add(ply);
}
if(ply.IsWalking && !ply.IsBlocking && ply.FacingDirection == -1 && ply.IsInMidAir && !ply.IsLedgeGrabbing && !ply.IsDiving && !ply.IsClimbing && !ply.IsJumpAttacking){
Game.PlayEffect("H_T",Here);
Game.PlayEffect("H_T",Here);
Game.PlayEffect("TR_D",Here);
Game.PlayEffect("TR_D",Here);
Game.PlaySound("M60",Here,1f);
ply.SetLinearVelocity(ply.GetLinearVelocity() + new Vector2(-8,1));
SpeedON.Remove(ply);
SpeedOFF.Add(ply);
Ground.Add(ply);
Slow.Add(ply);
}
}
for (int i = Slow.Count-1;i>=0;i--){
IPlayer ply = Slow[i];
Vector2 Here = ply.GetWorldPosition();
if(ply.IsWalking && ply.IsBlocking && ply.IsInMidAir){
Game.PlayEffect("H_T",Here);
Game.PlayEffect("H_T",Here);
Game.PlayEffect("TR_D",Here);
Game.PlayEffect("TR_D",Here);
Game.PlaySound("M60",Here,1f);
ply.SetLinearVelocity(ply.GetLinearVelocity()/3);
Slow.Remove(ply);
SpeedOFF.Remove(ply);
}
}
for (int i = SpeedON.Count-1;i>=0;i--){
IPlayer ply = SpeedON[i];
Vector2 Here = ply.GetWorldPosition();
if(ply.IsWalking && ply.IsInMidAir && ply.IsJumpAttacking && ply.FacingDirection == 1){
Game.PlayEffect("H_T",Here);
Game.PlayEffect("H_T",Here);
Game.PlayEffect("TR_D",Here);
Game.PlayEffect("TR_D",Here);
Game.PlaySound("M60",Here,1f);
ply.SetLinearVelocity(ply.GetLinearVelocity() + new Vector2(8,-5));
SpeedON.Remove(ply);
SpeedOFF.Add(ply);
Ground.Add(ply);
}
}
for (int i = SpeedON.Count-1;i>=0;i--){
IPlayer ply = SpeedON[i];
Vector2 Here = ply.GetWorldPosition();
if(ply.IsWalking && ply.IsInMidAir && ply.IsJumpAttacking && ply.FacingDirection == -1){
Game.PlayEffect("H_T",Here);
Game.PlayEffect("H_T",Here);
Game.PlayEffect("TR_D",Here);
Game.PlayEffect("TR_D",Here);
Game.PlaySound("M60",Here,1f);
ply.SetLinearVelocity(ply.GetLinearVelocity() + new Vector2(-8,-5));
SpeedON.Remove(ply);
SpeedOFF.Add(ply);
Ground.Add(ply);
}
}
}



public void HPRegen(TriggerArgs args){
foreach(IPlayer ply in Game.GetPlayers()){
if(ply.IsIdle && !ply.IsDead && ply.GetHealth() < 100){
ply.SetHealth(ply.GetHealth() + 1);
}
}
}


public void Tips(TriggerArgs args){
Random rand = new Random();
int randomNumber = rand.Next(7);
if(randomNumber == 0){
Game.ShowPopupMessage("Welcome To EXO , The Enhanced Combat System By Armadyl5",Color.Grey);
}
if(randomNumber == 1){
Game.ShowPopupMessage("You Can Boost Using The Walk Key While In Mid Air",Color.Green);
}
if(randomNumber == 2){
Game.ShowPopupMessage("You Can Boost Down To The Ground By Pressing Walk While JumpAttacking",Color.Green);
}
if(randomNumber == 3){
Game.ShowPopupMessage("You Can Slow Down a Speed-Boost In Mid-Air By Pressing Block + (Hold) Walk Key",Color.Grey);
}
if(randomNumber == 4){
Game.ShowPopupMessage("The Ability To SlowDown Speed-Boosts Can Save Your Life Sometimes",Color.Green);
}
if(randomNumber == 5){
Game.ShowPopupMessage("Be Carefull Before Using Speed-Boost , It Could Lead You To Death If Used Carelessly",Color.Red);
}
if(randomNumber == 6){
Game.ShowPopupMessage("You Can Disable or Enable Optional Features , By Going To The Script Box , Instructions Inside",Color.Grey);
}
}