Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   Compound Members   Related Pages  

OBJ_SHIP Class Reference

Inheritance diagram for OBJ_SHIP:

Inheritance graph
List of all members.

Private Methods

GALOBJ Create (int gsubtype, int ssubtype)
GALOBJ Destruct ()
void SetFormationLeader (GALOBJ a_fl)
void SetFormationType (int a_ft)
int GetFormationType ()
int GetDefaultFormationTypeFromRace (int a_raceid)
dynarray GetFormationShips ()
GALOBJ GetFormationLeader ()
void AddFormationShip (GALOBJ a_ship)
void AddToFormation (GALOBJ a_leader)
void RemoveFormationShip (GALOBJ a_ship)
void RemoveFromFormation ()
int GetMaxFormationSpeed ()
int IsInFollowMode ()
void SetFollowMode (BOOL a_on)
void ReorgFormation (int a_removedidx)
void RemoveAllFormationShips ()
GALOBJ SelectNewFormationLeader (int a_flag)
void GiveFormationLeadershipTo (GALOBJ a_newleader)
GALOBJ GetDestination ()
void SetDestination (GALOBJ a_dest)
GALOBJ GetAttackTarget ()
void SetAttackTarget (GALOBJ a_dest)
int GetSpeedLimit ()
int GetMaxSpeed ()
int GetSubType ()
int GetGSubType ()
int GetTypeCode ()
int GetClass ()
int IsClass (int cl)
int IsClassType (int cl)
int GetGType ()
int GetType ()
GALOBJ GetOwner ()
GALOBJ GetOwnerObject ()
int GetObjectID ()
int GetGSize ()
int GetSize ()
array GetPos ()
GALOBJ GetEnvironment ()
GALOBJ IsDocked ()
int GetNameID ()
string GetName ()
string GetYourName ()
void SetYourName (string a_name)
void SetPlayerWingMen (int a_set)
int IsPlayerWingMen ()
void SetEnvironment (GALOBJ env)
void SetOwner (GALOBJ owner)
int IsHired ()
void SetHired (BOOL a_yes)
void SetOwnerObject (GALOBJ ownerobj)
void SetPilotName (string a_name)
void SetPilotFace (int a_face)
string GetPilotName ()
int GetPilotFace ()
void DisableCapture (BOOL yes)
void DisableSelling (BOOL yes)
void SetPilotID (int a_id)
BOOL IsInHomeSector ()
BOOL HasIllegalGoods ()
BOOL IsControllable ()
int IsHidden (GALOBJ srcobj)
SECOBID Activate ()
void Deactivate ()
void AddTo (GALOBJ genv)
void SetPos (int x, int y, int z)
void SetSafePos ()
void SetRot (int alpha, int beta, int gamma)
BOOL IsDockingPossibleOf (GALOBJ a_ship)
BOOL IsPlayerShip ()
void SetAsPlayerShip (BOOL yesno)
BOOL HasCockpit ()
int GetNumCockpits ()
int GetNumTurrets ()
int GetNumLasersInTurret (int a_turretid)
string GetCockpitName (int a_cockpitid)
string GetTurretName (int a_turretid)
int GetTurretLaserMask (int a_turretid)
int GetLaserTypeInTurret (int a_turretid, int a_slot)
BOOL DoesCommunicate ()
void SetRelation (GALOBJ otherobj, int relation)
void SetGroupRelation (int raceid, int relation)
int SetRelationsToAll (int relation)
int GetRelation (GALOBJ otherobj)
int GetGroupRelation (int raceid)
void SetRelationsFromNotoriety ()
array GetShields ()
array GetLasers ()
int GetCurrentRocketType ()
array GetMaxRockets ()
int SetMaxShieldType (int st)
int GetNumShieldBays ()
int GetNumLaserBays ()
int SetShield (int newshield)
int GetShield ()
int GetMaxShield ()
int GetStrength ()
int GetLaser ()
int GetMaxLaser ()
int AddShield (int gsubtype, int count)
int AddLaser (int gsubtype, int count)
BOOL InstallLaserInTurret (int gsubtype, int turretid, int slot)
int AddRocket (int gsubtype, int count)
int SetCurrentRocketType (int gsubtype)
int AddMaxRocket (int gsubtype, int count)
void AddDefaultLasers ()
void AddDefaultShields ()
void AddDefaultRockets ()
void AddDefaultUpgrades ()
void AddDefaultItems ()
int RemoveShield (int gsubtype, int count)
int RemoveLaser (int gsubtype, int count)
int RemoveRocket (int gsubtype, int count)
void AddMaxLasers (int gsubtype)
int InstallWare (int gtype, int gsubtype, int count)
void SetWantedFreight (int gtypecode)
int GetWantedFreightPrice ()
int GetWantedFreight ()
int GetWantedCount ()
table GetWares ()
int TradeWare (int gtype, int gsubtype, int count)
void SetExtraTradeContainerSize (int newsize)
int GetTradeContainerSize ()
int GetExtraTradeContainerSize ()
int GetTotalVolume ()
int GetTradeContainerFree ()
int GetWareTypeContainerSize (int gtype, int gsubtype)
int GetTrueWareTypeCount (int gtype, int gsubtype)
int AddWare (int gtype, int gsubtype, int count)
int GetFreeShieldBays ()
void EscortAddTo (GALOBJ gescortee)
GALOBJ SetAttacker (GALOBJ att)
GALOBJ GetAttacker ()
int BuyWare (int a_ware, int a_amount, int a_maxprice)
int LoadWare (int a_ware, int a_amount)
int SellWare (int a_ware, int a_amount)
int UnLoadWare (int a_ware, int a_amount)
int AttackRunOnTarget (GALOBJ a_target)
void AttackedBy (SECOBID attacker)
void KilledBy (int reason, SECOBID skiller, SECOBID sother)
void KilledInEnvironment ()
void SelfDestruct (int reason)
void Stop ()
int StopAction ()
int StopCommand ()
int GetAction ()
GALOBJ GetActionTarget ()
array GetCommandAndPars ()
int GetCommand ()
int GetCommandTarget ()
int GetCommandTarget2 ()
void StartKill (GALOBJ genemy)
void StartKillAndLand (GALOBJ genemy, GALOBJ ghangar)
void StartKillPreferred (GALOBJ genemy)
void StartKillAllEnemies ()
void StartKillAllEnemiesAndLand (GALOBJ ghangar)
void MakeBreak ()
void TradeMoney (int amount)
BOOL HasFreight ()
BOOL DropFreight ()
void ChangePlayerShipTo (GALOBJ ship)
BOOL IsAttacked ()
void StartFollowLeader (GALOBJ gleader)
void StartTransferToHangar (GALOBJ gfrom, GALOBJ ghangar)
void StartAction ()
void StartExecuteCommand (int command, GALOBJ gtarget)
void StartExecuteCommand2 (int command, GALOBJ gtarget, GALOBJ gtarget2)

