Add 'part' cmd, which takes 1 parameter. The TE_ effect num to test. Not all are implemented, only the stubbed ones

This commit is contained in:
Marco Cawthorne 2023-08-28 16:41:12 -07:00
parent 971f7206f9
commit 2a18135b6a
Signed by: eukara
GPG key ID: CE2032F0A2882A22

190
g_cmds.c
View file

@ -899,6 +899,194 @@ void Cmd_PlayerList_f(edict_t *ent)
gi.cprintf(ent, PRINT_HIGH, "%s", text); gi.cprintf(ent, PRINT_HIGH, "%s", text);
} }
void Cmd_ParticleTest_f(edict_t *ent)
{
char *s;
vec3_t start;
vec3_t forward, right;
vec3_t offset;
vec3_t end;
int partNum = 0;
if (gi.argc () < 2)
return;
partNum = atoi(gi.args());
AngleVectors (ent->client->v_angle, forward, right, NULL);
start[0] = ent->s.origin[0] + forward[0] * 48;
start[1] = ent->s.origin[1] + forward[1] * 48;
start[2] = ent->s.origin[2] + forward[2] * 48;
end[0] = ent->s.origin[0] + forward[0] * 128;
end[1] = ent->s.origin[1] + forward[1] * 128;
end[2] = ent->s.origin[2] + forward[2] * 128;
gi.cprintf(ent, PRINT_CHAT, "impulse %d\n", partNum);
gi.WriteByte (svc_temp_entity);
gi.WriteByte (partNum);
switch (partNum) {
case TE_GUNSHOT:
break;
case TE_BLOOD:
break;
case TE_BLASTER:
break;
case TE_RAILTRAIL:
gi.WritePosition (start);
gi.WritePosition (end);
break;
case TE_SHOTGUN:
break;
case TE_EXPLOSION1:
break;
case TE_EXPLOSION2:
break;
case TE_ROCKET_EXPLOSION:
break;
case TE_GRENADE_EXPLOSION:
break;
case TE_SPARKS:
break;
case TE_SPLASH:
break;
case TE_BUBBLETRAIL:
break;
case TE_SCREEN_SPARKS:
break;
case TE_SHIELD_SPARKS:
break;
case TE_BULLET_SPARKS:
break;
case TE_LASER_SPARKS:
break;
case TE_PARASITE_ATTACK:
break;
case TE_ROCKET_EXPLOSION_WATER:
break;
case TE_GRENADE_EXPLOSION_WATER:
break;
case TE_MEDIC_CABLE_ATTACK:
break;
case TE_BFG_EXPLOSION:
break;
case TE_BFG_BIGEXPLOSION:
break;
case TE_BOSSTPORT:
break;
case TE_BFG_LASER:
break;
case TE_GRAPPLE_CABLE:
break;
case TE_WELDING_SPARKS:
break;
case TE_GREENBLOOD:
break;
case TE_BLUEHYPERBLASTER_DUMMY:
break;
case TE_PLASMA_EXPLOSION:
break;
case TE_TUNNEL_SPARKS:
break;
// ROGUE
case TE_BLASTER2:
break;
case TE_RAILTRAIL2:
break;
case TE_FLAME:
break;
case TE_LIGHTNING:
break;
case TE_DEBUGTRAIL: // 34
gi.WritePosition( start );
gi.WritePosition( end );
break;
case TE_PLAIN_EXPLOSION:
break;
case TE_FLASHLIGHT:
break;
case TE_FORCEWALL:
break;
case TE_HEATBEAM:
break;
case TE_MONSTER_HEATBEAM:
break;
case TE_STEAM:
break;
case TE_BUBBLETRAIL2:
break;
case TE_MOREBLOOD:
break;
case TE_HEATBEAM_SPARKS: // 43
gi.WritePosition( end );
gi.WriteDir( forward );
break;
case TE_HEATBEAM_STEAM:
break;
case TE_CHAINFIST_SMOKE:
break;
case TE_ELECTRIC_SPARKS:
break;
case TE_TRACKER_EXPLOSION:
break;
case TE_TELEPORT_EFFECT: // 48
gi.WritePosition( end );
break;
case TE_DBALL_GOAL: // 49
gi.WritePosition( end );
break;
case TE_WIDOWBEAMOUT: // 50
gi.WriteShort( 2001 );
gi.WritePosition( end );
break;
case TE_NUKEBLAST:
break;
case TE_WIDOWSPLASH:
break;
case TE_EXPLOSION1_BIG:
break;
case TE_EXPLOSION1_NP:
break;
case TE_FLECHETTE:
break;
case TE_BLUEHYPERBLASTER: // 56
gi.WritePosition( end );
gi.WriteDir( forward );
break;
case TE_BFG_ZAP: // 57
gi.WritePosition( ent->s.origin );
gi.WritePosition( end );
break;
case TE_BERSERK_SLAM: // 58
gi.WritePosition( end );
gi.WriteDir( forward );
break;
case TE_GRAPPLE_CABLE_2: // 59
gi.WriteShort(ent-g_edicts);
gi.WritePosition( start );
gi.WritePosition( end );
break;
case TE_POWER_SPLASH: // 60
gi.WriteShort(ent-g_edicts);
gi.WriteByte( 0 );
break;
case TE_LIGHTNING_BEAM: // 61
gi.WriteShort(ent-g_edicts);
gi.WritePosition( start );
gi.WritePosition( end );
break;
case TE_EXPLOSION1_NL: // 62
gi.WritePosition( end );
break;
case TE_EXPLOSION2_NL: // 63
gi.WritePosition( end );
break;
}
gi.multicast (ent->s.origin, MULTICAST_PHS);
}
/* /*
================= =================
@ -987,6 +1175,8 @@ void ClientCommand (edict_t *ent)
Cmd_Wave_f (ent); Cmd_Wave_f (ent);
else if (Q_stricmp(cmd, "playerlist") == 0) else if (Q_stricmp(cmd, "playerlist") == 0)
Cmd_PlayerList_f(ent); Cmd_PlayerList_f(ent);
else if (Q_stricmp(cmd, "part") == 0)
Cmd_ParticleTest_f(ent);
else // anything that doesn't match a command will be a chat else // anything that doesn't match a command will be a chat
Cmd_Say_f (ent, false, true); Cmd_Say_f (ent, false, true);
} }