mirror of
https://github.com/halpz/re3.git
synced 2025-06-27 01:46:17 +00:00
script 1000-1154
This commit is contained in:
@ -11,6 +11,9 @@
|
||||
#include "Lights.h"
|
||||
#include "VisibilityPlugins.h"
|
||||
#include "World.h"
|
||||
#include "Particle.h"
|
||||
#include "General.h"
|
||||
#include "Camera.h"
|
||||
|
||||
WRAPPER void CSpecialFX::Render(void) { EAXJMP(0x518DC0); }
|
||||
WRAPPER void CSpecialFX::Update(void) { EAXJMP(0x518D40); }
|
||||
@ -383,6 +386,77 @@ CMoneyMessages::RegisterOne(CVector vecPos, const char *pText, uint8 bRed, uint8
|
||||
aMoneyMessages[nIndex].m_fOpacity = fOpacity;
|
||||
}
|
||||
|
||||
void CSpecialParticleStuff::CreateFoamAroundObject(CMatrix* pMatrix, float innerFw, float innerRg, float innerUp, int32 particles)
|
||||
{
|
||||
int attempts = 0;
|
||||
float outerFw = innerFw + 5.0f;
|
||||
float outerRg = innerRg + 5.0f;
|
||||
float outerUp = innerUp + 5.0f;
|
||||
while (particles > 0 && attempts < 1000) {
|
||||
CVector pos;
|
||||
int rnd = CGeneral::GetRandomNumber();
|
||||
pos.x = (int8)(rnd - 128) / 110.0f;
|
||||
pos.y = (int8)((rnd >> 8) - 128) / 110.0f;
|
||||
pos.z = 0.0f;
|
||||
if (DotProduct2D(pos, TheCamera.GetForward()) >= 0)
|
||||
continue;
|
||||
pos += pMatrix->GetPosition();
|
||||
pos.z = 2.0f;
|
||||
// was there any point in adding it here?
|
||||
float fw = DotProduct(pMatrix->GetForward(), pos - pMatrix->GetPosition());
|
||||
if (fw >= outerFw)
|
||||
continue;
|
||||
float rg = DotProduct(pMatrix->GetRight(), pos - pMatrix->GetPosition());
|
||||
if (rg >= outerRg)
|
||||
continue;
|
||||
float up = DotProduct(pMatrix->GetUp(), pos - pMatrix->GetPosition());
|
||||
if (up >= outerUp)
|
||||
continue;
|
||||
if (fw > innerFw || rg > innerRg || up > innerUp) {
|
||||
CParticle::AddParticle(PARTICLE_STEAM2, pos, CVector(0.0f, 0.0f, 0.0f), nil, 4.0f, 1, 0, 0, 0);
|
||||
particles--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CSpecialParticleStuff::StartBoatFoamAnimation()
|
||||
{
|
||||
BoatFromStart = CTimer::GetTimeInMilliseconds();
|
||||
}
|
||||
|
||||
CRGBA FoamColour(255, 255, 255, 255);
|
||||
unsigned int CSpecialParticleStuff::BoatFromStart;
|
||||
|
||||
void CSpecialParticleStuff::UpdateBoatFoamAnimation(CMatrix* pMatrix)
|
||||
{
|
||||
static int32 FrameInAnimation = 0;
|
||||
static float X, Y, Z, dX, dY, dZ;
|
||||
CreateFoamAroundObject(pMatrix, 107.0f, 24.1f, 30.5f, 2);
|
||||
uint32 prev = CTimer::GetPreviousTimeInMilliseconds();
|
||||
uint32 cur = CTimer::GetTimeInMilliseconds();
|
||||
if (FrameInAnimation != 0) {
|
||||
X += dX;
|
||||
Y += dY;
|
||||
Z += dZ;
|
||||
CVector pos = *pMatrix * CVector(X, Y, Z);
|
||||
CParticle::AddParticle(PARTICLE_STEAM_NY, pos, CVector(0.0f, 0.0f, 0.0f),
|
||||
nil, FrameInAnimation * 0.5f + 2.0f, FoamColour, 1, 0, 0, 0);
|
||||
if (++FrameInAnimation)
|
||||
FrameInAnimation = 0;
|
||||
}
|
||||
if ((cur & 0x3FF) < (prev & 0x3FF)) {
|
||||
FrameInAnimation = 1;
|
||||
int rnd = CGeneral::GetRandomNumber();
|
||||
X = (int8)(rnd - 128) * 0.2f;
|
||||
Y = (int8)((rnd >> 8) - 128) * 0.2f;
|
||||
Z = 10.0f;
|
||||
rnd = CGeneral::GetRandomNumber();
|
||||
dX = (int8)(rnd - 128) * 0.02f;
|
||||
dY = (int8)((rnd >> 8) - 128) * 0.02f;
|
||||
dZ = 2.0f;
|
||||
}
|
||||
}
|
||||
|
||||
STARTPATCHES
|
||||
InjectHook(0x51B070, &C3dMarker::AddMarker, PATCH_JUMP);
|
||||
InjectHook(0x51B170, &C3dMarker::DeleteMarkerObject, PATCH_JUMP);
|
||||
|
@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "rwplcore.h"
|
||||
|
||||
class CSpecialFX
|
||||
{
|
||||
public:
|
||||
@ -109,4 +111,13 @@ public:
|
||||
static void Init();
|
||||
static void Render();
|
||||
static void RegisterOne(CVector vecPos, const char *pText, uint8 bRed, uint8 bGreen, uint8 bBlue, float fSize, float fOpacity);
|
||||
};
|
||||
};
|
||||
|
||||
class CSpecialParticleStuff
|
||||
{
|
||||
static uint32 BoatFromStart;
|
||||
public:
|
||||
static void CreateFoamAroundObject(CMatrix*, float, float, float, int32);
|
||||
static void StartBoatFoamAnimation();
|
||||
static void UpdateBoatFoamAnimation(CMatrix*);
|
||||
};
|
||||
|
Reference in New Issue
Block a user