Private Attributes

GALOBJ sh_FormationLeader
dynarray sh_FormationShips
int sh_FormationType
int sh_GSubType
int sh_SubType
int sh_PilotID
string sh_Name
string sh_PilotName
int sh_PilotFace
int sh_Hull
int sh_NumLaserSlots
int sh_NumShieldSlots
int sh_MaxShieldType
array sh_Lasers
int sh_Shield
array sh_Shields
int sh_Rocket
array sh_MaxRockets
int sh_FireMissileProb
int sh_FireMissileTimeDiff
int sh_FireMissileLastTime
table sh_Wares
GALOBJ sh_OwnerObject
GALOBJ sh_Attacker
int sh_LastAttackTime
int sh_Action
GALOBJ sh_ActionTarget
int sh_CommandTargetType
int sh_CommandTarget
int sh_CommandTarget2Type
int sh_CommandTarget2
int sh_ContainerUpgrades
int sh_TotalVolume
int sh_MaxLaser
int sh_MaxShield
int sh_WantedFreight
int sh_WantedCount
int sh_WantedFreightPrice
GALOBJ sh_Destination
GALOBJ sh_AttackTarget
int sh_SpeedLimit

Detailed Description

Base class for all ships. A ship has n cockpits (n>=1). A cockpit can be connected to a turret and a turret has k lasers installed (k>=0). Not every ship can have every laser/missile installed. For lasers there is a mask defining which lasertype can be installed in each turret of a ship. It can be a NPC-ship, a ship the player owns or sits in. It handles also execution of commands and formation-flightlogic & -functionality.


Member Function Documentation

SECOBID Activate   [private]
 

activates ship-object in sector

Reimplemented in OBJ_SHIP_BIG, OBJ_SHIP_CARRIER, OBJ_SPACEFLY, OBJ_MINE, OBJ_ORBITALLASER, and OBJ_SATELLITECLASS.

void AddDefaultItems   [private]
 

Adds default Lasers, Shields, Rockets and Upgrades to the ship.

void AddDefaultLasers   [private]
 

installs a default laser for each turret

void AddDefaultRockets   [private]
 

adds randomly rockets

void AddDefaultShields   [private]
 

installs a shield randomly for each shield slot

