Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
Functions | |
void | switchFg (Unit *my_unit, string arg) |
int | communicateTo (Unit *my_unit, Unit *other_unit, float mood) |
bool | commAnimation (Unit *my_unit, string anim) |
void | setMissionRelevant (Unit *my_unit) |
string | getFactionName (const Unit *my_unit) |
int | getFactionIndex (const Unit *my_unit) |
void | setFactionIndex (Unit *my_unit, int factionname) |
void | RecomputeUnitUpgrades (Unit *my_unit) |
void | setFactionName (Unit *my_unit, string factionname) |
float | getFactionRelation (const Unit *my_unit, const Unit *their_unit) |
float | getRelationToFaction (const Unit *my_unit, int other_faction) |
float | getRelationFromFaction (const Unit *their_unit, int my_faction) |
string | getName (const Unit *my_unit) |
void | setName (Unit *my_unit, string name) |
void | SetHull (Unit *my_unit, float hull) |
string | getFlightgroupName (const Unit *my_unit) |
const string & | getFlightgroupNameCR (const Unit *my_unit) |
Unit * | getFlightgroupLeader (Unit *my_unit) |
void | orbit (Unit *my_unit, Unit *orbitee, float speed, QVector R, QVector S, QVector center) |
bool | setFlightgroupLeader (Unit *my_unit, Unit *un) |
string | getFgDirective (const Unit *my_unit) |
bool | setFgDirective (Unit *my_unit, string inp) |
int | getPhysicsPriority (Unit *un) |
int | getFgSubnumber (const Unit *my_unit) |
int | removeCargo (Unit *my_unit, string s, int quantity, bool erasezero) |
bool | repair (Unit *my_unit) |
int | removeWeapon (Unit *my_unit, string weapon, int mountoffset, bool loop_through_mounts) |
float | upgrade (Unit *my_unit, string file, int mountoffset, int subunitoffset, bool force, bool loop_through_mounts) |
int | addCargo (Unit *my_unit, Cargo carg) |
int | forceAddCargo (Unit *my_unit, Cargo carg) |
bool | incrementCargo (Unit *my_unit, float percentagechange, int quantity) |
bool | decrementCargo (Unit *my_unit, float percentagechange) |
float | getDistance (const Unit *my_unit, const Unit *un) |
float | getSignificantDistance (const Unit *un, const Unit *sig) |
int | hasCargo (const Unit *my_unit, std::string mycarg) |
Cargo | GetCargoIndex (const Unit *my_unit, int index) |
Cargo | GetCargo (const Unit *my_unit, std::string cargname) |
string | getUnitSystemFile (const Unit *my_unit) |
float | getCredits (const Unit *my_unit) |
void | addCredits (const Unit *my_unit, float credits) |
bool | isSignificant (const Unit *my_unit) |
bool | isCloseEnoughToDock (const Unit *my_unit, const Unit *un) |
bool | isCapitalShip (const Unit *my_unit) |
bool | isDockableUnit (const Unit *my_unit) |
bool | isAsteroid (const Unit *my_unit) |
bool | isSun (const Unit *my_unit) |
bool | JumpTo (Unit *unit, string system) |
int | isPlayerStarship (const Unit *un) |
void | setECM (Unit *un, int NewECM) |
int | getECM (const Unit *un) |
void | setSpeed (Unit *un, float speed) |
Unit * | owner (const Unit *un) |
float | maxSpeed (const Unit *un) |
float | maxAfterburnerSpeed (const Unit *un) |
void | performDockingOperations (Unit *un, Unit *unitToDockWith, int actuallyDockP) |
float | PercentOperational (Unit *un, string, string category, bool countHullAndArmorAsFull) |
template<typename T > | |
static T | mymin (T a, T b) |
template<typename T > | |
static T | mymax (T a, T b) |
static const string & | getFgDirectiveCR (const Unit *my_unit) |
bool | hasDockingUnits (const Unit *my_unit) |
int | getFgSubnumber (Unit *my_unit) |
int | hasCargo (const Unit *my_unit, string mycarg) |
static bool | ishere (const Unit *par, const Unit *look) |
float | PercentOperational (Unit *un, std::string name, std::string category, bool countHullAndArmorAsFull) |
Definition at line 557 of file unit_util_generic.cpp.
References Unit::AddCargo(), Unit::CanAddCargo(), i, and Cargo::quantity.
Definition at line 399 of file unit_util_generic.cpp.
References _Universe, Cockpit::credits, Unit::GetSerial(), Universe::isPlayerStarship(), NetServer::sendCredits(), SERVER, and VSServer.
Referenced by BasicRepair().
Definition at line 47 of file unit_util.cpp.
References _Universe, Hashtable< KEY, VALUE, SIZ >::Get(), Universe::isPlayerStarship(), Hashtable< KEY, VALUE, SIZ >::Put(), and Cockpit::SetCommAnimation().
Definition at line 33 of file unit_util.cpp.
References _Universe, Pilot::getCommFace(), Universe::isPlayerStarship(), Unit::pilot, and Cockpit::SetCommAnimation().
Definition at line 624 of file unit_util_generic.cpp.
References Unit::GetCargo(), index, Unit::numCargo(), Cargo::price, and Unit::RemoveCargo().
Definition at line 572 of file unit_util_generic.cpp.
References Unit::AddCargo(), and Cargo::quantity.
Definition at line 647 of file unit_util_generic.cpp.
References Unit::GetCargo(), and Cargo::quantity.
Referenced by Unit::DealDamageToHullReturnArmor(), Unit::EjectCargo(), Unit::GetCargo(), Unit::ImportPartList(), Unit::Repair(), Unit::RepairCost(), Unit::RepairUpgrade(), Unit::RepairUpgradeCargo(), and Unit::Upgrade().
Definition at line 637 of file unit_util_generic.cpp.
References Unit::GetCargo(), and Cargo::quantity.
Definition at line 389 of file unit_util_generic.cpp.
References _Universe, Cockpit::credits, and Universe::isPlayerStarship().
Referenced by BasicRepair().
Definition at line 688 of file unit_util_generic.cpp.
References Magnitude(), Unit::Position(), and Unit::rSize().
Referenced by Unit::AutoPilotToErrorMessage(), ChooseNavPoint(), Orders::FireAt::ChooseTargets(), CloseEnoughToNavOrDest(), dockingdistance(), Orders::LoopAround::Execute(), Orders::FacePerpendicular::Execute(), Radar::Sensor::FindTracksInRange(), getPhysicsPriority(), getSignificantDistance(), isCloseEnoughToDock(), CommunicatingAI::RandomInitiateCommunication(), GameUnit< UnitType >::Thrust(), Radar::Track::Track(), and Cockpit::updateAttackers().
Definition at line 763 of file unit_util_generic.cpp.
References Unit::computer, UnitImages< BOGUS >::ecm, Unit::Computer::ecmactive, and Unit::pImage.
Referenced by FireKeyboard::Execute(), Radar::Track::HasActiveECM(), GameCockpit::LookupUnitStat(), GameMissile::UpdatePhysics2(), and Missile::UpdatePhysics2().
Definition at line 323 of file unit_util_generic.cpp.
References Unit::faction.
string UnitUtil::getFactionName | ( | const Unit * | my_unit) |
Definition at line 317 of file unit_util_generic.cpp.
References Unit::faction, and FactionUtil::GetFaction().
Referenced by NetClient::AddObjects(), and displayUnitInfo().
Definition at line 341 of file unit_util_generic.cpp.
References _Universe, Unit::faction, FactionUtil::GetIntRelation(), UniverseUtil::getRelationModifierInt(), and Universe::whichPlayerStarship().
Referenced by CommunicatingAI::AdjustRelationTo(), Pilot::GetEffectiveRelationship(), getNearestTarget(), HelpOut(), CommunicatingAI::selectCommunicationMessage(), and NetServer::sendCommunication().
string UnitUtil::getFgDirective | ( | const Unit * | my_unit) |
Definition at line 448 of file unit_util_generic.cpp.
References getFgDirectiveCR().
Referenced by getPhysicsPriority().
|
static |
Definition at line 453 of file unit_util_generic.cpp.
References Flightgroup::directive, and Unit::getFlightgroup().
Referenced by getFgDirective().
Referenced by Unit::ExecuteAI().
Definition at line 476 of file unit_util_generic.cpp.
References Unit::getFgSubnumber().
Definition at line 427 of file unit_util_generic.cpp.
References Unit::getFlightgroup(), UnitContainer::GetUnit(), and Flightgroup::leader.
Referenced by Orders::FireAt::ChooseTargets().
string UnitUtil::getFlightgroupName | ( | const Unit * | my_unit) |
Definition at line 422 of file unit_util_generic.cpp.
References getFlightgroupNameCR().
Referenced by ChooseNavPoint(), Orders::AggressiveAI::ExecuteNoEnemies(), getNearestTargetUnit(), FactionUtil::GetRandCommAnimation(), isDockableUnit(), CommunicatingAI::RandomInitiateCommunication(), Unit::reactToCollision(), UniverseUtil::StopTargettingEachOther(), UniverseUtil::TargetEachOther(), and TryDock().
const string & UnitUtil::getFlightgroupNameCR | ( | const Unit * | my_unit) |
Definition at line 410 of file unit_util_generic.cpp.
References Unit::getFlightgroup(), and Flightgroup::name.
Referenced by getFlightgroupName(), and isSignificant().
string UnitUtil::getName | ( | const Unit * | my_unit) |
Definition at line 371 of file unit_util_generic.cpp.
References Unit::name.
Referenced by UniverseUtil::getUnitByName(), Audio::OpenALStreamingSound::readAndFlip(), and Audio::OpenALStreamingSound::seek().
Definition at line 80 of file unit_util_generic.cpp.
References _Universe, Cockpit::AccessCamera(), Universe::AccessCockpit(), Unit::activeStarSystem, blah, Unit::faction, Unit::getAverageGunSpeed(), getDistance(), GetElapsedTime(), FactionUtil::GetFactionIndex(), getFgDirective(), UniverseUtil::GetGameTime(), FactionUtil::GetNeutralFaction(), Cockpit::GetParent(), Camera::GetPosition(), Cockpit::GetSaveParent(), getTopLevelOwner(), FactionUtil::GetUpgradeFaction(), VegaConfig::getVariable(), Camera::GetVelocity(), Unit::GetVelocity(), Unit::graphicOptions, hasDockingUnits(), i, Unit::graphic_options::InWarp, isAsteroid(), Unit::isJumppoint(), Universe::isPlayerStarship(), Unit::isUnit(), MISSILEPTR, mymax(), mymin(), Network, Universe::numPlayers(), ORBIT_PRIORITY, Unit::owner, XMLSupport::parse_bool(), XMLSupport::parse_float(), XMLSupport::parse_int(), Unit::Position(), QVector, Unit::radial_size, Unit::graphic_options::RampCounter, Unit::rSize(), Unit::schedule_priority, Unit::scheduleAField, Unit::scheduleDefault, Unit::scheduleRoid, SERVER, SIM_QUEUE_SIZE, SIMULATION_ATOM, speed, Unit::Target(), Unit::Velocity, vs_config, and Unit::graphic_options::WarpRamping.
Referenced by StarSystem::AddUnit(), Unit::UpdateSubunitPhysics(), and StarSystem::UpdateUnitPhysics().
Definition at line 362 of file unit_util_generic.cpp.
References _Universe, Unit::faction, FactionUtil::GetIntRelation(), UniverseUtil::getRelationModifierInt(), and Universe::whichPlayerStarship().
Referenced by StarSystem::Statistics::AddUnit(), AllUnitsCloseAndEngage(), Arrested(), StarSystem::Statistics::CheckVitals(), ChooseNavPoint(), NavigationSystem::DrawMission(), StarSystem::Statistics::RemoveUnit(), and BaseComputer::showPlayerInfo().
Definition at line 353 of file unit_util_generic.cpp.
References _Universe, Unit::faction, FactionUtil::GetIntRelation(), UniverseUtil::getRelationModifierInt(), and Universe::whichPlayerStarship().
Referenced by Pilot::adjustSpecificRelationship(), Arrested(), and ScoreKill().
Definition at line 695 of file unit_util_generic.cpp.
References getDistance(), UniverseUtil::getPlanetRadiusPercent(), Unit::isPlanet(), and Unit::rSize().
Referenced by CalculateNearestWarpUnit(), DockToSavedBases(), Orders::AutoLongHaul::Execute(), isCloseEnoughToDock(), Cockpit::unitInAutoRegion(), Cockpit::Update(), Unit::UpdatePhysics(), and WarpToP().
string UnitUtil::getUnitSystemFile | ( | const Unit * | my_unit) |
Definition at line 597 of file unit_util_generic.cpp.
References _Universe, Universe::activeStarSystem(), StarSystem::getFileName(), and Unit::getStarSystem().
Referenced by Arrested(), BaseInterface::BaseInterface(), CommunicatingAI::InitiateContrabandSearch(), CommunicatingAI::ProcessCommMessage(), CommunicatingAI::RandomInitiateCommunication(), and ScoreKill().
Definition at line 579 of file unit_util_generic.cpp.
References c, Unit::GetCargo(), i, and Cargo::quantity.
Definition at line 73 of file unit_util_generic.cpp.
References Unit::DockedOrDocking(), Unit::DOCKING_UNITS, and Unit::hasPendingClearanceRequests().
Referenced by getPhysicsPriority().
Definition at line 605 of file unit_util_generic.cpp.
References Unit::AddCargo(), c, Unit::CanAddCargo(), Unit::GetCargo(), index, Unit::numCargo(), and Cargo::price.
Definition at line 60 of file unit_util_generic.cpp.
References ASTEROIDPTR, Unit::isUnit(), Unit::name, and nameIsAsteroid().
Referenced by StarSystem::Statistics::AddUnit(), Unit::AutoPilotToErrorMessage(), GenerateAutoError(), getPhysicsPriority(), and UniverseUtil::SafeStarSystemEntrancePoint().
Definition at line 66 of file unit_util_generic.cpp.
References ROLES::getCapitalRoles(), and Unit::unitRole().
Referenced by NearestNavOrCapshipLocator::acquire(), Orders::AutoDocking::CanDock(), Orders::AggressiveAI::ExecuteNoEnemies(), and Radar::Track::IdentifyType().
Definition at line 676 of file unit_util_generic.cpp.
References getDistance(), getSignificantDistance(), VegaConfig::getVariable(), Unit::isUnit(), XMLSupport::parse_bool(), PLANETPTR, and vs_config.
Referenced by Orders::AutoDocking::CanDock(), DoDockingOps(), and SuperDock().
Definition at line 660 of file unit_util_generic.cpp.
References Unit::DockingPortLocations(), getFlightgroupName(), Unit::isJumppoint(), Unit::isPlanet(), isSignificant(), isSun(), Unit::isUnit(), and UNITPTR.
Referenced by Orders::AutoDocking::CanDock(), GameCockpit::DoAutoLanding(), DoDockingOps(), Orders::AggressiveAI::ExecuteNoEnemies(), FactionUtil::GetRandCommAnimation(), CommunicatingAI::InitiateContrabandSearch(), and SuperDock().
Definition at line 771 of file unit_util_generic.cpp.
References Unit::viewSubUnits().
Referenced by owner().
Definition at line 731 of file unit_util_generic.cpp.
References _Universe, and Universe::whichPlayerStarship().
Referenced by BaseComputer::acceptMission(), BaseInterface::BaseInterface(), GameUnit< UnitType >::Cloak(), NavigationSystem::DrawSystem(), Unit::ForceDock(), Unit::Kill(), BaseComputer::loadMissionsMasterList(), BaseComputer::loadNewsControls(), and BaseInterface::Terminate().
Definition at line 721 of file unit_util_generic.cpp.
References ASTEROIDPTR, getFlightgroupNameCR(), isSun(), Unit::isUnit(), NEBULAPTR, and PLANETPTR.
Referenced by NearestNavLocator::acquire(), NearestNavOrCapshipLocator::acquire(), StarSystem::Statistics::AddUnit(), UniverseUtil::PythonUnitIter::advanceInsignificant(), UniverseUtil::PythonUnitIter::advanceNInsignificant(), UniverseUtil::PythonUnitIter::advanceNSignificant(), UniverseUtil::PythonUnitIter::advanceSignificant(), Arrested(), ChooseNearNavPoint(), NavigationSystem::DrawSystem(), isDockableUnit(), Unit::LockTarget(), StarSystem::Statistics::RemoveUnit(), TargSig(), and StarSystem::Update().
Definition at line 709 of file unit_util_generic.cpp.
References Unit::isJumppoint(), and Unit::isPlanet().
Referenced by Unit::AutoPilotToErrorMessage(), NavigationSystem::DrawSystem(), getNearestTarget(), isDockableUnit(), isSignificant(), TargAll(), and TargNear().
Definition at line 589 of file unit_util_generic.cpp.
References Unit::getStarSystem(), and StarSystem::JumpTo().
Referenced by Orders::AggressiveAI::AfterburnerJumpTurnTowards(), and Arrested().
Definition at line 748 of file unit_util_generic.cpp.
References Unit::Computer::max_ab_speed(), and Unit::ViewComputerData().
Definition at line 742 of file unit_util_generic.cpp.
References Unit::Computer::max_speed(), and Unit::ViewComputerData().
|
inlinestatic |
Definition at line 53 of file unit_util_generic.cpp.
References b.
Referenced by getPhysicsPriority().
|
inlinestatic |
Definition at line 47 of file unit_util_generic.cpp.
References b.
Referenced by getPhysicsPriority().
void UnitUtil::orbit | ( | Unit * | my_unit, |
Unit * | orbitee, | ||
float | speed, | ||
QVector | R, | ||
QVector | S, | ||
QVector | center | ||
) |
Definition at line 300 of file unit_util_generic.cpp.
References center, Unit::EnqueueAI(), Unit::faction, FactionUtil::GetFactionIndex(), getTopLevelOwner(), Unit::isUnit(), orbitee, PLANETPTR, Unit::PrimeOrders(), R, S, Unit::SetOwner(), and Unit::SetTurretAI().
Definition at line 783 of file unit_util_generic.cpp.
References UniverseUtil::getUnitList(), and ishere().
Referenced by Arrested(), Bolt::Bolt(), ChooseSubTargets(), UnitDrawer::drawParents(), Unit::EjectCargo(), Unit::Fire(), MissileEffect::MissileEffect(), Unit::reactToCollision(), Unit::SetOwner(), Unit::SetRecursiveOwner(), Unit::UnDock(), and Unit::UpdatePhysics().
float UnitUtil::PercentOperational | ( | Unit * | un, |
std::string | name, | ||
std::string | category, | ||
bool | countHullAndArmorAsFull | ||
) |
Definition at line 804 of file unit_util_generic.cpp.
References Unit::ArmorData(), Unit::canUpgrade(), DamagedCategory, Mount::DESTROYED, f, Unit::faction, Unit::GetHull(), Unit::GetNumMounts(), getUnitFromUpgradeName(), i, isWeapon(), makeTemplateUpgrade(), Unit::mounts, Unit::name, Mount::type, upgrade(), and weapon_info::weapon_name.
Definition at line 795 of file unit_util_generic.cpp.
References Unit::aistate, and Unit::PrimeOrders().
void UnitUtil::RecomputeUnitUpgrades | ( | Unit * | my_unit) |
Definition at line 493 of file unit_util_generic.cpp.
References c, Cargo::content, DamagedCategory, Unit::GetCargo(), Cargo::GetCategory(), Cargo::GetContent(), i, j, Network, Unit::numCargo(), Cargo::quantity, Unit::ReduceToTemplate(), and Unit::Upgrade().
Referenced by BaseComputer::sellUpgrade().
Definition at line 482 of file unit_util_generic.cpp.
References Unit::GetCargo(), index, and Unit::RemoveCargo().
int UnitUtil::removeWeapon | ( | Unit * | my_unit, |
string | weapon, | ||
int | mountoffset, | ||
bool | loop_through_mounts | ||
) |
Definition at line 541 of file unit_util_generic.cpp.
References Mount::ACTIVE, i, Mount::INACTIVE, max(), Unit::mounts, and Mount::UNCHOSEN.
Definition at line 525 of file unit_util_generic.cpp.
References Unit::RepairUpgrade().
Referenced by BaseComputer::loadBuyUpgradeControls().
Definition at line 755 of file unit_util_generic.cpp.
References UnitImages< BOGUS >::ecm, and Unit::GetImageInformation().
Referenced by FireKeyboard::Execute().
Definition at line 329 of file unit_util_generic.cpp.
References Unit::SetFaction().
void UnitUtil::setFactionName | ( | Unit * | my_unit, |
string | factionname | ||
) |
Definition at line 335 of file unit_util_generic.cpp.
References FactionUtil::GetFactionIndex(), and Unit::SetFaction().
Definition at line 466 of file unit_util_generic.cpp.
References Flightgroup::directive, and Unit::getFlightgroup().
Referenced by UniverseUtil::StopTargettingEachOther(), and UniverseUtil::TargetEachOther().
Definition at line 437 of file unit_util_generic.cpp.
References Unit::getFlightgroup(), Flightgroup::leader, and UnitContainer::SetUnit().
Referenced by UniverseUtil::TargetEachOther().
Definition at line 383 of file unit_util_generic.cpp.
References Unit::hull.
void UnitUtil::setMissionRelevant | ( | Unit * | my_unit) |
Definition at line 845 of file unit_util_generic.cpp.
References mission, Mission::Runtime::pymissions, PythonMissionBaseClass::relevant_units, and Mission::runtime.
void UnitUtil::setName | ( | Unit * | my_unit, |
string | name | ||
) |
Definition at line 377 of file unit_util_generic.cpp.
References Unit::name.
Definition at line 736 of file unit_util_generic.cpp.
References Unit::GetComputerData(), Unit::Computer::set_speed, and speed.
void UnitUtil::switchFg | ( | Unit * | my_unit, |
string | arg | ||
) |
Definition at line 14 of file unit_util.cpp.
References Flightgroup::ainame, Flightgroup::Decrement(), Unit::faction, FactionUtil::GetFaction(), Unit::getFlightgroup(), mission, Unit::name, Flightgroup::newFlightgroup(), Flightgroup::nr_ships_left, Flightgroup::nr_waves_left, Unit::SetFg(), and Flightgroup::type.
float UnitUtil::upgrade | ( | Unit * | my_unit, |
string | file, | ||
int | mountoffset, | ||
int | subunitoffset, | ||
bool | force, | ||
bool | loop_through_mounts | ||
) |
Definition at line 532 of file unit_util_generic.cpp.
References Unit::SetTurretAI(), and Unit::Upgrade().
Referenced by cell_has_recursive_data(), computeDowngradePercent(), PercentOperational(), Unit::RepairUpgradeCargo(), and UpgradeUnit().