Add more bullet tracers (#1537)

* Add more bullet tracers

* Add Merasmus tracers

* Add Merasmus tracers
This commit is contained in:
Sinner 2021-08-23 19:24:33 +02:00 committed by GitHub
parent 5abc786fa8
commit 9bce1e2055
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 47 additions and 4 deletions

View File

@ -2,6 +2,15 @@
<Box padding="12 6 6 6" width="content" height="content" name="Bullet tracers"> <Box padding="12 6 6 6" width="content" height="content" name="Bullet tracers">
<List width="150"> <List width="150">
<AutoVariable width="fill" target="visual.bullet-tracers.enable" label="Enable" tooltip="Make weapons have Machina tracers."/> <AutoVariable width="fill" target="visual.bullet-tracers.enable" label="Enable" tooltip="Make weapons have Machina tracers."/>
<LabeledObject width="fill" label="Type">
<Select target="visual.bullet-tracers.type">
<Option name="Machina" value="0"/>
<Option name="C.A.P.P.E.R" value="1"/>
<Option name="Short Circuit Zap" value="2"/>
<Option name="Merasmus Vortex" value="3"/>
<Option name="Merasmus Zap" value="4"/>
</Select>
</LabeledObject>
<AutoVariable width="fill" target="visual.bullet-tracers.sniper-only" label="Sniperrifles only" tooltip="Only snipers have bullet tracers."/> <AutoVariable width="fill" target="visual.bullet-tracers.sniper-only" label="Sniperrifles only" tooltip="Only snipers have bullet tracers."/>
<AutoVariable width="fill" target="visual.bullet-tracers.local-only" label="Don't draw other players"/> <AutoVariable width="fill" target="visual.bullet-tracers.local-only" label="Don't draw other players"/>
<AutoVariable width="fill" target="visual.bullet-tracers.draw-local" label="Draw local beams" tooltip="Draw bullet tracers for self."/> <AutoVariable width="fill" target="visual.bullet-tracers.draw-local" label="Draw local beams" tooltip="Draw bullet tracers for self."/>

View File

@ -15,6 +15,7 @@ static settings::Boolean draw_local{ "visual.bullet-tracers.draw-local", "true"
static settings::Int team_mode{ "visual.bullet-tracers.teammode", "0" }; static settings::Int team_mode{ "visual.bullet-tracers.teammode", "0" };
static settings::Boolean one_trace_only{ "visual.bullet-tracers.one-trace-only", "false" }; static settings::Boolean one_trace_only{ "visual.bullet-tracers.one-trace-only", "false" };
static settings::Boolean sentry_tracers{ "visual.bullet-tracers.sentry", "true" }; static settings::Boolean sentry_tracers{ "visual.bullet-tracers.sentry", "true" };
static settings::Int tracer_type{ "visual.bullet-tracers.type", "0" };
class CEffectData class CEffectData
{ {
@ -44,10 +45,43 @@ CalcZoomedMuzzleLocation_t CalcZoomedMuzzleLocation_fn;
const char *AppropiateBeam(int team) const char *AppropiateBeam(int team)
{ {
if (team == TEAM_RED) switch (*tracer_type)
return "dxhr_sniper_rail_red"; {
else case 0:
return "dxhr_sniper_rail_blue"; //Machina
if (team == TEAM_RED)
return "dxhr_sniper_rail_red";
else
return "dxhr_sniper_rail_blue";
case 1:
//C.A.P.P.E.R
if (re::CTFPlayerShared::IsCritBoosted(re::CTFPlayerShared::GetPlayerShared(RAW_ENT(LOCAL_E))))
{
if (team == TEAM_RED)
return "bullet_tracer_raygun_red_crit";
else
return "bullet_tracer_raygun_blue_crit";
}
else
{
if (team == TEAM_RED)
return "bullet_tracer_raygun_red";
else
return "bullet_tracer_raygun_blue";
}
case 2:
//Short Circuit Zap
if (team == TEAM_RED)
return "dxhr_lightningball_hit_zap_red";
else
return "dxhr_lightningball_hit_zap_blue";
case 3:
//Merasmus Vortex
return "merasmus_zap_beam02";
case 4:
//Merasmus Zap
return "merasmus_zap";
}
} }
const char *GetParticleSystemNameFromIndex__detour(CEffectData &data) const char *GetParticleSystemNameFromIndex__detour(CEffectData &data)