MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / TriggerSuperJetFlame

Function TriggerSuperJetFlame

TombEngine/Game/effects/effects.cpp:1086–1175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1084}
1085
1086void TriggerSuperJetFlame(ItemInfo* item, int yvel, int deadly)
1087{
1088 long dx = LaraItem->Pose.Position.x - item->Pose.Position.x;
1089 long dz = LaraItem->Pose.Position.z - item->Pose.Position.z;
1090
1091 if (dx >= -BLOCK(16) && dx <= BLOCK(16) &&
1092 dz >= -BLOCK(16) && dz <= BLOCK(16))
1093 {
1094 int size = (GetRandomControl() & 0x1FF) - yvel;
1095 auto* sptr = GetFreeParticle();
1096
1097 if (size < 512)
1098 size = 512;
1099
1100 if (item->Model.Color == Vector4::One)
1101 {
1102 sptr->sR = sptr->sG = (GetRandomControl() & 0x1F) + 48;
1103 sptr->sB = (GetRandomControl() & 0x3F) - 64;
1104 sptr->dR = (GetRandomControl() & 0x3F) - 64;
1105 sptr->dG = (GetRandomControl() & 0x3F) - 128;
1106 sptr->dB = 32;
1107 }
1108 else
1109 {
1110 auto colorD = item->Model.Color / 2.0f * UCHAR_MAX;
1111 auto luma = Luma((Vector3)item->Model.Color / 2.0f) * 0.85f * UCHAR_MAX;
1112 auto colorS = Vector3(0.15f * colorD.x + luma,
1113 0.15f * colorD.y + luma,
1114 0.15f * colorD.z + luma);
1115
1116 sptr->sR = colorS.x;
1117 sptr->sG = colorS.y;
1118 sptr->sB = colorS.z;
1119 sptr->dR = colorD.x;
1120 sptr->dG = colorD.y;
1121 sptr->dB = colorD.z;
1122
1123 sptr->fxObj = item->Index;
1124 }
1125
1126 sptr->on = 1;
1127 sptr->colFadeSpeed = 8;
1128 sptr->fadeToBlack = 8;
1129 sptr->blendMode = BlendMode::Additive;
1130 sptr->life = sptr->sLife = (size >> 9) + (GetRandomControl() & 7) + 16;
1131 sptr->x = (GetRandomControl() & 0x1F) + item->Pose.Position.x - 16;
1132 sptr->y = (GetRandomControl() & 0x1F) + item->Pose.Position.y - 16;
1133 sptr->z = (GetRandomControl() & 0x1F) + item->Pose.Position.z - 16;
1134 sptr->friction = 51;
1135 sptr->maxYvel = 0;
1136 sptr->flags = SP_EXPDEF | SP_ROTATE | SP_DEF | SP_SCALE;
1137
1138 if (deadly)
1139 sptr->flags = SP_EXPDEF | SP_ROTATE | SP_DEF | SP_SCALE | SP_FIRE;
1140
1141 sptr->scalar = 2;
1142 sptr->dSize = (GetRandomControl() & 0xF) + (size >> 6) + 16;
1143 sptr->sSize = sptr->size = sptr->dSize / 2;

Callers 1

FlameEmitterControlFunction · 0.85

Calls 8

GetRandomControlFunction · 0.85
GetFreeParticleFunction · 0.85
LumaFunction · 0.85
ANGLEFunction · 0.85
phd_cosFunction · 0.85
phd_sinFunction · 0.85
Vector3Function · 0.50
NormalizeMethod · 0.45

Tested by

no test coverage detected