Created
May 14, 2014 15:01
-
-
Save rroa/752f0c084bcaa80ca4f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ACF_Bot extends ACF_Pawn; | |
/************************************************************************************ | |
* Bot Globals | |
***********************************************************************************/ | |
var int TeamNumber; | |
var() float BotSpawnTime; | |
var() bool StayAlive; | |
var ParticleSystem ProjExplosionTemplate; | |
var float MaxEffectDistance; | |
var ParticleSystemComponent ProjExplosion; | |
var (ReplicatedExplosion) class<UTReplicatedEmitter> DecoyReplicatedEmitter; | |
function SetTeamNumber( int teamNumber_ ) | |
{ | |
TeamNumber = teamNumber_; | |
} | |
reliable server function spawnExplosion( vector HitLocation ) | |
{ | |
local class<EmitterPool> PoolClass; | |
local EmitterPool emitterPool; | |
if ( ProjExplosionTemplate != None ) | |
{ | |
PoolClass = class<EmitterPool>(DynamicLoadObject("UDKBase.UDKEmitterPool", class'Class')); | |
if ( PoolClass != None ) | |
{ | |
emitterPool = Spawn(PoolClass, self,, vect(0,0,0), rot(0,0,0)); | |
if( emitterPool != None ) | |
{ | |
emitterPool.bForceNetUpdate = true; | |
emitterPool.SpawnEmitter( ProjExplosionTemplate, HitLocation ); | |
} | |
} | |
} | |
} | |
simulated function PostBeginPlay() | |
{ | |
super.PostBeginPlay(); | |
AddDefaultInventory(); | |
PlaySound( SpawnSound ); | |
// If stay alive is set then the bot does not dissapears | |
// | |
if( !StayAlive ) | |
{ | |
SetTimer( BotSpawnTime, true ); | |
} | |
} | |
simulated function onDeath() | |
{ | |
self.Destroy(); | |
} | |
function Timer() | |
{ | |
spawnExplosion( Location ); | |
onDeath(); | |
} | |
event TakeDamage(int Damage, Controller EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser) | |
{ | |
local ACF_Proj_Shot acfShot; | |
acfShot = ACF_Proj_Shot(DamageCauser); | |
if( ( acfShot != None ) && bCanBeDamaged ) // If bot can be damaged then upon a hit it should be destroyed! | |
{ | |
onDeath(); | |
} | |
} | |
DefaultProperties | |
{ | |
StayAlive=false | |
BotSpawnTime=5 | |
bCanBeDamaged = true | |
Begin Object Name=CollisionCylinder | |
CollisionHeight=+44.000000 | |
End Object | |
ControllerClass=class'ACF_AIController' | |
bJumpCapable=false | |
bCanJump=false | |
Begin Object Class=SkeletalMeshComponent Name=ACFPawnSkeletalMesh | |
SkeletalMesh=SkeletalMesh'alien_char.skeletal_meshes.Alien_NEW_skin_SK_01' | |
AnimSets(0)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman_BaseMale' | |
AnimTreeTemplate=AnimTree'CH_AnimHuman_Tree.AT_CH_Human' | |
HiddenGame=FALSE | |
bAcceptsDynamicDecals=FALSE | |
LightEnvironment=MyLightEnvironment | |
CastShadow=false | |
bOwnerNoSee=true | |
bUpdateSkelWhenNotRendered=false | |
bOverrideAttachmentOwnerVisibility=true | |
TickGroup=TG_PostAsyncWork | |
bPerBoneMotionBlur=true | |
End Object | |
Mesh=ACFPawnSkeletalMesh | |
CollisionType=COLLIDE_BlockAll | |
Components.Add(ACFPawnSkeletalMesh) | |
m_DecoyProjectileClass=class'ACF_Proj_Decoy' | |
ProjExplosionTemplate=ParticleSystem'poct_weapons.Particles.decoy_burst_particle_ps_01' | |
MaxEffectDistance=+10000.0 | |
SpawnSound=SoundCue'SOUNDS.Cues.DECOY_IMPACT_Cue' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment