Deadly Syringes


(hellraiser) #1

Just wanted to know if someone could tell me how to make the medic’s syringe inflict damage upon an enemy? I would like it to kill the player instantly or make the player explode after a few seconds. I think it’s got something to do with g_weapon.c, but I’m not too sure. I found the code in here for medics reviving teammates. Any help would be greatly appreciated.

Thanks.


(bacon) #2

Open g_combat.c
Find:


#ifndef DEBUG_STATS
	if ( g_debugDamage.integer )
#endif

Above that add:

if ((attacker->client->sess.sessionTeam != targ->client->sess.sessionTeam) && attacker->client->ps.weapon == WP_MEDIC_SYRINGE) {
		//take = targ->health;		// uncomment this line & comment the below to just wound them
		take = 200;
	}

(hellraiser) #3

Thank you so much bacon, I’ll go try that now. :banana:


(Sauron|EFG) #4

Could you do the same with pliers (a.k.a. Nipple Twisters)? :moo:


(pgh) #5

Add a low armour ammount for each class which can take small ammounts of armour and health instead of a full whack of health, allow medics to replenish health and engys to replenish armour. :] repairs self with pliers


(hellraiser) #6

Hey Bacon, I tried adding that code, but it has no effect. Any ideas?

Thanks.


(bacon) #7

Yeah I noticed that after I posted it. There’s code somewhere that’s preventing it from working; I still haven’t found that code :confused:


(ToasterKing) #8

Hellraiser from over at Kevinrose.com? <just an aside>


(Hydra) #9

You did compile it right?


(pgh) #10

rofl.


(hellraiser) #11

Hi Bacon, did you manage to find the code that prevents it from working? I can’t seem to find it. Thanks again.


(nUllSkillZ) #12

Hi,

inspired by this thread I 've tried to add a new weapon.
I decided that the covert op should get the poison syringe.
I’ve included the syringe already. It’s in the game. And covert op can use it.
But I’m not sure because of the function that should damage the opponents.
I changed the function for the knife (the original function of the medic is too complex for me). But I haven’t got the chance to test it.
So if you like I will post the changes that I 've made.


(hellraiser) #13

Have you given the covert a working poison syringe? It would be great if you could post the changes.

Thanks.


(nUllSkillZ) #14

I don’t know if it’s working.
Haven’t tested so far.
But I will post the changes.


(bacon) #15

I don’t know if this will work but it should be close…
Find:

if ( (traceEnt->client->ps.pm_type == PM_DEAD) && (traceEnt->client->sess.sessionTeam == ent->client->sess.sessionTeam)) {
				// Mad Doc - TDF moved all the revive stuff into its own function
				usedSyringe = ReviveEntity( ent, traceEnt );

				// OSP - syringe "hit"
				if(g_gamestate.integer == GS_PLAYING) ent->client->sess.aWeaponStats[WS_SYRINGE].hits++;
				if(ent && ent->client) G_LogPrintf("Medic_Revive: %d %d
", ent - g_entities, traceEnt - g_entities);	// OSP

				if( !traceEnt->isProp ) { // Gordon: flag for if they were teamkilled or not
					AddScore(ent, WOLF_MEDIC_BONUS); // JPW NERVE props to the medic for the swift and dexterous bit o healitude

					G_AddSkillPoints( ent, SK_FIRST_AID, 4.f );
					G_DebugAddSkillPoints( ent, SK_FIRST_AID, 4.f, "reviving a player" );
				}

				// Arnout: calculate ranks to update numFinalDead arrays. Have to do it manually as addscore has an early out
				if( g_gametype.integer == GT_WOLF_LMS ) {
					CalculateRanks();
				}
			}

Below it add:

else if ( (traceEnt->client->ps.pm_type != PM_DEAD) && (traceEnt->client->sess.sessionTeam != ent->client->sess.sessionTeam)) {
				//damage = traceEnt->health;
				damage = 200;
				mod = MOD_SYRINGE;
				G_Damage( traceEnt, ent, ent, vec3_origin, tr.endpos, damage , 0, mod);
			}

You might also want to do this.
Find:

if(mod != MOD_SYRINGE) {
		attacker->client->sess.damage_given += dmg;
		targ->client->sess.damage_received += dmg;
		if(targ->health <= 0) {
			attacker->client->sess.kills++;
			targ->client->sess.deaths++;
		}
	}

and replace it with:

attacker->client->sess.damage_given += dmg;
		targ->client->sess.damage_received += dmg;
		if(targ->health <= 0) {
			attacker->client->sess.kills++;
			targ->client->sess.deaths++;
		}

(MessiaH) #16

You should state that the code was in g_weapon.c

BTW, I get 2 compile errors saying that “damage” and “mod” are undeclared identifiers.


(bacon) #17

Yeah I forgot to mention that at the top of the function you have to put this in

int damage, mod;

(nUllSkillZ) #18

I made a “zip”-File containing the changed source-files.
Just search for the word “PSy” to find the changes.
In addition the following files have to be unzipped from “pak0.pk3” to the mod-directory:
“\icons\iconw_syringe_1_select.tga”
rename this to “\icons\iconw_p_syringe_1_select.tga”

“\weapons\syringe.weap”
rename this to “\weapons\p_syringe.weap”

All files of the directory:
“\models\multiplayer\syringe*.*”
rename this directory to “\models\multiplayer\p_syringe”

If you have tested this mini-mod please give me some feed-back.
Because I’ve modified the “Weapon_Knife”-damage-code I’m not sure if syringe hurts.
It should take all the health (but opponent should be revivabel) if Cov Op is up to level3 (instagib for level 4).

Source I haven’t touched is:

  • Calculating and displaying the stats at end of game (may be this works already)
  • The change of uniform skin if covert ops get / or loose disguise for the used arm-model.

Things I want to add:

  • Damage should be some kind of Flame-Thrower effect.

(MessiaH) #19

Thanks bacon it works! =D


(jamez) #20

G_BurnMeGood( gentity_t *self, gentity_t *body )

u want them to be on fire, use this function