===============================================================

Code used by the xogre to function as a Shield Ogre.
That is.., bullits and grenades won't damage it.
MadFox / Ijed.

===============================================================

ai.qc     : 
on top after
void() knight_bow1;
add:

void() xogre_shield1;

---
*(not implemented in qiakec-V1-01)
(void) SightSound =
{
local float	rsnd;
add:

	else if	(self.classname == "monster_xogre")							
		sound (self, CHAN_VOICE, "xogre/xogwake.wav", 1, ATTN_NORM);

---
line : 603
void(float dist) ai_run =

after:

	enemy_yaw = vectoyaw(self.enemy.origin - self.origin);
add:	
	//ijed XOgre shielding awareness code
	if ((self.classname == "monster_xogre") && (time < self.enemy.attack_finished)) //is my enemy attacking?
	{
		//shields himself from nails and rockets, does not shield against monsters
		if ((self.enemy.weapon == IT_NAILGUN) ||
		(self.enemy.weapon == IT_SUPER_NAILGUN) ||
		(self.enemy.weapon == IT_GRENADE_LAUNCHER) ||
		(self.enemy.weapon == IT_ROCKET_LAUNCHER))
		{
			self.think = xogre_shield1;	//go into shield routine
		}
	}
	
==============================================================

client.qc    :
line : 1777

after:

				if (attacker.classname == "monster_ogre")
					bprint (" was destroyed by an Ogre\n");
add:
				if (attacker.classname == "monster_xogre")
					bprint (" was butchered by an Elder Ogre\n");

==============================================================

defs.qc     :
at the end :

void(entity targ, entity inflictor, entity attacker, float damage) T_Damage;
.float				shielded;		//for the XOgre
.float spawned;
==============================================================

weapons.qc  :

line 548 : 

add this at top:

void() GrenadeTouch =
{
	//ijed XOgre shielding
	if (other.shielded)	
	{
		other.solid = SOLID_BBOX;	//bounce off the ogre...
		self.owner = other;
		return;
	}
	
---

line 355:

after:

	if (pointcontents(self.origin) == CONTENT_SKY)
	{
		remove(self);
		return;
	}

add:

	//ijed XOgre reflection
	if (other.shielded //remove the current projectile and replace it with a reflected one
	{
		self.movetype = MOVETYPE_BOUNCE;	
		self.owner = other;
		return;
	}

        damg = 100 + random()*20;
	
	if (other.health)
	{
		if ((other.classname == "monster_shambler") || (other.classname == "monster_xogre"))
			damg = damg * 0.5;	// mostly immune
		T_Damage (other, self, self.owner, damg );		
	}

---
In :
void(float ox) W_FireSpikes =

line 691 :

after: 

	self.punchangle_x = -2;
};
					
and before :

void() spike_touch =

Add:


.float hit_z;
void() spike_touch =
{
local float rand;

	if (other == self.owner)
		return;

	if (other.solid == SOLID_TRIGGER)
		return;	// trigger field, do nothing

	if (pointcontents(self.origin) == CONTENT_SKY)
	{
		remove(self);
		return;
	}
	
	//ijed XOgre reflection
	if (other.shielded)	//this should really remove the current projectile and replace it with a properly reflected one
	{
		self.movetype = MOVETYPE_BOUNCE;	
		self.owner = other;
		return;
	}
	
// hit something that bleeds
	if (other.takedamage)
	{
		spawn_touchblood (9, other.bloodtype);
		T_Damage (other, self, self.owner, 9);
	}
	else
	{
		WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
		
		if (self.classname == "wizspike")
			WriteByte (MSG_BROADCAST, TE_WIZSPIKE);
		else if (self.classname == "knightspike")
			WriteByte (MSG_BROADCAST, TE_KNIGHTSPIKE);
		else
			WriteByte (MSG_BROADCAST, TE_SPIKE);
		WriteCoord (MSG_BROADCAST, self.origin_x);
		WriteCoord (MSG_BROADCAST, self.origin_y);
		WriteCoord (MSG_BROADCAST, self.origin_z);
	}

	remove(self);

};

======================================================================