Guest User

Untitled

a guest
Aug 20th, 2018
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class EngagePawn extends UTPawn;
  2. var bool bCanDodge;
  3. var AudioComponent HealthSound;
  4. var EngageGFxHUD EngageGFxHUD;
  5.  
  6. function bool Dodge(eDoubleClickDir DoubleClickMove)
  7. {
  8.     if(bCanDodge)
  9.         return super.Dodge(DoubleClickMove);
  10.  
  11.     return false;
  12. }
  13.  
  14. function AddDefaultInventory()
  15. {
  16.     InvManager.CreateInventory(class'UTGame.Carabine_Weapon');
  17. }
  18.  
  19. event TakeDamage(int DamageAmount, Controller EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser)
  20. {
  21.     EngageGFxHUD = EngageGFxHUD(Owner);
  22.     super.TakeDamage(DamageAmount, EventInstigator, HitLocation, Momentum, DamageType, HitInfo, DamageCauser);
  23.     if (Health <= 25)
  24.     {
  25.         HealthSound.Play(); //PLAY HEARTBEAT SOUND
  26.     }
  27.     if (Health < 100)
  28.     {
  29.         HUD.Bloodsplatter(true); //SHOW BLOOD SPLAAATTTEERRRR
  30.     }
  31. }
  32.  
  33. function Tick(float DeltaTime)
  34. {
  35.     Super.Tick(DeltaTime);
  36.    
  37.     if (Health > 25)
  38.          HealthSound.Stop();
  39. }
  40.  
  41. simulated event Destroyed()
  42. {
  43.     HealthSound = None;
  44.     super.Destroyed();
  45. }
  46.  
  47. defaultproperties
  48. {
  49.     Begin Object class=AudioComponent name=MenuAudioComponent
  50.         SoundCue = SoundCue'Sounds.Misc.Heartbeat_Cue'
  51.     End Object
  52.     HealthSound = MenuAudioComponent
  53.     Components.Add(MenuAudioComponent)
  54.  
  55.     Begin Object Class=SkeletalMeshComponent Name=EPawnSkeletalMeshComponent
  56.         bCacheAnimSequenceNodes=FALSE
  57.         AlwaysLoadOnClient=true
  58.         AlwaysLoadOnServer=true
  59.         bOwnerNoSee=true
  60.         CastShadow=true
  61.         BlockRigidBody=TRUE
  62.         bUpdateSkelWhenNotRendered=false
  63.         bIgnoreControllersWhenNotRendered=TRUE
  64.         bUpdateKinematicBonesFromAnimation=true
  65.         bCastDynamicShadow=true
  66.         Translation=(Z=8.0)
  67.         RBChannel=RBCC_Untitled3
  68.         RBCollideWithChannels=(Untitled3=true)
  69.         LightEnvironment=MyLightEnvironment
  70.         bOverrideAttachmentOwnerVisibility=true
  71.         bAcceptsDynamicDecals=FALSE
  72.         AnimTreeTemplate=AnimTree'Engage_Soldier.Anims.Soldier_AnimTree'
  73.         bHasPhysicsAssetInstance=true
  74.         TickGroup=TG_PreAsyncWork
  75.         MinDistFactorForKinematicUpdate=0.2
  76.         bChartDistanceFactor=true
  77.         //bSkipAllUpdateWhenPhysicsAsleep=TRUE
  78.         RBDominanceGroup=20
  79.         Scale=1.075
  80.         // Nice lighting for hair
  81.         bUseOnePassLightingOnTranslucency=TRUE
  82.         bPerBoneMotionBlur=true
  83.     End Object
  84.     Mesh=EPawnSkeletalMeshComponent
  85.     Components.Add(EPawnSkeletalMeshComponent)
  86.    
  87.     //Add Sounds Here. Hit Sound, Jump Sound etc. Lookup: UTPawnSoundGroup_Liandri.uc file
  88.     SoundGroupClass=None
  89.    
  90.     InventoryManagerClass=class'EngageInventoryManager'
  91.    
  92.     MaxMultiJump=0 //Set this to 1 to enable Double Jump
  93.     bCanDodge=false //Set this to true to enable Dodging
  94.     EngageGFxHUD = EngageGFxHUD(Owner);
  95. }
Add Comment
Please, Sign In to add comment