void AddDefaultUpgrades   [private]
 

adds randomly speed, rotation speed, tradeContainerSize, drones and other tech. upgrades

void AddFormationShip GALOBJ    a_ship [private]
 

adds a given ship to sh_FormationShips and makes the ship (via which this fct. is called) the leader of this given ship.

int AddLaser int    gsubtype,
int    count
[private]
 

Adds amount (given in count, which also can be negative to remove) of lasers (laser-type given in gsubtype) to the ship as ware and also installs it if possible. Every ship has a maximum number of mounted lasers, which cannot be exceeded. See also AddMaxLasers(). *_W_LASER subtype constants-definitions Returns how many lasers were installed/uninstalled.

void AddMaxLasers int    gsubtype [private]
 

Adds the maximum possible number of same lasers of type gsubtype to the ship. For types, see *_W_LASER subtype constants-definitions.

int AddMaxRocket int    gsubtype,
int    count
[private]
 

Sets the maximum number of rockets that can be reloaded during docking. *_W_ROCKET subtype constants-definitions.

int AddRocket int    gsubtype,
int    count
[private]
 

Adds amount (given in count, which also can be negative to remove) of rockets (see *_W_ROCKET subtype constants-definitions) to the ship as ware. Rockets can be reloaded by computer controlled ships. To set the maximum number of rockets to reload on docking, use AddMaxRockets(). Returns how many rockets were added.

int AddShield int    gsubtype,
int    count
[private]
 

Adds amount (given in count, which also can be negative to remove) of shields (type given in gsubtype) to the ship. *_W_SHIELD subtype constants-definitions

void AddTo GALOBJ    genv [private]
 

See Functions common in every object.

Reimplemented in OBJ_SHIP_M0, and OBJ_SPACEFLY.

void AddToFormation GALOBJ    a_leader [private]
 

adds the ship (via which this fct. is called) to the formation (sh_FormationShips member) of the given ship and makes the first mentioned ship the formation-leader. Removes this ship from the previous leader if necessary.

int AddWare int    gtype,
int    gsubtype,
int    count
[private]
 

adds amount (given in count, which also can be negative to remove a ware) of ware (given in gtype, gsubtype) to the ship. Any upgrades (SS_WARE_TECH213, SS_WARE_TECH246, SS_WARE_TECH251) are installed. For gtype see MainObjectTypes and for gsubtype see subtype definitions. Returns the number of upgrades that were installed/uninstalled or wares added.

Reimplemented in OBJ_SHIP_BIG.

void AttackedBy SECOBID    attacker [private]
 

Fct. handles being attacked. Causes some random damage. If a non-player ship is attacked, there is a chance that the ship can be taken over and the player looses the licence of the race of the attacked ship. This fct. is called when ship is in current sector

Reimplemented in OBJ_SPACEFLY.

int AttackRunOnTarget GALOBJ    a_target [private]
 

ship attacks given target returns FLRET_NOCOMMANDS, FLRET_INTERRUPTED, FLRET_BREAK, FLRET_FIREFREE (ship has attacked)

int BuyWare int    a_ware,
int    a_amount,
int    a_maxprice
[private]
 

buy a ware from a station (ship must be in these environments)

void ChangePlayerShipTo GALOBJ    ship [private]
 

put player in given ship

GALOBJ Create int    gsubtype,
int    ssubtype
[private]
 

This function initializes a OBJ_SHIP instance created with new OBJ_SHIP and returns the object itself. gsubtype is the galaxy subtype, and ssubtype is the sector subtype (determines which body is used for the object, when in the current sector). *_SHIP subtype constants-definitions

void Deactivate   [private]
 

See Functions common in every object.

Reimplemented in OBJ_SHIP_CARRIER, OBJ_SPACEFLY, and OBJ_ORBITALLASER.

GALOBJ Destruct   [private]
 

See Functions common in every object.

Reimplemented in OBJ_SHIP_BIG, OBJ_SHIP_CARRIER, OBJ_SHIP_M0, OBJ_SHIP_ASTRONAUT, OBJ_SPACEFLY, OBJ_FIGHTDRONE, OBJ_MINE, and OBJ_ORBITALLASER.

void DisableCapture BOOL    yes [private]
 

sets sh_CaptureDisabled

void DisableSelling BOOL    yes [private]
 

sets sh_SellDisabled

BOOL DoesCommunicate   [private]
 

returns TRUE

Reimplemented in OBJ_SHIP_ASTRONAUT, OBJ_SPACEFLY, and OBJ_SATELLITECLASS.

BOOL DropFreight   [private]
 

