示例#1
0
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;
}
示例#2
0
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);
}
示例#3
0
文件: g_misc.c 项目: DrItanium/rogue
//=========
//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);
}
示例#4
0
文件: g_monster.c 项目: yquake2/zaero
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--;
}
示例#5
0
//==========================================
// M_default_RunFrame
//
// States Machine & call client movement
//==========================================
void M_default_RunFrame( edict_t *self )
{
	usercmd_t	ucmd;
	memset( &ucmd, 0, sizeof(ucmd) );

	// Look for enemies
	if( M_default_FindEnemy(self) )
	{
		M_default_ChooseWeapon( self );
		M_default_FireWeapon( self );
		self->ai->state = BOT_STATE_ATTACK;
		self->ai->state_combat_timeout = level.time + 1.0;
	
	} else if( self->ai->state == BOT_STATE_ATTACK && 
		level.time > self->ai->state_combat_timeout)
	{
		//Jalfixme: change to: AI_SetUpStateMove(self);
		self->ai->state = BOT_STATE_MOVE;
	}

	// Execute the move, or wander
	if( self->ai->state == BOT_STATE_MOVE )
		M_default_Move( self, &ucmd );

	else if(self->ai->state == BOT_STATE_ATTACK)
		M_default_CombatMovement( self, &ucmd );

	else if ( self->ai->state == BOT_STATE_WANDER )
		M_default_Wander( self, &ucmd );


	//move a step
	if( M_default_movestep ( self, &ucmd ) )
		self->ai->bloqued_timeout = level.time + 10.0;

	M_WorldEffects (self);

	//MAKEME: NEEDS TO ADD MODEL ANIMATIONS (jal: I won't do it)
	//M_Default_SetUpAnimMoveFlags( self, &ucmd );
	//G_SetPModelFrame ( self );
	
	self->nextthink = level.time + FRAMETIME;
}
示例#6
0
文件: g_monster.c 项目: qbism/qbq2
// 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);
}
示例#7
0
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;
}