add teamplay 3

This commit is contained in:
alison wright 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(vector org) spawn_tfog;
void(vector org, entity death_owner) spawn_tdeath;
float(entity targ, entity attacker) SameTeam;
float modelindex_eyes, modelindex_player;
@ -1132,7 +1133,7 @@ void(entity targ, entity attacker) ClientObituary = {
bprint(" becomes bored with life\n");
}
return;
} else if((teamplay == 2) && (targ.team > 0) && (targ.team == attacker.team)) {
} else if(teamplay == 2 && SameTeam(targ, attacker)) {
if(rnum < 0.25) {
deathstring = " mows down a teammate\n";
} 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
@ -109,6 +117,15 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = {
local float save;
local float take;
// team play damage avoidance
if(teamplay == 1 && SameTeam(targ, attacker)) {
return;
}
if(teamplay == 3 && BothPlayers(targ, attacker)) {
return;
}
if(!targ.takedamage) {
return;
}
@ -161,11 +178,6 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = {
return;
}
// team play damage avoidance
if((teamplay == 1) && (targ.team > 0) && (targ.team == attacker.team)) {
return;
}
// do the damage
targ.health = targ.health - take;

8
todo
View File

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