Makes ship drop all freight (only a small part of the freight can actually be collected by the player).

void EscortAddTo GALOBJ    gescortee [private]
 

same as AddToFormation()

int GetAction   [private]
 

returns sh_Action

GALOBJ GetActionTarget   [private]
 

returns sh_ActionTarget

GALOBJ GetAttacker   [private]
 

returns sh_Attacker

GALOBJ GetAttackTarget   [private]
 

returns sh_AttackTarget

int GetClass   [private]
 

Functions common in every object

Reimplemented in OBJ_SHIP_BIG, OBJ_SHIP_CARRIER, OBJ_SHIP_M0, OBJ_SHIP_M1, OBJ_SHIP_M2, OBJ_SHIP_M6, OBJ_SHIP_FIGHTER, OBJ_SHIP_M3, OBJ_SHIP_M4, OBJ_SHIP_M5, OBJ_SHIP_TS, OBJ_SHIP_TP, OBJ_SHIP_TS_PIRATE, OBJ_SHIP_GONER, OBJ_SHIP_UFO, OBJ_SHIP_ASTRONAUT, OBJ_SPACEFLY, OBJ_FIGHTDRONE, OBJ_MINE, OBJ_ORBITALLASER, OBJ_SATELLITECLASS, OBJ_SATELLITE, and OBJ_SATELLITE2.

string GetCockpitName int    a_cockpitid [private]
 

Gets the name of the cockpit a_cockpitid.

int GetCommand   [private]
 

Returns the currently executed command. If a command is finished, COMMAND_NONE is returned.

array GetCommandAndPars   [private]
 

returns an array of format {current command, targettype, target, target2type, target2, para1type, parameter1, para2type, parameter2}

int GetCommandTarget   [private]
 

Return the target (destination) for the current command.

int GetCommandTarget2   [private]
 

Return the second target (destination) for the current command (if the command deserves this).

int GetCurrentRocketType   [private]
 

Returns sh_Rocket.

int GetDefaultFormationTypeFromRace int    a_raceid [private]
 

returns the formation a race prefers

GALOBJ GetDestination   [private]
 

returns sh_Destination

GALOBJ GetEnvironment   [private]
 

See Functions common in every object.

int GetExtraTradeContainerSize   [private]
 

returns sh_ContainerUpgrades

GALOBJ GetFormationLeader   [private]
 

returns sh_FormationLeader

dynarray GetFormationShips   [private]
 

returns sh_FormationShips

int GetFormationType   [private]
 

returns sh_FormationType

int GetFreeShieldBays   [private]
 

returns the number of shield-bays that have no shield installed

int GetGroupRelation int    raceid [private]
 

returns 1 if the given raceId is friendly, -1 if it´s enemie and 0 if neutral

int GetGSize   [private]
 

See Functions common in every object.

Reimplemented in OBJ_SHIP_BIG, and OBJ_SHIP_M6.

int GetGSubType   [private]
 

Differences of in-game objects

int GetGType   [private]
 

Differences of in-game objects

int GetLaser   [private]
 

returns sh_MaxLaser independent of sector or galaxy case

array GetLasers   [private]
 

Returns sh_Lasers
Here´s a little code-snippet.

    array lasers = gship.GetLasers(); // the array is just passed by reference
    int numlasers = SE_ArraySize(lasers); // number of installable lasers
    for (i = 0; i < numlasers; ++i) {
        if (lasers[i] == -1)
            SE_DMprintf(0, "No lasers installed!\n");
        else
            SE_DMprintf(0, "Laser subtype %d installed\n", lasers[i]);
    }

int GetLaserTypeInTurret int    a_turretid,
int    a_slot
[private]
 

returns the laser installed in a turret in a certain slotNr. (>=0) or -1 if empty.

int GetMaxFormationSpeed   [private]
 

returns speed of slowest ship in formation

int GetMaxLaser   [private]
 

returns sh_MaxLaser in the galaxy case

array GetMaxRockets   [private]
 

returns sh_MaxRockets or NULL if the shiptype does not support any installed devices

int GetMaxShield   [private]
 

returns sh_MaxShield

int GetMaxSpeed   [private]
 

returns sh_MaxSpeed

string GetName   [private]
 

See Functions common in every object.

int GetNameID   [private]
 

See Functions common in every object.

int GetNumCockpits   [private]
 

Returns the number of cockpits in this ship.

int GetNumLaserBays   [private]
 

returns sh_NumLaserSlots

int GetNumLasersInTurret int    a_turretid [private]
 

Returns the maximal number of lasers in the turret a_turretid.

int GetNumShieldBays   [private]
 

