add teamplay 3

master
an 2019-09-16 14:56:56 -04:00
parent 9edc786311
commit 6e03b9ec3d
3 changed files with 25 additions and 8 deletions

View File

@ -6,6 +6,7 @@ void() player_pain;
void() player_stand1; void() player_stand1;
void(vector org) spawn_tfog; void(vector org) spawn_tfog;
void(vector org, entity death_owner) spawn_tdeath; void(vector org, entity death_owner) spawn_tdeath;
float(entity targ, entity attacker) SameTeam;
float modelindex_eyes, modelindex_player; float modelindex_eyes, modelindex_player;
@ -1132,7 +1133,7 @@ void(entity targ, entity attacker) ClientObituary = {
bprint(" becomes bored with life\n"); bprint(" becomes bored with life\n");
} }
return; return;
} else if((teamplay == 2) && (targ.team > 0) && (targ.team == attacker.team)) { } else if(teamplay == 2 && SameTeam(targ, attacker)) {
if(rnum < 0.25) { if(rnum < 0.25) {
deathstring = " mows down a teammate\n"; deathstring = " mows down a teammate\n";
} else if(rnum < 0.50) { } else if(rnum < 0.50) {

View File

@ -7,6 +7,14 @@ void() monster_death_use;
//============================================================================ //============================================================================
float(entity targ, entity attacker) SameTeam = {
return targ.team > 0 && targ.team == attacker.team;
};
float(entity targ, entity attacker) BothPlayers = {
return targ.classname == "player" && attacker.classname == "player";
};
/* /*
============ ============
CanDamage CanDamage
@ -109,6 +117,15 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = {
local float save; local float save;
local float take; local float take;
// team play damage avoidance
if(teamplay == 1 && SameTeam(targ, attacker)) {
return;
}
if(teamplay == 3 && BothPlayers(targ, attacker)) {
return;
}
if(!targ.takedamage) { if(!targ.takedamage) {
return; return;
} }
@ -161,11 +178,6 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = {
return; return;
} }
// team play damage avoidance
if((teamplay == 1) && (targ.team > 0) && (targ.team == attacker.team)) {
return;
}
// do the damage // do the damage
targ.health = targ.health - take; targ.health = targ.health - take;

8
todo
View File

@ -1,10 +1,8 @@
core features: core features:
corpse pickups have keys
custom pronouns custom pronouns
distributed ammo distributed ammo
lives counting lives counting
no friendly fire by default
useful features: useful features:
@ -16,6 +14,12 @@ extraneous features:
emotes emotes
player sound effect option player sound effect option
players shoot through eachother
selectable player models and skins selectable player models and skins
sound clips sound clips
third person player weapon models third person player weapon models
done:
corpse pickups have keys
no friendly fire