Core.Object | +--Engine.Actor | +--Engine.Effects | +--Botpack.MortarSpawner
int
Deviation
sound
FireSound
RateOfFire
ShellBlastRadius
ShellDamage
ShellMomentumTransfer
float
ShellSpeed
bool
bDeviate
void
BeginPlay()
LaunchShell()
Timer()
00001 //============================================================================= 00002 // MortarSpawner. 00003 //============================================================================= 00004 class MortarSpawner extends Effects; 00005 00006 var() int ShellDamage; 00007 var() int ShellMomentumTransfer; 00008 var() int ShellBlastRadius; 00009 var() int RateOfFire; 00010 var() float ShellSpeed; 00011 var() int Deviation; 00012 var() bool bDeviate; 00013 var() sound FireSound; 00014 00015 function BeginPlay() 00016 { 00017 SetTimer(RateOfFire, True); 00018 } 00019 00020 function Timer() 00021 { 00022 LaunchShell(); 00023 PlaySound(FireSound, SLOT_None, 4.0); 00024 } 00025 00026 function LaunchShell() 00027 { 00028 local rotator NewRot; 00029 local MortarShell shell; 00030 00031 if (bDeviate) 00032 { 00033 NewRot.Pitch = Rotation.Pitch + (Deviation/2) - (Deviation * FRand()); 00034 NewRot.Roll = Rotation.Roll + (Deviation/2) - (Deviation * FRand()); 00035 NewRot.Yaw = Rotation.Yaw + (Deviation/2) - (Deviation * FRand()); 00036 } 00037 else 00038 NewRot = Rotation; 00039 shell = Spawn(class'MortarShell',,, Location+Vector(Rotation)*20, NewRot); 00040 00041 shell.speed = ShellSpeed; 00042 shell.damage = ShellDamage; 00043 shell.momentumtransfer = ShellMomentumTransfer; 00044 shell.blastradius = ShellBlastRadius; 00045 } 00046 00047 defaultproperties 00048 { 00049 ShellDamage=70 00050 ShellMomentumTransfer=150000 00051 ShellBlastRadius=400 00052 RateOfFire=5 00053 ShellSpeed=1000.000000 00054 Deviation=4096 00055 bDeviate=True 00056 FireSound=Sound'UnrealShare.flak.Explode1' 00057 bHidden=True 00058 bNetTemporary=False 00059 bDirectional=True 00060 DrawType=DT_Sprite 00061 }