sets sh_MaxShieldType

int GetNumTurrets   [private]
 

Returns the number of turrets in this ship.

int GetObjectID   [private]
 

Functions common in every object

GALOBJ GetOwner   [private]
 

returns sh_Owner

GALOBJ GetOwnerObject   [private]
 

returns sh_OwnerObject

int GetPilotFace   [private]
 

returns sh_PilotFace

string GetPilotName   [private]
 

returns sh_PilotName

array GetPos   [private]
 

See Functions common in every object.

int GetRelation GALOBJ    otherobj [private]
 

returns 1 if the raceId of the given object is friendly, -1 if it´s enemy and 0 if neutral

int GetShield   [private]
 

returns sh_Shield

array GetShields   [private]
 

Returns sh_Shields . The size of the array is the number of shields the ship can have installed. The function could return NULL if the shiptype does not support any installed devices.

int GetSize   [private]
 

See Functions common in every object.

Reimplemented in OBJ_SHIP_BIG, and OBJ_SHIP_M6.

int GetSpeedLimit   [private]
 

returns sh_SpeedLimit

int GetStrength   [private]
 

Returns approximate strength by adding up current shield and laser level. If not in current sector, lasers are assumed to be fully charged.

int GetSubType   [private]
 

Differences of in-game objects

int GetTotalVolume   [private]
 

returns sh_TotalVolume

int GetTradeContainerFree   [private]
 

free container-volume

int GetTradeContainerSize   [private]
 

returns the maximum size of the trade container in freight bay units

int GetTrueWareTypeCount int    gtype,
int    gsubtype
[private]
 

Get number of units that are truely available as ware (especially for shields and lasers).

int GetTurretLaserMask int    a_turretid [private]
 

returns the lasermask for a turret. The bits of the returnvalue (32) stand for the laser subtypes.

string GetTurretName int    a_turretid [private]
 

Gets the name of the turret a_turretid.

int GetType   [private]
 

Differences of in-game objects

int GetTypeCode   [private]
 

returns typecode of the ship (a ship is also a ware). See Macro Definitions

int GetWantedCount   [private]
 

Returns sh_WantedCount.

int GetWantedFreight   [private]
 

Returns sh_WantedFreight.

int GetWantedFreightPrice   [private]
 

returns sh_WantedFreightPrice

table GetWares   [private]
 

returns sh_Wares

int GetWareTypeContainerSize int    gtype,
int    gsubtype
[private]
 

the maximum number of wares (of the type) that can be stored

string GetYourName   [private]
 

returns sh_Name

void GiveFormationLeadershipTo GALOBJ    a_newleader [private]
 

sets the leader of all formation-ships (of the ship via which this fct. is called) to a_newleader. a_newleader type of OBJ_SHIP or derived class

BOOL HasCockpit   [private]
 

Returns TRUE if the ship has at least one cockpit.

BOOL HasFreight   [private]
 

does the ship carry wares?

BOOL HasIllegalGoods   [private]
 

checks if ship has illegal goods on board depending on it´s actual sector

BOOL InstallLaserInTurret int    gsubtype,
int    turretid,
int    slot
[private]
 

Installs a laser (laser-type given in gsubtype) in a turret. See *_W_LASER subtype constants-definitions for laser defines. Turretid is a number >=1, specifying the turret. slot is zero-based. Returns whether fct. was successfull.

int InstallWare int    gtype,
int    gsubtype,
int    count
[private]
 

Install given ware to the ship. If count<0 the wares are removed.

laser, shields and rockets are added with AddXXXX(), the rest via AddWare()

BOOL IsAttacked   [private]
 

returns if the ship is currently being attacked (regarding sh_LastAttackTime)

int IsClass int    cl [private]
 

Functions common in every object

Reimplemented in OBJ_SHIP_BIG, OBJ_SHIP_CARRIER, OBJ_SHIP_M0, OBJ_SHIP_M1, OBJ_SHIP_M2, OBJ_SHIP_M6, OBJ_SHIP_FIGHTER, OBJ_SHIP_M3, OBJ_SHIP_M4, OBJ_SHIP_M5, OBJ_SHIP_TS, OBJ_SHIP_TP, OBJ_SHIP_TS_PIRATE, OBJ_SHIP_GONER, OBJ_SHIP_UFO, OBJ_SHIP_ASTRONAUT, OBJ_SPACEFLY, OBJ_FIGHTDRONE, OBJ_MINE, OBJ_ORBITALLASER, OBJ_SATELLITECLASS, OBJ_SATELLITE, and OBJ_SATELLITE2.

int IsClassType int    cl [private]
 

