Deus Ex: Assault Crossbow Demo
Code: Select all
//=============================================================================
// WeaponAssaultBow.
//=============================================================================
class WeaponAssaultBow extends DeusExWeapon;
function bool LoadAmmo(int ammoNum)
{
local class<Ammo> newAmmoClass;
local Ammo newAmmo;
local Pawn P;
if ((ammoNum < 0) || (ammoNum > 2))
return False;
P = Pawn(Owner);
// sorry, only pawns can have weapons
if (P == None)
return False;
newAmmoClass = AmmoNames[ammoNum];
if (newAmmoClass != None)
{
if (newAmmoClass != AmmoName)
{
newAmmo = Ammo(P.FindInventoryType(newAmmoClass));
if (newAmmo == None)
{
P.ClientMessage(Sprintf(msgOutOf, newAmmoClass.Default.ItemName));
return False;
}
// if we don't have a projectile for this ammo type, then set instant hit
// EXCEPT NOT ANYMORE, BITCHES! -DDL
if (ProjectileNames[ammoNum] == None)
{
bInstantHit = True;
bAutomatic = Default.bAutomatic;
ShotTime = Default.ShotTime;
if ( Level.NetMode != NM_Standalone )
{
if (HasReloadMod())
ReloadTime = mpReloadTime * (1.0+ModReloadTime);
else
ReloadTime = mpReloadTime;
}
else
{
if (HasReloadMod())
ReloadTime = Default.ReloadTime * (1.0+ModReloadTime);
else
ReloadTime = Default.ReloadTime;
}
FireSound = Default.FireSound;
ProjectileClass = None;
}
else
{
// otherwise, set us to fire projectiles
bInstantHit = False;
bAutomatic = Default.bAutomatic; //--Copied from above, instead of 'false' and 1.0, respectively
ShotTime = Default.ShotTime; //--DDL
if (HasReloadMod())
ReloadTime = 2.0 * (1.0+ModReloadTime);
else
ReloadTime = 2.0;
FireSound = None; // handled by the projectile
ProjectileClass = ProjectileNames[ammoNum];
ProjectileSpeed = ProjectileClass.Default.Speed;
}
AmmoName = newAmmoClass;
AmmoType = newAmmo;
// AlexB had a new sound for 20mm but there's no mechanism for playing alternate sounds per ammo type
// Same for WP rocket
if ( Ammo20mm(newAmmo) != None )
FireSound=Sound'AssaultGunFire20mm';
else if ( AmmoRocketWP(newAmmo) != None )
FireSound=Sound'GEPGunFireWP';
else if ( AmmoRocket(newAmmo) != None )
FireSound=Sound'GEPGunFire';
if ( Level.NetMode != NM_Standalone )
SetClientAmmoParams( bInstantHit, bAutomatic, ShotTime, FireSound, ProjectileClass, ProjectileSpeed );
// Notify the object belt of the new ammo
if (DeusExPlayer(P) != None)
DeusExPlayer(P).UpdateBeltText(Self);
ReloadAmmo();
P.ClientMessage(Sprintf(msgNowHas, ItemName, newAmmoClass.Default.ItemName));
return True;
}
else
{
P.ClientMessage(Sprintf(MsgAlreadyHas, ItemName, newAmmoClass.Default.ItemName));
}
}
return False;
}
defaultproperties
{
LowAmmoWaterMark=40
GoverningSkill=Class'DeusEx.SkillWeaponRifle'
Concealability=CONC_All
bAutomatic=True
ShotTime=0.200000
reloadTime=5.000000
HitDamage=4
maxRange=7200
AccurateRange=4000
BaseAccuracy=0.600000
bCanHaveScope=True
ScopeFOV=15
AmmoNames(0)=Class'DeusEx.AmmoDart'
AmmoNames(1)=Class'DeusEx.AmmoDartEM'
AmmoNames(2)=Class'DeusEx.AmmoDartFlare'
ProjectileNames(0)=Class'DeusEx.Dart'
ProjectileNames(1)=Class'DeusEx.DartEM'
ProjectileNames(2)=Class'DeusEx.DartFlare'
StunDuration=10.000000
mpReloadTime=4.500000
mpHitDamage=5
mpBaseAccuracy=0.100000
mpAccurateRange=1200
mpMaxRange=1200
mpReloadCount=14
mpPickupAmmoCount=10
bCanHaveModBaseAccuracy=True
bCanHaveModAccurateRange=True
bCanHaveModReloadTime=True
AmmoName=Class'DeusEx.AmmoDart'
ReloadCount=30
PickupAmmoCount=16
FireOffset=(X=-25.000000,Y=8.000000,Z=14.000000)
ProjectileClass=Class'DeusEx.Dart'
shakemag=30.000000
FireSound=Sound'DeusExSounds.Weapons.AssaultShotgunFire'
AltFireSound=Sound'DeusExSounds.Weapons.AssaultShotgunReloadEnd'
CockingSound=Sound'DeusExSounds.Weapons.AssaultShotgunReload'
SelectSound=Sound'DeusExSounds.Weapons.AssaultShotgunSelect'
InventoryGroup=111
ItemName="Assault Crossbow"
ItemArticle="the"
PlayerViewOffset=(Y=-10.000000,Z=-12.000000)
PlayerViewMesh=LodMesh'DeusExItems.AssaultShotgun'
PickupViewMesh=LodMesh'DeusExItems.AssaultShotgunPickup'
ThirdPersonMesh=LodMesh'DeusExItems.AssaultShotgun3rd'
LandSound=Sound'DeusExSounds.Generic.DropMediumWeapon'
Icon=Texture'DeusExUI.Icons.BeltIconAssaultShotgun'
largeIcon=Texture'DeusExUI.Icons.LargeIconAssaultShotgun'
largeIconWidth=99
largeIconHeight=55
invSlotsX=2
invSlotsY=2
Description="Intrigued by a vampire hunter film made at the beginning of the 21st century, General Samuel Carter personally designed a crossbow that could quickly incapacitate a large group of enemies in a short amount of time. However, he felt that this new 'Assault Crossbow' outperformed itself a little too well -- the collateral damage made it less than cost-effective, and the whole project was scrapped. Rumors say that he kept the only remaining prototype that wasn't destroyed..."
beltDescription="AUTOBOW"
Mesh=LodMesh'DeusExItems.AssaultShotgunPickup'
CollisionRadius=15.000000
CollisionHeight=8.000000
Mass=30.000000
}