From 417850ca608bd0fe367c4bd5c2975c52ed8f97ef Mon Sep 17 00:00:00 2001 From: sireus Date: Fri, 14 Sep 2012 22:57:42 +0000 Subject: [PATCH] fixed particle type guesswork git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6878 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/bot/botmanager.cpp | 10 +++++----- source/src/entities.cpp | 20 ++++++++++---------- source/src/protos.h | 24 ++++++++++++++++++++++++ source/src/serveractions.h | 2 +- source/src/weapon.cpp | 14 +++++++------- 5 files changed, 47 insertions(+), 23 deletions(-) diff --git a/source/src/bot/botmanager.cpp b/source/src/bot/botmanager.cpp index f6d759fb..70b0a1df 100644 --- a/source/src/bot/botmanager.cpp +++ b/source/src/bot/botmanager.cpp @@ -945,7 +945,7 @@ botent *CBotManager::CreateBot(const char *team, const char *skill, const char * if (name && *name) copystring(m->name, name, 16); else copystring(m->name, BotManager.GetBotName(), 16); - + updateclientname((playerent *)m); const char *tempteam = team && *team && strcmp(team, "random") ? team : BotManager.GetBotTeam(); @@ -1054,7 +1054,7 @@ void drawbeamtobots() loopv(bots) { if (bots[i]) - particle_trail(1, 500, player1->o, bots[i]->o); + particle_trail(PART_SMOKE, 500, player1->o, bots[i]->o); } } @@ -1128,7 +1128,7 @@ COMMAND(togglegrap, ARG_NONE); void togglebotview(char *bot) { if(!botmode()) return; - /** + /** Disable in arena modes, this command causes the game to go in an "infinite loop" due to player1 automatically suiciding thus causing a new round to begin. */ @@ -1209,7 +1209,7 @@ void drawbeamtocarrots() entity &e = ents[i]; vec o = { e.x, e.y, S(e.x, e.y)->floor+player1->eyeheight }; if ((e.type != CARROT) || !e.spawned) continue; - particle_trail(1, 500, player1->o, o); + particle_trail(PART_SMOKE, 500, player1->o, o); } } @@ -1222,7 +1222,7 @@ void drawbeamtoteleporters() entity &e = ents[i]; vec o = { e.x, e.y, S(e.x, e.y)->floor+player1->eyeheight }; if (e.type != TELEPORT) continue; - particle_trail(1, 500, player1->o, o); + particle_trail(PART_SMOKE, 500, player1->o, o); } } diff --git a/source/src/entities.cpp b/source/src/entities.cpp index c7c2ca64..14ad1f56 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -168,29 +168,29 @@ void renderentities() if(ice) continue; vec v(e.x, e.y, e.z); if(vec(v).sub(camera1->o).dot(camdir) < 0) continue; - //particle_splash(i == closest ? 12 : 2, 2, 40, v); - int sc = 17; // "carrot" (orange) - entity slot currently unused, possibly "reserved" + //particle_splash(i == closest ? PART_ELIGHT : PART_ECLOSEST, 2, 40, v); + int sc = PART_ECARROT; // "carrot" (orange) - entity slot currently unused, possibly "reserved" if(i==closest) { - sc = 2; // blue + sc = PART_ECLOSEST; // blue } else switch(e.type) { - case LIGHT : sc = 12; break; // white - case PLAYERSTART: sc = 13; break; // green + case LIGHT : sc = PART_ELIGHT; break; // white + case PLAYERSTART: sc = PART_ESPAWN; break; // green case I_CLIPS: case I_AMMO: - case I_GRENADE: sc = 14; break; // red + case I_GRENADE: sc = PART_EAMMO; break; // red case I_HEALTH: case I_HELMET: case I_ARMOUR: - case I_AKIMBO: sc = 15; break; // yellow + case I_AKIMBO: sc = PART_EPICKUP; break; // yellow case MAPMODEL: - case SOUND: sc = 16; break; // magenta + case SOUND: sc = PART_EMODEL; break; // magenta case LADDER: case CLIP: - case PLCLIP: sc = 18; break; // grey - case CTF_FLAG: sc = 19; break; // turquoise + case PLCLIP: sc = PART_ELADDER; break; // grey + case CTF_FLAG: sc = PART_EFLAG; break; // turquoise default: break; } //particle_splash(sc, i==closest?6:2, i==closest?120:40, v); diff --git a/source/src/protos.h b/source/src/protos.h index f4490df9..ef119178 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -600,6 +600,30 @@ enum #define PT_DECAL_MASK ((1<o); + particle_splash(PART_BLOOD, damage/10, 1000, d->o); } struct hitweap @@ -930,8 +930,8 @@ void grenadeent::explode() void grenadeent::splash() { - particle_splash(0, 50, 300, o); - particle_fireball(5, o); + particle_splash(PART_SPARK, 50, 300, o); + particle_fireball(PART_FIREBALL, o); addscorchmark(o); adddynlight(NULL, o, 16, 200, 100, 255, 255, 224); adddynlight(NULL, o, 16, 600, 600, 192, 160, 128); @@ -1214,7 +1214,7 @@ void gun::attackfx(const vec &from, const vec &to, int millis) TraceLine(from, to, owner, true, &tr); addbullethole(owner, from, tr.end); addshotline(owner, from, tr.end); - particle_splash(0, 5, 250, tr.end); + particle_splash(PART_SPARK, 5, 250, tr.end); adddynlight(owner, from, 4, 100, 50, 96, 80, 64); attacksound(); } @@ -1240,7 +1240,7 @@ bool shotgun::attack(vec &targ) void shotgun::attackfx(const vec &from, const vec &to, int millis) { - loopi(SGRAYS) particle_splash(0, 5, 200, sgr[i].rv); + loopi(SGRAYS) particle_splash(PART_SPARK, 5, 200, sgr[i].rv); if(addbullethole(owner, from, to)) { loopk(3) @@ -1274,8 +1274,8 @@ void sniperrifle::attackfx(const vec &from, const vec &to, int millis) TraceLine(from, to, owner, true, &tr); addbullethole(owner, from, tr.end); addshotline(owner, from, tr.end); - particle_splash(0, 50, 200, tr.end); - particle_trail(1, 500, from, tr.end); + particle_splash(PART_SPARK, 50, 200, tr.end); + particle_trail(PART_SMOKE, 500, from, tr.end); adddynlight(owner, from, 4, 100, 50, 96, 80, 64); attacksound(); }