<commit_before>/* bzflag
* Copyright (c) 1993 - 2008 <NAME>
*
* This package is free software;  you can redistribute it and/or
* modify it under the terms of the license found in the file
* named COPYING that should have accompanied this file.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/

#include "common.h"

/* interface header */
#include "Flag.h"

/* system implementation headers */
#include <math.h>
#include <string>
#include <assert.h>
#include <string.h>

/* common implementation headers */
#include "Team.h"
#include "Pack.h"
#include "TextUtils.h"


FlagSet *FlagType::flagSets = NULL;
const int FlagType::packSize = FlagPackSize;
FlagSet FlagType::customFlags;

static const char NullString[2] = { '\0', '\0' };

// Initialize flag description singletons in our Flags namespace
namespace Flags {
  /* alphabetical order */
  FlagType *Agility;
  FlagType *Blindness;
  FlagType *BlueTeam;
  FlagType *Bouncy;
  FlagType *Burrow;
  FlagType *Cloaking;
  FlagType *Colorblindness;
  FlagType *ForwardOnly;
  FlagType *Genocide;
  FlagType *GreenTeam;
  FlagType *GuidedMissile;
  FlagType *Identify;
  FlagType *InvisibleBullet;
  FlagType *Jamming;
  FlagType *Jumping;
  FlagType *Laser;
  FlagType *LeftTurnOnly;
  FlagType *LowGravity;
  FlagType *MachineGun;
  FlagType *Masquerade;
  FlagType *Momentum;
  FlagType *Narrow;
  FlagType *NoJumping;
  FlagType *Obesity;
  FlagType *OscillationOverthruster;
  FlagType *PhantomZone;
  FlagType *PurpleTeam;
  FlagType *QuickTurn;
  FlagType *RapidFire;
  FlagType *RedTeam;
  FlagType *ReverseControls;
  FlagType *ReverseOnly;
  FlagType *Ricochet;
  FlagType *RightTurnOnly;
  FlagType *Seer;
  FlagType *Shield;
  FlagType *ShockWave;
  FlagType *Stealth;
  FlagType *Steamroller;
  FlagType *SuperBullet;
  FlagType *Thief;
  FlagType *Tiny;
  FlagType *TriggerHappy;
  FlagType *Useless;
  FlagType *Velocity;
  FlagType *WideAngle;
  FlagType *Wings;
  FlagType *Null; // leave Null at the end

