SegmentedShotStrategy::SegmentedShotStrategy(ShotPath* _path, bool useSuperTexture, bool faint) :
				ShotStrategy(_path)
{
  // initialize times
  prevTime = getPath().getStartTime();
  lastTime = currentTime = prevTime;

  // start at first segment
  lastSegment = segment = 0;

  // get team
  Player* p = lookupPlayer(_path->getPlayer());
  team = p ? p->getTeam() : RogueTeam;

  // initialize scene nodes
  boltSceneNode = new BoltSceneNode(_path->getPosition());
  const float* c = Team::getRadarColor(team);
  if (faint){
    boltSceneNode->setColor(c[0], c[1], c[2],0.2f);
    boltSceneNode->setTextureColor(1.0f,1.0f,1.0f,0.3f);
  } else {
    boltSceneNode->setColor(c[0], c[1], c[2], 1.0f);
  }

  TextureManager &tm = TextureManager::instance();
  std::string imageName = Team::getImagePrefix(team);
  if (useSuperTexture)
    imageName += BZDB.get("superPrefix");
  imageName += BZDB.get("boltTexture");

  int texture = tm.getTextureID(imageName.c_str());
  if (texture >= 0)
    boltSceneNode->setTexture(texture);
}
Example #2
0
/**
 * @brief Write player stats to network buffer
 * @sa G_SendStats
 */
void G_SendPlayerStats (const Player& player)
{
	Edict* ent = nullptr;

	while ((ent = G_EdictsGetNextActor(ent)))
		if (ent->team == player.getTeam()) {
			G_EventActorStats(*ent, G_PlayerToPM(player));
			G_SendWoundStats(ent);
		}
}
Example #3
0
/**
 * @brief Sets visible edict on player spawn
 * @sa G_ClientStartMatch
 * @sa G_CheckVisTeam
 * @sa G_AppearPerishEvent
 */
void G_CheckVisPlayer (Player& player, const vischeckflags_t visFlags)
{
	Edict* ent = nullptr;

	/* check visibility */
	while ((ent = G_EdictsGetNextInUse(ent))) {
		/* check if he's visible */
		G_DoTestVis(player.getTeam(), ent, visFlags, G_PlayerToPM(player), nullptr);
	}
}