Advertisement
Guest User

Untitled

a guest
Jan 15th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Class KF2KillMessage extends LocalMessage;
  2.  
  3. var bool bJustName;
  4. var localized string KillString,KillsString;
  5. var localized float MessageShowTime;
  6.  
  7. static final function string GetNameOf( class<Monster> M )
  8. {
  9.     if( Len(M.Default.MenuName)==0 )
  10.         return string(M.Name);
  11.     return M.Default.MenuName;
  12. }
  13.  
  14. static function string GetString(optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject)
  15. {
  16.     // KF2 styled kill messages - Just monster name
  17.     if ( default.bJustName )
  18.     {
  19.         // Other player did not kill this zed
  20.         if( RelatedPRI_1==None )
  21.             return GetNameOf(Class<Monster>(OptionalObject));
  22.        
  23.         // Other player killed this zed!
  24.         return RelatedPRI_1.PlayerName@"-"@GetNameOf(Class<Monster>(OptionalObject));
  25.     }
  26.    
  27.     // Clasic kill messages - +1 Clot kill
  28.     else
  29.     {
  30.         if( RelatedPRI_1==None )
  31.             return "+"$(Switch+1)@GetNameOf(Class<Monster>(OptionalObject))@Eval(Switch==0,Default.KillString,Default.KillsString);
  32.         return RelatedPRI_1.PlayerName@"+"$(Switch+1)@GetNameOf(Class<Monster>(OptionalObject))@Eval(Switch==0,Default.KillString,Default.KillsString);
  33.     }
  34. }
  35.  
  36. static function ClientReceive(PlayerController P, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject)
  37. {
  38.     local KF2HUD H;
  39.     local HUDKillingFloor HKF;
  40.  
  41.     if( Class<Monster>(OptionalObject)==None || HudBase(P.myHud)==None || (RelatedPRI_1==None && Switch==1) )
  42.         return;
  43.    
  44.     //if (SRPlayerReplicationInfo(P.PlayerReplicationInfo) != None && !SRPlayerReplicationInfo(P.PlayerReplicationInfo).bKillMsg)
  45.     //  return;
  46.    
  47.     // Disable standard kill messages
  48.     HKF = HUDKillingFloor(P.myHud);
  49.     if (HKF != None)
  50.         HKF.bTallySpecimenKills = false;
  51.    
  52.     H = KF2HUD(P.myHud);
  53.    
  54.     // Always show messages - No bTallySpecimenKills check
  55.     if(H != none)
  56.     {
  57.         // Only UPDATE a message if we're using classic mode
  58.         if ( default.bJustName )
  59.             H.LocalizedMessage(Default.Class,0,RelatedPRI_1,,OptionalObject);
  60.         else if (!H.UpdateCustomKillMessage(OptionalObject,RelatedPRI_1))
  61.             H.LocalizedMessage(Default.Class,0,RelatedPRI_1,,OptionalObject);
  62.     }
  63.  
  64. }
  65.  
  66. static function float GetLifeTime(int Switch)
  67. {
  68.     return default.MessageShowTime;
  69. }
  70.  
  71. // Fade color: Green (0-3 frags) > Yellow (4-7 frags) > Red (8-12 frags) > Dark Red (13+ frags).
  72. static function color GetColor(
  73.     optional int Switch,
  74.     optional PlayerReplicationInfo RelatedPRI_1,
  75.     optional PlayerReplicationInfo RelatedPRI_2
  76.     )
  77. {
  78.     local color C;
  79.  
  80.     C.A = 255;
  81.     if( Switch<10 )
  82.     {
  83.         C.G = Clamp(500-Switch*50,0,255);
  84.         C.R = Clamp(0+Switch*50,0,255);
  85.     }
  86.     else C.R = Max(505-Switch*25,150);
  87.     return C;
  88. }
  89.  
  90. defaultproperties
  91. {
  92.     FontSize = -2
  93.     KillString="kill"
  94.     KillsString="kills"
  95.     MessageShowTime=4.000000
  96.     bJustName=False
  97.     bIsConsoleMessage=False
  98.     bFadeMessage=True
  99.     DrawColor=(B=0,G=0,R=150)
  100.     DrawPivot=DP_UpperLeft
  101.     StackMode=SM_Down
  102.     PosX=0.020000
  103.     PosY=0.200000
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement