Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

UTGame.UTAttachment_BioRifle


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
/**
 * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
 */
class UTAttachment_BioRifle extends UTWeaponAttachment;

var name CurrentIdleAnim;
var name WeaponFireAnims[3];
var name WeaponIdleAnim;
var name WeaponAltFireAnim;
var name WeaponAltChargeAnim;
var name WeaponAltChargeIdleAnim;
var float FireAnimDuration;
/** The particle system while the bio is charging*/
var ParticleSystemComponent ChargeComponent;

simulated function FireModeUpdated(byte FireModeNum, bool bViaReplication)
{
	if(FireModeNum == 0 && CurrentIdleAnim != WeaponIdleAnim)
	{
		CurrentIdleAnim = WeaponIdleAnim;
		RestartIdle();
	}
	else if(FireModeNum == 1 && CurrentIdleAnim != WeaponAltChargeIdleAnim)
	{
		StartCharging();
	}
}

simulated function AttachTo(UTPawn OwnerPawn)
{
	if (OwnerPawn.Mesh != None)
	{
		if (Mesh != None && MuzzleFlashSocket != '')
		{
			Mesh.AttachComponentToSocket(ChargeComponent, MuzzleFlashSocket);
		}
	}
	Super.AttachTo(OwnerPawn);

}
simulated function StartCharging()
{
	ClearTimer('RestartIdle');
	CurrentIdleAnim = WeaponAltChargeIdleAnim;
	if(WorldInfo.NetMode != NM_DedicatedServer)
	{
		Play3pAnimation(WeaponAltChargeAnim,2.7f);
		ChargeComponent.ActivateSystem();
	}
	SetTimer(2.7,false,'RestartIdle');
}

simulated event ThirdPersonFireEffects(vector HitLocation)
{
	local name Anim;
	local UTPawn UTP;
	Super.ThirdPersonFireEffects(HitLocation);
	UTP = UTPawn(Owner);
	if(UTP==none || UTP.FiringMode == 0)
	{
		Anim = WeaponFireAnims[rand(3)];
	}
	else
	{
		Anim = WeaponAltFireAnim;
	}
	ChargeComponent.DeactivateSystem();
	ChargeComponent.KillParticlesForced();
	Play3pAnimation(Anim,FireAnimDuration);
	FireModeUpdated(0,false); // force bio back to 'base' state
	SetTimer(FireAnimDuration,false,'RestartIdle');
}

/** 
*   Optimized equivalent of calling ThirdPersonFireEffects while in splitscreen
*/
simulated function SplitScreenEffects(vector HitLocation)
{
	local name Anim;
	local UTPawn UTP;
	Super.SplitScreenEffects(HitLocation);
	UTP = UTPawn(Owner);
	if(UTP==none || UTP.FiringMode == 0)
	{
		Anim = WeaponFireAnims[rand(3)];
	}
	else
	{
		Anim = WeaponAltFireAnim;
	}

	//This particular effect must be stopped here
	ChargeComponent.DeactivateSystem();
	ChargeComponent.KillParticlesForced();
	Play3pAnimation(Anim,FireAnimDuration);
	FireModeUpdated(0,false); // force bio back to 'base' state
	SetTimer(FireAnimDuration,false,'RestartIdle');
}

simulated function RestartIdle()
{
//	`log("Idling with"@currentidleanim);
	Play3pAnimation(CurrentIdleAnim,0.03f,true);
}

simulated event StopThirdPersonFireEffects()
{
	ChargeComponent.DeactivateSystem();
	ChargeComponent.KillParticlesForced();
	Super.StopThirdPersonFireEffects();
}

simulated function Play3pAnimation(name Sequence, float fDesiredDuration, optional bool bLoop)
{
	// Check we have access to mesh and animations
	if (Mesh != None && Mesh.Animations != None)
	{
		// @todo - this should call GetWeaponAnimNodeSeq, move 'duration' code into AnimNodeSequence and use that.
		Mesh.PlayAnim(Sequence, fDesiredDuration, bLoop);
	}
}

defaultproperties
{
   WeaponFireAnims(0)="WeaponFire1"
   WeaponFireAnims(1)="WeaponFire2"
   WeaponFireAnims(2)="WeaponFire3"
   WeaponIdleAnim="WeaponIdle"
   WeaponAltFireAnim="WeaponAltFire"
   WeaponAltChargeAnim="WeaponAltCharge"
   WeaponAltChargeIdleAnim="weaponaltidle"
   FireAnimDuration=0.400000
   Begin Object Class=ParticleSystemComponent Name=BioChargeEffect ObjName=BioChargeEffect Archetype=ParticleSystemComponent'Engine.Default__ParticleSystemComponent'
      Template=ParticleSystem'WP_BioRifle.Particles.P_WP_Bio_3P_Alt_MF'
      bAutoActivate=False
      SecondsBeforeInactive=1.000000
      Name="BioChargeEffect"
      ObjectArchetype=ParticleSystemComponent'Engine.Default__ParticleSystemComponent'
   End Object
   ChargeComponent=BioChargeEffect
   Begin Object Class=SkeletalMeshComponent Name=SkeletalMeshComponent0 ObjName=SkeletalMeshComponent0 Archetype=SkeletalMeshComponent'UTGame.Default__UTWeaponAttachment:SkeletalMeshComponent0'
      Begin Object Class=UTAnimNodeSequence Name=MeshSequenceA ObjName=MeshSequenceA Archetype=UTAnimNodeSequence'UTGame.Default__UTWeaponAttachment:MeshSequenceA'
         ObjectArchetype=UTAnimNodeSequence'UTGame.Default__UTWeaponAttachment:MeshSequenceA'
      End Object
      SkeletalMesh=SkeletalMesh'WP_BioRifle.Mesh.SK_WP_BioRifle_3P_Mid'
      Animations=UTAnimNodeSequence'UTGame.Default__UTAttachment_BioRifle:SkeletalMeshComponent0.MeshSequenceA'
      AnimSets(0)=AnimSet'WP_BioRifle.Anims.K_WP_BioRifle_3P'
      bForceRefpose=0
      ObjectArchetype=SkeletalMeshComponent'UTGame.Default__UTWeaponAttachment:SkeletalMeshComponent0'
   End Object
   Mesh=SkeletalMeshComponent0
   MuzzleFlashSocket="MuzzleFlashSocket"
   MuzzleFlashPSCTemplate=ParticleSystem'WP_BioRifle.Particles.P_WP_Bio_3P_MF'
   MuzzleFlashAltPSCTemplate=ParticleSystem'WP_BioRifle.Particles.P_WP_Bio_3P_MF'
   MuzzleFlashLightClass=Class'UTGame.UTGreenMuzzleFlashLight'
   MuzzleFlashDuration=0.330000
   Name="Default__UTAttachment_BioRifle"
   ObjectArchetype=UTWeaponAttachment'UTGame.Default__UTWeaponAttachment'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: tr 31-1-2018 17:18:38.000 - Creation time: sk 18-3-2018 10:01:18.790 - Created with UnCodeX