Cleanups, comments.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2747 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
Meep-Eep
2007-05-04 22:10:34 +00:00
parent 1f9a38ea65
commit bad03fbd62
+26 -17
View File
@@ -316,12 +316,12 @@ shofixti_intelligence (ELEMENT *ShipPtr, EVALUATE_DESC *ObjectsOfConcern,
{
STARSHIP *StarShipPtr;
ship_intelligence (ShipPtr,
ObjectsOfConcern, ConcernCounter);
ship_intelligence (ShipPtr, ObjectsOfConcern, ConcernCounter);
GetElementStarShip (ShipPtr, &StarShipPtr);
if (StarShipPtr->special_counter == 0)
{
if (StarShipPtr->special_counter != 0)
return;
if (StarShipPtr->ship_input_state & SPECIAL)
StarShipPtr->ship_input_state &= ~SPECIAL;
else
@@ -332,8 +332,10 @@ shofixti_intelligence (ELEMENT *ShipPtr, EVALUATE_DESC *ObjectsOfConcern,
lpWeaponEvalDesc = &ObjectsOfConcern[ENEMY_WEAPON_INDEX];
lpShipEvalDesc = &ObjectsOfConcern[ENEMY_SHIP_INDEX];
if (StarShipPtr->RaceDescPtr->ship_data.special[0]
&& (GetFrameCount (StarShipPtr->RaceDescPtr->ship_data.captain_control.special)
- GetFrameIndex (StarShipPtr->RaceDescPtr->ship_data.captain_control.special) > 5
&& (GetFrameCount (StarShipPtr->RaceDescPtr->ship_data.
captain_control.special)
- GetFrameIndex (StarShipPtr->RaceDescPtr->ship_data.
captain_control.special) > 5
|| (lpShipEvalDesc->ObjectPtr != NULL
&& lpShipEvalDesc->which_turn <= 4)
|| (lpWeaponEvalDesc->ObjectPtr != NULL
@@ -341,11 +343,11 @@ shofixti_intelligence (ELEMENT *ShipPtr, EVALUATE_DESC *ObjectsOfConcern,
&& (((lpWeaponEvalDesc->ObjectPtr->state_flags & PLAYER_SHIP)
&& ShipPtr->crew_level == 1)
|| (PlotIntercept (lpWeaponEvalDesc->ObjectPtr, ShipPtr, 2, 0)
&& lpWeaponEvalDesc->ObjectPtr->mass_points >= ShipPtr->crew_level
&& lpWeaponEvalDesc->ObjectPtr->mass_points >=
ShipPtr->crew_level
&& (TFB_Random () & 1))))))
StarShipPtr->ship_input_state |= SPECIAL;
}
}
}
static void
@@ -358,9 +360,12 @@ shofixti_postprocess (ELEMENT *ElementPtr)
^ StarShipPtr->old_status_flags) & SPECIAL)
{
StarShipPtr->RaceDescPtr->ship_data.captain_control.special =
IncFrameIndex (StarShipPtr->RaceDescPtr->ship_data.captain_control.special);
if (GetFrameCount (StarShipPtr->RaceDescPtr->ship_data.captain_control.special)
- GetFrameIndex (StarShipPtr->RaceDescPtr->ship_data.captain_control.special) == 3)
IncFrameIndex (StarShipPtr->RaceDescPtr->ship_data.
captain_control.special);
if (GetFrameCount (StarShipPtr->RaceDescPtr->ship_data.
captain_control.special)
- GetFrameIndex (StarShipPtr->RaceDescPtr->ship_data.
captain_control.special) == 3)
self_destruct (ElementPtr);
}
}
@@ -380,21 +385,23 @@ init_shofixti (void)
if (LOBYTE (GLOBAL (CurrentActivity)) == IN_ENCOUNTER
&& !GET_GAME_STATE (SHOFIXTI_RECRUITED))
{
// Tanaka/Katana flies in a damaged ship.
#define NUM_LIMPETS 3
COUNT i;
new_shofixti_desc.ship_data.ship[0] = (FRAME)OLDSHOF_BIG_MASK_PMAP_ANIM;
new_shofixti_desc.ship_data.ship[1] = (FRAME)OLDSHOF_MED_MASK_PMAP_ANIM;
new_shofixti_desc.ship_data.ship[2] = (FRAME)OLDSHOF_SML_MASK_PMAP_ANIM;
new_shofixti_desc.ship_data.special[0] =
new_shofixti_desc.ship_data.special[1] =
new_shofixti_desc.ship_data.special[0] = (FRAME)0;
new_shofixti_desc.ship_data.special[1] = (FRAME)0;
new_shofixti_desc.ship_data.special[2] = (FRAME)0;
new_shofixti_desc.ship_data.captain_control.background =
(FRAME)OLDSHOF_CAPTAIN_MASK_PMAP_ANIM;
/* weapon doesn't work as well */
/* Weapon doesn't work as well */
new_shofixti_desc.characteristics.weapon_wait = 10;
/* simulate VUX limpets */
/* Simulate VUX limpets */
for (i = 0; i < NUM_LIMPETS; ++i)
{
if (++new_shofixti_desc.characteristics.turn_wait == 0)
@@ -402,7 +409,8 @@ init_shofixti (void)
if (++new_shofixti_desc.characteristics.thrust_wait == 0)
--new_shofixti_desc.characteristics.thrust_wait;
#define MIN_THRUST_INCREMENT DISPLAY_TO_WORLD (1)
if (new_shofixti_desc.characteristics.thrust_increment <= MIN_THRUST_INCREMENT)
if (new_shofixti_desc.characteristics.thrust_increment <=
MIN_THRUST_INCREMENT)
{
new_shofixti_desc.characteristics.max_thrust =
new_shofixti_desc.characteristics.thrust_increment << 1;
@@ -415,7 +423,8 @@ init_shofixti (void)
new_shofixti_desc.characteristics.thrust_increment;
--new_shofixti_desc.characteristics.thrust_increment;
new_shofixti_desc.characteristics.max_thrust =
new_shofixti_desc.characteristics.thrust_increment * num_thrusts;
new_shofixti_desc.characteristics.thrust_increment *
num_thrusts;
}
}
}