The difference to IsClass() is that this fct. only checks the object an not the super-objects. Functions common in every object.

BOOL IsControllable   [private]
 

Checks if the ship is controllable (in case the player is in another sector). To do that, the fct. checks through all ships in the ship´s sector whether there is a satellite that is owned by the player. You can use OBJ_CLIENT.CanSeeObject(gobj) instead.

GALOBJ IsDocked   [private]
 

Returns sh_Environment if ship is docked or 0 if in space.

Reimplemented in OBJ_SHIP_BIG.

BOOL IsDockingPossibleOf GALOBJ    a_ship [private]
 

can a ship dock at this ship?

Reimplemented in OBJ_SHIP_CARRIER, and OBJ_SHIP_M6.

int IsHidden GALOBJ    srcobj [private]
 

Check if this object is hidden either by a nebula or using a cloaking device.

int IsHired   [private]
 

returns sh_Hired

int IsInFollowMode   [private]
 

returns sh_FollowMode

BOOL IsInHomeSector   [private]
 

returns whether if ship is not in homesector

BOOL IsPlayerShip   [private]
 

returns sh_IsPlayer

int IsPlayerWingMen   [private]
 

returns sh_IsPlayerWingMen

void KilledBy int    reason,
SECOBID    skiller,
SECOBID    sother
[private]
 

See Functions common in every object.

Reimplemented in OBJ_SHIP_CARRIER, OBJ_SHIP_M0, OBJ_SPACEFLY, OBJ_MINE, and OBJ_ORBITALLASER.

void KilledInEnvironment   [private]
 

this function is used when the ship should be destroyed without a explosion

Reimplemented in OBJ_SHIP_CARRIER.

int LoadWare int    a_ware,
int    a_amount
[private]
 

load a ware from a carrier or station (ship must be in these environments)

void MakeBreak   [private]
 

As Stop(), stops a currently running synchronous SA_ system call (by calling SA_StopObject()) but return SACMDFINISH_BREAK.

void RemoveAllFormationShips   [private]
 

removes the formation leader of all ships in sh_FormationShips and clears sh_FormationShips.

void RemoveFormationShip GALOBJ    a_ship [private]
 

removes the given ship from sh_FormationShips

void RemoveFromFormation   [private]
 

removes ship from formation

int RemoveLaser int    gsubtype,
int    count
[private]
 

removes laser

int RemoveRocket int    gsubtype,
int    count
[private]
 

removes rocket

int RemoveShield int    gsubtype,
int    count
[private]
 

removes shield

void ReorgFormation int    a_removedidx [private]
 

sets the formation of the ships as specified in sh_FormationType. a_removedidx if >=0 the last ship (in sh_FormationShips) gets removed and inserted on the position specified in this parameter

GALOBJ SelectNewFormationLeader int    a_flag [private]
 

find a leader wich meets the requirements specified in parameter a_flag. a_flag can be SHIP_NEWLEADER_BY_CLASS, SHIP_NEWLEADER_BY_STRENGTH or SHIP_NEWLEADER_BY_SPEED returns the new leader

void SelfDestruct int    reason [private]
 

See Functions common in every object.

Reimplemented in OBJ_SHIP_CARRIER, OBJ_SPACEFLY, OBJ_MINE, OBJ_ORBITALLASER, and OBJ_SATELLITECLASS.

int SellWare int    a_ware,
int    a_amount
[private]
 

sell a ware to a station (ship must be in these environments)

void SetAsPlayerShip BOOL    yesno [private]
 

sets this ship as the player´s ship in the sector engine.

GALOBJ SetAttacker GALOBJ    att [private]
 

set sh_Attacker

void SetAttackTarget GALOBJ    a_dest [private]
 

sets sh_AttackTarget

int SetCurrentRocketType int    gsubtype [private]
 

select the given rockettype as actual see *_W_ROCKET subtype constants-definitions

void SetDestination GALOBJ    a_dest [private]
 

sets sh_Destination

void SetEnvironment GALOBJ    env [private]
 

See Functions common in every object.

void SetExtraTradeContainerSize int    newsize [private]
 

sets sh_ContainerUpgrades

void SetFollowMode BOOL    a_on [private]
 

sets sh_FollowMode

void SetFormationLeader GALOBJ    a_fl [private]
 

sets sh_FormationLeader

void SetFormationType int    a_ft [private]
 

sets the type of the formation Shipformations

void SetGroupRelation int    raceid,
int    relation
[private]
 

sets relation between this ship and the given raceid as specified in "relation". relation 1 means friendly, -1 means enemy, 0 means neutral

