Untitled diff
843 lines
//=============================================================================
//=============================================================================
// DeusExWeapon.
// DeusExWeapon.
//=============================================================================
//=============================================================================
class DeusExWeapon extends Weapon
class DeusExWeapon extends Weapon
	abstract;
	abstract;
//
//
// enums for weapons (duh)
// enums for weapons (duh)
//
//
enum EEnemyEffective
enum EEnemyEffective
{
{
	ENMEFF_All,
	ENMEFF_All,
	ENMEFF_Organic,
	ENMEFF_Organic,
	ENMEFF_Robot
	ENMEFF_Robot
};
};
enum EEnviroEffective
enum EEnviroEffective
{
{
	ENVEFF_All,
	ENVEFF_All,
	ENVEFF_Air,
	ENVEFF_Air,
	ENVEFF_Water,
	ENVEFF_Water,
	ENVEFF_Vacuum,
	ENVEFF_Vacuum,
	ENVEFF_AirWater,
	ENVEFF_AirWater,
	ENVEFF_AirVacuum,
	ENVEFF_AirVacuum,
	ENVEFF_WaterVacuum
	ENVEFF_WaterVacuum
};
};
enum EConcealability
enum EConcealability
{
{
	CONC_None,
	CONC_None,
	CONC_Visual,
	CONC_Visual,
	CONC_Metal,
	CONC_Metal,
	CONC_All
	CONC_All
};
};
enum EAreaType
enum EAreaType
{
{
	AOE_Point,
	AOE_Point,
	AOE_Cone,
	AOE_Cone,
	AOE_Sphere
	AOE_Sphere
};
};
enum ELockMode
enum ELockMode
{
{
	LOCK_None,
	LOCK_None,
	LOCK_Invalid,
	LOCK_Invalid,
	LOCK_Range,
	LOCK_Range,
	LOCK_Acquire,
	LOCK_Acquire,
	LOCK_Locked
	LOCK_Locked
};
};
var bool				bReadyToFire;			// true if our bullets are loaded, etc.
var bool				bReadyToFire;			// true if our bullets are loaded, etc.
var() int				LowAmmoWaterMark;		// critical low ammo count
var() int				LowAmmoWaterMark;		// critical low ammo count
var travel int			ClipCount;				// number of bullets remaining in current clip
var travel int			ClipCount;				// number of bullets remaining in current clip
var() Name		FireAnim[2];
var() Name		FireAnim[2];
var() class<Skill>		GoverningSkill;			// skill that affects this weapon
var() class<Skill>		GoverningSkill;			// skill that affects this weapon
var() travel float		NoiseLevel;				// amount of noise that weapon makes when fired
var() travel float		NoiseLevel;				// amount of noise that weapon makes when fired
var() EEnemyEffective	EnemyEffective;			// type of enemies that weapon is effective against
var() EEnemyEffective	EnemyEffective;			// type of enemies that weapon is effective against
var() EEnviroEffective	EnviroEffective;		// type of environment that weapon is effective in
var() EEnviroEffective	EnviroEffective;		// type of environment that weapon is effective in
var() EConcealability	Concealability;			// concealability of weapon
var() EConcealability	Concealability;			// concealability of weapon
var() travel bool		bAutomatic;				// is this an automatic weapon?
var() travel bool		bAutomatic;				// is this an automatic weapon?
var() travel float		ShotTime;				// number of seconds between shots
var() travel float		ShotTime;				// number of seconds between shots
var() travel float		ReloadTime;				// number of seconds needed to reload the clip
var() travel float		ReloadTime;				// number of seconds needed to reload the clip
var() int				HitDamage;				// damage done by a single shot (or for shotguns, a single slug)
var() int				HitDamage;				// damage done by a single shot (or for shotguns, a single slug)
var() int				MaxRange;				// absolute maximum range in world units (feet * 16)
var() int				MaxRange;				// absolute maximum range in world units (feet * 16)
var() travel int		AccurateRange;			// maximum accurate range in world units (feet * 16)
var() travel int		AccurateRange;			// maximum accurate range in world units (feet * 16)
var() travel float		BaseAccuracy;			// base accuracy (0.0 is dead on, 1.0 is far off)
var() travel float		BaseAccuracy;			// base accuracy (0.0 is dead on, 1.0 is far off)
//IRONOUT var bool          bInIronSight;         //GMDX iron sight active, removing bZoomed . test to see if bZoomed hides weapon
//IRONOUT var bool          bInIronSight;         //GMDX iron sight active, removing bZoomed . test to see if bZoomed hides weapon
var bool				bCanHaveScope;			// can this weapon have a scope?
var bool				bCanHaveScope;			// can this weapon have a scope?
var() travel bool		bHasScope;				// does this weapon have a scope?
var() travel bool		bHasScope;				// does this weapon have a scope?
var() int				ScopeFOV;				// FOV while using scope
var() int				ScopeFOV;				// FOV while using scope
var bool				bZoomed;				// are we currently zoomed?
var bool				bZoomed;				// are we currently zoomed?
var bool				bWasZoomed;				// were we zoomed? (used during reloading)
var bool				bWasZoomed;				// were we zoomed? (used during reloading)
var bool				bCanHaveLaser;			// can this weapon have a laser sight?
var bool				bCanHaveLaser;			// can this weapon have a laser sight?
var() travel bool		bHasLaser;				// does this weapon have a laser sight?
var() travel bool		bHasLaser;				// does this weapon have a laser sight?
var bool				bLasing;				// is the laser sight currently on?
var bool				bLasing;				// is the laser sight currently on?
var LaserEmitter		Emitter;				// actual laser emitter - valid only when bLasing == True
var LaserEmitter		Emitter;				// actual laser emitter - valid only when bLasing == True
var bool				bCanHaveSilencer;		// can this weapon have a silencer?
var bool				bCanHaveSilencer;		// can this weapon have a silencer?
var() travel bool		bHasSilencer;			// does this weapon have a silencer?
var() travel bool		bHasSilencer;			// does this weapon have a silencer?
var() bool				bCanTrack;				// can this weapon lock on to a target?
var() bool				bCanTrack;				// can this weapon lock on to a target?
var() float				LockTime;				// how long the target must stay targetted to lock
var() float				LockTime;				// how long the target must stay targetted to lock
var float				LockTimer;				// used for lock checking
var float				LockTimer;				// used for lock checking
var float            MaintainLockTimer;   // Used for maintaining a lock even after moving off target.
var float            MaintainLockTimer;   // Used for maintaining a lock even after moving off target.
var Actor            LockTarget;          // Used for maintaining a lock even after moving off target.
var Actor            LockTarget;          // Used for maintaining a lock even after moving off target.
var Actor				Target;					// actor currently targetted
var Actor				Target;					// actor currently targetted
var ELockMode			LockMode;				// is this target locked?
var ELockMode			LockMode;				// is this target locked?
var string				TargetMessage;			// message to print during targetting
var string				TargetMessage;			// message to print during targetting
var float				TargetRange;			// range to current target
var float				TargetRange;			// range to current target
var() Sound				LockedSound;			// sound to play when locked
var() Sound				LockedSound;			// sound to play when locked
var() Sound				TrackingSound;			// sound to play while tracking a target
var() Sound				TrackingSound;			// sound to play while tracking a target
var float				SoundTimer;				// to time the sounds correctly
var float				SoundTimer;				// to time the sounds correctly
var() class<Ammo>		AmmoNames[4];			// three possible types of ammo per weapon   //CyberP ammo part 1
var() class<Ammo>		AmmoNames[4];			// three possible types of ammo per weapon   //CyberP ammo part 1
var() class<Projectile> ProjectileNames[4];		// projectile classes for different ammo     //CyberP ammo part 1
var() class<Projectile> ProjectileNames[4];		// projectile classes for different ammo     //CyberP ammo part 1
var() EAreaType			AreaOfEffect;			// area of effect of the weapon
var() EAreaType			AreaOfEffect;			// area of effect of the weapon
var() bool				bPenetrating;			// shot will penetrate and cause blood
var() bool				bPenetrating;			// shot will penetrate and cause blood
var() float				StunDuration;			// how long the shot stuns the target
var() float				StunDuration;			// how long the shot stuns the target
var() bool				bHasMuzzleFlash;		// does this weapon have a flash when fired?
var() bool				bHasMuzzleFlash;		// does this weapon have a flash when fired?
var() bool				bHandToHand;			// is this weapon hand to hand (no ammo)?
var() bool				bHandToHand;			// is this weapon hand to hand (no ammo)?
var globalconfig vector SwingOffset;     // offsets for this weapon swing.
var globalconfig vector SwingOffset;     // offsets for this weapon swing.
var() travel float		recoilStrength;			// amount that the weapon kicks back after firing (0.0 is none, 1.0 is large)
var() travel float		recoilStrength;			// amount that the weapon kicks back after firing (0.0 is none, 1.0 is large)
var bool				bFiring;				// True while firing, used for recoil
var bool				bFiring;				// True while firing, used for recoil
var bool				bOwnerWillNotify;		// True if firing hand-to-hand weapons is dependent on the owner's animations
var bool				bOwnerWillNotify;		// True if firing hand-to-hand weapons is dependent on the owner's animations
var bool				bFallbackWeapon;		// If True, only use if no other weapons are available
var bool				bFallbackWeapon;		// If True, only use if no other weapons are available
var bool				bNativeAttack;			// True if weapon represents a native attack
var bool				bNativeAttack;			// True if weapon represents a native attack
var bool				bEmitWeaponDrawn;		// True if drawing this weapon should make NPCs react
var bool				bEmitWeaponDrawn;		// True if drawing this weapon should make NPCs react
var bool				bUseWhileCrouched;		// True if NPCs should crouch while using this weapon
var bool				bUseWhileCrouched;		// True if NPCs should crouch while using this weapon
var bool				bUseAsDrawnWeapon;		// True if this weapon should be carried by NPCs as a drawn weapon
var bool				bUseAsDrawnWeapon;		// True if this weapon should be carried by NPCs as a drawn weapon
var bool				bWasInFiring;
var bool				bWasInFiring;
var bool bNearWall;								// used for prox. mine placement
var bool bNearWall;								// used for prox. mine placement
var Vector placeLocation;						// used for prox. mine placement
var Vector placeLocation;						// used for prox. mine placement
var Vector placeNormal;							// used for prox. mine placement
var Vector placeNormal;							// used for prox. mine placement
var Mover placeMover;							// used for prox. mine placement
var Mover placeMover;							// used for prox. mine placement
var float ShakeTimer;
var float ShakeTimer;
var float ShakeYaw;
var float ShakeYaw;
var float ShakePitch;
var float ShakePitch;
var float AIMinRange;							// minimum "best" range for AI; 0=default min range
var float AIMinRange;							// minimum "best" range for AI; 0=default min range
var float AIMaxRange;							// maximum "best" range for AI; 0=default max range
var float AIMaxRange;							// maximum "best" range for AI; 0=default max range
var float AITimeLimit;							// maximum amount of time an NPC should hold the weapon; 0=no time limit
var float AITimeLimit;							// maximum amount of time an NPC should hold the weapon; 0=no time limit
var float AIFireDelay;							// Once fired, use as fallback weapon until the timeout expires; 0=no time limit
var float AIFireDelay;							// Once fired, use as fallback weapon until the timeout expires; 0=no time limit
var float standingTimer;						// how long we've been standing still (to increase accuracy)
var float standingTimer;						// how long we've been standing still (to increase accuracy)
var float currentAccuracy;						// what the currently calculated accuracy is (updated every tick)
var float currentAccuracy;						// what the currently calculated accuracy is (updated every tick)
var MuzzleFlash flash;							// muzzle flash actor
var MuzzleFlash flash;							// muzzle flash actor
var float MinSpreadAcc;        // Minimum accuracy for multiple slug weapons (shotgun).  Affects only multiplayer,
var float MinSpreadAcc;        // Minimum accuracy for multiple slug weapons (shotgun).  Affects only multiplayer,
							   // keeps shots from all going in same place (ruining shotgun effect)
							   // keeps shots from all going in same place (ruining shotgun effect)
