Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include "unit_generic.h"
#include "gfx/vec.h"
#include "gfx/cockpit_generic.h"
#include "faction_generic.h"
#include "ai/communication.h"
#include "savegame.h"
#include "xml_support.h"
#include "unit_factory.h"
#include "unit_util.h"
#include "universe_util.h"
#include "unit_const_cache.h"
#include "pilot.h"
Go to the source code of this file.
Functions | |
int | cloakVal (int cloak, int cloakmin, int cloakrate, bool cloakglass) |
const Unit * | getUnitFromUpgradeName (const string &upgradeName, int myUnitFaction=0) |
int | SelectDockPort (Unit *utdw, Unit *parent) |
Unit * | CreateGameTurret (std::string tur, int faction) |
void | SetShieldZero (Unit *un) |
void | ScoreKill (Cockpit *cp, Unit *un, Unit *killedUnit) |
signed char | ComputeAutoGuarantee (Unit *un) |
float | getAutoRSize (Unit *orig, Unit *un, bool ignore_friend=false) |
bool | AdjustMatrix (Matrix &mat, const Vector &vel, Unit *target, float speed, bool lead, float cone) |
enum weapon_info::MOUNT_SIZE | lookupMountSize (const char *str) |
int | parseMountSizes (const char *str) |
void | DealPossibleJumpDamage (Unit *un) |
void | Enslave (Unit *parent, bool enslave) |
Variables | |
double | saved_interpolation_blend_factor |
double | interpolation_blend_factor |
bool | cam_setup_phase = false |
bool AdjustMatrix | ( | Matrix & | mat, |
const Vector & | vel, | ||
Unit * | target, | ||
float | speed, | ||
bool | lead, | ||
float | cone | ||
) |
Definition at line 214 of file unit_functions_generic.cpp.
References Matrix::getQ(), Matrix::getR(), Matrix::p, Unit::Position(), Unit::PositionITTS(), QVector, R, Vector, and VectorAndPositionToMatrix().
Referenced by AdjustMatrixToTrackTarget(), Mount::PhysicsAlignedFire(), and Beam::UpdatePhysics().
Definition at line 23 of file unit_functions_generic.cpp.
Referenced by GameUnit< UnitType >::Draw(), and GameUnit< UnitType >::DrawNow().
signed char ComputeAutoGuarantee | ( | Unit * | un) |
Definition at line 160 of file unit_functions_generic.cpp.
References _Universe, Universe::AccessCockpit(), active_missions, Mission::AUTO_NORMAL, Mission::AUTO_ON, i, and Universe::isPlayerStarship().
Referenced by Unit::AutoPilotToErrorMessage().
Definition at line 73 of file unit_functions_generic.cpp.
References UnitFactory::createUnit(), and StarSystemGent::faction.
Referenced by GameUnit< UnitType >::UpgradeSubUnits().
void DealPossibleJumpDamage | ( | Unit * | un) |
Definition at line 297 of file unit_functions_generic.cpp.
References Unit::ApplyDamage(), Unit::UnitJump::damage, float, Unit::GetJumpStatus(), VegaConfig::getVariable(), Unit::GetVelocity(), XMLSupport::parse_float(), Unit::Position(), speed, and vs_config.
Referenced by GameUnit< UnitType >::TransferUnitToSystem().
Definition at line 317 of file unit_functions_generic.cpp.
References Unit::AddCargo(), Unit::CanAddCargo(), Cargo::content, Unit::GetCargo(), Cargo::GetCategory(), UniverseUtil::GetMasterPartList(), i, Unit::numCargo(), Cargo::quantity, and Unit::RemoveCargo().
Referenced by FireKeyboard::Execute().
Definition at line 178 of file unit_functions_generic.cpp.
References ASTEROIDPTR, Unit::faction, Unit::getFlightgroup(), FactionUtil::GetNeutralFaction(), Unit::getRelation(), FactionUtil::GetUpgradeFaction(), VegaConfig::getVariable(), Unit::isUnit(), XMLSupport::parse_float(), PLANETPTR, Unit::rSize(), Unit::Target(), and vs_config.
Referenced by Unit::AutoPilotToErrorMessage().
Definition at line 37 of file unit_functions_generic.cpp.
References UnitFactory::createUnit(), ClassCache< Typ, Key >::getCachedConst(), FactionUtil::GetUpgradeFaction(), Unit::name, and ClassCache< Typ, Key >::setCachedConst().
Referenced by BaseComputer::UpgradeOperation::endInit(), UnitUtil::PercentOperational(), Unit::Repair(), and Unit::RepairUpgradeCargo().
enum weapon_info::MOUNT_SIZE lookupMountSize | ( | const char * | str) |
Definition at line 237 of file unit_functions_generic.cpp.
References weapon_info::AUTOTRACKING, weapon_info::CAPSHIPHEAVY, weapon_info::CAPSHIPHEAVYMISSILE, weapon_info::CAPSHIPLIGHT, weapon_info::CAPSHIPLIGHTMISSILE, weapon_info::HEAVY, weapon_info::HEAVYMISSILE, i, weapon_info::LIGHT, weapon_info::LIGHTMISSILE, weapon_info::MEDIUM, weapon_info::MEDIUMMISSILE, weapon_info::NOWEAP, weapon_info::SPECIAL, and weapon_info::SPECIALMISSILE.
Referenced by BeamXML::beginElement(), Unit::mountSerializer(), parseMountSizes(), BaseComputer::BuyUpgradeOperation::selectMount(), BaseComputer::SellUpgradeOperation::selectMount(), showUnitStats(), and Unit::WriteUnitString().
int parseMountSizes | ( | const char * | str) |
Definition at line 273 of file unit_functions_generic.cpp.
References i, lookupMountSize(), and weapon_info::NOWEAP.
Referenced by AddMounts().
Definition at line 106 of file unit_functions_generic.cpp.
References _Universe, Universe::AccessCockpit(), UniverseUtil::adjustRelationModifierInt(), c, Order::Communicate(), StarSystemGent::faction, Unit::faction, CommunicationMessage::fsm, Unit::getAIState(), Pilot::getCommFaces(), FactionUtil::GetIntRelation(), SaveGame::getMissionData(), FactionUtil::GetNumFactions(), Cockpit::GetParent(), FactionUtil::GetPlanetFaction(), UniverseUtil::getRelationModifierInt(), UnitUtil::getRelationToFaction(), FSM::GetScoreKillNode(), UnitUtil::getUnitSystemFile(), FactionUtil::GetUpgradeFaction(), VegaConfig::getVariable(), i, int, Unit::isUnit(), Universe::numPlayers(), XMLSupport::parse_float(), Unit::pilot, Cockpit::savegame, CommunicationMessage::SetCurrentState(), UNITPTR, vs_config, and Universe::whichPlayerStarship().
Referenced by Unit::ApplyDamage().
Definition at line 55 of file unit_functions_generic.cpp.
References Unit::DockingPortLocations(), Unit::GetTransformation(), i, Unit::Position(), Transform(), and Vector.
void SetShieldZero | ( | Unit * | un) |
Definition at line 78 of file unit_functions_generic.cpp.
References Shield::number, Unit::shield, Shield::shield2fb, Shield::shield4fbrl, and Shield::shield8.
Referenced by StarSystem::ProcessPendingJumps(), and Unit::UpdatePhysics().
bool cam_setup_phase = false |
Definition at line 21 of file unit_functions_generic.cpp.
Referenced by GameStarSystem::Draw(), and GameUnit< UnitType >::Draw().
double interpolation_blend_factor |
Definition at line 20 of file unit_functions_generic.cpp.
Referenced by BlendTrans(), Mount::ComputeAnimatedFrame(), GameStarSystem::Draw(), GameUnit< UnitType >::Draw(), UnitDrawer::draw(), Briefing::Render(), and GameNebula::SetFogState().
double saved_interpolation_blend_factor |
Definition at line 19 of file unit_functions_generic.cpp.
Referenced by GameStarSystem::Draw(), GameUnit< UnitType >::Draw(), and UnitDrawer::draw().