class ChimeraHealthChangeListener extends CustomValueStatPoolsListener
{
	private var m_owner : weak< NPCPuppet >;

	public function SetOwner( owner : weak< NPCPuppet > )
	{
		m_owner = owner;
	}

	public override function OnStatPoolValueChanged( oldValue : Float, newValue : Float, percToPoints : Float )
	{
		CheckPhase( oldValue, newValue, percToPoints );
	}

	public function CheckPhase( oldValue : Float, newValue : Float, percToPoints : Float )
	{
		var phase2evt : ChangeToPhase2DelayedEvent;
		var gascloudevt : EnableGasCloudDelayedEvent;
		var phase3evt : ChangeToPhase3DelayedEvent;
		phase2evt = new ChangeToPhase2DelayedEvent;
		gascloudevt = new EnableGasCloudDelayedEvent;
		phase3evt = new ChangeToPhase3DelayedEvent;
		if( ( ( ( oldValue > 70.0 ) && ( newValue <= 70.0 ) ) && StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Chimera.Phase1" ) ) && !( StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Chimera.ChimeraForcePhase2" ) ) )
		{
			StatusEffectHelper.RemoveStatusEffect( m_owner, T"Chimera.ChimeraFocusMyers" );
			StatusEffectHelper.RemoveStatusEffect( m_owner, T"Chimera.ChimeraWaitForMyers" );
			m_owner.ScheduleAppearanceChange( 'mch_004__militech_chimera__basic_01_destroyed' );
			GameInstance.GetDelaySystem( m_owner.GetGame() ).DelayEvent( m_owner, phase2evt, 0.1 );
		}
		else if( StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Chimera.ChimeraForcePhase2" ) && StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Chimera.Phase1" ) )
		{
			StatusEffectHelper.RemoveStatusEffect( m_owner, T"Chimera.ChimeraFocusMyers" );
			StatusEffectHelper.RemoveStatusEffect( m_owner, T"Chimera.ChimeraWaitForMyers" );
			GameInstance.GetDelaySystem( m_owner.GetGame() ).DelayEvent( m_owner, phase2evt, 0.1 );
		}
		else if( ( ( ( oldValue > 1.0 ) && ( newValue <= 1.0 ) ) && StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Chimera.Phase2" ) ) && !( StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Chimera.ChimeraForcePhase3" ) ) )
		{
			StatusEffectHelper.RemoveStatusEffect( m_owner, T"Chimera.ChimeraFocusMyers" );
			StatusEffectHelper.RemoveStatusEffect( m_owner, T"Chimera.ChimeraWaitForMyers" );
			GameInstance.GetDelaySystem( m_owner.GetGame() ).DelayEvent( m_owner, phase3evt, 0.0 );
		}
		else if( ( ( oldValue > 40.0 ) && ( newValue <= 40.0 ) ) && StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Chimera.Phase2" ) )
		{
			GameInstance.GetDelaySystem( m_owner.GetGame() ).DelayEvent( m_owner, gascloudevt, 0.0 );
		}
		else if( StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Chimera.ChimeraForcePhase3" ) && StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Chimera.Phase2" ) )
		{
			GameInstance.GetDelaySystem( m_owner.GetGame() ).DelayEvent( m_owner, phase3evt, 0.0 );
		}
		else if( ( ( oldValue > 0.0 ) && ( newValue <= 0.0 ) ) && StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Chimera.Phase3" ) )
		{
			GameObject.StartReplicatedEffectEvent( m_owner, 'explode_Death' );
		}
	}

}

class ChimeraWeakspotDelayedEvent extends Event
{
}

