From b54bb62c944f8f3e8d85501fbb762915fdc6569b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Thu, 13 Aug 2020 23:39:55 +0300 Subject: Stats(except displaying), PlayerInfo, marker fix --- src/control/GameLogic.cpp | 6 +++++- src/control/Script.cpp | 40 ++++++++++++++++++++++------------------ 2 files changed, 27 insertions(+), 19 deletions(-) (limited to 'src/control') diff --git a/src/control/GameLogic.cpp b/src/control/GameLogic.cpp index 2af9464c..f4e4fdd4 100644 --- a/src/control/GameLogic.cpp +++ b/src/control/GameLogic.cpp @@ -28,6 +28,7 @@ #include "Particle.h" #include "ColStore.h" #include "Automobile.h" +#include "MBlur.h" uint8 CGameLogic::ActivePlayers; uint8 CGameLogic::ShortCutState; @@ -343,7 +344,10 @@ CGameLogic::RestorePlayerStuffDuringResurrection(CPlayerPed *pPlayerPed, CVector pPlayerPed->bIsVisible = true; pPlayerPed->m_bloodyFootprintCountOrDeathTime = 0; pPlayerPed->bDoBloodyFootprints = false; - //TODO(MIAMI): clear drunk stuff + pPlayerPed->m_nDrunkenness = 0; + pPlayerPed->m_nFadeDrunkenness = 0; + CMBlur::ClearDrunkBlur(); + pPlayerPed->m_nDrunkCountdown = 0; pPlayerPed->ClearAdrenaline(); pPlayerPed->m_fCurrentStamina = pPlayerPed->m_fMaxStamina; if (pPlayerPed->m_pFire) diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 9508677b..69b8ee4f 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -1806,7 +1806,7 @@ void CMissionCleanup::Process() // TODO(MIAMI) //CSpecialFX::bLiftCam = false; //CSpecialFX::bVideoCam = false; - //CTimeCycle::StopExtraColour(0); + CTimeCycle::StopExtraColour(0); for (int i = 0; i < MISSION_AUDIO_SLOTS; i++) DMAudio.ClearMissionAudio(i); CWeather::ReleaseWeather(); @@ -1822,8 +1822,11 @@ void CMissionCleanup::Process() CWorld::Players[0].m_pPed->m_pWanted->m_bIgnoredByCops = false; CWorld::Players[0].m_pPed->m_pWanted->m_bIgnoredByEveryone = false; CWorld::Players[0].MakePlayerSafe(false); - //TODO(MIAMI): drunkenness, enable drive by - //DMAudio::ShutUpPlayerTalking(0); + CWorld::Players[0].m_pPed->m_nFadeDrunkenness = 1; + CWorld::Players[0].m_pPed->m_nDrunkCountdown = 0; + // CPad::GetPad(0)->SetDrunkInputDelay(0); // TODO(Miami) + CWorld::Players[0].m_bDriveByAllowed = true; + // DMAudio::ShutUpPlayerTalking(0); // TODO(Miami) CVehicle::bDisableRemoteDetonation = false; CVehicle::bDisableRemoteDetonationOnContact = false; CGameLogic::ClearShortCut(); @@ -5353,7 +5356,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command) if (pos.z <= MAP_Z_LOW_LIMIT) pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y); CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp)); - int handle = CRadar::SetCoordBlip(BLIP_COORD, pos, 2, BLIP_DISPLAY_BOTH); + int handle = CRadar::SetCoordBlip(BLIP_CONTACT_POINT, pos, 2, BLIP_DISPLAY_BOTH); CRadar::ChangeBlipScale(handle, 3); ScriptParams[0] = handle; StoreParameters(&m_nIp, 1); @@ -9792,7 +9795,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command) CVector pos = *(CVector*)&ScriptParams[0]; if (pos.z <= MAP_Z_LOW_LIMIT) pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y); - C3dMarkers::PlaceMarkerSet((uintptr)this + m_nIp, 4, pos, *(float*)&ScriptParams[3], + C3dMarkers::PlaceMarkerSet((uintptr)this + m_nIp, MARKERTYPE_CYLINDER, pos, *(float*)&ScriptParams[3], SPHERE_MARKER_R, SPHERE_MARKER_G, SPHERE_MARKER_B, SPHERE_MARKER_A, SPHERE_MARKER_PULSE_PERIOD, SPHERE_MARKER_PULSE_FRACTION, 0); return 0; @@ -13008,11 +13011,11 @@ int8 CRunningScript::ProcessCommands1300To1399(int32 command) //case COMMAND_IS_MISSION_AUDIO_LOADING: case COMMAND_ADD_MONEY_SPENT_ON_WEAPONS: CollectParameters(&m_nIp, 1); - debug("ADD_MONEY_SPENT_ON_WEAPON not implemented\n"); // TODO(MIAMI) + CStats::MoneySpentOnWeapons(ScriptParams[0]); return 0; case COMMAND_ADD_MONEY_SPENT_ON_PROPERTY: CollectParameters(&m_nIp, 1); - debug("ADD_MONEY_SPENT_ON_PROPERTY not implemented\n"); // TODO(MIAMI) + CStats::MoneySpentOnProperty(ScriptParams[0]); return 0; //case COMMAND_ADD_MONEY_SPENT_ON_AUTO_PAINTING: case COMMAND_SET_CHAR_ANSWERING_MOBILE: @@ -13041,21 +13044,21 @@ int8 CRunningScript::ProcessCommands1300To1399(int32 command) //case COMMAND_ADD_LOAN_SHARK_VISITS: case COMMAND_ADD_STORES_KNOCKED_OFF: CollectParameters(&m_nIp, 1); - debug("ADD_STORES_KNOCKED_OFF not implemented\n"); // TODO(MIAMI) + CStats::NumOfStoresKnockedOff(ScriptParams[0]); return 0; //case COMMAND_ADD_MOVIE_STUNTS: case COMMAND_ADD_NUMBER_OF_ASSASSINATIONS: CollectParameters(&m_nIp, 1); - debug("ADD_NUMBER_OF_ASSASSINATIONS not implemented\n"); // TODO(MIAMI) + CStats::NumOfAssassinations(ScriptParams[0]); return 0; case COMMAND_ADD_PIZZAS_DELIVERED: CollectParameters(&m_nIp, 1); - debug("ADD_PIZZAS_DELIVERED not implemented\n"); // TODO(MIAMI) + CStats::NumOfPizzasDelivered(ScriptParams[0]); return 0; //case COMMAND_ADD_GARBAGE_PICKUPS: case COMMAND_ADD_ICE_CREAMS_SOLD: CollectParameters(&m_nIp, 1); - debug("ADD_ICE_CREAMS_SOLD not implemented\n"); // TODO(MIAMI) + CStats::NumOfIceCreamSold(ScriptParams[0]); return 0; //case COMMAND_SET_TOP_SHOOTING_RANGE_SCORE: //case COMMAND_ADD_SHOOTING_RANGE_RANK: @@ -13137,15 +13140,15 @@ int8 CRunningScript::ProcessCommands1300To1399(int32 command) } case COMMAND_SET_PROPERTY_AS_OWNED: CollectParameters(&m_nIp, 1); - debug("SET_PROPERTY_AS_OWNED not implemented\n"); // TODO(MIAMI) + CStats::AddPropertyAsOwned(ScriptParams[0]); return 0; case COMMAND_ADD_BLOOD_RING_KILLS: CollectParameters(&m_nIp, 1); - debug("ADD_BLOOD_RING_KILLS not implemented\n"); // TODO(MIAMI) + CStats::AddNumBloodRingKills(ScriptParams[0]); return 0; case COMMAND_SET_LONGEST_TIME_IN_BLOOD_RING: CollectParameters(&m_nIp, 1); - debug("SET_LONGEST_TIME_IN_BLOOD_RING not implemented\n"); // TODO(MIAMI) + CStats::LongestTimeInBloodRing(ScriptParams[0]); return 0; case COMMAND_REMOVE_EVERYTHING_FOR_HUGE_CUTSCENE: { @@ -13271,7 +13274,8 @@ int8 CRunningScript::ProcessCommands1300To1399(int32 command) //case COMMAND_SET_CHAR_OBJ_GOTO_CAR_ON_FOOT: //case COMMAND_GET_CLOSEST_WATER_NODE: case COMMAND_ADD_PORN_LEAFLET_TO_RUBBISH: - debug("ADD_PORN_LEAFLET_TO_RUBBISH is not implemented\n"); // TODO(MIAMI) + CollectParameters(&m_nIp, 1); + CStats::PamphletMissionPassed = ScriptParams[0]; return 0; case COMMAND_CREATE_CLOTHES_PICKUP: { @@ -13541,7 +13545,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command) switch (command) { case COMMAND_REGISTER_VIGILANTE_LEVEL: CollectParameters(&m_nIp, 1); - debug("REGISTER_VIGILANTE_LEVEL not implemented\n"); // TODO(MIAMI) + CStats::RegisterLevelVigilanteMission(ScriptParams[0]); return 0; case COMMAND_CLEAR_ALL_CHAR_ANIMS: { @@ -13854,7 +13858,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command) } case COMMAND_REGISTER_FIRE_LEVEL: CollectParameters(&m_nIp, 1); - debug("REGISTER_FIRE_LEVEL not implemented\n"); // TODO(MIAMI) + CStats::RegisterLevelFireMission(ScriptParams[0]); return 0; case COMMAND_IS_AUSTRALIAN_GAME: UpdateCompareFlag(false); // should we make some check? @@ -14007,7 +14011,7 @@ void CTheScripts::DrawScriptSpheres() { for (int i = 0; i < MAX_NUM_SCRIPT_SPHERES; i++) { if (ScriptSphereArray[i].m_bInUse) - C3dMarkers::PlaceMarkerSet(ScriptSphereArray[i].m_Id, 4, ScriptSphereArray[i].m_vecCenter, ScriptSphereArray[i].m_fRadius, + C3dMarkers::PlaceMarkerSet(ScriptSphereArray[i].m_Id, MARKERTYPE_CYLINDER, ScriptSphereArray[i].m_vecCenter, ScriptSphereArray[i].m_fRadius, SPHERE_MARKER_R, SPHERE_MARKER_G, SPHERE_MARKER_B, SPHERE_MARKER_A, SPHERE_MARKER_PULSE_PERIOD, SPHERE_MARKER_PULSE_FRACTION, 0); } } -- cgit v1.2.3 From f403a63a5cc2262dc2a10f4963140aceff15e681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Fri, 14 Aug 2020 18:54:01 +0300 Subject: Wheelie opcode --- src/control/Script.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/control') diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 69b8ee4f..0c3d269c 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -12725,14 +12725,20 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command) case COMMAND_GET_WHEELIE_STATS: { CollectParameters(&m_nIp, 1); - static bool bShowed = false; - if (!bShowed) { - debug("GET_WHEELIE_STATS not implemented\n"); - bShowed = true; - } - for (int i = 0; i < 6; i++) - ScriptParams[i] = 0; + CPlayerInfo* pPlayerInfo = &CWorld::Players[ScriptParams[0]]; + ScriptParams[0] = pPlayerInfo->m_nLastTimeCarSpentOnTwoWheels; + ScriptParams[1] = pPlayerInfo->m_nLastDistanceCarTravelledOnTwoWheels; + ScriptParams[2] = pPlayerInfo->m_nLastTimeSpentOnWheelie; + ScriptParams[3] = pPlayerInfo->m_nLastDistanceTravelledOnWheelie; + ScriptParams[4] = pPlayerInfo->m_nLastTimeSpentOnStoppie; + ScriptParams[5] = pPlayerInfo->m_nLastDistanceTravelledOnStoppie; StoreParameters(&m_nIp, 6); + pPlayerInfo->m_nLastTimeCarSpentOnTwoWheels = 0; + pPlayerInfo->m_nLastDistanceCarTravelledOnTwoWheels = 0; + pPlayerInfo->m_nLastTimeSpentOnWheelie = 0; + pPlayerInfo->m_nLastDistanceTravelledOnWheelie = 0; + pPlayerInfo->m_nLastTimeSpentOnStoppie = 0; + pPlayerInfo->m_nLastDistanceTravelledOnStoppie = 0; return 0; } //case COMMAND_DISARM_CHAR: -- cgit v1.2.3 From 8b3ca9564b1eeef6fd9d6296499594cfc8fec3aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Fri, 14 Aug 2020 22:41:04 +0300 Subject: Continue to Frontend, fix savegame list bug --- src/control/Script.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/control') diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 0c3d269c..e16ba9e0 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -12727,18 +12727,18 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command) CollectParameters(&m_nIp, 1); CPlayerInfo* pPlayerInfo = &CWorld::Players[ScriptParams[0]]; ScriptParams[0] = pPlayerInfo->m_nLastTimeCarSpentOnTwoWheels; - ScriptParams[1] = pPlayerInfo->m_nLastDistanceCarTravelledOnTwoWheels; + ScriptParams[1] = *(int*)&pPlayerInfo->m_nLastDistanceCarTravelledOnTwoWheels; ScriptParams[2] = pPlayerInfo->m_nLastTimeSpentOnWheelie; - ScriptParams[3] = pPlayerInfo->m_nLastDistanceTravelledOnWheelie; + ScriptParams[3] = *(int*)&pPlayerInfo->m_nLastDistanceTravelledOnWheelie; ScriptParams[4] = pPlayerInfo->m_nLastTimeSpentOnStoppie; - ScriptParams[5] = pPlayerInfo->m_nLastDistanceTravelledOnStoppie; + ScriptParams[5] = *(int*)&pPlayerInfo->m_nLastDistanceTravelledOnStoppie; StoreParameters(&m_nIp, 6); pPlayerInfo->m_nLastTimeCarSpentOnTwoWheels = 0; - pPlayerInfo->m_nLastDistanceCarTravelledOnTwoWheels = 0; + pPlayerInfo->m_nLastDistanceCarTravelledOnTwoWheels = 0.0f; pPlayerInfo->m_nLastTimeSpentOnWheelie = 0; - pPlayerInfo->m_nLastDistanceTravelledOnWheelie = 0; + pPlayerInfo->m_nLastDistanceTravelledOnWheelie = 0.0f; pPlayerInfo->m_nLastTimeSpentOnStoppie = 0; - pPlayerInfo->m_nLastDistanceTravelledOnStoppie = 0; + pPlayerInfo->m_nLastDistanceTravelledOnStoppie = 0.0f; return 0; } //case COMMAND_DISARM_CHAR: -- cgit v1.2.3