Advertisement
poosh

GameRules example for counting FP explosive kills

Dec 25th, 2017
916
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class VozGameRules extends GameRules
  2.  
  3. function bool PreventDeath(Pawn Killed, Controller Killer, class<DamageType> damageType, vector HitLocation)
  4. {
  5.     local class<KFWeaponDamageType> KFDamType;
  6.     local SRStatsBase stats;
  7.    
  8.     if ( (NextGameRules != None) && NextGameRules.PreventDeath(Killed,Killer, damageType,HitLocation) )
  9.         return true;
  10.        
  11.     KFDamType = class<KFWeaponDamageType>(damageType);
  12.     if ( PlayerController(Killer) != none ) {
  13.         stats = SRStatsBase(PlayerController(Killer).SteamStatsAndAchievements);
  14.     }
  15.        
  16.     if ( Killed.IsA('ZombieFleshpound') && KFDamType != none && KFDamType.default.bIsExplosive ) {
  17.         // Fleshpound killed by explosive damage
  18.         if ( stats != none ) {
  19.             stats.Rep.ProgressCustomValue(Class'VozFPKillProgress ', 1);
  20.         }
  21.     }
  22.     return false;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement