Added resetEnergyBattle()

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2320 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2006-04-23 06:28:27 +00:00
parent 7803342ae2
commit f9c645567c
3 changed files with 31 additions and 4 deletions
+24
View File
@@ -64,6 +64,7 @@ debugKeyPressed (void)
// State modifying:
equipShip ();
resetCrewBattle ();
resetEnergyBattle ();
instantMove = !instantMove;
showSpheres ();
activateAllShips ();
@@ -1287,6 +1288,29 @@ resetCrewBattle(void) {
SetContext (OldContext);
}
void
resetEnergyBattle(void) {
STARSHIPPTR StarShipPtr;
COUNT delta;
CONTEXT OldContext;
if (!(GLOBAL (CurrentActivity) & IN_BATTLE) ||
(LOBYTE (GLOBAL (CurrentActivity)) == IN_HYPERSPACE))
return;
StarShipPtr = findPlayerShip (GOOD_GUY);
if (StarShipPtr == NULL || StarShipPtr->RaceDescPtr == NULL)
return;
delta = StarShipPtr->RaceDescPtr->ship_info.max_energy -
StarShipPtr->RaceDescPtr->ship_info.energy_level;
OldContext = SetContext (StatusContext);
DeltaEnergy (StarShipPtr->hShip, delta);
SetContext (OldContext);
}
#endif /* DEBUG */
+3
View File
@@ -148,6 +148,9 @@ STARSHIPPTR findPlayerShip(ELEMENT_FLAGS which);
// Resets the crew of the first player (the bottom one) to its maximum.
void resetCrewBattle(void);
// Resets the energy of the first player (the bottom one) to its maximum.
void resetEnergyBattle(void);
// Move instantly across hyperspace/quasispace.
extern BOOLEAN instantMove;