/** ** Missile don't move, than checks the source unit for HP. */ void MissileFire::Action() { CUnit *unit; unit = this->SourceUnit; this->Wait = this->Type->Sleep; if (unit->Destroyed || unit->Orders[0]->Action == UnitActionDie) { this->TTL = 0; return; } if (NextMissileFrame(this, 1, 0)) { int f; MissileType *fire; this->SpriteFrame = 0; f = (100 * unit->Variable[HP_INDEX].Value) / unit->Variable[HP_INDEX].Max; fire = MissileBurningBuilding(f); if (!fire) { this->TTL = 0; unit->Burning = 0; } else { if (this->Type != fire) { this->X += this->Type->Width / 2; this->Y += this->Type->Height / 2; this->Type = fire; this->X -= this->Type->Width / 2; this->Y -= this->Type->Height / 2; } } } }
/** ** Missile don't move, than checks the source unit for HP. */ void MissileFire::Action() { CUnit &unit = *this->SourceUnit; this->Wait = this->Type->Sleep; if (unit.IsAlive() == false) { this->TTL = 0; return; } if (this->NextMissileFrame(1, 0)) { this->SpriteFrame = 0; const int f = (100 * unit.Variable[HP_INDEX].Value) / unit.Variable[HP_INDEX].Max; MissileType *fire = MissileBurningBuilding(f); if (!fire) { this->TTL = 0; unit.Burning = 0; } else { if (this->Type != fire) { this->position += this->Type->size / 2; this->Type = fire; this->position -= this->Type->size / 2; } } } }