void mybrain_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { int n; M_Notify(self); // reduce lag by removing the entity right away #ifdef OLD_NOLAG_STYLE if (nolag->value) { M_Remove(self, false, true); return; } #endif self->s.effects = 0; self->monsterinfo.power_armor_type = POWER_ARMOR_NONE; self->monsterinfo.power_armor_power = 0; //GHz: Check for gibbed body if (self->health <= self->gib_health) { gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0); for (n= 0; n < 2; n++) ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC); for (n= 0; n < 4; n++) ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC); //ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC); #ifdef OLD_NOLAG_STYLE M_Remove(self, false, false); #else if (nolag->value) M_Remove(self, false, true); else M_Remove(self, false, false); #endif return; } if (self->deadflag == DEAD_DEAD) return; //GHz: Begin death sequence gi.sound (self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0); self->deadflag = DEAD_DEAD; self->takedamage = DAMAGE_YES; if (random() <= 0.5) self->monsterinfo.currentmove = &mybrain_move_death1; else self->monsterinfo.currentmove = &mybrain_move_death2; DroneList_Remove(self); if (self->activator && !self->activator->client) { self->activator->num_monsters_real--; // gi.bprintf(PRINT_HIGH, "releasing %p (%d)\n", self, self->activator->num_monsters_real); } }
void mychick_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { int n; M_Notify(self); // reduce lag by removing the entity right away #ifdef OLD_NOLAG_STYLE if (nolag->value) { M_Remove(self, false, true); return; } #endif // check for gib if (self->health <= self->gib_health) { gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0); for (n= 0; n < 2; n++) ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC); for (n= 0; n < 4; n++) ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC); //ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC); //self->deadflag = DEAD_DEAD; #ifdef OLD_NOLAG_STYLE M_Remove(self, false, false); #else if (nolag->value) M_Remove(self, false, true); else M_Remove(self, false, false); #endif return; } if (self->deadflag == DEAD_DEAD) return; // regular death self->deadflag = DEAD_DEAD; self->takedamage = DAMAGE_YES; //level.total_monsters--; n = rand() % 2; if (n == 0) { self->monsterinfo.currentmove = &mychick_move_death1; gi.sound (self, CHAN_VOICE, sound_death1, 1, ATTN_NORM, 0); } else { self->monsterinfo.currentmove = &mychick_move_death2; gi.sound (self, CHAN_VOICE, sound_death2, 1, ATTN_NORM, 0); } // gi.dprintf("mychick_die end()\n"); }
void gladiator_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { int n; M_Notify(self); // reduce lag by removing the entity right away #ifdef OLD_NOLAG_STYLE if (nolag->value) { M_Remove(self, false, true); return; } #endif // check for gib if (self->health <= self->gib_health) { gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0); for (n= 0; n < 2; n++) ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC); for (n= 0; n < 4; n++) ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC); #ifdef OLD_NOLAG_STYLE M_Remove(self, false, false); #else if (nolag->value) M_Remove(self, false, true); else M_Remove(self, false, false); #endif return; } if (self->deadflag == DEAD_DEAD) return; // begin death sequence gi.sound (self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0); self->deadflag = DEAD_DEAD; self->takedamage = DAMAGE_YES; self->monsterinfo.currentmove = &gladiator_move_death; DroneList_Remove(self); if (self->activator && !self->activator->client) { self->activator->num_monsters_real--; // gi.bprintf(PRINT_HIGH, "releasing %p (%d)\n", self, self->activator->num_monsters_real); } }
qboolean boss_checkstatus (edict_t *self) { if (!self->activator || !self->activator->inuse) { M_Remove(self, false, true); gi.dprintf("WARNING: boss_checkstatus() removed player-less boss!\n"); return false; } M_WorldEffects (self); M_CatagorizePosition (self); //M_SetEffects (self); if (level.time > self->wait) { if (self->health <= (0.1*self->max_health)) gi.centerprintf(self->owner, "***HEALTH LEVEL CRITICAL***\n"); else if (self->health <= (0.3*self->max_health)) gi.centerprintf(self->owner, "Low health warning.\n"); self->wait = level.time + BOSS_STATUS_DELAY; } // monitor boss idle frames if (!self->style) self->monsterinfo.idle_frames++; else self->monsterinfo.idle_frames = 0; //if (self->mtype != P_TANK && !self->activator->myskills.administrator)//4.2 player-tank exception // self->activator->client->ability_delay = level.time + 1; // don't let them use abilities! return true; }
void mytank_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { int n; M_Notify(self); // reduce lag by removing the entity right away if (nolag->value) { M_Remove(self, false, true); return; } // check for gibbed body if (self->health <= self->gib_health) { gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0); for (n= 0; n < 1; n++) ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC); for (n= 0; n < 4; n++) ThrowGib (self, "models/objects/gibs/sm_metal/tris.md2", damage, GIB_METALLIC); ThrowGib (self, "models/objects/gibs/chest/tris.md2", damage, GIB_ORGANIC); //ThrowHead (self, "models/objects/gibs/gear/tris.md2", damage, GIB_METALLIC); //self->deadflag = DEAD_DEAD; M_Remove(self, false, false); return; } if (self->deadflag == DEAD_DEAD) return; // begin death sequence gi.sound (self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0); self->deadflag = DEAD_DEAD; self->takedamage = DAMAGE_YES; self->monsterinfo.currentmove = &mytank_move_death; }
void decoy_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { int n; M_Notify(self); // check for gib if (self->health <= self->gib_health) { for (n= 0; n < 2; n++) ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC); for (n= 0; n < 4; n++) ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC); //ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC); //self->deadflag = DEAD_DEAD; M_Remove(self, false, false); return; } if (self->deadflag == DEAD_DEAD) return; self->deadflag = DEAD_DEAD; //Talent: Exploding Decoy /* if(damage > 0 && self->activator && getTalentLevel(self->activator, TALENT_EXPLODING_DECOY) != -1) { int talentLevel = getTalentLevel(self->activator, TALENT_EXPLODING_DECOY); int decoyDamage = 100 + talentLevel * 50; int decoyRadius = 100 + talentLevel * 25; T_RadiusDamage(self, self->activator, decoyDamage, self, decoyRadius, MOD_EXPLODING_DECOY); self->takedamage = DAMAGE_NO; self->think = BecomeExplosion1; self->nextthink = level.time + FRAMETIME; return; }*/ // regular death self->takedamage = DAMAGE_YES; self->s.modelindex2 = 0; n = rand() % 2; if (n == 0) self->monsterinfo.currentmove = &actor_move_death1; else self->monsterinfo.currentmove = &actor_move_death2; }
void makron_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { edict_t *tempent; int n; self->s.sound = 0; // check for gib if (self->health <= self->gib_health) { gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0); for (n= 0; n < 1 /*4*/; n++) ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC); for (n= 0; n < 4; n++) ThrowGib (self, "models/objects/gibs/sm_metal/tris.md2", damage, GIB_METALLIC); ThrowHead (self, "models/objects/gibs/gear/tris.md2", damage, GIB_METALLIC); //self->deadflag = DEAD_DEAD; M_Remove(self, false, false); return; } if (self->deadflag == DEAD_DEAD) return; // regular death gi.sound (self, CHAN_VOICE, sound_death, 1, ATTN_NONE, 0); self->deadflag = DEAD_DEAD; self->takedamage = DAMAGE_YES; tempent = G_Spawn(); VectorCopy (self->s.origin, tempent->s.origin); VectorCopy (self->s.angles, tempent->s.angles); tempent->s.origin[1] -= 84; makron_torso (tempent); self->monsterinfo.currentmove = &makron_move_death2; }
void m_soldier_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { int n; // notify the owner that the monster is dead M_Notify(self); #ifdef OLD_NOLAG_STYLE // reduce lag by removing the entity right away if (nolag->value) { M_Remove(self, false, true); return; } #endif // check for gib if (self->health <= self->gib_health) { gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0); for (n= 0; n < 2; n++) ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC); for (n= 0; n < 4; n++) ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC); //ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC); //self->deadflag = DEAD_DEAD; #ifdef OLD_NOLAG_STYLE M_Remove(self, false, false); #else if (nolag->value) M_Remove(self, false, true); else M_Remove(self, false, false); #endif return; } if (self->deadflag == DEAD_DEAD) return; // regular death gi.sound (self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0); self->takedamage = DAMAGE_YES; self->deadflag = DEAD_DEAD; n = GetRandom(1, 6); switch (n) { case 1: self->monsterinfo.currentmove = &m_soldier_move_death1; break; case 2: self->monsterinfo.currentmove = &m_soldier_move_death2; break; case 3: self->monsterinfo.currentmove = &m_soldier_move_death3; break; case 4: self->monsterinfo.currentmove = &m_soldier_move_death4; break; case 5: self->monsterinfo.currentmove = &m_soldier_move_death5; break; case 6: self->monsterinfo.currentmove = &m_soldier_move_death6; break; } DroneList_Remove(self); if (self->activator && !self->activator->client) { self->activator->num_monsters_real--; // gi.bprintf(PRINT_HIGH, "releasing %p (%d)\n", self, self->activator->num_monsters_real); } }
edict_t* INV_SpawnDrone(edict_t* self, edict_t *e, int index) { edict_t *monster; vec3_t start; trace_t tr; int mhealth = 1; monster = SpawnDrone(self, index, true); //monster = SpawnDrone(self, 4, true); // calculate starting position VectorCopy(e->s.origin, start); start[2] = e->absmax[2] + 1 + abs(monster->mins[2]); tr = gi.trace(start, monster->mins, monster->maxs, start, NULL, MASK_SHOT); // don't spawn here if a friendly monster occupies this space if (index != 30) // not a boss? if ((tr.fraction < 1) || (tr.ent && tr.ent->inuse && tr.ent->activator && tr.ent->activator->inuse && (tr.ent->activator == self) && (tr.ent->deadflag != DEAD_DEAD))) { // remove the monster and try again M_Remove(monster, false, false); return NULL; } e->wait = level.time + 1.0; // time until spawn is available again monster->monsterinfo.aiflags |= AI_FIND_NAVI; // search for navi monster->s.angles[YAW] = e->s.angles[YAW]; monster->prev_navi = NULL; // we modify the monsters' health lightly if (invasion->value == 1) // easy mode { if (invasion_difficulty_level < 7 && invasion_difficulty_level > 5) mhealth = (invasion_difficulty_level-5) * 0.2 + 1; else if (invasion_difficulty_level >= 7) mhealth = 1.8 + 0.15 * invasion_difficulty_level; }else if (invasion->value == 2) // hard mode { mhealth = 1.63 + 0.22 * invasion_difficulty_level; } monster->max_health = monster->health = monster->max_health*mhealth; // move the monster onto the spawn pad if (index != 30) { VectorCopy(start, monster->s.origin); VectorCopy(start, monster->s.old_origin); } monster->s.event = EV_OTHER_TELEPORT; if (e->count) monster->monsterinfo.inv_framenum = level.framenum + e->count; else { if (invasion->value == 1) monster->monsterinfo.inv_framenum = level.framenum + 60; // give them quad/invuln to prevent spawn-camping else if (invasion->value == 2) monster->monsterinfo.inv_framenum = level.framenum + 80; // Hard mode invin } gi.linkentity(monster); return monster; }