本文整理汇总了C++中GetElementStarShip函数的典型用法代码示例。如果您正苦于以下问题:C++ GetElementStarShip函数的具体用法?C++ GetElementStarShip怎么用?C++ GetElementStarShip使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetElementStarShip函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: syreen_intelligence
static void
syreen_intelligence (ELEMENT *ShipPtr, EVALUATE_DESC *ObjectsOfConcern,
COUNT ConcernCounter)
{
EVALUATE_DESC *lpEvalDesc;
ship_intelligence (ShipPtr,
ObjectsOfConcern, ConcernCounter);
lpEvalDesc = &ObjectsOfConcern[ENEMY_SHIP_INDEX];
if (lpEvalDesc->ObjectPtr != NULL)
{
STARSHIP *StarShipPtr;
STARSHIP *EnemyStarShipPtr;
GetElementStarShip (ShipPtr, &StarShipPtr);
GetElementStarShip (lpEvalDesc->ObjectPtr, &EnemyStarShipPtr);
if (!(EnemyStarShipPtr->RaceDescPtr->ship_info.ship_flags & CREW_IMMUNE)
&& StarShipPtr->special_counter == 0
&& lpEvalDesc->ObjectPtr->crew_level > 1
&& lpEvalDesc->which_turn <= 14)
StarShipPtr->ship_input_state |= SPECIAL;
else
StarShipPtr->ship_input_state &= ~SPECIAL;
}
}
示例2: arilou_intelligence
static void
arilou_intelligence (ELEMENT *ShipPtr, EVALUATE_DESC *ObjectsOfConcern,
COUNT ConcernCounter)
{
STARSHIP *StarShipPtr;
GetElementStarShip (ShipPtr, &StarShipPtr);
StarShipPtr->ship_input_state |= THRUST;
ObjectsOfConcern[ENEMY_SHIP_INDEX].MoveState = ENTICE;
ship_intelligence (ShipPtr, ObjectsOfConcern, ConcernCounter);
if (StarShipPtr->special_counter == 0)
{
EVALUATE_DESC *lpEvalDesc;
StarShipPtr->ship_input_state &= ~SPECIAL;
lpEvalDesc = &ObjectsOfConcern[ENEMY_WEAPON_INDEX];
if (lpEvalDesc->ObjectPtr && lpEvalDesc->which_turn <= 6)
{
BOOLEAN IsTrackingWeapon;
STARSHIP *EnemyStarShipPtr;
GetElementStarShip (lpEvalDesc->ObjectPtr, &EnemyStarShipPtr);
if (((EnemyStarShipPtr->RaceDescPtr->ship_info.ship_flags
& SEEKING_WEAPON) &&
lpEvalDesc->ObjectPtr->next.image.farray ==
EnemyStarShipPtr->RaceDescPtr->ship_data.weapon) ||
((EnemyStarShipPtr->RaceDescPtr->ship_info.ship_flags
& SEEKING_SPECIAL) &&
lpEvalDesc->ObjectPtr->next.image.farray ==
EnemyStarShipPtr->RaceDescPtr->ship_data.special))
IsTrackingWeapon = TRUE;
else
IsTrackingWeapon = FALSE;
// JMS: Added the GASSY_SUBSTANCE clauses to prevent 'long teleport' if Baul gas is sticking to the Arilou ship.
if (((lpEvalDesc->ObjectPtr->state_flags & PLAYER_SHIP) /* means IMMEDIATE WEAPON */
|| (IsTrackingWeapon && (lpEvalDesc->which_turn == 1
|| (lpEvalDesc->ObjectPtr->state_flags & CREW_OBJECT))) /* FIGHTERS!!! */
|| (PlotIntercept (lpEvalDesc->ObjectPtr, ShipPtr, 3, 0)
&& (!(lpEvalDesc->ObjectPtr->state_flags & GASSY_SUBSTANCE) // Ignore stuck gas
|| (lpEvalDesc->ObjectPtr->state_flags & GASSY_SUBSTANCE && EnemyStarShipPtr->ship_input_state & WEAPON
&& ObjectsOfConcern[ENEMY_SHIP_INDEX].which_turn <= 20) // If sticking to gas, teleport when Baul is near&firing primary
|| (lpEvalDesc->ObjectPtr->state_flags & GASSY_SUBSTANCE && lpEvalDesc->ObjectPtr->state_flags & IGNORE_VELOCITY))) // non-stuck gas
)
&& !(TFB_Random () & 3))
{
StarShipPtr->ship_input_state &= ~(LEFT | RIGHT | THRUST | WEAPON);
StarShipPtr->ship_input_state |= SPECIAL;
}
}
}
if (StarShipPtr->RaceDescPtr->ship_info.energy_level <= SPECIAL_ENERGY_COST << 1)
StarShipPtr->ship_input_state &= ~WEAPON;
}
示例3: druuge_intelligence
static void
druuge_intelligence (ELEMENT *ShipPtr, EVALUATE_DESC *ObjectsOfConcern,
COUNT ConcernCounter)
{
UWORD ship_flags;
STARSHIP *StarShipPtr;
STARSHIP *EnemyStarShipPtr;
EVALUATE_DESC *lpEvalDesc;
GetElementStarShip (ShipPtr, &StarShipPtr);
ship_flags = 0;
lpEvalDesc = &ObjectsOfConcern[ENEMY_SHIP_INDEX];
if (StarShipPtr->cur_status_flags & SHIP_BEYOND_MAX_SPEED)
lpEvalDesc->MoveState = ENTICE;
else if (lpEvalDesc->ObjectPtr
&& lpEvalDesc->which_turn <= WORLD_TO_TURN (MISSILE_RANGE * 3 / 4))
{
GetElementStarShip (lpEvalDesc->ObjectPtr, &EnemyStarShipPtr);
ship_flags = EnemyStarShipPtr->RaceDescPtr->ship_info.ship_flags;
EnemyStarShipPtr->RaceDescPtr->ship_info.ship_flags &=
~(FIRES_FORE | FIRES_RIGHT | FIRES_AFT | FIRES_LEFT);
lpEvalDesc->MoveState = PURSUE;
if (ShipPtr->thrust_wait == 0)
++ShipPtr->thrust_wait;
}
ship_intelligence (ShipPtr, ObjectsOfConcern, ConcernCounter);
if (ship_flags)
{
EnemyStarShipPtr->RaceDescPtr->ship_info.ship_flags = ship_flags;
}
if (!(StarShipPtr->cur_status_flags & SHIP_BEYOND_MAX_SPEED)
&& (lpEvalDesc->which_turn <= 12
|| (
ObjectsOfConcern[ENEMY_WEAPON_INDEX].ObjectPtr
&& ObjectsOfConcern[ENEMY_WEAPON_INDEX].which_turn <= 6
)))
{
StarShipPtr->ship_input_state |= WEAPON;
if (ShipPtr->thrust_wait < WEAPON_WAIT + 1)
ShipPtr->thrust_wait = WEAPON_WAIT + 1;
}
if ((StarShipPtr->ship_input_state & WEAPON)
&& StarShipPtr->RaceDescPtr->ship_info.energy_level < WEAPON_ENERGY_COST
&& ShipPtr->crew_level > 1)
StarShipPtr->ship_input_state |= SPECIAL;
else
StarShipPtr->ship_input_state &= ~SPECIAL;
}
示例4: arilou_intelligence
static void
arilou_intelligence (ELEMENT *ShipPtr, EVALUATE_DESC *ObjectsOfConcern,
COUNT ConcernCounter)
{
STARSHIP *StarShipPtr;
GetElementStarShip (ShipPtr, &StarShipPtr);
StarShipPtr->ship_input_state |= THRUST;
ObjectsOfConcern[ENEMY_SHIP_INDEX].MoveState = ENTICE;
ship_intelligence (ShipPtr, ObjectsOfConcern, ConcernCounter);
if (StarShipPtr->special_counter == 0)
{
EVALUATE_DESC *lpEvalDesc;
StarShipPtr->ship_input_state &= ~SPECIAL;
lpEvalDesc = &ObjectsOfConcern[ENEMY_WEAPON_INDEX];
if (lpEvalDesc->ObjectPtr && lpEvalDesc->which_turn <= 6)
{
BOOLEAN IsTrackingWeapon;
STARSHIP *EnemyStarShipPtr;
GetElementStarShip (lpEvalDesc->ObjectPtr, &EnemyStarShipPtr);
if (((EnemyStarShipPtr->RaceDescPtr->ship_info.ship_flags
& SEEKING_WEAPON) &&
lpEvalDesc->ObjectPtr->next.image.farray ==
EnemyStarShipPtr->RaceDescPtr->ship_data.weapon) ||
((EnemyStarShipPtr->RaceDescPtr->ship_info.ship_flags
& SEEKING_SPECIAL) &&
lpEvalDesc->ObjectPtr->next.image.farray ==
EnemyStarShipPtr->RaceDescPtr->ship_data.special))
IsTrackingWeapon = TRUE;
else
IsTrackingWeapon = FALSE;
if (((lpEvalDesc->ObjectPtr->state_flags & PLAYER_SHIP) /* means IMMEDIATE WEAPON */
|| (IsTrackingWeapon && (lpEvalDesc->which_turn == 1
|| (lpEvalDesc->ObjectPtr->state_flags & CREW_OBJECT))) /* FIGHTERS!!! */
|| PlotIntercept (lpEvalDesc->ObjectPtr, ShipPtr, 3, 0))
&& !(TFB_Random () & 3))
{
StarShipPtr->ship_input_state &= ~(LEFT | RIGHT | THRUST | WEAPON);
StarShipPtr->ship_input_state |= SPECIAL;
}
}
}
if (StarShipPtr->RaceDescPtr->ship_info.energy_level <= SPECIAL_ENERGY_COST << 1)
StarShipPtr->ship_input_state &= ~WEAPON;
}
示例5: pkunk_postprocess
static void
pkunk_postprocess (ELEMENT *ElementPtr)
{
STARSHIP *StarShipPtr;
GetElementStarShip (ElementPtr, &StarShipPtr);
if (StarShipPtr->RaceDescPtr->characteristics.special_wait)
--StarShipPtr->RaceDescPtr->characteristics.special_wait;
else if ((StarShipPtr->cur_status_flags & SPECIAL)
&& StarShipPtr->RaceDescPtr->ship_info.energy_level <
StarShipPtr->RaceDescPtr->ship_info.max_energy)
{
COUNT CurSound;
do
{
CurSound =
2 + ((COUNT)TFB_Random ()
% (GetSoundCount (StarShipPtr->RaceDescPtr->ship_data.ship_sounds) - 2));
} while (CurSound == LastSound);
ProcessSound (SetAbsSoundIndex (
StarShipPtr->RaceDescPtr->ship_data.ship_sounds, CurSound
), ElementPtr);
LastSound = CurSound;
DeltaEnergy (ElementPtr, SPECIAL_ENERGY_COST);
StarShipPtr->RaceDescPtr->characteristics.special_wait = SPECIAL_WAIT;
}
}
示例6: intercept_pkunk_death
static void
intercept_pkunk_death (ELEMENT *ElementPtr)
{
STARSHIP *StarShipPtr;
ElementPtr->state_flags &= ~DISAPPEARING;
ElementPtr->life_span = 1;
GetElementStarShip (ElementPtr, &StarShipPtr);
if (StarShipPtr->RaceDescPtr->ship_info.crew_level == 0)
{
ELEMENT *ShipPtr;
LockElement (StarShipPtr->hShip, &ShipPtr);
if (GRAVITY_MASS (ShipPtr->mass_points + 1))
{
ElementPtr->state_flags |= DISAPPEARING;
ElementPtr->life_span = 0;
}
else
{
ShipPtr->mass_points = MAX_SHIP_MASS + 1;
StarShipPtr->RaceDescPtr->preprocess_func = ShipPtr->preprocess_func;
StarShipPtr->RaceDescPtr->postprocess_func = ShipPtr->postprocess_func;
StarShipPtr->RaceDescPtr->init_weapon_func =
(COUNT (*) (ELEMENT *ElementPtr, HELEMENT Weapon[]))
ShipPtr->death_func;
ElementPtr->death_func = new_pkunk;
}
UnlockElement (StarShipPtr->hShip);
}
}
示例7: pkunk_intelligence
static void
pkunk_intelligence (ELEMENT *ShipPtr, EVALUATE_DESC *ObjectsOfConcern,
COUNT ConcernCounter)
{
STARSHIP *StarShipPtr;
HELEMENT hPhoenix;
GetElementStarShip (ShipPtr, &StarShipPtr);
hPhoenix = (HELEMENT) StarShipPtr->RaceDescPtr->data;
if (hPhoenix && (StarShipPtr->control & STANDARD_RATING))
{
RemoveElement (hPhoenix);
FreeElement (hPhoenix);
StarShipPtr->RaceDescPtr->data = 0;
}
if (StarShipPtr->RaceDescPtr->ship_info.energy_level <
StarShipPtr->RaceDescPtr->ship_info.max_energy
&& (StarShipPtr->special_counter == 0
|| (BYTE)TFB_Random () < 20))
StarShipPtr->ship_input_state |= SPECIAL;
else
StarShipPtr->ship_input_state &= ~SPECIAL;
ship_intelligence (ShipPtr, ObjectsOfConcern, ConcernCounter);
}
示例8: initialize_test_pump_up
static COUNT
initialize_test_pump_up (ELEMENT *ShipPtr, HELEMENT PumpUpArray[])
{
STARSHIP *StarShipPtr;
MISSILE_BLOCK MissileBlock;
//ELEMENT *PumpUpPtr;
GetElementStarShip (ShipPtr, &StarShipPtr);
MissileBlock.cx = ShipPtr->next.location.x;
MissileBlock.cy = ShipPtr->next.location.y;
MissileBlock.farray = StarShipPtr->RaceDescPtr->ship_data.weapon;
MissileBlock.face = StarShipPtr->ShipFacing;
MissileBlock.index = 0;
MissileBlock.sender = ShipPtr->playerNr;
MissileBlock.flags = IGNORE_SIMILAR;
MissileBlock.pixoffs = MELNORME_OFFSET;
MissileBlock.speed = RES_SCALE(PUMPUP_SPEED);
MissileBlock.hit_points = PUMPUP_DAMAGE;
MissileBlock.damage = PUMPUP_DAMAGE;
MissileBlock.life = PUMPUP_LIFE;
MissileBlock.preprocess_func = 0;
MissileBlock.blast_offs = 0;
PumpUpArray[0] = initialize_missile (&MissileBlock);
return (1);
}
示例9: initialize_confusion
static COUNT
initialize_confusion (ELEMENT *ShipPtr, HELEMENT ConfusionArray[])
{
STARSHIP *StarShipPtr;
MISSILE_BLOCK ConfusionBlock;
GetElementStarShip (ShipPtr, &StarShipPtr);
ConfusionBlock.cx = ShipPtr->next.location.x;
ConfusionBlock.cy = ShipPtr->next.location.y;
ConfusionBlock.farray = StarShipPtr->RaceDescPtr->ship_data.special;
ConfusionBlock.index = 0;
ConfusionBlock.face = StarShipPtr->ShipFacing;
ConfusionBlock.sender = ShipPtr->playerNr;
ConfusionBlock.flags = IGNORE_SIMILAR;
ConfusionBlock.pixoffs = MELNORME_OFFSET;
ConfusionBlock.speed = CMISSILE_SPEED;
ConfusionBlock.hit_points = CMISSILE_HITS;
ConfusionBlock.damage = CMISSILE_DAMAGE;
ConfusionBlock.life = CMISSILE_LIFE;
ConfusionBlock.preprocess_func = confuse_preprocess;
ConfusionBlock.blast_offs = CMISSILE_OFFSET;
ConfusionArray[0] = initialize_missile (&ConfusionBlock);
if (ConfusionArray[0])
{
ELEMENT *CMissilePtr;
LockElement (ConfusionArray[0], &CMissilePtr);
CMissilePtr->collision_func = confusion_collision;
SetElementStarShip (CMissilePtr, StarShipPtr);
UnlockElement (ConfusionArray[0]);
}
return (1);
}
示例10: druuge_preprocess
static void
druuge_preprocess (ELEMENT *ElementPtr)
{
STARSHIP *StarShipPtr;
GetElementStarShip (ElementPtr, &StarShipPtr);
if (StarShipPtr->cur_status_flags & SPECIAL)
{
if (StarShipPtr->special_counter
|| ElementPtr->crew_level == 1
|| StarShipPtr->RaceDescPtr->ship_info.energy_level
== StarShipPtr->RaceDescPtr->ship_info.max_energy)
StarShipPtr->cur_status_flags &= ~SPECIAL;
else
{
ProcessSound (SetAbsSoundIndex (
/* BURN UP CREW */
StarShipPtr->RaceDescPtr->ship_data.ship_sounds, 1), ElementPtr);
DeltaCrew (ElementPtr, -1);
DeltaEnergy (ElementPtr, SPECIAL_ENERGY_COST);
StarShipPtr->special_counter =
StarShipPtr->RaceDescPtr->characteristics.special_wait;
}
}
}
示例11: human_intelligence
static void
human_intelligence (ELEMENT *ShipPtr, EVALUATE_DESC *ObjectsOfConcern,
COUNT ConcernCounter)
{
STARSHIP *StarShipPtr;
GetElementStarShip (ShipPtr, &StarShipPtr);
if (StarShipPtr->special_counter == 0
&& ((ObjectsOfConcern[ENEMY_WEAPON_INDEX].ObjectPtr != NULL
&& ObjectsOfConcern[ENEMY_WEAPON_INDEX].which_turn <= 2)
|| (ObjectsOfConcern[ENEMY_SHIP_INDEX].ObjectPtr != NULL
&& ObjectsOfConcern[ENEMY_SHIP_INDEX].which_turn <= 4)))
StarShipPtr->ship_input_state |= SPECIAL;
else
StarShipPtr->ship_input_state &= ~SPECIAL;
ObjectsOfConcern[ENEMY_WEAPON_INDEX].ObjectPtr = NULL;
ship_intelligence (ShipPtr,
ObjectsOfConcern, ConcernCounter);
if (StarShipPtr->weapon_counter == 0)
{
if (ObjectsOfConcern[ENEMY_SHIP_INDEX].ObjectPtr
&& (!(StarShipPtr->ship_input_state & (LEFT | RIGHT /* | THRUST */))
|| ObjectsOfConcern[ENEMY_SHIP_INDEX].which_turn <= 12))
StarShipPtr->ship_input_state |= WEAPON;
}
}
示例12: melnorme_postprocess
static void
melnorme_postprocess (ELEMENT *ElementPtr)
{
STARSHIP *StarShipPtr;
GetElementStarShip (ElementPtr, &StarShipPtr);
if ((StarShipPtr->cur_status_flags & SPECIAL)
&& StarShipPtr->special_counter == 0
&& DeltaEnergy (ElementPtr, -SPECIAL_ENERGY_COST))
{
HELEMENT Confusion;
initialize_confusion (ElementPtr, &Confusion);
if (Confusion)
{
ELEMENT *CMissilePtr;
LockElement (Confusion, &CMissilePtr);
ProcessSound (SetAbsSoundIndex (
StarShipPtr->RaceDescPtr->ship_data.ship_sounds, 1), CMissilePtr);
UnlockElement (Confusion);
PutElement (Confusion);
StarShipPtr->special_counter =
StarShipPtr->RaceDescPtr->characteristics.special_wait;
}
}
}
示例13: findPlayerShip
// playerNr should be 0 or 1
STARSHIP*
findPlayerShip (SIZE playerNr)
{
HELEMENT hElement, hNextElement;
for (hElement = GetHeadElement (); hElement; hElement = hNextElement)
{
ELEMENT *ElementPtr;
LockElement (hElement, &ElementPtr);
hNextElement = GetSuccElement (ElementPtr);
if ((ElementPtr->state_flags & PLAYER_SHIP) &&
ElementPtr->playerNr == playerNr)
{
STARSHIP *StarShipPtr;
GetElementStarShip (ElementPtr, &StarShipPtr);
UnlockElement (hElement);
return StarShipPtr;
}
UnlockElement (hElement);
}
return NULL;
}
示例14: baul_preprocess
static void
baul_preprocess (ELEMENT *ElementPtr)
{
STARSHIP *StarShipPtr;
GetElementStarShip (ElementPtr, &StarShipPtr);
}
示例15: spin_preprocess
static void
spin_preprocess (ELEMENT *ElementPtr)
{
ELEMENT *ShipPtr;
STARSHIP *StarShipPtr;
GetElementStarShip (ElementPtr, &StarShipPtr);
LockElement (StarShipPtr->hShip, &ShipPtr);
if (ShipPtr->crew_level && ++StarShipPtr->RaceDescPtr->characteristics.special_wait > MAX_SAWS)
{
ElementPtr->life_span = 1;
ElementPtr->state_flags |= DISAPPEARING;
}
else
{
++ElementPtr->life_span;
if (ElementPtr->turn_wait)
--ElementPtr->turn_wait;
else
{
#define LAST_SPIN_INDEX 1
if (GetFrameIndex (ElementPtr->current.image.frame) < LAST_SPIN_INDEX)
ElementPtr->next.image.frame = IncFrameIndex (ElementPtr->current.image.frame);
else
ElementPtr->next.image.frame = SetAbsFrameIndex (ElementPtr->current.image.frame, 0);
ElementPtr->state_flags |= CHANGING;
ElementPtr->turn_wait = SAW_RATE;
}
}
UnlockElement (StarShipPtr->hShip);
}