diff options
author | erorcun <erayorcunus@gmail.com> | 2020-06-16 19:46:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-16 19:46:44 +0200 |
commit | 6f0304f90ec65f3b14e8c8870b4c5435ecf06ae5 (patch) | |
tree | 891b2defe753ccf5cd698ad54585a141fe37132b /src/control | |
parent | Bike anim. fix (diff) | |
parent | some cutscene opcodes and heli guns (diff) | |
download | re3-6f0304f90ec65f3b14e8c8870b4c5435ecf06ae5.tar re3-6f0304f90ec65f3b14e8c8870b4c5435ecf06ae5.tar.gz re3-6f0304f90ec65f3b14e8c8870b4c5435ecf06ae5.tar.bz2 re3-6f0304f90ec65f3b14e8c8870b4c5435ecf06ae5.tar.lz re3-6f0304f90ec65f3b14e8c8870b4c5435ecf06ae5.tar.xz re3-6f0304f90ec65f3b14e8c8870b4c5435ecf06ae5.tar.zst re3-6f0304f90ec65f3b14e8c8870b4c5435ecf06ae5.zip |
Diffstat (limited to 'src/control')
-rw-r--r-- | src/control/Pickups.cpp | 72 | ||||
-rw-r--r-- | src/control/Script.cpp | 24 |
2 files changed, 57 insertions, 39 deletions
diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp index 1ab09d52..1db6dfa2 100644 --- a/src/control/Pickups.cpp +++ b/src/control/Pickups.cpp @@ -699,41 +699,51 @@ CPickups::DoPickUpEffects(CEntity *entity) int16 colorId; + bool doInnerGlow = false; + bool doOuterGlow = true; - if (entity->GetModelIndex() == MI_PICKUP_ADRENALINE || entity->GetModelIndex() == MI_PICKUP_CAMERA) + if (entity->GetModelIndex() == MI_PICKUP_ADRENALINE || entity->GetModelIndex() == MI_PICKUP_CAMERA) { colorId = WEAPONTYPE_TOTALWEAPONS; - else if (entity->GetModelIndex() == MI_PICKUP_BODYARMOUR || entity->GetModelIndex() == MI_PICKUP_BRIBE) + doInnerGlow = true; + doOuterGlow = false; + } else if (entity->GetModelIndex() == MI_PICKUP_BODYARMOUR) { colorId = WEAPONTYPE_TOTALWEAPONS + 1; - else if (entity->GetModelIndex() == MI_PICKUP_INFO || entity->GetModelIndex() == MI_PICKUP_KILLFRENZY) + } else if (entity->GetModelIndex() == MI_PICKUP_BRIBE) { + doInnerGlow = true; + doOuterGlow = false; + } else if (entity->GetModelIndex() == MI_PICKUP_INFO || entity->GetModelIndex() == MI_PICKUP_KILLFRENZY) { colorId = WEAPONTYPE_TOTALWEAPONS + 2; - else if (entity->GetModelIndex() == MI_PICKUP_HEALTH || entity->GetModelIndex() == MI_PICKUP_BONUS) - colorId = WEAPONTYPE_TOTALWEAPONS + 3; - else + doInnerGlow = true; + doOuterGlow = false; + } else if (entity->GetModelIndex() == MI_PICKUP_HEALTH || entity->GetModelIndex() == MI_PICKUP_BONUS) { + colorId = WEAPONTYPE_TOTALWEAPONS; + doInnerGlow = true; + doOuterGlow = false; + } else colorId = WeaponForModel(entity->GetModelIndex()); - assert(colorId >= 0); - - const CVector &pos = entity->GetPosition(); - - float colorModifier = ((CGeneral::GetRandomNumber() & 0x1F) * 0.015f + 1.0f) * modifiedSin * 0.15f; - CShadows::StoreStaticShadow( - (uintptr)entity, - SHADOWTYPE_ADDITIVE, - gpShadowExplosionTex, - &pos, - 2.0f, 0.0f, 0.0f, -2.0f, - 255, // this is 0 on PC which results in no shadow - aWeaponReds[colorId] * colorModifier, aWeaponGreens[colorId] * colorModifier, aWeaponBlues[colorId] * colorModifier, - 4.0f, 1.0f, 40.0f, false, 0.0f); - - float radius = (CGeneral::GetRandomNumber() & 0xF) * 0.1f + 3.0f; - CPointLights::AddLight(CPointLights::LIGHT_POINT, pos, CVector(0.0f, 0.0f, 0.0f), radius, aWeaponReds[colorId] * modifiedSin / 256.0f, aWeaponGreens[colorId] * modifiedSin / 256.0f, aWeaponBlues[colorId] * modifiedSin / 256.0f, CPointLights::FOG_NONE, true); - float size = (CGeneral::GetRandomNumber() & 0xF) * 0.0005f + 0.6f; - CCoronas::RegisterCorona( (uintptr)entity, - aWeaponReds[colorId] * modifiedSin / 2.0f, aWeaponGreens[colorId] * modifiedSin / 2.0f, aWeaponBlues[colorId] * modifiedSin / 2.0f, - 255, - pos, - size, 65.0f, CCoronas::TYPE_RING, CCoronas::FLARE_NONE, CCoronas::REFLECTION_OFF, CCoronas::LOSCHECK_OFF, CCoronas::STREAK_OFF, 0.0f); + const CVector& pos = entity->GetPosition(); + if (doOuterGlow) { + float colorModifier = ((CGeneral::GetRandomNumber() & 0x1F) * 0.015f + 1.0f) * modifiedSin * 0.15f; + CShadows::StoreStaticShadow( + (uintptr)entity, + SHADOWTYPE_ADDITIVE, + gpShadowExplosionTex, + &pos, + 2.0f, 0.0f, 0.0f, -2.0f, + 255, // this is 0 on PC which results in no shadow + aWeaponReds[colorId] * colorModifier, aWeaponGreens[colorId] * colorModifier, aWeaponBlues[colorId] * colorModifier, + 4.0f, 1.0f, 40.0f, false, 0.0f); + + float radius = (CGeneral::GetRandomNumber() & 0xF) * 0.1f + 3.0f; + CPointLights::AddLight(CPointLights::LIGHT_POINT, pos, CVector(0.0f, 0.0f, 0.0f), radius, aWeaponReds[colorId] * modifiedSin / 256.0f, aWeaponGreens[colorId] * modifiedSin / 256.0f, aWeaponBlues[colorId] * modifiedSin / 256.0f, CPointLights::FOG_NONE, true); + float size = (CGeneral::GetRandomNumber() & 0xF) * 0.0005f + 0.6f; + CCoronas::RegisterCorona((uintptr)entity, + aWeaponReds[colorId] * modifiedSin / 2.0f, aWeaponGreens[colorId] * modifiedSin / 2.0f, aWeaponBlues[colorId] * modifiedSin / 2.0f, + 255, + pos, + size, 65.0f, CCoronas::TYPE_RING, CCoronas::FLARE_NONE, CCoronas::REFLECTION_OFF, CCoronas::LOSCHECK_OFF, CCoronas::STREAK_OFF, 0.0f); + } CObject *object = (CObject*)entity; if (object->bPickupObjWithMessage || object->bOutOfStock || object->m_nBonusValue) { @@ -761,6 +771,10 @@ CPickups::DoPickUpEffects(CEntity *entity) } entity->GetMatrix().SetRotateZOnlyScaled((float)(CTimer::GetTimeInMilliseconds() & 0x7FF) * DEGTORAD(360.0f / 0x800), aWeaponScale[colorId]); + + if (doInnerGlow) + CCoronas::RegisterCorona((uintptr)entity + 1, 126, 69, 121, 255, entity->GetPosition(), 1.2f, 50.0f, + CCoronas::TYPE_STAR, CCoronas::FLARE_NONE, CCoronas::REFLECTION_ON, CCoronas::LOSCHECK_OFF, CCoronas::STREAK_ON, 0.f, false); } } diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 957815fe..b1cf44c6 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -9996,7 +9996,7 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command) continue; if (pPed->CharCreatedBy != RANDOM_CHAR) continue; - if (!pPed->IsPedInControl() && pPed->GetPedState() != PED_DRIVING /* && pPed->GetPedState() != PED_ONROPE */) // TODO(MIAMI)! + if (!pPed->IsPedInControl() && pPed->GetPedState() != PED_DRIVING && pPed->GetPedState() != PED_ABSEIL) continue; if (pPed->bRemoveFromWorld) continue; @@ -10640,7 +10640,7 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command) char key[KEY_LENGTH_IN_SCRIPT]; CTheScripts::ReadTextLabelFromScript(&m_nIp, key); m_nIp += KEY_LENGTH_IN_SCRIPT; - debug("SET_CUTSCENE_ANIM_TO_LOOP not implemented yet, skipping\n"); + CCutsceneMgr::SetCutsceneAnimToLoop(key); return 0; } case COMMAND_MARK_CAR_AS_CONVOY_CAR: @@ -11339,6 +11339,7 @@ int8 CRunningScript::ProcessCommands1300To1399(int32 command) { CollectParameters(&m_nIp, 2); debug("ATTACH_CUTSCENE_OBJECT_TO_COMPONENT not implemented, skipping\n"); // TODO(MIAMI) + m_nIp += KEY_LENGTH_IN_SCRIPT; return 0; } case COMMAND_SET_CHAR_STAY_IN_CAR_WHEN_JACKED: @@ -11464,7 +11465,15 @@ int8 CRunningScript::ProcessCommands1300To1399(int32 command) case COMMAND_FIRE_HUNTER_GUN: { CollectParameters(&m_nIp, 1); - debug("FIRE_HUNTER_GUN is not implemented, skipping\n"); // TODO(MIAMI) + CVehicle *pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]); + if (CTimer::GetTimeInMilliseconds() > pVehicle->m_nGunFiringTime + 150) { + CWeapon gun(WEAPONTYPE_HELICANNON, 5000); + CVector worldGunPos = (pVehicle->GetMatrix() * vecHunterGunPos) + (CTimer::GetTimeStep() * pVehicle->m_vecMoveSpeed); + gun.FireInstantHit(pVehicle, &worldGunPos); + gun.AddGunshell(pVehicle, worldGunPos, CVector2D(0.f, 0.1f), 0.025f); + DMAudio.PlayOneShot(pVehicle->m_audioEntityId, SOUND_WEAPON_SHOT_FIRED, 0.f); + pVehicle->m_nGunFiringTime = CTimer::GetTimeInMilliseconds(); + } return 0; } case COMMAND_SET_PROPERTY_AS_OWNED: @@ -11704,7 +11713,7 @@ int8 CRunningScript::ProcessCommands1300To1399(int32 command) case COMMAND_SET_CHAR_IGNORE_THREATS_BEHIND_OBJECTS: { CollectParameters(&m_nIp, 2); - CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed; + CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); assert(pPed); pPed->bIgnoreThreatsBehindObjects = ScriptParams[1]; return 0; @@ -11769,12 +11778,7 @@ int8 CRunningScript::ProcessCommands1300To1399(int32 command) } case COMMAND_WAS_CUTSCENE_SKIPPED: { - static bool bShowed = false; - if (!bShowed) { - debug("COMMAND_WAS_CUTSCENE_SKIPPED not implemented, default to TRUE\n"); - bShowed = true; - } - UpdateCompareFlag(true); + UpdateCompareFlag(CCutsceneMgr::WasCutsceneSkipped()); return 0; } case COMMAND_SET_CHAR_CROUCH_WHEN_THREATENED: |