Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <fire.h>
Public Member Functions | |
virtual void | ChooseTarget () |
this function calls the destructor (needs to be overridden for python; More... | |
void | PossiblySwitchTarget (bool istargetjumpableplanet) |
virtual bool | PursueTarget (Unit *, bool leader) |
void | AddReplaceLastOrder (bool replace) |
void | ExecuteLastScriptFor (float time) |
void | FaceTarget (bool end) |
void | FaceTargetITTS (bool end) |
void | MatchLinearVelocity (bool terminate, Vector vec, bool afterburn, bool local) |
void | MatchAngularVelocity (bool terminate, Vector vec, bool local) |
void | ChangeHeading (QVector vec) |
void | ChangeLocalDirection (Vector vec) |
void | MoveTo (QVector, bool afterburn) |
void | MatchVelocity (bool terminate, Vector vec, Vector angvel, bool afterburn, bool local) |
void | Cloak (bool enable, float seconds) |
void | FormUp (QVector pos) |
void | FormUpToOwner (QVector pos) |
void | FaceDirection (float distToMatchFacing, bool finish) |
void | XMLScript (std::string script) |
void | LastPythonScript () |
virtual void | SetParent (Unit *parent) |
Sets the parent of this Unit. Any virtual functions must call this one. More... | |
Unit * | GetParent () |
FireAt (float aggressivitylevel) | |
FireAt () | |
virtual void | Execute () |
The function that gets called and executes all queued suborders. More... | |
virtual std::string | Pickle () |
virtual void | UnPickle (std::string) |
virtual | ~FireAt () |
![]() | |
virtual void | Destroy () |
The virutal function that unrefs all memory then calls Destruct () which takes care of unreffing this or calling delete on this. More... | |
virtual float | getMood () |
Unit * | GetRandomUnit (float PlayerProbability, float TargetProbability) |
void | RandomInitiateCommunication (float PlayerProbability, float TargetProbability) |
void | TerminateContrabandSearch (bool foundcontraband) |
void | InitiateContrabandSearch (float PlayerProbability, float TargetProbability) |
void | UpdateContrabandSearch () |
CommunicatingAI (int ttype, int stype, float mood=0, float anger=-666, float appeasement=666, float moodswingyness=666, float randomnessresponse=666) | |
virtual void | ProcessCommMessage (class CommunicationMessage &c) |
processes a single message...generally called by the Messages() func More... | |
virtual void | AdjustRelationTo (Unit *un, float factor) |
virtual | ~CommunicatingAI () |
virtual int | selectCommunicationMessage (class CommunicationMessage &c, Unit *) |
virtual int | selectCommunicationMessageMood (CommunicationMessage &c, float mood) |
![]() | |
void | ClearMessages () |
clears the messasges of this order More... | |
Order () | |
The default constructor setting everything to NULL and no dependency on order. More... | |
Order (int type, int subtype) | |
The constructor that specifies what order dependencies this order has. More... | |
Order * | queryType (unsigned int type) |
returns a pointer to the first order that may be bitwised ored with that type More... | |
Order * | queryAny (unsigned int type) |
returns a pointer to the first order that may be bitwise ored with any type More... | |
void | eraseType (unsigned int type) |
Erases all orders that bitwise OR with that type. More... | |
bool | AttachOrder (Unit *targets) |
Attaches a group of targets to this order (used for strategery-type games) More... | |
bool | AttachOrder (QVector target) |
Attaches a navigation point to this order. More... | |
bool | AttachSelfOrder (Unit *targets) |
Attaches a group (form up) to this order. More... | |
Order * | EnqueueOrder (Order *ord) |
Enqueues another order that will be executed (in parallel perhaps) when next void Execute() is called. More... | |
Order * | ReplaceOrder (Order *ord) |
Replaces the first order of that type in the order queue. More... | |
bool | Done () |
int | getType () |
int | getSubType () |
Unit * | GetParent () const |
virtual void | Communicate (const class CommunicationMessage &c) |
Sends a communication message from the Unit (encapulated in c) to this unit. More... | |
virtual void | ProcessCommunicationMessages (float CommRepsonseTime, bool RemoveMessageProcessed) |
responds (or does not) to certain messages in the message queue More... | |
Order * | findOrder (Order *ord) |
return pointer to order or NULL if not found More... | |
void | eraseOrder (Order *ord) |
erase that order from the list More... | |
Order * | EnqueueOrderFirst (Order *ord) |
enqueue order as first order More... | |
virtual olist_t * | getOrderList () |
returns the orderlist (NULL for orders that haven't got any) More... | |
virtual std::string | getOrderDescription () |
Order * | findOrderList () |
searches the suborders recursively for the first order that has an orderlist More... | |
std::string | createFullOrderDescription (int level=0) |
void | setActionString (std::string astring) |
std::string | getActionString () |
Protected Member Functions | |
bool | ShouldFire (Unit *targ, bool &missilelock) |
void | FireWeapons (bool shouldfire, bool lockmissile) |
virtual void | ChooseTargets (int num, bool force=false) |
bool | isJumpablePlanet (Unit *) |
void | ReInit (float agglevel) |
virtual void | SignalChosenTarget () |
![]() | |
void | GetMadAt (Unit *which, int howMad) |
![]() | |
virtual | ~Order () |
virtual void | Destructor () |
changes the local relation of this unit to another...may inform superiors about "good" or bad! behavior depending on the AI More... | |
Protected Attributes | |
float | missileprobability |
float | lastmissiletime |
float | delay |
float | agg |
float | distance |
float | lastchangedtarg |
bool | had_target |
![]() | |
float | anger |
float | appease |
float | moodswingyness |
float | randomresponse |
float | mood |
UnitContainer | contraband_searchee |
Vector | SpeedAndCourse |
int | which_cargo_item |
![]() | |
Unit * | parent |
The unit this order is attached to. More... | |
unsigned int | type |
The bit code (from ORDERTYPES) that this order is (for parallel execution) More... | |
unsigned int | subtype |
bool | done |
Whether or not this order is done. More... | |
UnitContainer | group |
If this order applies to a group of units (as in form up with this group) More... | |
QVector | targetlocation |
If this order applies to a physical location in world space. More... | |
std::vector< Order * > | suborders |
The queue of suborders that will be executed in parallel according to bit code. More... | |
std::list< class CommunicationMessage * > | messagequeue |
a bunch of communications that have not been answered CommunicationMessages are actually containing reference to a nice Finite State Machine that can allow a player to have a reasonable conversation with an AI More... | |
std::string | actionstring |
Additional Inherited Members | |
![]() | |
enum | ORDERTYPES { MOVEMENT =1, FACING =2, WEAPON =4, CLOAKING =8, ALLTYPES =(1|2|4|8) } |
The varieties of order types MOVEMENT,FACING, and WEAPON orders may not be mutually executed (lest one engine goes left, the other right) More... | |
enum | SUBORDERTYPES { SLOCATION =1, STARGET =2, SSELF =4 } |
FireAt::FireAt | ( | float | aggressivitylevel) |
FireAt::FireAt | ( | ) |
Definition at line 119 of file fire.cpp.
References VegaConfig::getVariable(), XMLSupport::parse_float(), ReInit(), and vs_config.
|
virtual |
void FireAt::AddReplaceLastOrder | ( | bool | replace) |
Definition at line 48 of file hard_coded_scripts.cpp.
References AddOrd(), Order::parent, and ReplaceOrd().
void FireAt::ChangeHeading | ( | QVector | vec) |
Definition at line 80 of file hard_coded_scripts.cpp.
void FireAt::ChangeLocalDirection | ( | Vector | vec) |
Definition at line 84 of file hard_coded_scripts.cpp.
References Order::parent, Unit::Position(), and Unit::ToWorldCoordinates().
|
inlinevirtual |
this function calls the destructor (needs to be overridden for python;
Reimplemented from Order.
Definition at line 28 of file fire.h.
References ChooseTargets().
Definition at line 424 of file fire.cpp.
References _Universe, Universe::AccessCockpit(), Universe::activeStarSystem(), AssignTBin(), Unit::attackPreference(), StarSystem::collidemap, Flightgroup::directive, findObjects(), float_to_int(), UnitUtil::getDistance(), UnitUtil::getFlightgroupLeader(), UniverseUtil::GetGameTime(), Cockpit::GetParent(), ROLES::getRole(), Unit::getSubUnits(), VegaConfig::getVariable(), i, k, Universe::numPlayers(), numpolled, numprocessed, XMLSupport::parse_bool(), XMLSupport::parse_float(), XMLSupport::parse_int(), pollindex, prevpollindex, queryTime(), Unit::Target(), targetpick, targrand, Unit::Threat(), VSRandom::uniformInc(), Unit::UNIT_ONLY, and vs_config.
Referenced by ChooseTarget().
Definition at line 99 of file hard_coded_scripts.cpp.
|
virtual |
The function that gets called and executes all queued suborders.
Reimplemented from Order.
Reimplemented in Orders::AggressiveAI, and Orders::Ikarus.
Definition at line 700 of file fire.cpp.
References Unit::CloakVisible(), done, Order::Execute(), float, Unit::GetHull(), VegaConfig::getVariable(), int, XMLSupport::parse_float(), SIMULATION_ATOM, Unit::Target(), UNITPTR, and vs_config.
Referenced by Orders::AggressiveAI::Execute().
void FireAt::ExecuteLastScriptFor | ( | float | time) |
Definition at line 58 of file hard_coded_scripts.cpp.
Definition at line 111 of file hard_coded_scripts.cpp.
void FireAt::FaceTarget | ( | bool | end) |
Definition at line 63 of file hard_coded_scripts.cpp.
References FaceTarget().
void FireAt::FaceTargetITTS | ( | bool | end) |
Definition at line 67 of file hard_coded_scripts.cpp.
Definition at line 660 of file fire.cpp.
References FireBitmask(), UniverseUtil::GetGameTime(), VegaConfig::getVariable(), XMLSupport::parse_float(), SIMULATION_ATOM, and vs_config.
void FireAt::FormUp | ( | QVector | pos) |
Definition at line 103 of file hard_coded_scripts.cpp.
void FireAt::FormUpToOwner | ( | QVector | pos) |
Definition at line 107 of file hard_coded_scripts.cpp.
|
inline |
Definition at line 55 of file fire.h.
References Order::GetParent().
Definition at line 676 of file fire.cpp.
References Unit::isUnit(), and PLANETPTR.
Referenced by Orders::AggressiveAI::ProcessCurrentFgDirective().
void FireAt::LastPythonScript | ( | ) |
Definition at line 119 of file hard_coded_scripts.cpp.
References PythonAI< SuperClass >::LastPythonClass().
Definition at line 76 of file hard_coded_scripts.cpp.
References Unit::ClampAngVel(), Order::parent, and BriefingUtil::terminate().
Definition at line 71 of file hard_coded_scripts.cpp.
References Unit::ClampVelocity(), Order::parent, BriefingUtil::terminate(), and useAfterburner().
void FireAt::MatchVelocity | ( | bool | terminate, |
Vector | vec, | ||
Vector | angvel, | ||
bool | afterburn, | ||
bool | local | ||
) |
Definition at line 93 of file hard_coded_scripts.cpp.
References Unit::ClampAngVel(), Unit::ClampVelocity(), MatchVelocity, Order::parent, BriefingUtil::terminate(), and useAfterburner().
|
inlinevirtual |
void FireAt::PossiblySwitchTarget | ( | bool | istargetjumpableplanet) |
Definition at line 686 of file fire.cpp.
References Flightgroup::directive, VegaConfig::getVariable(), XMLSupport::parse_float(), SIMULATION_ATOM, VSRandom::uniformInc(), vs_config, and vsrandom.
Reimplemented from Order.
Definition at line 66 of file fire.cpp.
References Unit::getRelation(), Order::parent, and Unit::Target().
|
protected |
Definition at line 99 of file fire.cpp.
References agg, delay, distance, UniverseUtil::GetGameTime(), VegaConfig::getVariable(), had_target, lastchangedtarg, lastmissiletime, missileprobability, XMLSupport::parse_float(), targrand, VSRandom::uniformInc(), and vs_config.
Referenced by FireAt().
|
inlinevirtual |
Sets the parent of this Unit. Any virtual functions must call this one.
Reimplemented from Order.
Reimplemented in Orders::AggressiveAI.
Definition at line 51 of file fire.h.
References Order::SetParent().
Referenced by Orders::AggressiveAI::SetParent().
Definition at line 574 of file fire.cpp.
References _Universe, UniverseUtil::cos(), f, float, VSRandom::genrand_int31(), Unit::GetComputerData(), UniverseUtil::GetGameTime(), VegaConfig::getVariable(), VSRandom::init_genrand(), int, Universe::isPlayerStarship(), Unit::isUnit(), Unit::Computer::itts, M_PI, Cockpit::number_of_attackers, XMLSupport::parse_float(), XMLSupport::parse_int(), PLANETPTR, Unit::Target(), test, Unit::Threaten(), Cockpit::tooManyAttackers(), vs_config, and VSFileSystem::vs_fprintf().
|
protectedvirtual |
Reimplemented in Orders::AggressiveAI.
Definition at line 125 of file fire.cpp.
Referenced by Orders::AggressiveAI::SignalChosenTarget().
|
inlinevirtual |
void FireAt::XMLScript | ( | std::string | script) |
Definition at line 115 of file hard_coded_scripts.cpp.
|
protected |
Definition at line 18 of file fire.h.
Referenced by Orders::AggressiveAI::ProcessLogicItem(), and ReInit().
|
protected |
|
protected |
|
protected |
|
protected |