mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
Remove useless lua gameclock variables, add lua externalized function to heal boxers
- These gameclock variables were not updated properly so it created a discrepancy between it and the proper gameclock variables, and it was causing issues with the lua hourly update script - Function that heals boxers after they finish resting
This commit is contained in:
@@ -249,10 +249,6 @@ void AdvanceClock( UINT8 ubWarpCode )
|
|||||||
guiDay = ( guiGameClock / NUM_SEC_IN_DAY );
|
guiDay = ( guiGameClock / NUM_SEC_IN_DAY );
|
||||||
guiHour = ( guiGameClock - ( guiDay * NUM_SEC_IN_DAY ) ) / NUM_SEC_IN_HOUR;
|
guiHour = ( guiGameClock - ( guiDay * NUM_SEC_IN_DAY ) ) / NUM_SEC_IN_HOUR;
|
||||||
guiMin = ( guiGameClock - ( ( guiDay * NUM_SEC_IN_DAY ) + ( guiHour * NUM_SEC_IN_HOUR ) ) ) / NUM_SEC_IN_MIN;
|
guiMin = ( guiGameClock - ( ( guiDay * NUM_SEC_IN_DAY ) + ( guiHour * NUM_SEC_IN_HOUR ) ) ) / NUM_SEC_IN_MIN;
|
||||||
|
|
||||||
uiHourLua = guiHour;
|
|
||||||
uiDayLua = guiDay;
|
|
||||||
uiMinLua = guiMin;
|
|
||||||
|
|
||||||
swprintf( WORLDTIMESTR, L"%s %d, %02d:%02d", gpGameClockString[ STR_GAMECLOCK_DAY_NAME ], guiDay, guiHour, guiMin );
|
swprintf( WORLDTIMESTR, L"%s %d, %02d:%02d", gpGameClockString[ STR_GAMECLOCK_DAY_NAME ], guiDay, guiHour, guiMin );
|
||||||
|
|
||||||
|
|||||||
@@ -859,6 +859,7 @@ static int l_PlayerTeamFull(lua_State* L);
|
|||||||
|
|
||||||
static int l_ProfilesStrategicInsertionData(lua_State* L);
|
static int l_ProfilesStrategicInsertionData(lua_State* L);
|
||||||
|
|
||||||
|
static int l_HealBoxers(lua_State* L);
|
||||||
static int l_ResetBoxers(lua_State* L);
|
static int l_ResetBoxers(lua_State* L);
|
||||||
|
|
||||||
static int l_AddVolunteers(lua_State* L);
|
static int l_AddVolunteers(lua_State* L);
|
||||||
@@ -912,9 +913,6 @@ static int l_SetIntelAndQuestMapDataForSector(lua_State* L);
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
UINT16 idProfil;
|
UINT16 idProfil;
|
||||||
UINT32 uiHourLua;
|
|
||||||
UINT32 uiDayLua;
|
|
||||||
UINT32 uiMinLua;
|
|
||||||
|
|
||||||
UINT16 PROFILLUA_sSectorX;
|
UINT16 PROFILLUA_sSectorX;
|
||||||
UINT16 PROFILLUA_sSectorY;
|
UINT16 PROFILLUA_sSectorY;
|
||||||
@@ -1189,6 +1187,7 @@ static void IniFunction(lua_State* L, BOOLEAN bQuests)
|
|||||||
lua_register(L, "TacticalCharacterDialogueWithSpecialEvent", l_TacticalCharacterDialogueWithSpecialEvent);
|
lua_register(L, "TacticalCharacterDialogueWithSpecialEvent", l_TacticalCharacterDialogueWithSpecialEvent);
|
||||||
lua_register(L, "SetSalary", l_MercSalary);
|
lua_register(L, "SetSalary", l_MercSalary);
|
||||||
lua_register(L, "SetProfileStrategicInsertionData", l_ProfilesStrategicInsertionData);
|
lua_register(L, "SetProfileStrategicInsertionData", l_ProfilesStrategicInsertionData);
|
||||||
|
lua_register(L, "HealBoxers", l_HealBoxers);
|
||||||
|
|
||||||
//Get merc
|
//Get merc
|
||||||
lua_register(L, "GetDirection", l_GetDirection); //new
|
lua_register(L, "GetDirection", l_GetDirection); //new
|
||||||
@@ -9315,6 +9314,27 @@ static int l_ResetBoxers(lua_State* L)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// heal boxers back to max health in case the player stays in sector while the boxers are resting
|
||||||
|
static int l_HealBoxers(lua_State* L)
|
||||||
|
{
|
||||||
|
for (UINT8 i = 0; i < NUM_BOXERS; ++i)
|
||||||
|
{
|
||||||
|
// Get breath back
|
||||||
|
gubBoxerID[i]->bBreath = gubBoxerID[i]->bBreathMax;
|
||||||
|
gubBoxerID[i]->sBreathRed = 0;
|
||||||
|
// Get life back
|
||||||
|
gubBoxerID[i]->stats.bLife = gubBoxerID[i]->stats.bLifeMax;
|
||||||
|
gubBoxerID[i]->bBleeding = 0;
|
||||||
|
// erase insta-healable injury
|
||||||
|
gubBoxerID[i]->iHealableInjury = 0;
|
||||||
|
|
||||||
|
DebugQuestInfo(String("Lua: healed gubBoxerID[%d] %d back to full health", i, gubBoxerID[i]));
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//Set character to sector Y
|
//Set character to sector Y
|
||||||
static int l_SetCharacterSectorY(lua_State* L)
|
static int l_SetCharacterSectorY(lua_State* L)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,9 +26,6 @@ typedef struct
|
|||||||
|
|
||||||
extern ACTION_ITEM_VALUES ActionItemsValues[500];
|
extern ACTION_ITEM_VALUES ActionItemsValues[500];
|
||||||
|
|
||||||
extern UINT32 uiHourLua;
|
|
||||||
extern UINT32 uiDayLua;
|
|
||||||
extern UINT32 uiMinLua;
|
|
||||||
extern UINT16 PROFILLUA_sSectorX;
|
extern UINT16 PROFILLUA_sSectorX;
|
||||||
extern UINT16 PROFILLUA_sSectorY;
|
extern UINT16 PROFILLUA_sSectorY;
|
||||||
extern UINT8 PROFILLUA_bSectorZ;
|
extern UINT8 PROFILLUA_bSectorZ;
|
||||||
|
|||||||
@@ -510,15 +510,6 @@ void IniGlobalGameSetting(lua_State *L)
|
|||||||
lua_pushinteger(L, gubBoxingMatchesWon);
|
lua_pushinteger(L, gubBoxingMatchesWon);
|
||||||
lua_setglobal(L, "gubBoxingMatchesWon");
|
lua_setglobal(L, "gubBoxingMatchesWon");
|
||||||
|
|
||||||
lua_pushinteger(L, uiHourLua);
|
|
||||||
lua_setglobal(L, "cHour");
|
|
||||||
|
|
||||||
lua_pushinteger(L, uiDayLua);
|
|
||||||
lua_setglobal(L, "cDay");
|
|
||||||
|
|
||||||
lua_pushinteger(L, uiMinLua);
|
|
||||||
lua_setglobal(L, "cMin");
|
|
||||||
|
|
||||||
lua_pushinteger(L, gbPlayerNum);
|
lua_pushinteger(L, gbPlayerNum);
|
||||||
lua_setglobal(L, "gbPlayerNum");
|
lua_setglobal(L, "gbPlayerNum");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user