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 monster_think(edict_t *self){ M_MoveFrame(self); if(self->linkcount != self->monsterinfo.linkcount){ self->monsterinfo.linkcount = self->linkcount; M_CheckGround(self); } M_CatagorizePosition(self); M_WorldEffects(self); M_SetEffects(self); }
//========= //PGM - change so barrels will think and hence, blow up void barrel_think (edict_t *self) { // the think needs to be first since later stuff may override. self->think = barrel_think; self->nextthink = level.time + FRAMETIME; M_CatagorizePosition (self); self->flags |= FL_IMMUNE_SLIME; self->air_finished = level.time + 100; M_WorldEffects (self); }
void monster_think (edict_t *self) { M_MoveFrame (self); if (self->linkcount != self->monsterinfo.linkcount) { self->monsterinfo.linkcount = self->linkcount; M_CheckGround (self); } M_CatagorizePosition (self); M_WorldEffects (self); M_SetEffects (self); // decrease blindness if (self->monsterinfo.flashTime > 0) self->monsterinfo.flashTime--; }
void M_droptofloor(edict_t *ent){ vec3_t end; trace_t trace; ent->s.origin[2] += 1; VectorCopy(ent->s.origin, end); end[2] -= 256; trace = gi.trace(ent->s.origin, ent->mins, ent->maxs, end, ent, MASK_MONSTERSOLID); if(trace.fraction == 1 || trace.allsolid) return; VectorCopy(trace.endpos, ent->s.origin); gi.linkentity(ent); M_CheckGround(ent); M_CatagorizePosition(ent); }
// Knightmare- for dead monsters to check // if they've fallen into lava, etc. void deadmonster_think (edict_t *self) { M_CatagorizePosition (self); M_WorldEffects (self); M_SetEffects (self); }
void totem_general_think(edict_t *self) { edict_t *caster = self->activator; // Die if caster is not alive, or is not a valid ent if (!caster || !caster->client || !G_EntIsAlive(caster) || caster->flags & FL_CHATPROTECT) { RemoveTotem(self); return; } //Some players can have two totems out (with talent). Take cubes away from them every 5 seconds. if(level.framenum % 50 == 0 && caster->client && caster->totem2 == self) { int *cubes = &caster->client->pers.inventory[ITEM_INDEX(Fdi_POWERCUBE)]; //Talent: Totemic Focus. int cost = 10;//30 - getTalentLevel(caster, TALENT_TOTEM) * 5; if(*cubes < cost) { *cubes = 0; RemoveTotem(self); return; } *cubes -= cost; } if(self->delay < level.time) { switch(self->mtype) { case TOTEM_FIRE: FireTotem_think(self, caster); break; case TOTEM_WATER: WaterTotem_think(self, caster); break; case TOTEM_NATURE: NatureTotem_think(self, caster); break; default: break; } } // totem mastery allows regeneration if (level.time > self->lasthurt + 1.0 && !caster->myskills.abilities[TOTEM_MASTERY].disable && caster->myskills.abilities[TOTEM_MASTERY].current_level > 0) M_Regenerate(self, TOTEM_REGEN_FRAMES, TOTEM_REGEN_DELAY, 1.0, true, false, false, &self->monsterinfo.regen_delay1); //Rotate a little. self->s.angles[YAW] += 5; if(self->s.angles[YAW] == 360) self->s.angles[YAW] = 0; //GHz 4.32 // if position has been updated, check for ground entity if (self->linkcount != self->monsterinfo.linkcount) { self->monsterinfo.linkcount = self->linkcount; M_CheckGround (self); } // don't slide if (self->groundentity) VectorClear(self->velocity); M_CatagorizePosition (self); M_WorldEffects (self); //GHz totem_effects(self); self->nextthink = level.time + FRAMETIME; }