void SetHired BOOL    a_yes [private]
 

sets sh_Hired

int SetMaxShieldType int    st [private]
 

returns sh_MaxShieldType

void SetOwner GALOBJ    owner [private]
 

See Functions common in every object.

void SetOwnerObject GALOBJ    ownerobj [private]
 

sets sh_OwnerObject . This function sets the owner object of a ship.

void SetPilotFace int    a_face [private]
 

sets sh_PilotFace

void SetPilotID int    a_id [private]
 

sets sh_PilotID

void SetPilotName string    a_name [private]
 

set sh_PilotName

void SetPlayerWingMen int    a_set [private]
 

set sh_IsPlayerWingMen to TRUE/FALSE

void SetPos int    x,
int    y,
int    z
[private]
 

set the position of the ship regardless if in actual sector or not. Useful settings for each coordinate range from -10000*STPOS_SHIP to 10000*STPOS_SHIP. Gates are placed at 12000*STPOS_SHIP.

void SetRelation GALOBJ    otherobj,
int    relation
[private]
 

sets the relation between the race (given in GALOBJ) and this shíp as specified in "relation"
For parameter otherobj see documentation of ga_Races[] in Global Functions
relation 1 means friendly, -1 means enemy, 0 means neutral

void SetRelationsFromNotoriety   [private]
 

The objects relation mask is updated based on the notoriets from the ship´s owner towards all races!

Reimplemented in OBJ_SHIP_CARRIER.

int SetRelationsToAll int    relation [private]
 

sets relations between this ship´s owner and all other races as specified in "relation" relation 1 means friendly, -1 means enemy, 0 means neutral

void SetRot int    alpha,
int    beta,
int    gamma
[private]
 

sets the rotation of the ship if the ship is in active sector. Useful values for alpha and gamma range from 0 to 0xffff, and for beta from -0x4000 to 0x4000.

void SetSafePos   [private]
 

moves the ship to a save position. Checks for possible collisions with other objects and changes the coordinates if necessary.

int SetShield int    newshield [private]
 

sets sh_Shield

void SetWantedFreight int    gtypecode [private]
 

Sets the type of a ware (TYPECODE(maintype,subtype)) that the ship should load when it docks at a station specified with COMMAND_GET_WARE and similar. Macro Definitions

void SetYourName string    a_name [private]
 

set sh_Name

void StartAction   [private]
 

StartAction defines which command is the default. Here it is COMMAND_NONE.

Reimplemented in OBJ_SHIP_M0, OBJ_SHIP_M1, OBJ_SHIP_M2, OBJ_SHIP_M6, OBJ_SHIP_FIGHTER, OBJ_SHIP_TS, OBJ_SHIP_GONER, OBJ_SHIP_UFO, OBJ_SHIP_ASTRONAUT, OBJ_SPACEFLY, OBJ_FIGHTDRONE, OBJ_MINE, OBJ_ORBITALLASER, and OBJ_SATELLITECLASS.

void StartExecuteCommand int    command,
GALOBJ    gtarget
[private]
 

Starts execution of certain COMMAND. This function is safe to use at any time. The ship will stop the currently executing COMMAND, if any, and start executing the new command. The function returns immediately. See Commands

void StartExecuteCommand2 int    command,
GALOBJ    gtarget,
GALOBJ    gtarget2
[private]
 

For commands that need 2 parameters. See also StartExecuteCommand().

void StartFollowLeader GALOBJ    gleader [private]
 

Ths ship starts to follow another ship (the leader). This even works when the leader flies to another sector. The ship will stay in this mode until the leader is destroyed.

void StartKill GALOBJ    genemy [private]
 

Sends the ship on a mission to kill a specific target. This is asynchronous, the function immediately returns.

void StartKillAllEnemies   [private]
 

The ship is sent to an infinite mission to kill any enemy ships. This is the asynchronous version. (asynchronous).

void StartKillAllEnemiesAndLand GALOBJ    ghangar [private]
 

Kill any enemies in the sector and return to the hangar if no enemies are left. (asynchronous).

void StartKillAndLand GALOBJ    genemy,
GALOBJ    ghangar
[private]
 

Sends the ship on a mission to kill a specific target. Once the target is killed, check for any other enemy targets to kill. If no enemy can be found, return to hangar. This is asynchronous, the function immediately returns.

void StartKillPreferred GALOBJ    genemy [private]
 

Kill one ship, then if it is gone, kill all other enemies (asynchronous).

void StartTransferToHangar GALOBJ    gfrom,
GALOBJ    ghangar
[private]
 