var float MinProjSpreadAcc;
var float MinProjSpreadAcc;
var float MinWeaponAcc;        // Minimum accuracy for a weapon at all.  Affects only multiplayer.
var float MinWeaponAcc;        // Minimum accuracy for a weapon at all.  Affects only multiplayer.
var bool bNeedToSetMPPickupAmmo;
var bool bNeedToSetMPPickupAmmo;
var bool	bDestroyOnFinish;
var bool	bDestroyOnFinish;
var float	mpReloadTime;
var float	mpReloadTime;
var int		mpHitDamage;
var int		mpHitDamage;
var float	mpBaseAccuracy;
var float	mpBaseAccuracy;
var int		mpAccurateRange;
var int		mpAccurateRange;
var int		mpMaxRange;
var int		mpMaxRange;
var int		mpReloadCount;
var int		mpReloadCount;
var int		mpPickupAmmoCount;
var int		mpPickupAmmoCount;
// Used to track weapon mods accurately.
// Used to track weapon mods accurately.
var bool bCanHaveModBaseAccuracy;
var bool bCanHaveModBaseAccuracy;
var bool bCanHaveModReloadCount;
var bool bCanHaveModReloadCount;
var bool bCanHaveModAccurateRange;
var bool bCanHaveModAccurateRange;
var bool bCanHaveModReloadTime;
var bool bCanHaveModReloadTime;
var bool bCanHaveModRecoilStrength;
var bool bCanHaveModRecoilStrength;
//Rate of Fire Mod -- Y|yukichigai
//Rate of Fire Mod -- Y|yukichigai
var travel float ModBaseAccuracy;
var travel float ModBaseAccuracy;
var travel float ModReloadCount;
var travel float ModReloadCount;
var travel float ModAccurateRange;
var travel float ModAccurateRange;
var travel float ModReloadTime;
var travel float ModReloadTime;
var travel float ModRecoilStrength;
var travel float ModRecoilStrength;
//Rate of Fire Mod -- Y|yukichigai
//Rate of Fire Mod -- Y|yukichigai
var localized String msgCannotBeReloaded;
var localized String msgCannotBeReloaded;
var localized String msgOutOf;
var localized String msgOutOf;
var localized String msgNowHas;
var localized String msgNowHas;
var localized String msgAlreadyHas;
var localized String msgAlreadyHas;
var localized String msgNone;
var localized String msgNone;
var localized String msgLockInvalid;
var localized String msgLockInvalid;
var localized String msgLockRange;
var localized String msgLockRange;
var localized String msgLockAcquire;
var localized String msgLockAcquire;
var localized String msgLockLocked;
var localized String msgLockLocked;
var localized String msgRangeUnit;
var localized String msgRangeUnit;
var localized String msgTimeUnit;
var localized String msgTimeUnit;
var localized String msgMassUnit;
var localized String msgMassUnit;
var localized String msgNotWorking;
var localized String msgNotWorking;
//
//
// strings for info display
// strings for info display
//
//
var localized String msgInfoAmmoLoaded;
var localized String msgInfoAmmoLoaded;
var localized String msgInfoAmmo;
var localized String msgInfoAmmo;
var localized String msgInfoDamage;
var localized String msgInfoDamage;
var localized String msgInfoClip;
var localized String msgInfoClip;
var localized String msgInfoReload;
var localized String msgInfoReload;
var localized String msgInfoRecoil;
var localized String msgInfoRecoil;
var localized String msgInfoAccuracy;
var localized String msgInfoAccuracy;
var localized String msgInfoAccRange;
var localized String msgInfoAccRange;
var localized String msgInfoMaxRange;
var localized String msgInfoMaxRange;
var localized String msgInfoMass;
var localized String msgInfoMass;
var localized String msgInfoLaser;
var localized String msgInfoLaser;
var localized String msgInfoScope;
var localized String msgInfoScope;
var localized String msgInfoSilencer;
var localized String msgInfoSilencer;
var localized String msgInfoNA;
var localized String msgInfoNA;
var localized String msgInfoYes;
var localized String msgInfoYes;
var localized String msgInfoNo;
var localized String msgInfoNo;
var localized String msgInfoAuto;
var localized String msgInfoAuto;
var localized String msgInfoSingle;
var localized String msgInfoSingle;
var localized String msgInfoRounds;
var localized String msgInfoRounds;
var localized String msgInfoRoundsPerSec;
var localized String msgInfoRoundsPerSec;
var localized String msgInfoSkill;
var localized String msgInfoSkill;
var localized String msgInfoWeaponStats;
var localized String msgInfoWeaponStats;
var bool		bClientReadyToFire, bClientReady, bInProcess, bFlameOn, bLooping;
var bool		bClientReadyToFire, bClientReady, bInProcess, bFlameOn, bLooping;
var int		SimClipCount, flameShotCount, SimAmmoAmount;
var int		SimClipCount, flameShotCount, SimAmmoAmount;
var float	TimeLockSet;
var float	TimeLockSet;
//GMDX:
//GMDX:
var transient bool bIsCloaked;
var transient bool bIsCloaked;
var() sound FireSilentSound;
var() sound FireSilentSound;
var travel bool bContactDeton; //CyberP: toggle contact detonation
var travel bool bContactDeton; //CyberP: toggle contact detonation
var vector RecoilShaker; //cosmetic shaking per shot, amount +/- added to dxplayers current as frand
var vector RecoilShaker; //cosmetic shaking per shot, amount +/- added to dxplayers current as frand
var int maxiAmmo;  //CyberP: for frobbing weapon pickups when we have max ammo
var int maxiAmmo;  //CyberP: for frobbing weapon pickups when we have max ammo
var bool bInvisibleWhore; //CyberP: emulating the weapon movement if player near wall
var bool bInvisibleWhore; //CyberP: emulating the weapon movement if player near wall
var travel bool bSuperheated;
var travel bool bSuperheated;
var bool bCanHaveModShotTime;
var bool bCanHaveModShotTime;
var bool bCanHaveModDamage;
var bool bCanHaveModDamage;
var bool bCanHaveModFullAuto;
var bool bCanHaveModFullAuto;
var travel float ModShotTime;
var travel float ModShotTime;
var travel float ModDamage;
var travel float ModDamage;
var travel bool  bFullAuto; //CyberP: this is different to bAutomatic.
var travel bool  bFullAuto; //CyberP: this is different to bAutomatic.
var localized String msgInfoROF;
var localized String msgInfoROF;
var localized String msgInfoFullAuto;
var localized String msgInfoFullAuto;
var bool bExtraShaker;
var bool bExtraShaker;
var() sound ReloadMidSound;
var() sound ReloadMidSound;
var bool bCancelLoading;
var bool bCancelLoading;
var int LoadedShells;
var int LoadedShells;
var float negTime;
var float negTime;
var bool bBeginQuickMelee;
var bool bBeginQuickMelee;
var float quickMeleeCombo;
var float quickMeleeCombo;
var vector ironSightLoc;
var vector ironSightLoc;
var float meleeStaminaDrain;
var float meleeStaminaDrain;
var bool activateAn;
var bool activateAn;
//END GMDX:
//END GMDX:
//
//
// network replication
// network replication
//
//
replication
replication
{
{
	// server to client
	// server to client
	reliable if ((Role == ROLE_Authority) && (bNetOwner))
	reliable if ((Role == ROLE_Authority) && (bNetOwner))
		ClipCount, bZoomed, bHasSilencer, bHasLaser, ModBaseAccuracy, ModReloadCount, ModAccurateRange, ModReloadTime, ModRecoilStrength;
		ClipCount, bZoomed, bHasSilencer, bHasLaser, ModBaseAccuracy, ModReloadCount, ModAccurateRange, ModReloadTime, ModRecoilStrength;
	// Things the client should send to the server
	// Things the client should send to the server
	//reliable if ( (Role<ROLE_Authority) )
	//reliable if ( (Role<ROLE_Authority) )
		//LockTimer, Target, LockMode, TargetMessage, TargetRange, bCanTrack, LockTarget;
		//LockTimer, Target, LockMode, TargetMessage, TargetRange, bCanTrack, LockTarget;
	// Functions client calls on server
	// Functions client calls on server
	reliable if ( Role < ROLE_Authority )
	reliable if ( Role < ROLE_Authority )
		ReloadAmmo, LoadAmmo, CycleAmmo, LaserOn, LaserOff, LaserToggle, ScopeOn, ScopeOff, ScopeToggle, PropagateLockState, ServerForceFire,
		ReloadAmmo, LoadAmmo, CycleAmmo, LaserOn, LaserOff, LaserToggle, ScopeOn, ScopeOff, ScopeToggle, PropagateLockState, ServerForceFire,
		  ServerGenerateBullet, ServerGotoFinishFire, ServerHandleNotify, StartFlame, StopFlame, ServerDoneReloading, DestroyOnFinish;
		  ServerGenerateBullet, ServerGotoFinishFire, ServerHandleNotify, StartFlame, StopFlame, ServerDoneReloading, DestroyOnFinish;
	// Functions Server calls in client
	// Functions Server calls in client
	reliable if ( Role == ROLE_Authority )
	reliable if ( Role == ROLE_Authority )
	  RefreshScopeDisplay, ReadyClientToFire, SetClientAmmoParams, ClientDownWeapon, ClientActive, ClientReload;
	  RefreshScopeDisplay, ReadyClientToFire, SetClientAmmoParams, ClientDownWeapon, ClientActive, ClientReload;
}
}
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// PropagateLockState()
// PropagateLockState()
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
simulated function PropagateLockState(ELockMode NewMode, Actor NewTarget)
simulated function PropagateLockState(ELockMode NewMode, Actor NewTarget)
{
{
	LockMode = NewMode;
	LockMode = NewMode;
	LockTarget = NewTarget;
	LockTarget = NewTarget;
}
}
event Bump( Actor Other )
event Bump( Actor Other )
{
{
local float speed2, mult;
local float speed2, mult;
local DeusExPlayer player;
local DeusExPlayer player;
local vector any;
local vector any;
if (Physics == PHYS_None)
if (Physics == PHYS_None)
return;
return;
player = DeusExPlayer(GetPlayerPawn());
player = DeusExPlayer(GetPlayerPawn());
if (player!=none && player.AugmentationSystem!=none)
if (player!=none && player.AugmentationSystem!=none)
mult = player.AugmentationSystem.GetAugLevelValue(class'AugMuscle');
mult = player.AugmentationSystem.GetAugLevelValue(class'AugMuscle');
if (mult == -1.0)
if (mult == -1.0)
mult = 1.0;
mult = 1.0;
speed2 = VSize(Velocity);
speed2 = VSize(Velocity);
if (speed2 > 500)
if (speed2 > 500)
{
{
if (Other.IsA('Pawn') || Other.IsA('Pickup') || (Other.IsA('DeusExDecoration') && DeusExDecoration(Other).minDamageThreshold < 30 && DeusExDecoration(Other).fragType != class'MetalFragment'))
if (Other.IsA('Pawn') || Other.IsA('Pickup') || (Other.IsA('DeusExDecoration') && DeusExDecoration(Other).minDamageThreshold < 30 && DeusExDecoration(Other).fragType != class'MetalFragment'))
  if (IsA('WeaponCrowbar'))
  if (IsA('WeaponCrowbar'))
    Other.TakeDamage((Mass*0.5)*mult*3,player,Location,0.8*Velocity,'Shot');
    Other.TakeDamage((Mass*0.5)*mult*3,player,Location,0.8*Velocity,'Shot');
  else
  else
    Other.TakeDamage((Mass*0.5)*mult,player,Location,0.8*Velocity,'Shot');
    Other.TakeDamage((Mass*0.5)*mult,player,Location,0.8*Velocity,'Shot');
if (Other.IsA('Pawn') && !Other.IsA('Robot'))
if (Other.IsA('Pawn') && !Other.IsA('Robot'))
{
{
SpawnBlood(Location,any);
SpawnBlood(Location,any);
PlaySound(Misc1Sound,SLOT_None,,,1024);
PlaySound(Misc1Sound,SLOT_None,,,1024);
}
}
}
}
}
}
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// SetLockMode()
// SetLockMode()
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
simulated function SetLockMode(ELockMode NewMode)
simulated function SetLockMode(ELockMode NewMode)
{
{
	if ((LockMode != NewMode) && (Role != ROLE_Authority))
	if ((LockMode != NewMode) && (Role != ROLE_Authority))
	{
	{
	  if (NewMode != LOCK_Locked)
	  if (NewMode != LOCK_Locked)
		 PropagateLockState(NewMode, None);
		 PropagateLockState(NewMode, None);
	  else
	  else
		 PropagateLockState(NewMode, Target);
		 PropagateLockState(NewMode, Target);
	}
	}
	TimeLockSet = Level.Timeseconds;
	TimeLockSet = Level.Timeseconds;
	LockMode = NewMode;
	LockMode = NewMode;
}
}
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// PlayLockSound()
// PlayLockSound()
// Because playing a sound from a simulated function doesn't play it
// Because playing a sound from a simulated function doesn't play it
// server side.
// server side.
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
function PlayLockSound()
function PlayLockSound()
{
{
	Owner.PlaySound(LockedSound, SLOT_None);
	Owner.PlaySound(LockedSound, SLOT_None);
}
}
//
//
// install the correct projectile info if needed
// install the correct projectile info if needed
//
//
function TravelPostAccept()
function TravelPostAccept()
{
{
	local int i;
	local int i;
	Super.TravelPostAccept();
	Super.TravelPostAccept();
	// make sure the AmmoName matches the currently loaded AmmoType
	// make sure the AmmoName matches the currently loaded AmmoType
	if (AmmoType != None)
	if (AmmoType != None)
		AmmoName = AmmoType.Class;
		AmmoName = AmmoType.Class;
	if (!bInstantHit)
	if (!bInstantHit)
	{
	{
		if (ProjectileClass != None)
		if (ProjectileClass != None)
			ProjectileSpeed = ProjectileClass.Default.speed;
			ProjectileSpeed = ProjectileClass.Default.speed;
		// make sure the projectile info matches the actual AmmoType
		// make sure the projectile info matches the actual AmmoType
		// since we can't "var travel class" (AmmoName and ProjectileClass)
		// since we can't "var travel class" (AmmoName and ProjectileClass)
		if (AmmoType != None)
		if (AmmoType != None)
		{
		{
			FireSound = None;
			FireSound = None;
			for (i=0; i<ArrayCount(AmmoNames); i++)
			for (i=0; i<ArrayCount(AmmoNames); i++)
			{
			{
				if (AmmoNames[i] == AmmoName)
				if (AmmoNames[i] == AmmoName)
				{
				{
					ProjectileClass = ProjectileNames[i];
					ProjectileClass = ProjectileNames[i];
					break;
					break;
				}
				}
			}
			}
		}
		}
	}
	}
}
}
//
//
// PreBeginPlay
// PreBeginPlay
//
//
function PreBeginPlay()
function PreBeginPlay()
{
{
	Super.PreBeginPlay();
	Super.PreBeginPlay();
	if ( Default.mpPickupAmmoCount == 0 )
	if ( Default.mpPickupAmmoCount == 0 )
	{
	{
		Default.mpPickupAmmoCount = Default.PickupAmmoCount;
		Default.mpPickupAmmoCount = Default.PickupAmmoCount;
	}
	}
	CheckWeaponSkins();
	CheckWeaponSkins();
}
}
function SupportActor( actor StandingActor )
function SupportActor( actor StandingActor )
{
{
   if (!standingActor.IsA('RubberBullet')) //CyberP:
   if (!standingActor.IsA('RubberBullet')) //CyberP:
	StandingActor.SetBase( self );
	StandingActor.SetBase( self );
}
}
function DropFrom(vector StartLocation)
function DropFrom(vector StartLocation)
{
{
	if ( !SetLocation(StartLocation) )
	if ( !SetLocation(StartLocation) )
		return;
		return;
	checkweaponskins();
	checkweaponskins();
	super.dropfrom(startlocation);
	super.dropfrom(startlocation);
}
}
function texture GetWeaponHandTex()
function texture GetWeaponHandTex()
{
{
	local deusexplayer p;
	local deusexplayer p;
	local texture tex;
	local texture tex;
	tex = texture'weaponhandstex';
	tex = texture'weaponhandstex';
	p = deusexplayer(owner);
	p = deusexplayer(owner);
	if(p != none)
	if(p != none)
	{
	{
		switch(p.PlayerSkin)
		switch(p.PlayerSkin)
		{
		{
			//default, black, latino, ginger, albino, respectively
			//default, black, latino, ginger, albino, respectively
			case 0: tex = texture'weaponhandstex'; break;
			case 0: tex = texture'weaponhandstex'; break;
			case 1: tex = texture'HDTPItems.skins.weaponhandstexblack'; break;
			case 1: tex = texture'HDTPItems.skins.weaponhandstexblack'; break;
			case 2: tex = texture'HDTPItems.skins.weaponhandstexlatino'; break;
			case 2: tex = texture'HDTPItems.skins.weaponhandstexlatino'; break;
			case 3: tex = texture'HDTPItems.skins.weaponhandstexginger'; break;
			case 3: tex = texture'HDTPItems.skins.weaponhandstexginger'; break;
			case 4: tex = texture'HDTPItems.skins.weaponhandstexalbino'; break;
			case 4: tex = texture'HDTPItems.skins.weaponhandstexalbino'; break;
		}
		}
	}
	}
	return tex;
	return tex;
}
}
//GMDX cloak weapon
//GMDX cloak weapon
function SetCloak(bool bEnableCloak,optional bool bForce)
function SetCloak(bool bEnableCloak,optional bool bForce)
{
{
	if ((Owner==none)||(!Owner.IsA('DeusExPlayer'))) return;
	if ((Owner==none)||(!Owner.IsA('DeusExPlayer'))) return;
	if (Owner!=none && Owner.IsA('DeusExPlayer'))
	if (Owner!=none && Owner.IsA('DeusExPlayer'))
	{
	{
	if (bEnableCloak && class'DeusExPlayer'.default.bRadarTran == True &&(!bIsCloaked||bForce))
	if (bEnableCloak && class'DeusExPlayer'.default.bRadarTran == True &&(!bIsCloaked||bForce))
	{
	{
	  bIsCloaked=true;
	  bIsCloaked=true;
	  AmbientGlow=255;
	  AmbientGlow=255;
      //Style=STY_Translucent;
      //Style=STY_Translucent;
	  //ScaleGlow=0.040000;
	  //ScaleGlow=0.040000;
	}
	}
    else if (bEnableCloak&&(!bIsCloaked||bForce))
    else if (bEnableCloak&&(!bIsCloaked||bForce))
	{
	{
	  bIsCloaked=true;
	  bIsCloaked=true;
      Style=STY_Translucent;
      Style=STY_Translucent;
	  ScaleGlow=0.040000;
	  ScaleGlow=0.040000;
	} else
	} else
	if(!bEnableCloak&&(bIsCloaked||bForce))
	if(!bEnableCloak&&(bIsCloaked||bForce))
	{
	{
	  bIsCloaked=false;
	  bIsCloaked=false;
	  class'DeusExPlayer'.default.bRadarTran=false;
	  class'DeusExPlayer'.default.bRadarTran=false;
	  //DeusExPlayer(Owner).bRadarTran=false;
	  //DeusExPlayer(Owner).bRadarTran=false;
	  AmbientGlow=default.AmbientGlow;
	  AmbientGlow=default.AmbientGlow;
	  Style=default.Style;
	  Style=default.Style;
	  ScaleGlow=default.ScaleGlow;
	  ScaleGlow=default.ScaleGlow;
	}
	}
    }
    }
}
}
//=============================================================================
//=============================================================================
// Weapon rendering
// Weapon rendering
// Draw first person view of inventory
// Draw first person view of inventory
simulated event RenderOverlays( canvas Canvas )
simulated event RenderOverlays( canvas Canvas )
{
{
	local rotator NewRot;
	local rotator NewRot;
	local bool bPlayerOwner;
	local bool bPlayerOwner;
	local int Hand;
	local int Hand;
	local PlayerPawn PlayerOwner;
	local PlayerPawn PlayerOwner;
	if ( bHideWeapon || (Owner == None) )
	if ( bHideWeapon || (Owner == None) )
		return;
		return;
	PlayerOwner = PlayerPawn(Owner);
	PlayerOwner = PlayerPawn(Owner);
	if ( PlayerOwner != None )
	if ( PlayerOwner != None )
	{
	{
		if ( PlayerOwner.DesiredFOV != PlayerOwner.DefaultFOV )
		if ( PlayerOwner.DesiredFOV != PlayerOwner.DefaultFOV )
			return;
			return;
		bPlayerOwner = true;
		bPlayerOwner = true;
		Hand = PlayerOwner.Handedness;
		Hand = PlayerOwner.Handedness;
		if (  (Level.NetMode == NM_Client) && (Hand == 2) )
		if (  (Level.NetMode == NM_Client) && (Hand == 2) )
		{
		{
			bHideWeapon = true;
			bHideWeapon = true;
			return;
			return;
		}
		}
	}
	}
	if ( !bPlayerOwner || (PlayerOwner.Player == None) )
	if ( !bPlayerOwner || (PlayerOwner.Player == None) )
		Pawn(Owner).WalkBob = vect(0,0,0);
		Pawn(Owner).WalkBob = vect(0,0,0);
	if ( (bMuzzleFlash > 0) && bDrawMuzzleFlash && Level.bHighDetailMode && (MFTexture != None) )
	if ( (bMuzzleFlash > 0) && bDrawMuzzleFlash && Level.bHighDetailMode && (MFTexture != None) )
	{
	{
		MuzzleScale = Default.MuzzleScale * Canvas.ClipX/640.0;
		MuzzleScale = Default.MuzzleScale * Canvas.ClipX/640.0;
		if ( !bSetFlashTime )
		if ( !bSetFlashTime )
		{
		{
			bSetFlashTime = true;
			bSetFlashTime = true;
			FlashTime = Level.TimeSeconds + FlashLength;
			FlashTime = Level.TimeSeconds + FlashLength;
		}
		}
		else if ( FlashTime < Level.TimeSeconds )
		else if ( FlashTime < Level.TimeSeconds )
			bMuzzleFlash = 0;
			bMuzzleFlash = 0;
		if ( bMuzzleFlash > 0 )
		if ( bMuzzleFlash > 0 )
		{
		{
			if ( Hand == 0 )
			if ( Hand == 0 )
				Canvas.SetPos(Canvas.ClipX/2 - 0.5 * MuzzleScale * FlashS + Canvas.ClipX * (-0.2 * Default.FireOffset.Y * FlashO), Canvas.ClipY/2 - 0.5 * MuzzleScale * FlashS + Canvas.ClipY * (FlashY + FlashC));
				Canvas.SetPos(Canvas.ClipX/2 - 0.5 * MuzzleScale * FlashS + Canvas.ClipX * (-0.2 * Default.FireOffset.Y * FlashO), Canvas.ClipY/2 - 0.5 * MuzzleScale * FlashS + Canvas.ClipY * (FlashY + FlashC));
			else
			else
				Canvas.SetPos(Canvas.ClipX/2 - 0.5 * MuzzleScale * FlashS + Canvas.ClipX * (Hand * Default.FireOffset.Y * FlashO), Canvas.ClipY/2 - 0.5 * MuzzleScale * FlashS + Canvas.ClipY * FlashY);
				Canvas.SetPos(Canvas.ClipX/2 - 0.5 * MuzzleScale * FlashS + Canvas.ClipX * (Hand * Default.FireOffset.Y * FlashO), Canvas.ClipY/2 - 0.5 * MuzzleScale * FlashS + Canvas.ClipY * FlashY);
			Canvas.Style = 3;
			Canvas.Style = 3;
			Canvas.DrawIcon(MFTexture, MuzzleScale);
			Canvas.DrawIcon(MFTexture, MuzzleScale);
			Canvas.Style = 1;
			Canvas.Style = 1;
		}
		}
	}
	}
	else
	else
		bSetFlashTime = false;
		bSetFlashTime = false;
	SetLocation( Owner.Location + CalcDrawOffset() );
	SetLocation( Owner.Location + CalcDrawOffset() );
	NewRot = Pawn(Owner).ViewRotation;
	NewRot = Pawn(Owner).ViewRotation;
	if ( Hand == 0 )
	if ( Hand == 0 )
		newRot.Roll = -2 * Default.Rotation.Roll;
		newRot.Roll = -2 * Default.Rotation.Roll;
	else
	else
		newRot.Roll = Default.Rotation.Roll * Hand;
		newRot.Roll = Default.Rotation.Roll * Hand;
	if (PlayerOwner != none) //CyberP: lets modify HDTP models to have believable rotation
	if (PlayerOwner != none) //CyberP: lets modify HDTP models to have believable rotation
    {
    {
    //ass gun iron sights: newRot.Pitch += 360; newRot.Yaw += 2280; PlayerViewOffset(X=12.500000,Y=3.300000,Z=-10.900000)
    //ass gun iron sights: newRot.Pitch += 360; newRot.Yaw += 2280; PlayerViewOffset(X=12.500000,Y=3.300000,Z=-10.900000)
    //pistol iron sight: {newRot.Yaw += 1400; newRot.Pitch -=1000; PlayerViewOffset=vect(1955.500000,-1170.300000,106.900000);}
    //pistol iron sight: {newRot.Yaw += 1400; newRot.Pitch -=1000; PlayerViewOffset=vect(1955.500000,-1170.300000,106.900000);}
    if (IsA('WeaponAssaultGun'))
    if (IsA('WeaponAssaultGun'))
    {newRot.Pitch -= 1100; newRot.Yaw += 1200; }   //p=1200 y=1400
    {newRot.Pitch -= 1100; newRot.Yaw += 1200; }   //p=1200 y=1400
    else if (IsA('WeaponPistol'))
    else if (IsA('WeaponPistol'))
    {          newRot.Yaw += 500; newRot.Pitch -=300; }
    {          newRot.Yaw += 500; newRot.Pitch -=300; }
    else if ((IsA('WeaponAssaultShotgun') || IsA('WeaponFlamethrower')))
    else if ((IsA('WeaponAssaultShotgun') || IsA('WeaponFlamethrower')))
    newRot.Pitch -= 500;
    newRot.Pitch -= 500;
    else if (IsA('WeaponRifle'))
    else if (IsA('WeaponRifle'))
    newRot.Pitch -=200;
    newRot.Pitch -=200;
    else if (IsA('WeaponMiniCrossbow'))
    else if (IsA('WeaponMiniCrossbow'))
    { newRot.Pitch -=1800; newRot.Yaw += 400;}
    { newRot.Pitch -=1800; newRot.Yaw += 400;}
    else if (IsA('WeaponStealthPistol'))
    else if (IsA('WeaponStealthPistol'))
    {newRot.Yaw += 800; newRot.Pitch -=500;}
    {newRot.Yaw += 800; newRot.Pitch -=500;}
    else if (IsA('WeaponGEPGun'))
    else if (IsA('WeaponGEPGun'))
    newRot.Pitch += 600;
    newRot.Pitch += 600;
    else if (IsA('WeaponSawedOffShotgun'))
    else if (IsA('WeaponSawedOffShotgun'))
    {newRot.Pitch -= 2000; newRot.Yaw += 800;}
    {newRot.Pitch -= 2000; newRot.Yaw += 800;}
    }
    }
	if (class'DeusExPlayer'.default.bCloakEnabled&&!bIsCloaked)
	if (class'DeusExPlayer'.default.bCloakEnabled&&!bIsCloaked)
	{
	{
	  SetCloak(true);
	  SetCloak(true);
	} else
	} else
	if (!class'DeusExPlayer'.default.bCloakEnabled&&bIsCloaked && !class'DeusExPlayer'.default.bRadarTran == True)
	if (!class'DeusExPlayer'.default.bCloakEnabled&&bIsCloaked && !class'DeusExPlayer'.default.bRadarTran == True)
	{
	{
	  SetCloak(false);
	  SetCloak(false);
	}
	}
//	if (IsA('WeaponGEPmounted')) return;
//	if (IsA('WeaponGEPmounted')) return;
	setRotation(newRot);
	setRotation(newRot);
	Canvas.DrawActor(self, false);
	Canvas.DrawActor(self, false);
}
}
//
//
// PostBeginPlay
// PostBeginPlay
//
//
function PostBeginPlay()
function PostBeginPlay()
{
{
	Super.PostBeginPlay();
	Super.PostBeginPlay();
	if (Level.NetMode != NM_Standalone)
	if (Level.NetMode != NM_Standalone)
	{
	{
	  bWeaponStay = True;
	  bWeaponStay = True;
	  if (bNeedToSetMPPickupAmmo)
	  if (bNeedToSetMPPickupAmmo)
	  {
	  {
		 PickupAmmoCount = PickupAmmoCount * 3;
		 PickupAmmoCount = PickupAmmoCount * 3;
		 bNeedToSetMPPickupAmmo = False;
		 bNeedToSetMPPickupAmmo = False;
	  }
	  }
	}
	}
}
}
singular function BaseChange()
singular function BaseChange()
{
{
	// Make sure we fall if we don't have a base
	// Make sure we fall if we don't have a base
	if ((base == None) && (Owner == None))
	if ((base == None) && (Owner == None))
		SetPhysics(PHYS_Falling);
		SetPhysics(PHYS_Falling);
	Super.BaseChange();
	Super.BaseChange();
}
}
function TakeDamage(int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, name DamageType)
function TakeDamage(int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, name DamageType)
	{
	{
        local float dammult, massmult;
        local float dammult, massmult;
		if ((DamageType == 'TearGas') || (DamageType == 'PoisonGas') || (DamageType == 'Radiation'))
		if ((DamageType == 'TearGas') || (DamageType == 'PoisonGas') || (DamageType == 'Radiation'))
			return;
			return;
		if ((DamageType == 'EMP') || (DamageType == 'NanoVirus') || (DamageType == 'Shocked'))
		if ((DamageType == 'EMP') || (DamageType == 'NanoVirus') || (DamageType == 'Shocked'))
			return;
			return;
		if (DamageType == 'HalonGas')
		if (DamageType == 'HalonGas')
			return;
			return;
		if (DamageType == 'KnockedOut' && Damage < 11) //CyberP: hack for gas nades
		if (DamageType == 'KnockedOut' && Damage < 11) //CyberP: hack for gas nades
            return;
            return;
    dammult = damage*0.1;
    dammult = damage*0.1;
    if (dammult < 1.1)
    if (dammult < 1.1)
    dammult = 1.1;
    dammult = 1.1;
    else if (dammult > 20)
    else if (dammult > 20)
    dammult = 20;  //capped so objects do not fly about at light speed.
    dammult = 20;  //capped so objects do not fly about at light speed.
    if (mass < 10)
    if (mass < 10)
    massmult = 1.2;
    massmult = 1.2;
    else if (mass < 20)
    else if (mass < 20)
    massmult = 1.1;
    massmult = 1.1;
    else if (mass < 30)
    else if (mass < 30)
    massmult = 1;
    massmult = 1;
    else if (mass < 50)
    else if (mass < 50)
    massmult = 0.7;
    massmult = 0.7;
    else if (mass < 80)
    else if (mass < 80)
    massmult = 0.4;
    massmult = 0.4;
    else
    else
    massmult = 0.2;
    massmult = 0.2;
    SetPhysics(PHYS_Falling);
    SetPhysics(PHYS_Falling);
    Velocity = (Momentum*0.25)*dammult*massmult;
    Velocity = (Momentum*0.25)*dammult*massmult;
    if (Velocity.Z <= 0)
    if (Velocity.Z <= 0)
    Velocity.Z = 80;
    Velocity.Z = 80;
    bFixedRotationDir = True;
    bFixedRotationDir = True;
    if (mass < 40)
    if (mass < 40)
    {
    {
	RotationRate.Pitch = (32768 - Rand(65536)) * dammult;
	RotationRate.Pitch = (32768 - Rand(65536)) * dammult;
	RotationRate.Yaw = (32768 - Rand(65536)) * dammult;
	RotationRate.Yaw = (32768 - Rand(65536)) * dammult;
	}
	}
    }
    }