class ChimeraComponent extends ScriptableComponent
{
	private var m_owner : weak< NPCPuppet >;
	private var m_ownerId : EntityID;
	private var m_player : weak< PlayerPuppet >;
	private var m_statPoolSystem : StatPoolsSystem;
	private var m_npcDeathCollisionComponent : SimpleColliderComponent;
	private var m_targetingBody : TargetingComponent;
	private var m_healthListener : ChimeraHealthChangeListener;
	private var m_defeatedOnAttach : Bool;
	private var m_weakspotComponent : WeakspotComponent;
	private var m_weakspots : array< weak< WeakspotObject > >;
	private var m_weakspotsInvulnerable : Bool;
	private var m_weakspotsDelay : DelayID;
	private var m_targetTrackerComponent : TargetTrackerComponent;

	public function OnGameAttach()
	{
		m_owner = ( ( NPCPuppet )( GetOwner() ) );
		m_ownerId = m_owner.GetEntityID();
		m_player = ( ( PlayerPuppet )( GetPlayerSystem().GetLocalPlayerControlledGameObject() ) );
		m_targetTrackerComponent = m_owner.GetTargetTrackerComponent();
		m_statPoolSystem = GameInstance.GetStatPoolsSystem( m_owner.GetGame() );
		m_defeatedOnAttach = GetFact( m_owner.GetGame(), 'chimera_defeated' ) != 0;
		if( m_defeatedOnAttach )
		{
			StatusEffectHelper.ApplyStatusEffect( m_owner, T"Chimera.Phase3", m_ownerId );
			DisableAllHitShapes();
			EnablePhase2HitShapes();
			m_owner.ScheduleAppearanceChange( 'mch_004__militech_chimera__basic_01_burnt' );
			if( m_npcDeathCollisionComponent )
			{
				m_npcDeathCollisionComponent.Toggle( true );
			}
		}
		else
		{
			m_healthListener = new ChimeraHealthChangeListener;
			m_healthListener.SetValue( 80.0 );
			m_healthListener.SetOwner( m_owner );
			m_statPoolSystem.RequestRegisteringListener( m_ownerId, gamedataStatPoolType.Health, m_healthListener );
			StatusEffectHelper.ApplyStatusEffect( m_owner, T"Chimera.Phase1", m_ownerId );
			DisableAllHitShapes();
			EnablePhase1HitShapes();
		}
		m_weakspotComponent = m_owner.GetWeakspotComponent();
		m_weakspotsInvulnerable = false;
		if( m_defeatedOnAttach )
		{
			SetWeakspotsInvulnerable();
		}
		else if( StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Chimera.ChimeraWeakSpotToggle" ) )
		{
			SetWeakspotsInvulnerable();
			AnimationControllerComponent.SetAnimWrapperWeight( m_owner, 'section1Locomotion', 1.0 );
		}
		GameInstance.GetGodModeSystem( m_owner.GetGame() ).AddGodMode( m_ownerId, gameGodModeType.Immortal, 'Default' );
	}

	public function OnGameDetach()
	{
		if( !( m_defeatedOnAttach ) )
		{
			m_statPoolSystem.RequestUnregisteringListener( m_ownerId, gamedataStatPoolType.Health, m_healthListener );
			m_healthListener = NULL;
		}
	}

	protected event OnRequestComponents( ri : EntityRequestComponentsInterface )
	{
		EntityRequestComponentsInterface.RequestComponent( ri, 'npcCollision', 'SimpleColliderComponent', true );
		EntityRequestComponentsInterface.RequestComponent( ri, 'TargetingChimeraBody', 'gameTargetingComponent', true );
	}

	protected event OnTakeControl( ri : EntityResolveComponentsInterface )
	{
		m_npcDeathCollisionComponent = ( ( SimpleColliderComponent )( EntityResolveComponentsInterface.GetComponent( ri, 'npcCollision' ) ) );
		m_targetingBody = ( ( TargetingComponent )( EntityResolveComponentsInterface.GetComponent( ri, 'TargetingChimeraBody' ) ) );
		m_targetingBody.Toggle( false );
	}

	protected event OnDeath( evt : gameDeathEvent )
	{
		StatusEffectHelper.RemoveStatusEffect( m_owner, T"Effectors.ChimeraSelfDestructPhase1" );
		StatusEffectHelper.RemoveStatusEffect( m_owner, T"Effectors.ChimeraSelfDestructPhase2" );
		StatusEffectHelper.RemoveStatusEffect( m_owner, T"Effectors.ChimeraSelfDestructPhase3" );
		StatusEffectHelper.RemoveStatusEffect( m_owner, T"Chimera.ChimeraSelfDestructCountdown" );
		StatusEffectHelper.RemoveStatusEffect( m_owner, T"Chimera.ChimeraBlackWallVFXStatusEffect" );
		GameObject.StopReplicatedEffectEvent( m_owner, 'self_destruction_stage_1' );
		GameObject.StopReplicatedEffectEvent( m_owner, 'self_destruction_stage_2' );
		GameObject.StopReplicatedEffectEvent( m_owner, 'self_destruction_stage_3' );
	}

	public function SetPercentLifeForPhase( value : Float )
	{
		m_statPoolSystem = GameInstance.GetStatPoolsSystem( m_owner.GetGame() );
		m_statPoolSystem.RequestSettingStatPoolValue( m_ownerId, gamedataStatPoolType.Health, value, m_owner, true );
	}

	protected event OnStatusEffectApplied( evt : ApplyStatusEffectEvent )
	{
		var tags : array< CName >;
		tags = evt.staticData.GameplayTags();
		if( tags.Contains( 'ChimeraArenaMode' ) )
		{
			AnimationControllerComponent.SetAnimWrapperWeight( m_owner, 'section3DamagedLocomotion', 1.0 );
			if( !( m_defeatedOnAttach ) )
			{
				SetPercentLifeForPhase( 90.0 );
				m_owner.ScheduleAppearanceChange( 'mch_004__militech_chimera__basic_01_fall_damage' );
			}
		}
		if( tags.Contains( 'ChimeraWeakSpotDestroyed' ) && StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Chimera.Phase1" ) )
		{
			WithdrawHealthPercentage( m_owner, 2.0 );
		}
		if( tags.Contains( 'ChimeraWeakSpotDestroyed' ) && StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Chimera.Phase2" ) )
		{
			WithdrawHealthPercentage( m_owner, 5.0 );
		}
		if( StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Minotaur.DefeatedMinotaur" ) )
		{
			if( m_npcDeathCollisionComponent )
			{
				m_npcDeathCollisionComponent.Toggle( true );
			}
			EnablePhase2HeadVulnerable();
		}
		if( StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"BaseStatusEffect.SuicideWithGrenade" ) )
		{
			StatusEffectHelper.ApplyStatusEffect( m_owner, T"Chimera.ChimeraDetonateWeakspot", m_ownerId );
		}
		if( tags.Contains( 'ChimeraWeakSpotToggle' ) )
		{
			SetWeakspotsInvulnerable();
			AnimationControllerComponent.SetAnimWrapperWeight( m_owner, 'section1Locomotion', 1.0 );
		}
		if( tags.Contains( 'Blind' ) )
		{
			StatusEffectHelper.ApplyStatusEffect( m_owner, T"Chimera.ChimeraBlinded", m_ownerId );
		}
		if( tags.Contains( 'ChimeraCameraHeavyShake' ) )
		{
			StatusEffectHelper.ApplyStatusEffect( m_player, T"BaseStatusEffect.ChimeraStompShake" );
		}
		if( tags.Contains( 'ChimeraSuicide' ) && StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Chimera.Phase1" ) )
		{
			SetPercentLifeForPhase( 69.90000153 );
		}
		if( tags.Contains( 'ChimeraSuicide' ) && StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Chimera.Phase2" ) )
		{
			SetPercentLifeForPhase( 1.0 );
		}
		if( tags.Contains( 'MemoryWipe' ) && m_targetTrackerComponent )
		{
			m_targetTrackerComponent.ClearThreats();
		}
		if( StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Chimera.ChimeraForcePhase2" ) )
		{
			SetPercentLifeForPhase( 69.90000153 );
		}
		if( StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Chimera.ChimeraForcePhase3" ) )
		{
			SetPercentLifeForPhase( 1.0 );
		}
	}

	protected event OnStatusEffectRemoved( evt : RemoveStatusEffect )
	{
		var tags : array< CName >;
		tags = evt.staticData.GameplayTags();
		if( tags.Contains( 'ChimeraRepairing' ) && StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Chimera.Phase2" ) )
		{
			StatusEffectHelper.RemoveStatusEffect( m_owner, T"BaseStatusEffect.BossNoInterrupt" );
			EnablePhase2HeadVulnerable();
		}
		if( tags.Contains( 'ChimeraWeakSpotToggle' ) )
		{
			RemoveWeakspotsInvulnerable();
			AnimationControllerComponent.SetAnimWrapperWeight( m_owner, 'section1Locomotion', 0.0 );
		}
	}

	protected event OnChimeraWeakspotDelayedEvent( evt : ChimeraWeakspotDelayedEvent )
	{
		EnsureWeakspotsInitialized();
	}

	public function EnsureWeakspotsInitialized() : Bool
	{
		var i : Int32;
		var request : ChimeraWeakspotDelayedEvent;
		var weakspotAttributesEvent : WeakspotRequestAttributeChangeEvent;
		if( !( m_weakspotComponent ) )
		{
			return false;
		}
		if( m_weakspots.Size() > 0 )
		{
			return true;
		}
		m_weakspotComponent.GetWeakspots( m_weakspots );
		if( m_weakspots.Size() == 0 )
		{
			request = new ChimeraWeakspotDelayedEvent;
			m_weakspotsDelay = GameInstance.GetDelaySystem( m_owner.GetGame() ).DelayEvent( m_owner, request, 0.1, true );
			return false;
		}
		for( i = 0; i < m_weakspots.Size(); i += 1 )
		{
			if( !( m_weakspots[ i ].IsDead() ) )
			{
				weakspotAttributesEvent = new WeakspotRequestAttributeChangeEvent;
				weakspotAttributesEvent.blockDamage = m_weakspotsInvulnerable;
				weakspotAttributesEvent.blockHighlight = m_weakspotsInvulnerable;
				m_weakspots[ i ].QueueEvent( weakspotAttributesEvent );
			}
		}
		return true;
	}

	public function SetWeakspotsInvulnerable()
	{
		var i : Int32;
		var weakspotAttributesEvent : WeakspotRequestAttributeChangeEvent;
		m_weakspotsInvulnerable = true;
		if( !( EnsureWeakspotsInitialized() ) )
		{
			return;
		}
		for( i = 0; i < m_weakspots.Size(); i += 1 )
		{
			if( !( m_weakspots[ i ].IsDead() ) )
			{
				weakspotAttributesEvent = new WeakspotRequestAttributeChangeEvent;
				weakspotAttributesEvent.blockDamage = true;
				weakspotAttributesEvent.blockHighlight = true;
				m_weakspots[ i ].QueueEvent( weakspotAttributesEvent );
			}
		}
	}

	public function RemoveWeakspotsInvulnerable()
	{
		var i : Int32;
		var weakspotAttributesEvent : WeakspotRequestAttributeChangeEvent;
		m_weakspotsInvulnerable = false;
		if( !( EnsureWeakspotsInitialized() ) )
		{
			return;
		}
		for( i = 0; i < m_weakspots.Size(); i += 1 )
		{
			if( !( m_weakspots[ i ].IsDead() ) )
			{
				weakspotAttributesEvent = new WeakspotRequestAttributeChangeEvent;
				weakspotAttributesEvent.blockDamage = false;
				weakspotAttributesEvent.blockHighlight = false;
				m_weakspots[ i ].QueueEvent( weakspotAttributesEvent );
			}
		}
	}

	private function WithdrawHealthPercentage( target : NPCPuppet, valueToSet : Float )
	{
		var value : Float;
		value = valueToSet;
		m_statPoolSystem.RequestChangingStatPoolValue( m_ownerId, gamedataStatPoolType.Health, -( value ), m_owner, false );
	}

	protected event OnChangeToPhase2( evt : ChangeToPhase2DelayedEvent )
	{
		ApplyPhase2();
		DisablePhase1HitShapes();
		EnablePhase2HitShapes();
		m_targetingBody.Toggle( true );
	}

	public function ApplyPhase2()
	{
		var ChimeraPhase2EnableDestrutionEvent : ToggleImpulseDestruction;
		ChimeraPhase2EnableDestrutionEvent = new ToggleImpulseDestruction;
		ChimeraPhase2EnableDestrutionEvent.enable = true;
		m_owner.QueueEvent( ChimeraPhase2EnableDestrutionEvent );
		GameObject.StartReplicatedEffectEvent( m_owner, 'explode_phase2' );
		StatusEffectHelper.RemoveStatusEffect( m_owner, T"Chimera.Phase1" );
		StatusEffectHelper.ApplyStatusEffect( m_owner, T"Chimera.Phase2", m_ownerId );
		StatusEffectHelper.ApplyStatusEffect( m_owner, T"Chimera.ChimeraRepairing", m_ownerId );
		StatusEffectHelper.ApplyStatusEffect( m_owner, T"Chimera.ChimeraHealing", 10.0 );
		StatusEffectHelper.ApplyStatusEffect( m_owner, T"BaseStatusEffect.BossNoInterrupt", m_ownerId );
		GameObject.StartReplicatedEffectEvent( m_owner, 'explode_phase2' );
		SetPercentLifeForPhase( 70.0 );
	}

	protected event OnEnableGasCloud( evt : EnableGasCloudDelayedEvent )
	{
		EnableGasCloud();
	}

	public function EnableGasCloud()
	{
		StatusEffectHelper.ApplyStatusEffect( m_owner, T"Chimera.UnlockGasCloud", m_ownerId );
	}

	private function DestroyAllWeakspots()
	{
		var weakspots : array< weak< WeakspotObject > >;
		var scriptWeakspot : ScriptedWeakspotObject;
		var i : Int32;
		m_owner.GetWeakspotComponent().GetWeakspots( weakspots );
		if( weakspots.Size() > 0 )
		{
			for( i = 0; i < weakspots.Size(); i += 1 )
			{
				scriptWeakspot = ( ( ScriptedWeakspotObject )( weakspots[ i ] ) );
				scriptWeakspot.DestroyWeakspot( m_owner );
				ScriptedWeakspotObject.Kill( weakspots[ i ] );
			}
		}
	}

	protected event OnChangeToPhase3( evt : ChangeToPhase3DelayedEvent )
	{
		ApplyPhase3();
	}

	public function ApplyPhase3()
	{
		StatusEffectHelper.RemoveStatusEffect( m_owner, T"Chimera.Phase2" );
		StatusEffectHelper.ApplyStatusEffect( m_owner, T"Chimera.Phase3", m_ownerId );
		StatusEffectHelper.ApplyStatusEffect( m_owner, T"Chimera.InvulnerablePhase3", m_ownerId );
		GameObject.StartReplicatedEffectEvent( m_owner, 'explode_phase3' );
		StatusEffectHelper.ApplyStatusEffect( m_owner, T"BaseStatusEffect.BossNoInterrupt", m_ownerId );
		SetPercentLifeForPhase( 1.20000005 );
		DestroyAllWeakspots();
	}

	protected function DisableAllHitShapes()
	{
		HitShapeUserDataBase.DisableHitShape( m_owner, 'Head', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'Front', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'MetalstormRepresentation', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'Head_Vulnerable', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'Front_Vulnerable', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'MetalstormRepresentation_Vulnerable', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'Head_Transition', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'Front_Transition', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'MetalstormRepresentation_Transition', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'LeftFrontLeg', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'LeftLeg', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'LeftBackLeg', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'RightFrontLeg', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'RightBackLeg', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'RightLeg', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'LeftFrontLeg_Vulnerable', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'RightBackLeg_Vulnerable', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'RightLeg_Vulnerable', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'RightFrontLeg_Vulnerable', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'LeftLeg_Vulnerable', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'LeftBackLeg_Vulnerable', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'LeftFrontLeg_b', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'LeftLeg_b', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'LeftBackLeg_b', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'RightFrontLeg_b', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'RightBackLeg_b', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'RightLeg_b', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'LeftFrontLeg_b_Vulnerable', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'RightBackLeg_b_Vulnerable', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'RightLeg_b_Vulnerable', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'RightFrontLeg_b_Vulnerable', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'LeftLeg_b_Vulnerable', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'LeftBackLeg_b_Vulnerable', false );
	}

	protected function DisablePhase1HitShapes()
	{
		HitShapeUserDataBase.DisableHitShape( m_owner, 'Head', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'Front', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'MetalstormRepresentation', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'LeftFrontLeg', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'LeftLeg', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'LeftBackLeg', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'RightFrontLeg', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'RightBackLeg', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'RightLeg', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'LeftFrontLeg_b', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'LeftLeg_b', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'LeftBackLeg_b', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'RightFrontLeg_b', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'RightBackLeg_b', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'RightLeg_b', false );
	}

	protected function EnablePhase2HeadVulnerable()
	{
		HitShapeUserDataBase.DisableHitShape( m_owner, 'Head_Transition', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'Head_Vulnerable', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'Front_Transition', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'Front_Vulnerable', false );
		HitShapeUserDataBase.DisableHitShape( m_owner, 'MetalstormRepresentation_Transition', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'MetalstormRepresentation_Vulnerable', false );
	}

	protected function EnablePhase1HitShapes()
	{
		HitShapeUserDataBase.EnableHitShape( m_owner, 'Head', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'Front', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'MetalstormRepresentation', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'LeftFrontLeg', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'LeftLeg', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'LeftBackLeg', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'RightFrontLeg', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'RightBackLeg', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'RightLeg', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'LeftFrontLeg_b', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'LeftLeg_b', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'LeftBackLeg_b', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'RightFrontLeg_b', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'RightBackLeg_b', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'RightLeg_b', false );
	}

	protected function EnablePhase2HitShapes()
	{
		HitShapeUserDataBase.EnableHitShape( m_owner, 'Head_Transition', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'Front_Transition', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'MetalstormRepresentation_Transition', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'LeftFrontLeg_Vulnerable', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'RightBackLeg_Vulnerable', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'RightLeg_Vulnerable', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'RightFrontLeg_Vulnerable', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'LeftLeg_Vulnerable', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'LeftBackLeg_Vulnerable', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'LeftFrontLeg_b_Vulnerable', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'RightBackLeg_b_Vulnerable', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'RightLeg_b_Vulnerable', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'RightFrontLeg_b_Vulnerable', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'LeftLeg_b_Vulnerable', false );
		HitShapeUserDataBase.EnableHitShape( m_owner, 'LeftBackLeg_b_Vulnerable', false );
	}

	protected event OnAudioEvent( evt : AudioEvent )
	{
		var evtFootstep : HeavyFootstepEvent;
		var player : weak< PlayerPuppet >;
		evtFootstep = new HeavyFootstepEvent;
		player = ( ( PlayerPuppet )( GetPlayerSystem().GetLocalPlayerControlledGameObject() ) );
		if( !( player ) )
		{
			return false;
		}
		if( ( evt.eventName == 'q302_sc_02_chimera_melee_stomp' || evt.eventName == 'q302_sc_02_chimera_melee_front_stomp' ) || evt.eventName == 'q302_sc_02_chimera_attack_land' )
		{
			evtFootstep.instigator = m_owner;
			evtFootstep.audioEventName = evt.eventName;
			player.QueueEvent( evtFootstep );
		}
	}

}

class ChangeToPhase2DelayedEvent extends DelayEvent
{
}

class ChangeToPhase3DelayedEvent extends DelayEvent
{
}

class EnableGasCloudDelayedEvent extends DelayEvent
{
}