The ship starts from Hangar gfrom, flies to the sector of destination hangar ghangar and lands there. Just starts a COMMAND_MOVE_STATION to ghangar. (async)

void Stop   [private]
 

Stops a currently running synchronous SA_ system call (by calling SA_StopObject()) and return SACMDFINISH_STOPPED.

int StopAction   [private]
 

same as StopCommand

int StopCommand   [private]
 

Terminates any current activity of the ship. The current task (and COMMAND) is stopped and the ship will wait with speed = 0.

void TradeMoney int    amount [private]
 

adds money to the ship-owner

int TradeWare int    gtype,
int    gsubtype,
int    count
[private]
 

same as AddWare()

int UnLoadWare int    a_ware,
int    a_amount
[private]
 

unload a ware to a carrier or station (ship must be in these environments)


Member Data Documentation

int sh_Action [private]
 

Currently executed Action Actions.

GALOBJ sh_ActionTarget [private]
 

the partner-object involved in certain commands (e.g COMMAND_ATTACK)

GALOBJ sh_Attacker [private]
 

last attacker

GALOBJ sh_AttackTarget [private]
 

the target of a ship, set by scripts

int sh_CommandTarget [private]
 

primary target or current commant

int sh_CommandTarget2 [private]
 

secondary target (for combined commands)

int sh_CommandTarget2Type [private]
 

script type for secondary target

int sh_CommandTargetType [private]
 

script type for primary target

int sh_ContainerUpgrades [private]
 

number of container-upgrades

GALOBJ sh_Destination [private]
 

the destination of a ship, set by scripts

int sh_FireMissileLastTime [private]
 

in seconds (set from OBJ_PLAYER.GetAge()) !

int sh_FireMissileProb [private]
 

probability when to fire a missile, 0 to 100 %

int sh_FireMissileTimeDiff [private]
 

in seconds

GALOBJ sh_FormationLeader [private]
 

handle to the formation-leader ship

dynarray sh_FormationShips [private]
 

ships that are in formation, too

int sh_FormationType [private]
 

actual type of the formation Shipformations

int sh_GSubType [private]
 

Galaxy Sub-Type (SG_SH_XX).

int sh_Hull [private]
 

current hull strength

array sh_Lasers [private]
 

currently installed lasers. The size of the array is the number of lasers the ship can have installed. The function could return NULL if the shiptype does not support any installed devices.

int sh_LastAttackTime [private]
 

time of last unfriedly-action (attack)

int sh_MaxLaser [private]
 

summarized laserstrength of currently installed lasers

array sh_MaxRockets [private]
 

number of maximum reloadable rockets (from editor)

int sh_MaxShield [private]
 

summarized shieldstrength of currently installed shields

int sh_MaxShieldType [private]
 

max. useable Shield subtype

string sh_Name [private]
 

Name of the ship.

int sh_NumLaserSlots [private]
 

how many lasers can be installed in this ship?

int sh_NumShieldSlots [private]
 

how many shields can be installed in this ship?

GALOBJ sh_OwnerObject [private]
 

can be a Dock, Factory... It is also the home base for that ship (but not the race-obj). Setting to NULL is ok, the ship is then homeless.

int sh_PilotFace [private]
 

a face id which is used for the speaker.

int sh_PilotID [private]
 

number of pilot (for communication); depends on race of pilot (only needed for pirates)

string sh_PilotName [private]
 

derived from the object ID and sort of random

int sh_Rocket [private]
 

currently installed rocket (see *_W_ROCKET subtype constants-definitions)

int sh_Shield [private]
 

actual shield strength (in galaxy case)

array sh_Shields [private]
 

array of currently installed shields (see DefSh)

int sh_SpeedLimit [private]
 

the speed of the slowest ship in formation

int sh_SubType [private]
 

Sector Sub-Type (SS_SH_XX), determines the body (polygon model) used for this ship when it is visible (=in current sector).

int sh_TotalVolume [private]
 

number of used up cargo bay units

int sh_WantedCount [private]
 

the amount of the ware that the ship should load when it docks at a station (specified with COMMAND_GET_WARE)

int sh_WantedFreight [private]
 

the type of ware that the ship should load when it docks at a station (specified with COMMAND_GET_WARE)

int sh_WantedFreightPrice [private]
 

the price of the ware that the ship should load when it docks at a station (specified with COMMAND_GET_WARE)

table sh_Wares [private]
 

loaded ware (amount), including laser, shields and rockets in container; format: {TYPECODE(gtype, gsubtype),amount}, see also Macro Definitions


Generated on Mon Aug 26 18:26:30 2002 for X² KC by doxygen1.2.17