Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include "config.h"
#include <set>
#include "configxml.h"
#include "audiolib.h"
#include "unit_generic.h"
#include "beam.h"
#include "lin_time.h"
#include "xml_serializer.h"
#include "vsfilesystem.h"
#include "file_main.h"
#include "universe_util.h"
#include "unit_util.h"
#include "script/mission.h"
#include "script/flightgroup.h"
#include "cmd/ai/fire.h"
#include "cmd/ai/turretai.h"
#include "cmd/ai/communication.h"
#include "cmd/ai/navigation.h"
#include "cmd/ai/script.h"
#include "cmd/ai/missionscript.h"
#include "cmd/ai/flybywire.h"
#include "cmd/ai/aggressive.h"
#include "python/python_class.h"
#include "cmd/unit_factory.h"
#include "missile_generic.h"
#include "gfx/cockpit_generic.h"
#include "gfx/vsbox.h"
#include <algorithm>
#include "cmd/ai/ikarus.h"
#include "role_bitmask.h"
#include "unit_const_cache.h"
#include "gfx/warptrail.h"
#include "networking/netserver.h"
#include "networking/netclient.h"
#include "universe_generic.h"
#include "csv.h"
#include "vs_random.h"
#include "galaxy_xml.h"
#include "gfx/camera.h"
#include "unit_find.h"
#include "pilot.h"
#include <iostream>
Go to the source code of this file.
Classes | |
class | WeaponComparator< FORWARD > |
class | VCString |
class | DoubleName |
class | CatCompare |
Macros | |
#define | DEBUG_MESH_ANI |
#define | damagelevel hullpercent |
#define | INVERSEFORCEDISTANCE 5400 |
#define | PARANOIA (0.4f) |
#define | MM(A, B) m.r[B*3+A] |
#define | MM(A, B) ( (cumulative_transformation_matrix.r[B*3+A]) ) |
#define | UPGRADEOK (1) |
#define | NOTTHERE (0) |
#define | CAUSESDOWNGRADE (-1) |
#define | LIMITEDBYTEMPLATE (-2) |
#define | STDUPGRADE_SPECIFY_DEFAULTS(my, oth, temp, noth, dgradelimer, dgradelimerdefault, clamp, value_to_lookat) |
#define | STDUPGRADE(my, oth, temp, noth) |
#define | STDUPGRADECLAMP(my, oth, temp, noth) |
#define | REPAIRINTEGRATED(functionality, max_functionality) |
Typedefs | |
typedef std::set< int > | WeaponGroup |
typedef double(* | adder )(double a, double b) |
typedef double(* | percenter )(double a, double b, double c) |
typedef bool(* | comparer )(double a, double b) |
typedef vsUMap< const char *, bool > | UnitHasRecursiveData |
typedef vsUMap< std::string, UnitHasRecursiveData > | FactionHasRecursiveData |
typedef std::vector < FactionHasRecursiveData > | HasRecursiveData |
Functions | |
static float | mymax (float a, float b) |
static float | mymin (float a, float b) |
void | DestroyMount (Mount *) |
bool | isMissile (const weapon_info *weap) |
bool | flickerDamage (Unit *un, float hullpercent) |
Vector | ReflectNormal (const Vector &vel, const Vector &norm) |
void | abletodock (int dock) |
bool | CrashForceDock (Unit *thus, Unit *dockingUn, bool force) |
float | copysign (float x, float y) |
float | rand01 () |
unsigned int | apply_float_to_unsigned_int (float tmp) |
std::string | accelStarHandler (const XMLType &input, void *mythis) |
std::string | speedStarHandler (const XMLType &input, void *mythis) |
void | CheckUnit (Unit *un) |
void | UncheckUnit (Unit *un) |
string | GetUnitDir (string filename) |
char * | GetUnitDir (const char *filename) |
std::string | lookupMountSize (int s) |
void | update_ani_cache () |
std::string | getMasterPartListUnitName () |
std::string | GetReadPlayerSaveGame (int) |
CSVRow | GetUnitRow (string filename, bool subu, int faction, bool readLast, bool &read) |
static float | tmpmax (float a, float b) |
bool | CheckAccessory (Unit *tur) |
bool | preEmptiveClientFire (const weapon_info *wi) |
static float | tmpsqr (float x) |
float | CloseEnoughCone (Unit *me) |
bool | CloseEnoughToAutotrack (Unit *me, Unit *targ, float &cone) |
static float | safeacos (float mycos) |
void | disableSubUnits (Unit *uhn) |
signed char | ComputeAutoGuarantee (Unit *un) |
float | getAutoRSize (Unit *orig, Unit *un, bool ignore_friend=false) |
void | SetShieldZero (Unit *) |
double | howFarToJump () |
QVector | SystemLocation (std::string system) |
static std::string | NearestSystem (std::string currentsystem, QVector pos) |
float | CalculateNearestWarpUnit (const Unit *thus, float minmultiplier, Unit **nearest_unit, bool count_negative_warp_units) |
static QVector | RealPosition (Unit *un) |
static QVector | AutoSafeEntrancePoint (const QVector start, float rsize, Unit *goal) |
float | globQueryShell (QVector pos, QVector dir, float rad) |
std::string | GenerateAutoError (Unit *me, Unit *targ) |
void | ActivateAnimation (Unit *jp) |
void | TurnJumpOKLightOn (Unit *un, Cockpit *cp) |
float | GetFuelUsage (bool afterburner) |
float | WARPENERGYMULTIPLIER (Unit *un) |
static bool | applyto (float &shield, const float max, const float amt) |
float | totalShieldVal (const Shield &shield) |
float | currentTotalShieldVal (const Shield &shield) |
float | totalShieldEnergyCapacitance (const Shield &shield) |
Unit * | findUnitInStarsystem (void *unitDoNotDereference) |
void | ScoreKill (Cockpit *cp, Unit *killer, Unit *killedUnit) |
void | AllUnitsCloseAndEngage (Unit *, int faction) |
Unit * | makeBlankUpgrade (string templnam, int faction) |
const Unit * | makeFinalBlankUpgrade (string name, int faction) |
const Unit * | makeTemplateUpgrade (string name, int faction) |
const Unit * | loadUnitByCache (std::string name, int faction) |
bool | DestroySystem (float hull, float maxhull, float numhits) |
bool | DestroyPlayerSystem (float hull, float maxhull, float numhits) |
bool | withinShield (const ShieldFacing &facing, float theta, float rho) |
void | WarpPursuit (Unit *un, StarSystem *sourcess, std::string destination) |
static Transformation | HoldPositionWithRespectTo (Transformation holder, const Transformation &changeold, const Transformation &changenew) |
void | ExecuteDirector () |
void | SwitchUnits (Unit *, Unit *) |
void | UpdateMasterPartList (Unit *) |
bool | insideDock (const DockingPorts &dock, const QVector &pos, float radius) |
const Unit * | getUnitFromUpgradeName (const string &upgradeName, int myUnitFaction=0) |
bool | GreaterZero (double a, double b) |
double | AddUp (double a, double b) |
double | MultUp (double a, double b) |
double | GetsB (double a, double b) |
bool | AGreaterB (double a, double b) |
double | SubtractUp (double a, double b) |
double | SubtractClamp (double a, double b) |
bool | ALessB (double a, double b) |
double | computePercent (double old, double upgrade, double newb) |
double | computeWorsePercent (double old, double upgrade, double isnew) |
double | computeAdderPercent (double a, double b, double c) |
double | computeMultPercent (double a, double b, double c) |
double | computeDowngradePercent (double old, double upgrade, double isnew) |
static int | UpgradeFloat (double &result, double tobeupgraded, double upgrador, double templatelimit, double(*myadd)(double, double), bool(*betterthan)(double a, double b), double nothing, double completeminimum, double(*computepercentage)(double oldvar, double upgrador, double newvar), double &percentage, bool forcedowngrade, bool usetemplate, double at_least_this, bool(*atLeastthiscompare)(double a, double b)=AGreaterB, bool clamp=false, bool force_nothing=false) |
int | UpgradeBoolval (int a, int upga, bool touchme, bool downgrade, int &numave, double &percentage, bool force_nothing) |
void | YoinkNewlines (char *input_buffer) |
bool | Quit (const char *input_buffer) |
void | Tokenize (const string &str, vector< string > &tokens, const string &delimiters=" ") |
std::string | CheckBasicSizes (const std::string tokens) |
std::map< VCString, VCString > | parseTurretSizes () |
std::string | getTurretSize (const std::string &size) |
Unit * | CreateGenericTurret (std::string tur, int faction) |
static void | GCCBugCheckFloat (float *f, int offset) |
double | ComputeMinDowngradePercent () |
int | GetModeFromName (const char *) |
Unit * | CreateGameTurret (std::string tur, int faction) |
bool | AddToDowngradeMap (std::string name, double value, int unitoffset, vsUMap< int, DoubleName > &tempdowngrademap) |
void | ClearDowngradeMap () |
std::set< std::string > | GetListOfDowngrades () |
static std::string | upgradeString ("Upgrades") |
static bool | cell_has_recursive_data (const string &name, unsigned int fac, const char *key) |
float | RepairPrice (float operational, float price) |
bool | isWeapon (std::string name) |
float | uniformrand (float min, float max) |
QVector | randVector (float min, float max) |
int | SelectDockPort (Unit *, Unit *parent) |
bool | cargoIsUpgrade (const Cargo &c) |
Unit & | GetUnitMasterPartList () |
bool | myless (const Cargo &a, const Cargo &b) |
Cargo * | GetMasterPartList (const char *input_buffer) |
std::string | CargoToString (const Cargo &cargo) |
string | toLowerCase (string in) |
Variables | |
float | capship_size = 500 |
static list< Unit * > | Unitdeletequeue |
static Hashtable< long, Unit, 2095 > | deletedUn |
int | deathofvs = 1 |
static const string | LOAD_FAILED = "LOAD_FAILED" |
const char * | DamagedCategory = "upgrades/Damaged/" |
vector< Vector > | perplines |
vector< int > | turretcontrol |
std::set< Unit * > | arrested_list_do_not_dereference |
vector< int > | switchunit |
vsUMap< int, DoubleName > | downgrademap |
int | curdowngrademapoffset = 5*sizeof (Unit) |
static HasRecursiveData | has_recursive_data |
static const GFXColor | disable (1, 0, 0, 1) |
#define CAUSESDOWNGRADE (-1) |
Definition at line 6075 of file unit_generic.cpp.
Referenced by UpgradeFloat().
#define damagelevel hullpercent |
Referenced by GameUnit< UnitType >::Draw(), GameUnit< UnitType >::DrawNow(), and flickerDamage().
#define DEBUG_MESH_ANI |
Definition at line 53 of file unit_generic.cpp.
#define INVERSEFORCEDISTANCE 5400 |
Definition at line 362 of file unit_generic.cpp.
#define LIMITEDBYTEMPLATE (-2) |
Definition at line 6076 of file unit_generic.cpp.
Referenced by UpgradeFloat().
#define MM | ( | A, | |
B | |||
) | m.r[B*3+A] |
Definition at line 4046 of file unit_generic.cpp.
Referenced by Unit::ToLocalCoordinates(), and Unit::UpCoordinateLevel().
#define MM | ( | A, | |
B | |||
) | ( (cumulative_transformation_matrix.r[B*3+A]) ) |
Definition at line 4046 of file unit_generic.cpp.
#define NOTTHERE (0) |
Definition at line 6074 of file unit_generic.cpp.
Referenced by UpgradeFloat().
#define PARANOIA (0.4f) |
Definition at line 1796 of file unit_generic.cpp.
Referenced by Unit::Threaten().
#define REPAIRINTEGRATED | ( | functionality, | |
max_functionality | |||
) |
Definition at line 8826 of file unit_generic.cpp.
Referenced by Unit::Repair().
#define STDUPGRADE | ( | my, | |
oth, | |||
temp, | |||
noth | |||
) |
Definition at line 6901 of file unit_generic.cpp.
Referenced by Unit::UpAndDownGrade().
#define STDUPGRADE_SPECIFY_DEFAULTS | ( | my, | |
oth, | |||
temp, | |||
noth, | |||
dgradelimer, | |||
dgradelimerdefault, | |||
clamp, | |||
value_to_lookat | |||
) |
Definition at line 6862 of file unit_generic.cpp.
Referenced by Unit::UpAndDownGrade().
#define STDUPGRADECLAMP | ( | my, | |
oth, | |||
temp, | |||
noth | |||
) |
Definition at line 6912 of file unit_generic.cpp.
Referenced by Unit::UpAndDownGrade().
#define UPGRADEOK (1) |
Definition at line 6073 of file unit_generic.cpp.
Referenced by Unit::UpAndDownGrade(), and UpgradeFloat().
Definition at line 6080 of file unit_generic.cpp.
Definition at line 6082 of file unit_generic.cpp.
typedef vsUMap< std::string, UnitHasRecursiveData > FactionHasRecursiveData |
Definition at line 6813 of file unit_generic.cpp.
typedef std::vector< FactionHasRecursiveData > HasRecursiveData |
Definition at line 6814 of file unit_generic.cpp.
Definition at line 6081 of file unit_generic.cpp.
typedef vsUMap< const char*, bool > UnitHasRecursiveData |
Definition at line 6812 of file unit_generic.cpp.
typedef std::set< int > WeaponGroup |
Definition at line 5426 of file unit_generic.cpp.
void abletodock | ( | int | dock) |
Definition at line 1247 of file firekeyboard.cpp.
References AUDCreateSoundWAV(), AUDPlay(), VegaConfig::getVariable(), soundContainer::loadsound(), XMLSupport::parse_bool(), soundContainer::playsound(), QVector, soundContainer::sound, Vector, and vs_config.
Referenced by BaseInterface::Room::Launch::Click(), BaseInterface::Room::Eject::Click(), CrashForceDock(), DoDockingOps(), Unit::EjectCargo(), and TryDock().
std::string accelStarHandler | ( | const XMLType & | input, |
void * | mythis | ||
) |
Definition at line 661 of file unit_generic.cpp.
References XMLType::wordlength::f, VegaConfig::getVariable(), XMLSupport::parse_float(), XMLSupport::tostring(), vs_config, and XMLType::w.
void ActivateAnimation | ( | Unit * | jp) |
Definition at line 893 of file star_system_generic.cpp.
Referenced by ActivateAnimation(), StarSystem::JumpTo(), and GameUnit< UnitType >::TransferUnitToSystem().
bool AddToDowngradeMap | ( | std::string | name, |
double | value, | ||
int | unitoffset, | ||
vsUMap< int, DoubleName > & | tempdowngrademap | ||
) |
Definition at line 6781 of file unit_generic.cpp.
References vsUMap.
Referenced by Unit::UpAndDownGrade().
double AddUp | ( | double | a, |
double | b | ||
) |
Definition at line 6089 of file unit_generic.cpp.
References b.
Referenced by Unit::UpAndDownGrade().
bool AGreaterB | ( | double | a, |
double | b | ||
) |
Definition at line 6104 of file unit_generic.cpp.
References b.
Referenced by Unit::UpAndDownGrade().
bool ALessB | ( | double | a, |
double | b | ||
) |
Definition at line 98 of file comm_ai.cpp.
References _Universe, Universe::activeStarSystem(), UniverseUtil::adjustRelationModifierInt(), UnitCollection::createIterator(), Flightgroup::directive, Unit::faction, Unit::getFlightgroup(), GetMadAt(), UnitUtil::getRelationFromFaction(), StarSystem::getUnitList(), VegaConfig::getVariable(), i, Magnitude(), XMLSupport::parse_float(), Unit::Position(), Unit::Target(), Unit::TargetTurret(), vs_config, and Universe::whichPlayerStarship().
Referenced by Unit::ApplyDamage(), and CommunicatingAI::TerminateContrabandSearch().
Definition at line 649 of file unit_generic.cpp.
References int.
Referenced by Unit::DealDamageToHullReturnArmor().
Definition at line 3564 of file unit_generic.cpp.
References max().
Referenced by Unit::RegenShields().
Definition at line 2797 of file unit_generic.cpp.
References j, k, QVector, RealPosition(), Unit::rSize(), and UniverseUtil::SafeEntrancePoint().
Referenced by Unit::AutoPilotToErrorMessage().
float CalculateNearestWarpUnit | ( | const Unit * | thus, |
float | minmultiplier, | ||
Unit ** | nearest_unit, | ||
bool | count_negative_warp_units | ||
) |
Definition at line 2595 of file unit_generic.cpp.
References _Universe, Universe::activeStarSystem(), StarSystem::collidemap, UnitCollection::fastIterator(), findObjects(), UniverseUtil::getPlanetRadiusPercent(), UnitUtil::getSignificantDistance(), VegaConfig::getVariable(), Unit::graphicOptions, StarSystem::gravitationalUnits(), Unit::location, XMLSupport::parse_float(), PLANETPTR, Unit::Position(), QVector, NearestUnitLocator::retval, Unit::rSize(), Unit::specInterdiction, Unit::graphic_options::specInterdictionOnline, Collidable::CollideRef::unit, Unit::UNIT_ONLY, and vs_config.
Referenced by Unit::AddVelocity(), and Orders::AutoLongHaul::Execute().
Definition at line 8255 of file unit_generic.cpp.
References Cargo::GetCategory().
Referenced by Unit::CanAddCargo(), Unit::getCargoVolume(), and Unit::getUpgradeVolume().
std::string CargoToString | ( | const Cargo & | cargo) |
Definition at line 8740 of file unit_generic.cpp.
References Cargo::GetContent(), Cargo::mass, Cargo::mission, Cargo::price, Cargo::quantity, XMLSupport::tostring(), and Cargo::volume.
Referenced by Unit::cargoSerializer().
|
static |
Definition at line 6819 of file unit_generic.cpp.
References FactionUtil::GetFactionName(), UniverseUtil::LookupUnitStat(), UnitUtil::upgrade(), and upgradeString().
Referenced by Unit::UpAndDownGrade().
Definition at line 1348 of file unit_generic.cpp.
References Unit::DownCoordinateLevel(), Unit::GetComputerData(), Unit::Computer::max_pitch_up, Unit::Computer::max_roll_right, Unit::Computer::max_yaw_right, Unit::name, Unit::SetAngularVelocity(), and Vector.
Referenced by AddSubUnits(), Unit::LoadRow(), Unit::SetTurretAI(), TurretFAW(), and Unit::TurretFAW().
std::string CheckBasicSizes | ( | const std::string | tokens) |
void CheckUnit | ( | Unit * | un) |
Definition at line 677 of file unit_generic.cpp.
References deathofvs, and deletedUn.
Referenced by UnitContainer::GetUnit().
void ClearDowngradeMap | ( | ) |
Definition at line 6797 of file unit_generic.cpp.
Referenced by BaseComputer::loadSellUpgradeControls().
Definition at line 1695 of file unit_generic.cpp.
References VegaConfig::getVariable(), XMLSupport::parse_float(), and vs_config.
Referenced by CloseEnoughToAutotrack().
Definition at line 1701 of file unit_generic.cpp.
References CloseEnoughCone(), Unit::curr_physical_state, VegaConfig::getVariable(), XMLSupport::parse_float(), Transformation::position, Unit::prev_physical_state, tmpsqr(), and vs_config.
Referenced by Unit::UpdatePhysics().
double computeAdderPercent | ( | double | a, |
double | b, | ||
double | c | ||
) |
Definition at line 6140 of file unit_generic.cpp.
Referenced by Unit::UpAndDownGrade().
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().
double computeDowngradePercent | ( | double | old, |
double | upgrade, | ||
double | isnew | ||
) |
Definition at line 6148 of file unit_generic.cpp.
References UnitUtil::upgrade().
Referenced by Unit::UpAndDownGrade().
double ComputeMinDowngradePercent | ( | ) |
Definition at line 6702 of file unit_generic.cpp.
References VegaConfig::getVariable(), XMLSupport::parse_float(), and vs_config.
Referenced by Unit::FilterDowngradeList(), and Unit::UpAndDownGrade().
double computeMultPercent | ( | double | a, |
double | b, | ||
double | c | ||
) |
Definition at line 6144 of file unit_generic.cpp.
Referenced by Unit::UpAndDownGrade().
double computePercent | ( | double | old, |
double | upgrade, | ||
double | newb | ||
) |
Definition at line 6124 of file unit_generic.cpp.
Referenced by Unit::UpAndDownGrade().
double computeWorsePercent | ( | double | old, |
double | upgrade, | ||
double | isnew | ||
) |
Definition at line 6132 of file unit_generic.cpp.
Definition at line 633 of file unit_generic.cpp.
References x.
Referenced by Unit::ClampThrust(), Unit::ClampTorque(), Unit::MaxThrust(), and Unit::MaxTorque().
Definition at line 365 of file unit_generic.cpp.
References _Universe, abletodock(), Unit::CanDockWithMe(), NetClient::dockRequest(), Unit::ForceDock(), Unit::GetSerial(), Network, Unit::Position(), QVector, Unit::rSize(), UniverseUtil::SafeEntrancePoint(), Unit::SetPosAndCumPos(), Unit::UpgradeInterface(), and Universe::whichPlayerStarship().
Referenced by GamePlanet::reactToCollision(), and Unit::reactToCollision().
Definition at line 73 of file unit_functions_generic.cpp.
References UnitFactory::createUnit(), and StarSystemGent::faction.
Definition at line 6513 of file unit_generic.cpp.
References StarSystemGent::faction.
Referenced by Unit::UpgradeSubUnits().
Definition at line 3593 of file unit_generic.cpp.
References Shield::number, Shield::shield2fb, Shield::shield4fbrl, and Shield::shield8.
Referenced by totalShieldEnergyCapacitance().
void DestroyMount | ( | Mount * | ) |
Definition at line 44 of file mount.cpp.
References AUDStopPlaying(), Mount::DESTROYED, Mount::sound, Mount::status, and Mount::UnFire().
Referenced by Unit::ClearMounts(), Unit::DamageRandSys(), Unit::Destroy(), and disableSubUnits().
Definition at line 4956 of file unit_generic.cpp.
References VegaConfig::getVariable(), XMLSupport::parse_float(), rand01(), and vs_config.
Referenced by Unit::DealDamageToHullReturnArmor().
Definition at line 4946 of file unit_generic.cpp.
References VegaConfig::getVariable(), XMLSupport::parse_float(), rand01(), and vs_config.
Referenced by Unit::DealDamageToHullReturnArmor().
void disableSubUnits | ( | Unit * | uhn) |
Definition at line 1824 of file unit_generic.cpp.
References DestroyMount(), disableSubUnits(), Unit::getSubUnits(), j, and Unit::mounts.
Referenced by disableSubUnits(), and GameUnit< UnitType >::Explode().
void ExecuteDirector | ( | ) |
Definition at line 617 of file star_system_generic.cpp.
Unit* findUnitInStarsystem | ( | void * | unitDoNotDereference) |
Definition at line 4194 of file unit_generic.cpp.
References _Universe, Universe::activeStarSystem(), UnitCollection::constIterator(), and StarSystem::getUnitList().
Referenced by Unit::ApplyDamage(), CockpitKeys::Inside(), Orders::AggressiveAI::ProcessCurrentFgDirective(), and Cockpit::Update().
Definition at line 317 of file unit_generic.cpp.
References damagelevel, flickertime, GetElapsedTime(), getNewTime(), VegaConfig::getVariable(), int, XMLSupport::parse_float(), and vs_config.
Referenced by GameUnit< UnitType >::Draw().
Definition at line 6606 of file unit_generic.cpp.
Referenced by Unit::UpAndDownGrade().
Definition at line 2818 of file unit_generic.cpp.
References XMLSupport::escaped_string(), Unit::getRelation(), VegaConfig::getVariable(), UnitUtil::isAsteroid(), Unit::isPlanet(), and vs_config.
Referenced by Unit::AutoPilotToErrorMessage().
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 3275 of file unit_generic.cpp.
References VegaConfig::getVariable(), XMLSupport::parse_float(), and vs_config.
Referenced by Unit::ClampThrust(), and Unit::ClampTorque().
std::set< std::string > GetListOfDowngrades | ( | ) |
Definition at line 6802 of file unit_generic.cpp.
References vsUMap.
Referenced by BaseComputer::loadSellUpgradeControls().
Cargo* GetMasterPartList | ( | const char * | input_buffer) |
Definition at line 8519 of file unit_generic.cpp.
References Unit::GetCargo(), and GetUnitMasterPartList().
Referenced by Beam::Collide(), showUnitStats(), and BaseComputer::SellUpgradeOperation::start().
std::string getMasterPartListUnitName | ( | ) |
Definition at line 33 of file unit_factory.cpp.
References VegaConfig::getVariable(), and vs_config.
int GetModeFromName | ( | const char * | ) |
Definition at line 87 of file unit_xml.cpp.
std::string GetReadPlayerSaveGame | ( | int | ) |
Definition at line 128 of file savegame.cpp.
References GetHelperPlayerSaveGame().
Referenced by SaveGame::ParseSaveGame().
double GetsB | ( | double | a, |
double | b | ||
) |
Definition at line 6099 of file unit_generic.cpp.
References b.
Referenced by Unit::UpAndDownGrade().
std::string getTurretSize | ( | const std::string & | size) |
Definition at line 6312 of file unit_generic.cpp.
References CheckBasicSizes(), h, parseTurretSizes(), and Tokenize().
Referenced by Unit::UpgradeSubUnitsWithFactory().
string GetUnitDir | ( | string | filename) |
Definition at line 690 of file unit_generic.cpp.
char* GetUnitDir | ( | const char * | filename) |
Definition at line 695 of file unit_generic.cpp.
References i.
Definition at line 37 of file unit_functions_generic.cpp.
Unit& GetUnitMasterPartList | ( | ) |
Definition at line 8366 of file unit_generic.cpp.
References UnitFactory::getMasterPartList().
Referenced by GetMasterPartList(), UniverseUtil::getRandCargo(), getShipList(), Unit::ImportPartList(), and BaseComputer::loadSellUpgradeControls().
Definition at line 1429 of file unit_csv.cpp.
References FactionUtil::GetFactionName(), i, and unitTables.
Definition at line 308 of file unit_collide.cpp.
References a, b, c, and UniverseUtil::sqrt().
Referenced by Unit::AutoPilotToErrorMessage(), and globQuerySphere().
bool GreaterZero | ( | double | a, |
double | b | ||
) |
Definition at line 6084 of file unit_generic.cpp.
Referenced by Unit::UpAndDownGrade().
|
static |
Definition at line 5769 of file unit_generic.cpp.
References Quaternion::Conjugate(), VegaConfig::getVariable(), Transformation::orientation, XMLSupport::parse_bool(), Transformation::position, Quaternion::to_matrix(), TransformNormal(), and vs_config.
Referenced by Unit::PerformDockingOperations().
double howFarToJump | ( | ) |
Definition at line 2129 of file unit_generic.cpp.
References VegaConfig::getVariable(), XMLSupport::parse_float(), and vs_config.
Referenced by ComputeJumpPointArrival(), GameCockpit::Draw(), and Unit::UpdatePhysics().
|
inline |
Definition at line 5930 of file unit_generic.cpp.
References DockingPorts::GetPosition(), DockingPorts::GetRadius(), and DockingPorts::IsOccupied().
Referenced by Unit::CanDockWithMe().
bool isMissile | ( | const weapon_info * | weap) |
Definition at line 306 of file unit_generic.cpp.
References VegaConfig::getVariable(), weapon_info::LIGHTMISSILE, XMLSupport::parse_bool(), weapon_info::PROJECTILE, weapon_info::size, weapon_info::type, and vs_config.
Referenced by Mount::Activate(), Unit::ActivateGuns(), WeaponComparator< FORWARD >::checkmount(), Mount::DeActive(), Mount::Fire(), Unit::Fire(), Unit::LockMissile(), Mount::PhysicsAlignedFire(), and Unit::setAverageGunSpeed().
bool isWeapon | ( | std::string | name) |
Definition at line 8815 of file unit_generic.cpp.
Referenced by BaseComputer::buyUpgrade(), BaseComputer::configureUpgradeCommitControls(), UnitUtil::PercentOperational(), Unit::RepairUpgradeCargo(), and BaseComputer::sellUpgrade().
Definition at line 4937 of file unit_generic.cpp.
References UnitFactory::createUnit(), StarSystemGent::faction, ClassCache< Typ, Key >::getCachedConst(), and ClassCache< Typ, Key >::setCachedConst().
Referenced by Unit::DealDamageToHullReturnArmor(), and Unit::RepairUpgrade().
std::string lookupMountSize | ( | int | s) |
Definition at line 711 of file unit_generic.cpp.
References weapon_info::AUTOTRACKING, weapon_info::CAPSHIPHEAVY, weapon_info::CAPSHIPHEAVYMISSILE, weapon_info::CAPSHIPLIGHT, weapon_info::CAPSHIPLIGHTMISSILE, weapon_info::HEAVY, weapon_info::HEAVYMISSILE, weapon_info::LIGHT, weapon_info::LIGHTMISSILE, weapon_info::MEDIUM, weapon_info::MEDIUMMISSILE, weapon_info::SPECIAL, and weapon_info::SPECIALMISSILE.
Definition at line 4893 of file unit_generic.cpp.
References UnitFactory::createServerSideUnit(), StarSystemGent::faction, Unit::GetCargo(), Unit::Mass, Unit::numCargo(), q, Cargo::quantity, and Unit::RemoveCargo().
Referenced by makeFinalBlankUpgrade().
Definition at line 4906 of file unit_generic.cpp.
References ClassCache< Typ, Key >::getCachedConst(), GetUnitDir(), LOAD_FAILED, makeBlankUpgrade(), Unit::name, and ClassCache< Typ, Key >::setCachedConst().
Referenced by Unit::ReduceToTemplate(), Unit::RepairUpgrade(), and BaseComputer::SellUpgradeOperation::start().
Definition at line 4921 of file unit_generic.cpp.
References UnitFactory::createUnit(), StarSystemGent::faction, ClassCache< Typ, Key >::getCachedConst(), GetUnitDir(), LOAD_FAILED, Unit::name, and ClassCache< Typ, Key >::setCachedConst().
Referenced by UnitUtil::PercentOperational(), Unit::Repair(), Unit::RepairUpgrade(), Unit::RepairUpgradeCargo(), and BaseComputer::BuyUpgradeOperation::start().
double MultUp | ( | double | a, |
double | b | ||
) |
Definition at line 6094 of file unit_generic.cpp.
References b.
Referenced by Unit::UpAndDownGrade().
|
static |
Definition at line 2145 of file unit_generic.cpp.
References _Universe, Universe::AccessCockpit(), Universe::getGalaxy(), GalaxyXML::SGalaxy::getHeirarchy(), Cockpit::GetNavSelectedSystem(), VegaConfig::getVariable(), j, Universe::numPlayers(), XMLSupport::parse_float(), QVector, SystemLocation(), test, and vs_config.
Referenced by Unit::UpdatePhysics().
Definition at line 6281 of file unit_generic.cpp.
References VSFileSystem::VSFile::Close(), VSFileSystem::Ok, VSFileSystem::VSFile::OpenReadOnly(), VSFileSystem::VSFile::ReadLine(), VSFileSystem::VSFile::Size(), VSFileSystem::UnknownFile, x, and y.
Referenced by getTurretSize().
bool preEmptiveClientFire | ( | const weapon_info * | wi) |
Definition at line 1415 of file unit_generic.cpp.
References weapon_info::BEAM, VegaConfig::getVariable(), XMLSupport::parse_bool(), weapon_info::PROJECTILE, weapon_info::type, and vs_config.
Referenced by Unit::Fire().
bool Quit | ( | const char * | input_buffer) |
Definition at line 6235 of file unit_generic.cpp.
float rand01 | ( | ) |
Definition at line 641 of file unit_generic.cpp.
References float.
Referenced by Unit::DamageRandSys(), Unit::DealDamageToHullReturnArmor(), DestroyPlayerSystem(), DestroySystem(), GameCockpit::Draw(), and GameUniverse::StartDraw().
Definition at line 7900 of file unit_generic.cpp.
References QVector, and uniformrand().
Referenced by Unit::EjectCargo().
Definition at line 2790 of file unit_generic.cpp.
References Unit::isSubUnit(), Unit::LocalPosition(), and Unit::Position().
Referenced by Unit::AutoPilotToErrorMessage(), AutoSafeEntrancePoint(), Unit::ResolveForces(), and Unit::UnDock().
Definition at line 356 of file unit_generic.cpp.
Definition at line 7684 of file unit_generic.cpp.
References game_data_t::difficulty, and g_game.
Referenced by BaseComputer::configureUpgradeCommitControls(), Unit::RepairUpgradeCargo(), SellPrice(), and BaseComputer::updateTransactionControlsForSelection().
Definition at line 1718 of file unit_generic.cpp.
References UniverseUtil::acos().
Referenced by Unit::cosAngleTo().
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 110 of file docking.cpp.
References Unit::DockingPortLocations(), Unit::GetTransformation(), i, Unit::Position(), Transform(), and Vector.
Referenced by Unit::EjectCargo(), FireKeyboard::Execute(), BaseComputer::loadCargoControls(), and Orders::DockingOps::RequestClearence().
void SetShieldZero | ( | Unit * | ) |
Definition at line 78 of file unit_functions_generic.cpp.
std::string speedStarHandler | ( | const XMLType & | input, |
void * | mythis | ||
) |
Definition at line 668 of file unit_generic.cpp.
References XMLType::wordlength::f, VegaConfig::getVariable(), XMLSupport::parse_float(), XMLSupport::tostring(), vs_config, and XMLType::w.
double SubtractClamp | ( | double | a, |
double | b | ||
) |
double SubtractUp | ( | double | a, |
double | b | ||
) |
Definition at line 6109 of file unit_generic.cpp.
References b.
Referenced by Unit::UpAndDownGrade().
Definition at line 328 of file cockpit_generic.cpp.
References _Universe, Universe::AccessCockpit(), Universe::CurrentCockpit(), Cockpit::GetParent(), Unit::getRelation(), i, Universe::numPlayers(), Unit::PrimeOrders(), Unit::SetAI(), Unit::SetVisible(), SwitchUnits2(), and Unit::Target().
QVector SystemLocation | ( | std::string | system) |
Definition at line 2135 of file unit_generic.cpp.
References _Universe, Universe::getGalaxyProperty(), and QVector.
Referenced by ComputeJumpPointArrival(), GameCockpit::Draw(), NearestSystem(), and WarpPursuit().
Definition at line 1343 of file unit_generic.cpp.
References b.
Referenced by Unit::calculate_extent(), and Unit::cosAngleTo().
Definition at line 1690 of file unit_generic.cpp.
References x.
Referenced by CloseEnoughToAutotrack().
void Tokenize | ( | const string & | str, |
vector< string > & | tokens, | ||
const string & | delimiters = " " |
||
) |
string toLowerCase | ( | string | in) |
Definition at line 3613 of file unit_generic.cpp.
References currentTotalShieldVal(), VegaConfig::getVariable(), XMLSupport::parse_bool(), XMLSupport::parse_float(), totalShieldVal(), and vs_config.
Referenced by Unit::EnergyData(), Unit::RegenShields(), and showUnitStats().
Definition at line 3572 of file unit_generic.cpp.
References Shield::number, Shield::shield2fb, Shield::shield4fbrl, and Shield::shield8.
Referenced by totalShieldEnergyCapacitance().
Definition at line 3078 of file unit_generic.cpp.
References Unit::UnitJump::drive, Unit::UnitJump::energy, Unit::GetJumpStatus(), Unit::GetWarpEnergy(), and Cockpit::jumpok.
Referenced by Unit::jumpReactToCollision().
void UncheckUnit | ( | Unit * | un) |
void update_ani_cache | ( | ) |
Definition at line 51 of file unit_functions.cpp.
void UpdateMasterPartList | ( | Unit * | ) |
Definition at line 1758 of file unit_csv.cpp.
References _Universe, Universe::AccessCockpit(), UnitImages< BOGUS >::cargo, Cargo::category, Cargo::content, Cargo::description, Unit::GetCargo(), Unit::GetImageInformation(), SaveGame::getMissionStringData(), i, j, Cargo::mass, Unit::numCargo(), Universe::numPlayers(), XMLSupport::parse_float(), Cargo::price, Cargo::quantity, Unit::RemoveCargo(), Cockpit::savegame, and Cargo::volume.
Referenced by Unit::ForceDock(), and Unit::makeMasterPartList().
int UpgradeBoolval | ( | int | a, |
int | upga, | ||
bool | touchme, | ||
bool | downgrade, | ||
int & | numave, | ||
double & | percentage, | ||
bool | force_nothing | ||
) |
Definition at line 6206 of file unit_generic.cpp.
References a.
Referenced by Unit::UpAndDownGrade().
|
static |
we know we can replace result with newsum
Definition at line 6156 of file unit_generic.cpp.
References CAUSESDOWNGRADE, LIMITEDBYTEMPLATE, NOTTHERE, and UPGRADEOK.
|
static |
Referenced by cell_has_recursive_data().
Definition at line 3550 of file unit_generic.cpp.
References _Universe, Unit::getFlightgroup(), UnitContainer::GetUnit(), VegaConfig::getVariable(), Universe::isPlayerStarship(), Flightgroup::leader, XMLSupport::parse_float(), and vs_config.
Referenced by Unit::RegenShields().
void WarpPursuit | ( | Unit * | un, |
StarSystem * | sourcess, | ||
std::string | destination | ||
) |
Definition at line 5260 of file unit_generic.cpp.
References Unit::UnitJump::delay, float_to_int(), StarSystem::getFileName(), VegaConfig::getVariable(), Unit::jump, StarSystem::JumpTo(), Magnitude(), XMLSupport::parse_bool(), XMLSupport::parse_float(), SystemLocation(), and vs_config.
Referenced by Unit::Target(), and GameUnit< UnitType >::TransferUnitToSystem().
bool withinShield | ( | const ShieldFacing & | facing, |
float | theta, | ||
float | rho | ||
) |
Definition at line 5144 of file unit_generic.cpp.
References ShieldFacing::rhomax, ShieldFacing::rhomin, ShieldFacing::thetamax, and ShieldFacing::thetamin.
Referenced by Unit::DealDamageToShield().
void YoinkNewlines | ( | char * | input_buffer) |
Definition at line 6228 of file unit_generic.cpp.
std::set< Unit* > arrested_list_do_not_dereference |
Definition at line 5826 of file unit_generic.cpp.
Referenced by Unit::ForceDock().
float capship_size = 500 |
Definition at line 646 of file unit_generic.cpp.
Referenced by Unit::Init(), and Unit::InRange().
Definition at line 6780 of file unit_generic.cpp.
const char* DamagedCategory = "upgrades/Damaged/" |
Definition at line 4970 of file unit_generic.cpp.
Referenced by Unit::DealDamageToHullReturnArmor(), UnitUtil::PercentOperational(), UnitUtil::RecomputeUnitUpgrades(), Unit::Repair(), Unit::RepairCost(), Unit::RepairUpgrade(), and Unit::RepairUpgradeCargo().
int deathofvs = 1 |
Definition at line 676 of file unit_generic.cpp.
Referenced by CheckUnit().
Definition at line 675 of file unit_generic.cpp.
Referenced by CheckUnit(), and UncheckUnit().
|
static |
Referenced by Unit::FilterDowngradeList(), and Unit::FilterUpgradeList().
vsUMap< int, DoubleName > downgrademap |
Definition at line 6779 of file unit_generic.cpp.
|
static |
Definition at line 6816 of file unit_generic.cpp.
|
static |
Definition at line 4904 of file unit_generic.cpp.
Referenced by makeFinalBlankUpgrade(), and makeTemplateUpgrade().
vector< Vector > perplines |
Definition at line 53 of file star_system_generic.cpp.
vector< int > switchunit |
Definition at line 38 of file cockpit_generic.cpp.
Referenced by Cockpit::Update().
vector< int > turretcontrol |
Definition at line 6004 of file unit_generic.cpp.
Referenced by Unit::UnDock(), and Cockpit::Update().
|
static |
Definition at line 674 of file unit_generic.cpp.
Referenced by Unit::Kill(), and Unit::ProcessDeleteQueue().