Skip to content

Commit

Permalink
You can now aim + Better rage sound
Browse files Browse the repository at this point in the history
  • Loading branch information
Batfoxkid committed Nov 20, 2024
1 parent 7d9f3db commit 7a046b4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 10 deletions.
37 changes: 29 additions & 8 deletions addons/sourcemod/scripting/vsh/abilities/ability_rage_meteor.sp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void RageMeteor_Create(SaxtonHaleBase boss)

boss.SetPropFloat("RageMeteor", "Damage", 50.0);
boss.SetPropFloat("RageMeteor", "Speed", 550.0);
boss.SetPropFloat("RageMeteor", "SpawnRadius", 800.0);
boss.SetPropFloat("RageMeteor", "SpawnRadius", 400.0);
boss.SetPropFloat("RageMeteor", "MinAngle", 45.0);
boss.SetPropFloat("RageMeteor", "FreezeTime", 4.0);
boss.SetPropFloat("RageMeteor", "SpawnDelay", 0.094);
Expand Down Expand Up @@ -144,9 +144,30 @@ static void SpawnRocket(SaxtonHaleBase boss)
float vecBossOrigin[3];
GetEntPropVector(boss.iClient, Prop_Send, "m_vecOrigin", vecBossOrigin);
vecBossOrigin[2] += 41.5;

float vecTargetOrigin[3], vecAngles[3];
GetClientEyePosition(boss.iClient, vecTargetOrigin);
GetClientEyeAngles(boss.iClient, vecAngles);

// Take crosshair location
TR_TraceRayFilter(vecTargetOrigin, vecAngles, MASK_PLAYERSOLID, RayType_Infinite, TraceRay_DontHitEntity, boss.iClient);
if(TR_DidHit())
{
TR_GetEndPosition(vecTargetOrigin);
vecTargetOrigin[2] += 20.0;
}
else
{
vecTargetOrigin = vecBossOrigin;
}

// Stay close to the boss
float flDistance = GetVectorDistance(vecTargetOrigin, vecBossOrigin);
if (flDistance > 500.0)
ConstrainDistance(vecBossOrigin, vecTargetOrigin, flDistance, 500.0);

// Find any valid spots
float vecSpawnPos[3], vecAngles[3];
float vecSpawnPos[3];
float radius = boss.GetPropFloat("RageMeteor", "SpawnRadius");
bool foundValidPoint = false;
for (int a = 0; a < 5; a++)
Expand All @@ -158,15 +179,15 @@ static void SpawnRocket(SaxtonHaleBase boss)
static const float Angles[] = { 0.0, 25.0, -25.0 };
vecAngles[0] = Angles[b];

Handle trace = TR_TraceRayFilterEx(vecBossOrigin, vecAngles, (CONTENTS_SOLID|CONTENTS_WINDOW|CONTENTS_GRATE), RayType_Infinite, TraceRay_HitWallOnly);
Handle trace = TR_TraceRayFilterEx(vecTargetOrigin, vecAngles, (CONTENTS_SOLID|CONTENTS_WINDOW|CONTENTS_GRATE), RayType_Infinite, TraceRay_HitWallOnly);
TR_GetEndPosition(vecSpawnPos, trace);
delete trace;

float traceDistance = GetVectorDistance(vecBossOrigin, vecSpawnPos);
if (traceDistance >= minDistance)
flDistance = GetVectorDistance(vecTargetOrigin, vecSpawnPos);
if (flDistance >= minDistance)
{
foundValidPoint = true;
ConstrainDistance(vecBossOrigin, vecSpawnPos, traceDistance, minDistance);
ConstrainDistance(vecTargetOrigin, vecSpawnPos, flDistance, minDistance);
break;
}
}
Expand All @@ -187,8 +208,8 @@ static void SpawnRocket(SaxtonHaleBase boss)
vecSpawnPos[2] -= 20.0;

// TOO high up
if(vecSpawnPos[2] > (vecBossOrigin[2] + 1500.0))
vecSpawnPos[2] = vecBossOrigin[2] + 1500.0;
if(vecSpawnPos[2] > (vecTargetOrigin[2] + 1500.0))
vecSpawnPos[2] = vecTargetOrigin[2] + 1500.0;

vecAngles[0] = GetRandomFloat(boss.GetPropFloat("RageMeteor", "MinAngle"), 89.9);
vecAngles[1] = GetRandomFloat(-179.9, 179.9);
Expand Down
10 changes: 8 additions & 2 deletions addons/sourcemod/scripting/vsh/bosses/boss_yeti.sp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ static char g_strYetiKill[][] = {
"player/taunt_yeti_roar_beginning.wav"
};

static char g_strYetiRage[] = "ambient/atmosphere/terrain_rumble1.wav";

static char g_strYetiLastMan[][] = {
"ambient_mp3/lair/animal_call_yeti2.mp3",
};
Expand Down Expand Up @@ -70,8 +72,8 @@ public void Yeti_GetBossInfo(SaxtonHaleBase boss, char[] sInfo, int length)
StrCat(sInfo, length, "\n ");
StrCat(sInfo, length, "\nRage");
StrCat(sInfo, length, "\n- Damage requirement: 2500");
StrCat(sInfo, length, "\n- Rains hail down on to players around you");
StrCat(sInfo, length, "\n- Players hit will get frozen for 3 seconds");
StrCat(sInfo, length, "\n- Rains hail down on to players in front of you");
StrCat(sInfo, length, "\n- Players hit will get frozen for 4 seconds");
StrCat(sInfo, length, "\n- 200%% Rage: Increased projectile count and spawn rate");
}

Expand Down Expand Up @@ -103,6 +105,9 @@ public void Yeti_OnThink(SaxtonHaleBase boss)
public void Yeti_OnRage(SaxtonHaleBase boss)
{
FakeClientCommand(boss.iClient, "voicemenu 2 1");

EmitSoundToAll(g_strYetiRage);
EmitSoundToAll(g_strYetiRage);
}

public void Yeti_OnPlayerKilled(SaxtonHaleBase boss, Event event, int iVictim)
Expand Down Expand Up @@ -193,6 +198,7 @@ public void Yeti_Precache(SaxtonHaleBase boss)
PrecacheModel(YETI_MODEL);

PrepareMusic(YETI_THEME, false);
PrecacheSound(g_strYetiRage);

for (int i = 0; i < sizeof(g_strYetiRoundStart); i++)PrecacheSound(g_strYetiRoundStart[i]);
for (int i = 0; i < sizeof(g_strYetiWin); i++)PrecacheSound(g_strYetiWin[i]);
Expand Down

0 comments on commit 7a046b4

Please sign in to comment.