## Engine
Class WeaponAttachment

source: C:\XIII\Engine\Classes\WeaponAttachment.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.InventoryAttachment
             |
             +--Engine.WeaponAttachment

Direct Known Subclasses:XIIIWeaponAttachment

class WeaponAttachment
extends Engine.InventoryAttachment

    //-----------------------------------------------------------
    //
    //-----------------------------------------------------------

Variables
`name` | `AltFiringMode` replicated to identify what type of firing/reload animations to play
`byte` | `AltFlashCount` when incremented, draw muzzle flash for current frame
`bool` | `DBOnline`
`name` | `FiringMode` replicated to identify what type of firing/reload animations to play
`float` | `FiringSpeed` used by human animations to determine the appropriate speed to play firing animations
`byte` | `FlashCount` when incremented, draw muzzle flash for current frame
`byte` | `ReloadClientCount` when incremented, draw muzzle flash for current frame
`sound` | `hAltFireSound` Used to avoid (the most) bullet trails going through objects
`sound` | `hFireSound` Used to avoid (the most) bullet trails going through objects
`sound` | `hReloadSound` Used to avoid (the most) bullet trails going through objects
`int` | `iBTrailDist` Used to avoid (the most) bullet trails going through objects

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class WeaponAttachment extends InventoryAttachment
    00005	  native
    00006	  nativereplication;
    00007
    00008	var bool DBOnline;
    00009
    00010	var byte FlashCount;        // when incremented, draw muzzle flash for current frame
    00011	var byte AltFlashCount;     // when incremented, draw muzzle flash for current frame
    00012	var byte ReloadClientCount; // when incremented, draw muzzle flash for current frame
    00013	var name FiringMode;        // replicated to identify what type of firing/reload animations to play
    00014	var name AltFiringMode;     // replicated to identify what type of firing/reload animations to play
    00015
    00016	// ::TODO:: get rid of this var, XIIIUNUSED
    00017	var float FiringSpeed;    // used by human animations to determine the appropriate speed to play firing animations
    00018	var int iBTrailDist;    // Used to avoid (the most) bullet trails going through objects
    00019
    00020	var sound hFireSound;
    00021	var sound hAltFireSound;
    00022	var sound hReloadSound;
    00023
    00024	// FIXME - should firingmode be compressed to byte?
    00025	//_____________________________________________________________________________
    00026	replication
    00027	{
    00028	    // Things the server should send to the client.
    00029	    reliable if( bNetDirty && !bNetOwner && (Role==ROLE_Authority) )
    00030	      FlashCount, FiringMode, AltFlashCount, AltFiringMode, ReloadClientCount;
    00031	}
    00032
    00033	//_____________________________________________________________________________
    00034	//ThirdPersonEffects called by Pawn's C++ tick if FlashCount incremented becomes true
    00035	// OR called locally for local player
    00036	simulated event ThirdPersonEffects()
    00037	{
    00038	    // spawn 3rd person effects
    00039	    if ( Instigator != None )
    00040	    {
    00041	      // have pawn play firing anim
    00042	      Instigator.PlayFiring(1.0,FiringMode);
    00043	      // Play firing sounds for clients
    00044	//      if ( (Level.NetMode == NM_Client) && !Instigator.IsLocallyControlled() )
    00045	      if ( !Instigator.IsLocallyControlled() && (Level.NetMode != NM_StandAlone) )
    00046	        Instigator.PlayRolloffSound(hFireSound, self, 0, 0, 0 );
    00047	    }
    00048	}
    00049
    00050	//_____________________________________________________________________________
    00051	//ThirdPersonEffects called by Pawn's C++ tick if AltFlashCount incremented becomes true
    00052	// OR called locally for local player
    00053	simulated event ThirdPersonAltEffects()
    00054	{
    00055	    // spawn 3rd person effects
    00056	    if ( Instigator != None )
    00057	    {
    00058	      // have pawn play Altfiring anim
    00059	      Instigator.PlayFiring(1.0,AltFiringMode);
    00060	      // Play altfiring sounds for clients
    00061	//      if ( (Level.NetMode == NM_Client) && !Instigator.IsLocallyControlled() )
    00062	      if ( !Instigator.IsLocallyControlled() && (Level.NetMode != NM_StandAlone) )
    00063	        Instigator.PlayRolloffSound(hAltFireSound, self, 0, 0, 0 );
    00064	    }
    00065	}
    00066
    00067	//_____________________________________________________________________________
    00068	simulated event ThirdPersonReLoad()
    00069	{
    00070	    // spawn 3rd person effects
    00071	    if ( DBOnline ) Log("WATTACH ThirdPersonReLoad call for "$self@"hReloadSound="$hReloadSound);
    00072	    if ( Instigator != None )
    00073	    {
    00074	      // have pawn play reloading anim
    00075	      Instigator.PlayReLoading(1.0, FiringMode);
    00076	      // play reloading sound for clients
    00077	//      if ( (Level.NetMode == NM_Client) && !Instigator.IsLocallyControlled() )
    00078	      if ( !Instigator.IsLocallyControlled() && (Level.NetMode != NM_StandAlone) )
    00079	        Instigator.PlayRolloffSound(hReloadSound, self, 0, 2, 0 );
    00080	    }
    00081	}
    00082
    00083	defaultproperties
    00084	{
    00085	     SaturationDistance=800.000000
    00086	     StabilisationDistance=2500.000000
    00087	}

End Source Code