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
//-----------------------------------------------------------
//
//-----------------------------------------------------------
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'
     ShieldHitSound=Sound'ONSVehicleSounds-S.ShieldHit'
     DrawType=DT_StaticMesh
     StaticMesh=StaticMesh'AW-ShieldShaders.ONS.EnergonShield'
     bHidden=True
     bStasis=True
     bAcceptsProjectors=False
     bIgnoreEncroachers=True
     RemoteRole=ROLE_None
     DrawScale3D=(X=2.000000,Y=2.000000)
     PrePivot=(Z=-250.000000)
     bMovable=False
     CollisionRadius=215.000000
     CollisionHeight=190.000000
     bProjTarget=True
     bUseCylinderCollision=True
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Wed 7/2/2007 19:12:22.000 - Creation time: Wed 7/2/2007 19:16:47.578 - Created with UnCodeX