A little something that many of you would find useful.

A refuge for those migrating from the fallen DXEditing.com and a place for general discussion relating to Deus Ex editing (coding, mapping, etc).
Post Reply
User avatar
CorinthMaxwell
NSF
Posts: 79
Joined: Sat Oct 04, 2008 1:28 am

A little something that many of you would find useful.

Post by CorinthMaxwell »

This particular item was made as a request in the old DXEditing forums a while back, and despite its versatility for most situations, I currently have no use for it. Rather than let it go to waste, I think it's only fair & appropriate that other modders get to utilize it as well.

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
}
Robin: "Holy flying snotburgers, Batman!"
Batman: o_0 O_0 o.0 O.0
User avatar
bjorn98009_91
Silhouette
Posts: 688
Joined: Thu May 08, 2008 8:17 am
Location: Hufvudstaden, Sweden
Contact:

Re: A little something that many of you would find useful.

Post by bjorn98009_91 »

Cool, do you have AmmoDartEM as well?
Producer and Quality Assurance Manager for Deus Ex: Revision.
User avatar
CorinthMaxwell
NSF
Posts: 79
Joined: Sat Oct 04, 2008 1:28 am

Re: A little something that many of you would find useful.

Post by CorinthMaxwell »

bjorn98009_91 wrote:Cool, do you have AmmoDartEM as well?
Here's the scripts for the ammo & the projectile.

Code: Select all

//=============================================================================
// DartEM.
//=============================================================================
class DartEM extends Dart;

var float	mpEMPDamage;

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

	if ( Level.NetMode != NM_Standalone )
	{
		Damage=mpEMPDamage;
		bIgnoresNanoDefense=True;
	}
}

defaultproperties
{
     mpEMPDamage=20.000000
     bBlood=False
     DamageType=EMP
     spawnAmmoClass=Class'DeusEx.AmmoDartEM'
     ItemName="Electromagnetic Dart"
     ItemArticle="an"
     Damage=15.000000
     ImpactSound=Sound'DeusExSounds.Weapons.EMPGrenadeExplode'
}

Code: Select all

//=============================================================================
// AmmoDartEM.
//=============================================================================
class AmmoDartEM extends AmmoDart;

defaultproperties
{
     bIsNonStandard=True
     AmmoAmount=xxx
     MaxAmmo=xxx
     ItemName="Electromagnetic Darts"
     Icon=Texture'DeusExUI.Icons.AmmoDartsEMIco'
     largeIcon=None
     Description="Electromagnetic darts are fitted with special charges that allow them to disable various electronic devices."
     beltDescription="EM DART"
     Skin=Texture'DeusExItems.Skins.AmmoDartsEM'
}
Robin: "Holy flying snotburgers, Batman!"
Batman: o_0 O_0 o.0 O.0
User avatar
bjorn98009_91
Silhouette
Posts: 688
Joined: Thu May 08, 2008 8:17 am
Location: Hufvudstaden, Sweden
Contact:

Re: A little something that many of you would find useful.

Post by bjorn98009_91 »

Thanks.
Producer and Quality Assurance Manager for Deus Ex: Revision.
Post Reply