//=============================================================================
// WeaponDeagle. 
//=============================================================================

class WeaponBadBoi extends DeusExWeapon;

var bool bBurst;

replication
{
    reliable if ( Role == ROLE_Authority )
    SetReloadStuff;
}


simulated function bool ClientFire( float value )
{
		if((Region.Zone.IsA('ArenaZoneSafe')) || (Region.Zone.IsA('MMRPGRoomArea')) || (Region.Zone.IsA('MMRPGSafeArea')))
		{
			return False;
		}

		if((!Region.Zone.IsA('ArenaZoneSafe')) && (!Region.Zone.IsA('MMRPGRoomArea')) && (!Region.Zone.IsA('MMRPGSafeArea')))
		{
			return Super.ClientFire(value);
		}
}

simulated event RenderOverlays( canvas Canvas )
{
	// set first person skin settings
		MultiSkins[0]=Texture'BadBoiTex1';
		MultiSkins[1]=Texture'BadBoiTex1';
		MultiSkins[3]=Texture'WeaponHandsTex';
		MultiSkins[2]=Texture'BlackMaskTex';
		MultiSkins[4]=Texture'WeaponHandsTex';

	Super.RenderOverlays( Canvas );

	// reset third person skin settings
		MultiSkins[0]=Texture'BadBoiTex2';
		MultiSkins[1]=Texture'BadBoiTex2';
		MultiSkins[2]=Texture'BlackMaskTex';
		MultiSkins[3]=Texture'BadBoiTex2';
}



function BecomePickup()
{
	Super.BecomePickup();
			MultiSkins[0]=Texture'BadBoiTex2';
			MultiSkins[1]=Texture'BadBoiTex2';
			MultiSkins[2]=Texture'BadBoiTex2';
			MultiSkins[3]=Texture'BadBoiTex2';
}

function DropFrom(vector StartLocation)
{
	Super.DropFrom(StartLocation);
			MultiSkins[0]=Texture'BadBoiTex2';
			MultiSkins[1]=Texture'BadBoiTex2';
			MultiSkins[2]=Texture'BadBoiTex2';
			MultiSkins[3]=Texture'BadBoiTex2';
}


function BecomeItem()
{
	Super.BecomeItem();
}



simulated function bool TestMPBeltSpot(int BeltSpot)
{
   return ( (BeltSpot >= 1) && (BeltSpot <=9) );
}

simulated function PreBeginPlay()
{
	Super.PreBeginPlay();

	// If this is a netgame, then override defaults
	if ( Level.NetMode != NM_StandAlone )
	{
		HitDamage = mpHitDamage;
		BaseAccuracy = mpBaseAccuracy;
		ReloadTime = mpReloadTime;
		AccurateRange = mpAccurateRange;
		MaxRange = mpMaxRange;
		ReloadCount = mpReloadCount;
	}
}
function Fire(float Value)
{
	if((Region.Zone.IsA('ArenaZoneSafe')) || (Region.Zone.IsA('MMRPGRoomArea')) || (Region.Zone.IsA('MMRPGSafeArea')))
	{
		return;
	}

	if((!Region.Zone.IsA('ArenaZoneSafe')) && (!Region.Zone.IsA('MMRPGRoomArea')) && (!Region.Zone.IsA('MMRPGSafeArea')))
	{
		Super.Fire(Value);
	}
}


simulated function SetReloadStuff( bool bLag)
{
	If (bLag)
	{
		ReloadCount = 3;
	}
	If (!bLag)
	{
		ReloadCount = 7;
	}
}

function CycleAmmo()
{
	local Pawn P;


	P = Pawn(Owner);

	if (P == None)
		return;

	if (bBurst)
	{
		P.ClientMessage("Semi-automatic firing style selected");
		bBurst = False;
		SetReloadStuff(false);
		ReloadAmmo();
		SetClientAmmoParams( True, False, 0.400000, FireSound, ProjectileClass, ProjectileSpeed );
		if ( Level.NetMode != NM_StandAlone )
		{
			HitDamage = 21;
		}
		return;
	}
	else if (!bBurst)
	{
		P.ClientMessage("Burst firing style selected");
		bBurst = True;
		SetReloadStuff(true);
		ReloadAmmo();
		SetClientAmmoParams( True, True, 0.050000, FireSound, ProjectileClass, ProjectileSpeed );
		if ( Level.NetMode != NM_StandAlone )
		{
			HitDamage = 15;
		}
		return;
	}

}



defaultproperties
{
     LowAmmoWaterMark=7
     GoverningSkill=Class'DeusEx.SkillWeaponPistol'
     EnviroEffective=ENVEFF_Air
     Concealability=CONC_Visual
     ShotTime=0.400000
     reloadTime=3.000000
     HitDamage=13
     maxRange=3200
     AccurateRange=2400
     bHasMuzzleFlash=True
     BaseAccuracy=0.800000
     bCanHaveScope=False
     ScopeFOV=25
     bCanHaveLaser=True
     recoilStrength=1.00000
     mpReloadTime=2.000000
     mpHitDamage=13
     mpBaseAccuracy=0.800000
     mpAccurateRange=1200
     mpMaxRange=1200
     mpReloadCount=7
     bCanHaveModBaseAccuracy=True
     bCanHaveModReloadCount=True
     bCanHaveModAccurateRange=True
     bCanHaveModReloadTime=True
     bCanHaveModRecoilStrength=True
     AmmoName=Class'Contender.AmmoBadBoi'
     ReloadCount=7
     PickupAmmoCount=7
     bInstantHit=True
     FireOffset=(X=-22.000000,Y=10.000000,Z=23.000000)
     shakemag=900.000000
     FireSound=Sound'ContenderStuff.Weapons.DeagleFire'
     CockingSound=Sound'ContenderStuff.Weapons.DeagleReload'
     SelectSound=Sound'ContenderStuff.Weapons.DeagleSelect'
     InventoryGroup=243
     ItemName="|p2'BadBoi'|p1 Desert Eagle"
     PlayerViewOffset=(X=22.000000,Y=-10.000000,Z=-14.000000)
     PlayerViewMesh=LodMesh'ContenderStuff.deagle1'
     PickupViewMesh=LodMesh'ContenderStuff.deaglepickup'
     ThirdPersonMesh=LodMesh'ContenderStuff.deagle3'
     Icon=Texture'ContenderStuff.Icons.BeltIconBadBoi'
     largeIcon=Texture'ContenderStuff.Icons.BeltIconBadBoi'
	MultiSkins(0)=Texture'BadBoiTex2'
	MultiSkins(1)=Texture'BadBoiTex2'
	MultiSkins(2)=Texture'BadBoiTex2'
	MultiSkins(3)=Texture'BadBoiTex2'
     largeIconWidth=46
     largeIconHeight=28
     Description="A .50 caliber desert eagle BadBoi."
     beltDescription="|p2BADBOI"
     Mesh=LodMesh'ContenderStuff.deaglepickup'
     CollisionRadius=10.000000
     CollisionHeight=1.500000
     Rotation=(Yaw=-5736)
}
