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

UT2k4AssaultFull.FM_SpaceFighter_AltFire


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
//=============================================================================
// FM_SpaceFighter_AltFire
//=============================================================================

class FM_SpaceFighter_AltFire extends ProjectileFire;

function DoFireEffect()
{
	// Get Rocket spawn location
	if ( ASVehicle_SpaceFighter(Instigator) != None )
		ProjSpawnOffset = ASVehicle_SpaceFighter(Instigator).GetRocketSpawnLocation();

	MyDoFireEffect();
}

function MyDoFireEffect()
{
	local Vector Start, X,Y,Z;

	Instigator.MakeNoise(1.0);
	GetAxes(Instigator.Rotation, X, Y, Z);

	Start = MyGetFireStart(X, Y, Z);

	SpawnProjectile(Start, Instigator.Rotation);
}

function Projectile SpawnProjectile(vector Start, rotator Dir)
{
	local PROJ_SpaceFighter_Rocket	P;
	local Vehicle					Target;

	P = PROJ_SpaceFighter_Rocket(super.SpawnProjectile(Start, Dir));

	if ( P != None && ASVehicle_SpaceFighter_Skaarj(Instigator) != None )	// hack for Skaarj SF damagetype
		P.MyDamageType = class'DamTypeSpaceFighterMissileSkaarj';

	if ( P != None && ASVehicle_SpaceFighter(Instigator) != None )
	{
		if ( Instigator.Controller.IsA('PlayerController') )
			Target = ASVehicle_SpaceFighter(Instigator).CurrentTarget;
		else if ( Instigator.Controller.IsA('Bot') && Instigator.Controller.Enemy != None 
			&& (Bot(Instigator.Controller).Skill > FRand() * 5.f) )
		{
			// very basic AI to target enemies...
			Target = Vehicle(Instigator.Controller.Enemy);
		}
	}

	// Check that Target is directly visible
	if ( Target != None && Normal(Target.Location - Instigator.Location) Dot Vector(Instigator.Rotation) > 0 
		&& Weapon.FastTrace( Target.Location, Instigator.Location ) )
	{
		P.HomingTarget = Target;
		Target.NotifyEnemyLockedOn();
	}

	return P;
}

simulated function vector MyGetFireStart(vector X, vector Y, vector Z)
{
    return Instigator.Location + X*ProjSpawnOffset.X + Y*ProjSpawnOffset.Y + Z*ProjSpawnOffset.Z;
}


simulated function bool AllowFire()
{
    return true;
}


//=============================================================================
// defaultproperties
//=============================================================================

defaultproperties
{
	bModeExclusive=false
    AmmoClass=class'Ammo_Dummy'
    AmmoPerFire=0

    FireAnim=Fire
    FireAnimRate=1.0

    ProjectileClass=class'UT2k4AssaultFull.PROJ_SpaceFighter_Rocket'
    FlashEmitterClass=None
    ProjSpawnOffset=(X=0,Y=0,Z=-25)

    FireSound=Sound'AssaultSounds.HnShipFire02'
    FireForce="RocketLauncherFire"  // jdf

    FireRate=4.0
    TweenTime=0.0

    bSplashDamage=true
    bRecommendSplashDamage=true
    bSplashJump=true
    BotRefireRate=0.5
	WarnTargetPct=+0.9

    ShakeOffsetMag=(X=-20.0,Y=0.00,Z=0.00)
    ShakeOffsetRate=(X=-1000.0,Y=0.0,Z=0.0)
    ShakeOffsetTime=2
    ShakeRotMag=(X=0.0,Y=0.0,Z=0.0)
    ShakeRotRate=(X=0.0,Y=0.0,Z=0.0)
    ShakeRotTime=2
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Di 5.9.2006 22:36:14.000 - Creation time: Do 14.8.2014 09:58:38.970 - Created with UnCodeX