  void init()
  {
    Null	= new FlagType( "", NullString, FlagNormal, StandardShot, FlagGood, NoTeam, NULL );

    RedTeam	= new FlagType( "Red Team", "R*", FlagNormal, StandardShot, FlagGood, ::RedTeam,
      "If it's yours, prevent other teams from taking it.  If it's not take it to your base to capture it!" );
    GreenTeam	= new FlagType( "Green Team", "G*", FlagNormal, StandardShot, FlagGood, ::GreenTeam,
      "If it's yours, prevent other teams from taking it.  If it's not take it to your base to capture it!" );
    BlueTeam	= new FlagType( "Blue Team", "B*", FlagNormal, StandardShot, FlagGood, ::BlueTeam,
      "If it's yours, prevent other teams from taking it.  If it's not take it to your base to capture it!" );
    PurpleTeam	= new FlagType( "Purple Team", "P*", FlagNormal, StandardShot, FlagGood, ::PurpleTeam,
      "If it's yours, prevent other teams from taking it.  If it's not take it to your base to capture it!" );
    Velocity	= new FlagType( "High Speed", "V", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Tank moves faster.  Outrun bad guys." );
    QuickTurn	= new FlagType( "Quick Turn", "QT", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Tank turns faster.  Good for dodging." );
    OscillationOverthruster	= new FlagType( "Oscillation Overthruster", "OO", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Can drive through buildings.  Can't backup or shoot while inside." );
    RapidFire	= new FlagType( "Rapid Fire", "F", FlagUnstable, RapidFireShot, FlagGood, NoTeam,
      "Shoots more often.  Shells go faster but not as far." );
    MachineGun	= new FlagType( "Machine Gun", "MG", FlagUnstable, MachineGunShot, FlagGood, NoTeam,
      "Very fast reload and very short range." );
    GuidedMissile	= new FlagType( "Guided Missile", "GM", FlagUnstable, GMShot, FlagGood, NoTeam,
      "Shots track a target.  Lock on with right button.  Can lock on or retarget after firing." );
    Laser	= new FlagType( "Laser", "L", FlagUnstable, LaserShot, FlagGood, NoTeam,
      "Shoots a laser.  Infinite speed, long range, but long reload time.");
    Ricochet	= new FlagType( "Ricochet", "R", FlagUnstable, RicoShot, FlagGood, NoTeam,
      "Shots bounce off walls.  Don't shoot yourself!" );
    SuperBullet	= new FlagType( "Super Bullet", "SB", FlagUnstable, SuperShot, FlagGood, NoTeam,
      "Shoots through buildings.  Can kill Phantom Zone." );
    InvisibleBullet	= new FlagType( "Invisible Bullet", "IB", FlagUnstable, InvisibleShot, FlagGood, NoTeam,
      "Your shots don't appear on other radars.  Can still see them out window.");
    Stealth	= new FlagType( "Stealth", "ST", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Tank is invisible on radar.  Shots are still visible.  Sneak up behind enemies!");
    Tiny	= new FlagType( "Tiny", "T", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Tank is small and can get through small openings.  Very hard to hit." );
    Narrow	= new FlagType( "Narrow", "N", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Tank is super thin.  Very hard to hit from front but is normal size from side.  Can get through small openings.");
    Shield	= new FlagType( "Shield", "SH", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Getting hit only drops flag.  Flag flies an extra-long time.");
    Steamroller	= new FlagType( "Steamroller", "SR", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Destroys tanks you touch but you have to get really close.");
    ShockWave	= new FlagType( "Shock Wave", "SW", FlagUnstable, ShockWaveShot, FlagGood, NoTeam,
      "Firing destroys all tanks nearby.  Don't kill teammates!  Can kill tanks on/in buildings.");
    PhantomZone	= new FlagType( "Phantom Zone", "PZ", FlagUnstable, PhantomShot, FlagGood, NoTeam,
      "Teleporting toggles Zoned effect.  Zoned tank can drive through buildings.  Zoned tank shoots Zoned bullets and can't be shot (except by superbullet, shock wave, and other Zoned tanks).");
    Genocide	= new FlagType( "Genocide", "G", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Killing one tank kills that tank's whole team.");
    Jumping	= new FlagType( "Jumping", "JP", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Tank can jump.  Use Tab key.  Can't steer in the air.");
    Identify	= new FlagType( "Identify", "ID", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Identifies type of nearest flag.");
    Cloaking	= new FlagType( "Cloaking", "CL", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Makes your tank invisible out-the-window.  Still visible on radar.");
    Useless	= new FlagType( "Useless", "US", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "You have found the useless flag. Use it wisely.");
    Masquerade	= new FlagType( "Masquerade", "MQ", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "In opponent's hud, you appear as a teammate.");
    Seer	= new FlagType( "Seer", "SE", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "See stealthed, cloaked and masquerading tanks as normal.");
    Thief	= new FlagType( "Thief", "TH", FlagUnstable, ThiefShot, FlagGood, NoTeam,
      "Steal flags.  Small and fast but can't kill.");<commit_msg>seer sees invisible bullets<commit_after>/* bzflag
* Copyright (c) 1993 - 2008 <NAME>
*
* This package is free software;  you can redistribute it and/or
* modify it under the terms of the license found in the file
* named COPYING that should have accompanied this file.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/

#include "common.h"

/* interface header */
#include "Flag.h"

/* system implementation headers */
#include <math.h>
#include <string>
#include <assert.h>
#include <string.h>

/* common implementation headers */
#include "Team.h"
#include "Pack.h"
#include "TextUtils.h"


FlagSet *FlagType::flagSets = NULL;
const int FlagType::packSize = FlagPackSize;
FlagSet FlagType::customFlags;

static const char NullString[2] = { '\0', '\0' };

// Initialize flag description singletons in our Flags namespace
namespace Flags {
  /* alphabetical order */
  FlagType *Agility;
  FlagType *Blindness;
  FlagType *BlueTeam;
  FlagType *Bouncy;
  FlagType *Burrow;
  FlagType *Cloaking;
  FlagType *Colorblindness;
  FlagType *ForwardOnly;
  FlagType *Genocide;
  FlagType *GreenTeam;
  FlagType *GuidedMissile;
  FlagType *Identify;
  FlagType *InvisibleBullet;
  FlagType *Jamming;
  FlagType *Jumping;
  FlagType *Laser;
  FlagType *LeftTurnOnly;
  FlagType *LowGravity;
  FlagType *MachineGun;
  FlagType *Masquerade;
  FlagType *Momentum;
  FlagType *Narrow;
  FlagType *NoJumping;
  FlagType *Obesity;
  FlagType *OscillationOverthruster;
  FlagType *PhantomZone;
  FlagType *PurpleTeam;
  FlagType *QuickTurn;
  FlagType *RapidFire;
  FlagType *RedTeam;
  FlagType *ReverseControls;
  FlagType *ReverseOnly;
  FlagType *Ricochet;
  FlagType *RightTurnOnly;
  FlagType *Seer;
  FlagType *Shield;
  FlagType *ShockWave;
  FlagType *Stealth;
  FlagType *Steamroller;
  FlagType *SuperBullet;
  FlagType *Thief;
  FlagType *Tiny;
  FlagType *TriggerHappy;
  FlagType *Useless;
  FlagType *Velocity;
  FlagType *WideAngle;
  FlagType *Wings;
  FlagType *Null; // leave Null at the end

  void init()
  {
    Null	= new FlagType( "", NullString, FlagNormal, StandardShot, FlagGood, NoTeam, NULL );

    RedTeam	= new FlagType( "Red Team", "R*", FlagNormal, StandardShot, FlagGood, ::RedTeam,
      "If it's yours, prevent other teams from taking it.  If it's not take it to your base to capture it!" );
    GreenTeam	= new FlagType( "Green Team", "G*", FlagNormal, StandardShot, FlagGood, ::GreenTeam,
      "If it's yours, prevent other teams from taking it.  If it's not take it to your base to capture it!" );
    BlueTeam	= new FlagType( "Blue Team", "B*", FlagNormal, StandardShot, FlagGood, ::BlueTeam,
      "If it's yours, prevent other teams from taking it.  If it's not take it to your base to capture it!" );
    PurpleTeam	= new FlagType( "Purple Team", "P*", FlagNormal, StandardShot, FlagGood, ::PurpleTeam,
      "If it's yours, prevent other teams from taking it.  If it's not take it to your base to capture it!" );
    Velocity	= new FlagType( "High Speed", "V", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Tank moves faster.  Outrun bad guys." );
    QuickTurn	= new FlagType( "Quick Turn", "QT", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Tank turns faster.  Good for dodging." );
    OscillationOverthruster	= new FlagType( "Oscillation Overthruster", "OO", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Can drive through buildings.  Can't backup or shoot while inside." );
    RapidFire	= new FlagType( "Rapid Fire", "F", FlagUnstable, RapidFireShot, FlagGood, NoTeam,
      "Shoots more often.  Shells go faster but not as far." );
    MachineGun	= new FlagType( "Machine Gun", "MG", FlagUnstable, MachineGunShot, FlagGood, NoTeam,
      "Very fast reload and very short range." );
    GuidedMissile	= new FlagType( "Guided Missile", "GM", FlagUnstable, GMShot, FlagGood, NoTeam,
      "Shots track a target.  Lock on with right button.  Can lock on or retarget after firing." );
    Laser	= new FlagType( "Laser", "L", FlagUnstable, LaserShot, FlagGood, NoTeam,
      "Shoots a laser.  Infinite speed, long range, but long reload time.");
    Ricochet	= new FlagType( "Ricochet", "R", FlagUnstable, RicoShot, FlagGood, NoTeam,
      "Shots bounce off walls.  Don't shoot yourself!" );
    SuperBullet	= new FlagType( "Super Bullet", "SB", FlagUnstable, SuperShot, FlagGood, NoTeam,
      "Shoots through buildings.  Can kill Phantom Zone." );
    InvisibleBullet	= new FlagType( "Invisible Bullet", "IB", FlagUnstable, InvisibleShot, FlagGood, NoTeam,
      "Your shots don't appear on other radars.  Can still see them out window.");
    Stealth	= new FlagType( "Stealth", "ST", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Tank is invisible on radar.  Shots are still visible.  Sneak up behind enemies!");
    Tiny	= new FlagType( "Tiny", "T", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Tank is small and can get through small openings.  Very hard to hit." );
    Narrow	= new FlagType( "Narrow", "N", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Tank is super thin.  Very hard to hit from front but is normal size from side.  Can get through small openings.");
    Shield	= new FlagType( "Shield", "SH", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Getting hit only drops flag.  Flag flies an extra-long time.");
    Steamroller	= new FlagType( "Steamroller", "SR", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Destroys tanks you touch but you have to get really close.");
    ShockWave	= new FlagType( "Shock Wave", "SW", FlagUnstable, ShockWaveShot, FlagGood, NoTeam,
      "Firing destroys all tanks nearby.  Don't kill teammates!  Can kill tanks on/in buildings.");
    PhantomZone	= new FlagType( "Phantom Zone", "PZ", FlagUnstable, PhantomShot, FlagGood, NoTeam,
      "Teleporting toggles Zoned effect.  Zoned tank can drive through buildings.  Zoned tank shoots Zoned bullets and can't be shot (except by superbullet, shock wave, and other Zoned tanks).");
    Genocide	= new FlagType( "Genocide", "G", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Killing one tank kills that tank's whole team.");
    Jumping	= new FlagType( "Jumping", "JP", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Tank can jump.  Use Tab key.  Can't steer in the air.");
    Identify	= new FlagType( "Identify", "ID", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Identifies type of nearest flag.");
    Cloaking	= new FlagType( "Cloaking", "CL", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "Makes your tank invisible out-the-window.  Still visible on radar.");
    Useless	= new FlagType( "Useless", "US", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "You have found the useless flag. Use it wisely.");
    Masquerade	= new FlagType( "Masquerade", "MQ", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "In opponent's hud, you appear as a teammate.");
    Seer	= new FlagType( "Seer", "SE", FlagUnstable, StandardShot, FlagGood, NoTeam,
      "See stealthed, cloaked and masquerading tanks as normal.  See invisible bullets.");
    Thief	= new FlagType( "Thief", "TH", FlagUnstable, ThiefShot, FlagGood, NoTeam,
      "Steal flags.  Small and fast but can't kill.");
{'fraction_non_alphanumeric': 0.10798090040927695, 'fraction_numerical': 0.0015006821282401092, 'mean_word_length': 4.067749740753543, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1027793', 'n_tokens_mistral': 4796, 'n_tokens_neox': 4619, 'n_words': 1709}