Code: Select all
//=============================================================================
// EnergyBolt. -> Local Bolt -> Null server code Bolt -> Crappy effects On-Line Bolt...
// Kinda null mapping knowledge related to server-stuff
// Finishing Intro, let's see this in a server
// Step 1) Put simulated functions as for other functional projectiles
// Step 2) Put a bit of noise into the crap
// Step 3) Being a slow Projectile made sure about presence of Instigator when hits an actor target - it might die during fly time
// Step 4) Is not a need for this to fly 3 years. Is a mess in end
//=============================================================================
class MHEnergyBolt extends Projectile;
simulated function PostBeginPlay() //These ought to be simulated in order to work in Net, I'm guessing.
{
Super.PostBeginPlay(); //Call momma
// Acceleration = vect(0,0,0); //Wheew ! Impressive
Velocity = Vector(Rotation) * MaxSpeed; // velocity
// SetLocation( Location + vect(0,0,25) ); //Fire from Hat, right ? Not now.
PlaySound(SpawnSound, SLOT_Misc, 2.0); //A small sound
}
simulated function ProcessTouch( Actor Other, Vector HitLocation )
{
local vector momentum;
if (MHEnergyBolt(Other) == none)
{
if ( Role == ROLE_Authority ) //Code done already in other classes
{
momentum = MomentumTransfer * Normal(Velocity);
if ( Instigator != None ) //Still alive ?
Other.TakeDamage(damage,Instigator,hitLocation,momentum,'zapped');
else
Other.TakeDamage(damage,None,hitLocation,momentum,'zapped');
}
Destroy();
}
}
simulated function HitWall( vector HitNormal, actor Wall )//lil effect
{
Super.HitWall(HitNormal, Wall);
PlaySound(ImpactSound, SLOT_Misc, 0.5); //human sound
SetPhysics(PHYS_None);
SetCollision(false,false,false);
MakeNoise(0.5); //Disturb Evil spirits
Destroy();
}
simulated function Explode(vector HitLocation, vector HitNormal)
{
}
simulated function AnimEnd()
{
Destroy();
}
defaultproperties
{
LifeSpan=10.00
MaxSpeed=1000.000000
MomentumTransfer=20
damage=20
RemoteRole=ROLE_SimulatedProxy
SpawnSound=Sound'UnrealShare.General.ArrowSpawn'
ImpactSound=Sound'UnrealShare.Razorjack.BladeHit'
Mesh=LodMesh'UnrealShare.bolt1'
AmbientGlow=67
bUnlit=True
LightType=LT_Steady
LightRadius=19
}