| 24 | |
| 25 | |
| 26 | ShockWaveStrategy::ShockWaveStrategy(ShotPath* _path) : |
| 27 | ShotStrategy(_path), |
| 28 | radius(BZDB.eval(BZDBNAMES.SHOCKINRADIUS)), |
| 29 | radius2(radius* radius) { |
| 30 | // setup shot |
| 31 | FiringInfo& f = getFiringInfo(_path); |
| 32 | f.lifetime *= BZDB.eval(BZDBNAMES.SHOCKADLIFE); |
| 33 | |
| 34 | // make scene node |
| 35 | const fvec3& pos = _path->getPosition(); |
| 36 | if (RENDERER.useQuality() >= _HIGH_QUALITY) { |
| 37 | shockNode = new SphereLodSceneNode(pos, radius); |
| 38 | shockNode->setShockWave(true); |
| 39 | } |
| 40 | else { |
| 41 | shockNode = new SphereBspSceneNode(pos, radius); |
| 42 | } |
| 43 | |
| 44 | // get team |
| 45 | if (_path->getPlayer() == ServerPlayer) { |
| 46 | TeamColor tmpTeam = _path->getFiringInfo().shot.team; |
| 47 | team = (tmpTeam < RogueTeam) ? RogueTeam : |
| 48 | (tmpTeam > HunterTeam) ? RogueTeam : tmpTeam; |
| 49 | } |
| 50 | else { |
| 51 | Player* p = lookupPlayer(_path->getPlayer()); |
| 52 | team = p ? p->getTeam() : RogueTeam; |
| 53 | } |
| 54 | |
| 55 | const fvec4& c = Team::getRadarColor(team); |
| 56 | if (RENDERER.useQuality() >= _HIGH_QUALITY) { |
| 57 | shockNode->setColor(c[0], c[1], c[2], 0.5f); |
| 58 | } |
| 59 | else { |
| 60 | shockNode->setColor(c[0], c[1], c[2], 0.75f); |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | |
| 65 | ShockWaveStrategy::~ShockWaveStrategy() { |
nothing calls this directly
no test coverage detected