Advertisement
Guest User

Untitled

a guest
May 22nd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.49 KB | None | 0 0
  1.     // battlesuit protects from all radius damage (but takes knockback)
  2.     // and protects 50% against all damage
  3.     if ( qtrue ) {
  4.         G_AddEvent( targ, EV_POWERUP_BATTLESUIT, 0 );
  5.         if ( ( dflags & DAMAGE_RADIUS ) || ( mod == MOD_FALLING ) ) {
  6.             return;
  7.         }
  8.         damage *= 0.5;
  9.     }
  10.  
  11.     // add to the attacker's hit counter (if the target isn't a general entity like a prox mine)
  12.     if ( attacker->client && targ != attacker && targ->health > 0
  13.             && targ->s.eType != ET_MISSILE
  14.             && targ->s.eType != ET_GENERAL) {
  15.         if ( OnSameTeam( targ, attacker ) ) {
  16.             attacker->client->ps.persistant[PERS_HITS]--;
  17.         } else {
  18.             attacker->client->ps.persistant[PERS_HITS]++;
  19.         }
  20.         attacker->client->ps.persistant[PERS_ATTACKEE_ARMOR] = (targ->health<<8)|(client->ps.stats[STAT_ARMOR]);
  21.     }
  22.  
  23.     // always give half damage if hurting self
  24.     // calculated after knockback, so rocket jumping works
  25.     if ( targ == attacker) {
  26.         damage *= 0.5;
  27.     }
  28.  
  29.     if ( damage < 1 ) {
  30.         damage = 1;
  31.     }
  32.  
  33.     if ((g_gametype.integer == GT_ELIMINATION || g_gametype.integer == GT_CTF_ELIMINATION || g_gametype.integer == GT_LMS)
  34.                 && g_elimination_selfdamage.integer<1 && ( targ == attacker ||  mod == MOD_FALLING )) {
  35.         damage = 0;
  36.     }
  37.  
  38.  
  39. //So people can be telefragged!
  40.     if ((g_gametype.integer == GT_ELIMINATION || g_gametype.integer == GT_CTF_ELIMINATION || g_gametype.integer == GT_LMS) && level.time < level.roundStartTime && ((mod == MOD_LAVA) || (mod == MOD_SLIME)) ) {
  41.         damage = 1000;
  42.     }
  43.  
  44.     damage = 0
  45.     take = damage;
  46.     save = 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement