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

Gameplay.BlasterProjectile


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
class BlasterProjectile extends Projectile;

var bool bShouldBounce;
var() float bounceTime "The amount of time for which a projectile is allowed to bounce";
var() int maxBounces;

const AI_FRIENDLY_FIRE_MULTIPLIER = 0.2;

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

	SetTimer(bounceTime, false); // blaster projectiles can only bounce over a short range
}
	
simulated function Timer()
{
	bShouldBounce = false;
}

simulated function HitWall(vector HitNormal, actor Wall)
{
	if (bShouldBounce && bounceCount < maxBounces)
	{
		bounce(HitNormal, Location, Vect(0.0, 0.0, 0.0));
		TriggerEffectEvent('Bounce');

		if (Level.NetMode == NM_Client)
			Destroy();
	}
	else
	{
		endLife(None, Location, HitNormal);
	}
}

simulated function ProjectileHit(Actor Other, vector TouchLocation, vector TouchNormal)
{
	local Rook rookOther;

	if (Level.NetMode == NM_StandAlone && Instigator != None && Instigator.Controller != None && !Instigator.Controller.bIsPlayer)
	{
		rookOther = Rook(Other);

		if (rookOther != None && rookOther.isFriendly(Rook(Instigator)))
			damageAmt *= AI_FRIENDLY_FIRE_MULTIPLIER;
	}

	super.ProjectileHit(Other, TouchLocation, TouchNormal);
}

defaultproperties
{
	bScaleProjectile = true
	initialXDrawScale = 0.05
	xDrawScalePerSecond = 10.0

	bShouldBounce = true
	bounceTime = 0.5
	maxBounces = 2
	bounceCount = 0
	damageAmt = 7
	StaticMesh = StaticMesh'Weapons.Disc'
	DrawScale3D = (X=0.3,Y=0.3,Z=0.3)	
	deathMessage = '%s copped it off %s\'s Blaster'
	
	knockback = 15000           // note that each individual shot applies knockback so this adds up to be quite large knockback
	knockbackAliveScale = 0 //0.5   // we dont want to push alive characters back as much with the shotgun as ragdolls and havok objects
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: ne 5.9.2004 15:53:20.000 - Creation time: st 23.5.2018 00:10:42.482 - Created with UnCodeX