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

Onslaught.ONSPowerCoreShield


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
//-----------------------------------------------------------
//
//-----------------------------------------------------------
class ONSPowerCoreShield extends Actor;

var Material TeamSkins[2];

//wake up call to fools shooting invalid target
var sound ShieldHitSound;
var float ImmediateWarningEndTime;
var int DamageCounter;
var PlayerController LastDamagedBy;

simulated function SetTeam(byte Team)
{
	ImmediateWarningEndTime = Level.TimeSeconds + 5;
	if (Team < 2)
		Skins[0] = TeamSkins[Team];
}

function TakeDamage(int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType)
{
	local PlayerController PC;

	if (Damage <= 0 || EventInstigator == None || EventInstigator.Role < ROLE_Authority)
		return;

	Owner.TakeDamage(Damage, EventInstigator, HitLocation, Momentum, DamageType);
	PC = PlayerController(EventInstigator.Controller);
	if (PC != None)
	{
		if (Level.TimeSeconds < ImmediateWarningEndTime)
			PC.ClientPlaySound(ShieldHitSound);
		else
		{
			if (PC != LastDamagedBy)
			{
				DamageCounter = Damage;
				LastDamagedBy = PC;
			}
			else
				DamageCounter += Damage;
			if (DamageCounter > 200)
			{
				PC.ClientPlaySound(ShieldHitSound);
				DamageCounter -= 200;
			}
		}
	}
}

simulated function bool TeamLink(int TeamNum)
{
	if (Owner != None)
		return Owner.TeamLink(TeamNum);

	return false;
}

simulated function Touch(Actor Other)
{
	if (Projectile(Other) != None)
	{
		TakeDamage(1, Other.Instigator, Other.Location, vect(0,0,0), Projectile(Other).MyDamageType);
		Projectile(Other).Explode(Other.Location, Normal(Other.Velocity));
	}
}

function bool BlocksShotAt(Actor Other)
{
	if ( (Other == Owner) || (Other == ONSPowerCore(Owner).ShootTarget) )
		return false;
	return true;
}

DefaultProperties
{
    TeamSkins(1)=FinalBlend'AW-ShieldShaders.Shaders.BlueShieldFinal'

    DrawType=DT_StaticMesh
    bMovable=false
    bStasis=true
    RemoteRole=ROLE_None
    StaticMesh=StaticMesh'AW-ShieldShaders.ONS.EnergonShield'
    DrawScale3D=(X=2.0,Y=2.0)
    PrePivot=(Z=-250)
    bAcceptsProjectors=false
    bHidden=true
    bCollideActors=False
    bCollideWorld=False
    bBlockKarma=False
    bIgnoreEncroachers=True
    bBlockActors=False
    bProjTarget=True
    bUseCylinderCollision=true
    CollisionHeight=190.0
    CollisionRadius=215.0
    ShieldHitSound=Sound'ONSVehicleSounds-S.ShieldHit'
}

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