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:
+4
-4
@@ -48,10 +48,10 @@ listed below:
|
|||||||
Outputs information on the universe to "./PlanetInfo". This function
|
Outputs information on the universe to "./PlanetInfo". This function
|
||||||
should only be called from debugHook, as threading issues would otherwise
|
should only be called from debugHook, as threading issues would otherwise
|
||||||
arrise.
|
arrise.
|
||||||
- the function resetCrewBattle()
|
- the functions resetCrewBattle() and resetEnergyBattle()
|
||||||
This function, when called in melee, sets the current crew level of the
|
This function, when called in melee, sets the current crew or energy
|
||||||
bottom player's ship to its maximum. This works both in Supermelee and in
|
level of the bottom player's ship to its maximum. This works both in
|
||||||
the full game.
|
Supermelee and in the full game.
|
||||||
- the function uio_debugInteractive()
|
- the function uio_debugInteractive()
|
||||||
This function is not defined in sc2code/uqmdebug.h, but in libs/uio.h.
|
This function is not defined in sc2code/uqmdebug.h, but in libs/uio.h.
|
||||||
This function can interactively (tty-based) display information on
|
This function can interactively (tty-based) display information on
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ debugKeyPressed (void)
|
|||||||
// State modifying:
|
// State modifying:
|
||||||
equipShip ();
|
equipShip ();
|
||||||
resetCrewBattle ();
|
resetCrewBattle ();
|
||||||
|
resetEnergyBattle ();
|
||||||
instantMove = !instantMove;
|
instantMove = !instantMove;
|
||||||
showSpheres ();
|
showSpheres ();
|
||||||
activateAllShips ();
|
activateAllShips ();
|
||||||
@@ -1287,6 +1288,29 @@ resetCrewBattle(void) {
|
|||||||
SetContext (OldContext);
|
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 */
|
#endif /* DEBUG */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -148,6 +148,9 @@ STARSHIPPTR findPlayerShip(ELEMENT_FLAGS which);
|
|||||||
// Resets the crew of the first player (the bottom one) to its maximum.
|
// Resets the crew of the first player (the bottom one) to its maximum.
|
||||||
void resetCrewBattle(void);
|
void resetCrewBattle(void);
|
||||||
|
|
||||||
|
// Resets the energy of the first player (the bottom one) to its maximum.
|
||||||
|
void resetEnergyBattle(void);
|
||||||
|
|
||||||
|
|
||||||
// Move instantly across hyperspace/quasispace.
|
// Move instantly across hyperspace/quasispace.
|
||||||
extern BOOLEAN instantMove;
|
extern BOOLEAN instantMove;
|
||||||
|
|||||||
Reference in New Issue
Block a user