function bool HandlePickupQuery(Inventory Item)
function bool HandlePickupQuery(Inventory Item)
{
{
	local DeusExWeapon W;
	local DeusExWeapon W;
	local DeusExPlayer player;
	local DeusExPlayer player;
	local bool bResult;
	local bool bResult;
	local class<Ammo> defAmmoClass;
	local class<Ammo> defAmmoClass;
	local Ammo defAmmo;
	local Ammo defAmmo;
	// make sure that if you pick up a modded weapon that you
	// make sure that if you pick up a modded weapon that you
	// already have, you get the mods
	// already have, you get the mods
	W = DeusExWeapon(Item);
	W = DeusExWeapon(Item);
	if ((W != None) && (W.Class == Class))
	if ((W != None) && (W.Class == Class))
	{
	{
		if (W.ModBaseAccuracy > ModBaseAccuracy)
		if (W.ModBaseAccuracy > ModBaseAccuracy)
			ModBaseAccuracy = W.ModBaseAccuracy;
			ModBaseAccuracy = W.ModBaseAccuracy;
		if (W.ModReloadCount > ModReloadCount)
		if (W.ModReloadCount > ModReloadCount)
			ModReloadCount = W.ModReloadCount;
			ModReloadCount = W.ModReloadCount;
		if (W.ModAccurateRange > ModAccurateRange)
		if (W.ModAccurateRange > ModAccurateRange)
			ModAccurateRange = W.ModAccurateRange;
			ModAccurateRange = W.ModAccurateRange;
		// these are negative
		// these are negative
		if (W.ModReloadTime < ModReloadTime)
		if (W.ModReloadTime < ModReloadTime)
			ModReloadTime = W.ModReloadTime;
			ModReloadTime = W.ModReloadTime;
		if (W.ModRecoilStrength < ModRecoilStrength)
		if (W.ModRecoilStrength < ModRecoilStrength)
			ModRecoilStrength = W.ModRecoilStrength;
			ModRecoilStrength = W.ModRecoilStrength;
		if (W.bHasLaser)
		if (W.bHasLaser)
			bHasLaser = True;
			bHasLaser = True;
		if (W.bHasSilencer)
		if (W.bHasSilencer)
			bHasSilencer = True;
			bHasSilencer = True;
		if (W.bHasScope)
		if (W.bHasScope)
			bHasScope = True;
			bHasScope = True;
		if (W.bFullAuto)     //CyberP:
		if (W.bFullAuto)     //CyberP:
            bFullAuto = True;
            bFullAuto = True;
		// copy the actual stats as well
		// copy the actual stats as well
		if (W.ReloadCount > ReloadCount)
		if (W.ReloadCount > ReloadCount)
			ReloadCount = W.ReloadCount;
			ReloadCount = W.ReloadCount;
		if (W.AccurateRange > AccurateRange)
		if (W.AccurateRange > AccurateRange)
			AccurateRange = W.AccurateRange;
			AccurateRange = W.AccurateRange;
		// these are negative
		// these are negative
		if (W.BaseAccuracy < BaseAccuracy)
		if (W.BaseAccuracy < BaseAccuracy)
			BaseAccuracy = W.BaseAccuracy;
			BaseAccuracy = W.BaseAccuracy;
		if (W.ReloadTime < ReloadTime)
		if (W.ReloadTime < ReloadTime)
			ReloadTime = W.ReloadTime;
			ReloadTime = W.ReloadTime;
		if (W.RecoilStrength < RecoilStrength)
		if (W.RecoilStrength < RecoilStrength)
			RecoilStrength = W.RecoilStrength;
			RecoilStrength = W.RecoilStrength;
		// This is for the ROF mod
		// This is for the ROF mod
			if(W.ModShotTime < ModShotTime)
			if(W.ModShotTime < ModShotTime)
				ModShotTime = W.ModShotTime;
				ModShotTime = W.ModShotTime;
	   //DAM mod
	   //DAM mod
            if(W.ModDamage > ModDamage)
            if(W.ModDamage > ModDamage)
				ModDamage = W.ModDamage;
				ModDamage = W.ModDamage;
	}
	}
	player = DeusExPlayer(Owner);
	player = DeusExPlayer(Owner);
	if (Item.Class == Class)
	if (Item.Class == Class)
	{
	{
	  if (!( (Weapon(item).bWeaponStay && (Level.NetMode == NM_Standalone)) && (!Weapon(item).bHeldItem || Weapon(item).bTossedOut)))
	  if (!( (Weapon(item).bWeaponStay && (Level.NetMode == NM_Standalone)) && (!Weapon(item).bHeldItem || Weapon(item).bTossedOut)))
		{
		{
			// Only add ammo of the default type
			// Only add ammo of the default type
			// There was an easy way to get 32 20mm shells, buy picking up another assault rifle with 20mm ammo selected
			// There was an easy way to get 32 20mm shells, buy picking up another assault rifle with 20mm ammo selected
			if ( AmmoType != None )
			if ( AmmoType != None )
			{
			{
				// Add to default ammo only
				// Add to default ammo only
				if ( AmmoNames[0] == None )
				if ( AmmoNames[0] == None )
					defAmmoClass = AmmoName;
					defAmmoClass = AmmoName;
				else
				else
					defAmmoClass = AmmoNames[0];
					defAmmoClass = AmmoNames[0];
				defAmmo = Ammo(player.FindInventoryType(defAmmoClass));
				defAmmo = Ammo(player.FindInventoryType(defAmmoClass));
				defAmmo.AddAmmo( Weapon(Item).PickupAmmoCount );
				defAmmo.AddAmmo( Weapon(Item).PickupAmmoCount );
				if ( Level.NetMode != NM_Standalone )
				if ( Level.NetMode != NM_Standalone )
				{
				{
					if (( player != None ) && ( player.InHand != None ))
					if (( player != None ) && ( player.InHand != None ))
					{
					{
						if ( DeusExWeapon(item).class == DeusExWeapon(player.InHand).class )
						if ( DeusExWeapon(item).class == DeusExWeapon(player.InHand).class )
							ReadyToFire();
							ReadyToFire();
					}
					}
				}
				}
			}
			}
		}
		}
	}
	}
	bResult = Super.HandlePickupQuery(Item);
	bResult = Super.HandlePickupQuery(Item);
	// Notify the object belt of the new ammo
	// Notify the object belt of the new ammo
	if (player != None)
	if (player != None)
		player.UpdateBeltText(Self);
		player.UpdateBeltText(Self);
	return bResult;
	return bResult;
}
}
function float SetDroppedAmmoCount()
function float SetDroppedAmmoCount()
{
{
	// Any weapons have their ammo set to a random number of rounds (1-4)
	// Any weapons have their ammo set to a random number of rounds (1-4)
	// unless it's a grenade, in which case we only want to dole out one.
	// unless it's a grenade, in which case we only want to dole out one.
	// DEUS_EX AMSD In multiplayer, give everything away.
	// DEUS_EX AMSD In multiplayer, give everything away.
	// Grenades and LAMs always pickup 1
	// Grenades and LAMs always pickup 1
	if (IsA('WeaponNanoVirusGrenade') || IsA('WeaponGasGrenade') || IsA('WeaponEMPGrenade') || IsA('WeaponLAM') || IsA('WeaponHideAGun'))
	if (IsA('WeaponNanoVirusGrenade') || IsA('WeaponGasGrenade') || IsA('WeaponEMPGrenade') || IsA('WeaponLAM') || IsA('WeaponHideAGun'))
		PickupAmmoCount = 1;
		PickupAmmoCount = 1;
	else if (Level.NetMode == NM_Standalone)
	else if (Level.NetMode == NM_Standalone)
    PickupAmmoCount = Rand(4) + 1;
    PickupAmmoCount = Rand(4) + 1;
}
}
function BringUp()
function BringUp()
{
{
	if ( Level.NetMode != NM_Standalone )
	if ( Level.NetMode != NM_Standalone )
		ReadyClientToFire( False );
		ReadyClientToFire( False );
	// alert NPCs that I'm whipping it out
	// alert NPCs that I'm whipping it out
	if (!bNativeAttack && bEmitWeaponDrawn)
	if (!bNativeAttack && bEmitWeaponDrawn)
		AIStartEvent('WeaponDrawn', EAITYPE_Visual);
		AIStartEvent('WeaponDrawn', EAITYPE_Visual);
	// reset the standing still accuracy bonus
	// reset the standing still accuracy bonus
	standingTimer = 0;
	standingTimer = 0;
	CheckWeaponSkins();
	CheckWeaponSkins();
	Super.BringUp();
	Super.BringUp();
}
}
//CyberP begin
//CyberP begin
function PlaySelect()
function PlaySelect()
{
{
local DeusExPlayer player;
local DeusExPlayer player;
local float p, mod;
local float p, mod;
     p = 1.3;
     p = 1.3;
     player = DeusExPlayer(Owner);
     player = DeusExPlayer(Owner);
     if (bBeginQuickMelee)
     if (bBeginQuickMelee)
     {
     {
       if (IsA('WeaponNanoSword'))
       if (IsA('WeaponNanoSword'))
       {
       {
             Owner.PlaySound(SelectSound, SLOT_Misc, Pawn(Owner).SoundDampening);
             Owner.PlaySound(SelectSound, SLOT_Misc, Pawn(Owner).SoundDampening);
             AISendEvent('LoudNoise', EAITYPE_Audio, TransientSoundVolume, 416);
             AISendEvent('LoudNoise', EAITYPE_Audio, TransientSoundVolume, 416);
       }
       }
       if (ReloadCount > 0)
       if (ReloadCount > 0)
			AmmoType.UseAmmo(1);
			AmmoType.UseAmmo(1);
       if (meleeStaminaDrain != 0)
       if (meleeStaminaDrain != 0)
       {
       {
       if (Owner.IsA('DeusExPlayer') && Owner != none)
       if (Owner.IsA('DeusExPlayer') && Owner != none)
       {
       {
		mod = DeusExPlayer(Owner).SkillSystem.GetSkillLevel(class'SkillWeaponLowTech');
		mod = DeusExPlayer(Owner).SkillSystem.GetSkillLevel(class'SkillWeaponLowTech');
        if (mod < 3)
        if (mod < 3)
          mod = 1;
          mod = 1;
        else
        else
          mod = 0.5;
          mod = 0.5;
             DeusExPlayer(Owner).swimTimer -= meleeStaminaDrain*mod;
             DeusExPlayer(Owner).swimTimer -= meleeStaminaDrain*mod;
          if (DeusExPlayer(Owner).swimTimer < 0)
          if (DeusExPlayer(Owner).swimTimer < 0)
		     DeusExPlayer(Owner).swimTimer = 0;
		     DeusExPlayer(Owner).swimTimer = 0;
        }
        }
        }
        }
		bReadyToFire = False;
		bReadyToFire = False;
		GotoState('NormalFire');
		GotoState('NormalFire');
		bPointing=True;
		bPointing=True;
		if (IsA('WeaponHideAGun'))
		if (IsA('WeaponHideAGun'))
		   ProjectileFire(ProjectileClass, ProjectileSpeed, bWarnTarget);
		   ProjectileFire(ProjectileClass, ProjectileSpeed, bWarnTarget);
		if ( Owner.IsA('PlayerPawn') )
		if ( Owner.IsA('PlayerPawn') )
			PlayerPawn(Owner).PlayFiring();
			PlayerPawn(Owner).PlayFiring();
		PlaySelectiveFiring();
		PlaySelectiveFiring();
		PlayFiringSound();
		PlayFiringSound();
     }
     }
     else
     else
     {
     {
     if (player != none && player.AugmentationSystem != none)
     if (player != none && player.AugmentationSystem != none)
     {
     {
     p = player.AugmentationSystem.GetAugLevelValue(class'AugCombat');
     p = player.AugmentationSystem.GetAugLevelValue(class'AugCombat');
     if (p < 1.3)
     if (p < 1.3)
     p = 1.3;
     p = 1.3;
     if (p > 1.3)
     if (p > 1.3)
     p *= 1.15;
     p *= 1.15;
     }
     }
    if (IsA('WeaponNanoSword'))
    if (IsA('WeaponNanoSword'))
    PlayAnim('Select',p*0.85,0.0);
    PlayAnim('Select',p*0.85,0.0);
    else
    else
	PlayAnim('Select',p,0.0);
	PlayAnim('Select',p,0.0);
	Owner.PlaySound(SelectSound, SLOT_Misc, Pawn(Owner).SoundDampening);
	Owner.PlaySound(SelectSound, SLOT_Misc, Pawn(Owner).SoundDampening);
	negTime = 0;
	negTime = 0;
	}
	}
}
}
//CyberP end
//CyberP end
Function CheckWeaponSkins()
Function CheckWeaponSkins()
{
{
//empty placeholder :p
//empty placeholder :p
}
}
function bool PutDown()
function bool PutDown()
{
{
	if ( Level.NetMode != NM_Standalone )
	if ( Level.NetMode != NM_Standalone )
		ReadyClientToFire( False );
		ReadyClientToFire( False );
	// alert NPCs that I'm putting away my gun
	// alert NPCs that I'm putting away my gun
	AIEndEvent('WeaponDrawn', EAITYPE_Visual);
	AIEndEvent('WeaponDrawn', EAITYPE_Visual);
	// reset the standing still accuracy bonus
	// reset the standing still accuracy bonus
	standingTimer = 0;
	standingTimer = 0;
	return Super.PutDown();
	return Super.PutDown();
}
}
function ReloadAmmo()
function ReloadAmmo()
{
{