Ejemplo n.º 1
0
	private void HandleCircuitryFixing(CComponentInterface _Component)
	{
		if(CNetwork.IsServer)
		{
			m_AtmosphereGenerator.ActivateGeneration();
		}
	}
Ejemplo n.º 2
0
 private void HandleFluidHealthChange(CComponentInterface _Component, CActorHealth _ComponentHealth)
 {
     if (CNetwork.IsServer)
     {
         m_AtmosphereGenerator.AtmosphereGenerationRate = m_MaxAtmosphereGenerationRate * (_ComponentHealth.health / _ComponentHealth.health_initial);
     }
 }
Ejemplo n.º 3
0
	private void HandleFluidHealthChange(CComponentInterface _Component, CActorHealth _ComponentHealth)
	{
		if(CNetwork.IsServer)
		{
			m_AtmosphereGenerator.AtmosphereGenerationRate = m_MaxAtmosphereGenerationRate * (_ComponentHealth.health / _ComponentHealth.health_initial);
		}
	}
Ejemplo n.º 4
0
 private void HandleCalibrationHealthChange(CComponentInterface _Component, CActorHealth _ComponentHealth)
 {
     if (CNetwork.IsServer)
     {
         m_PowerGenerator.PowerGenerationRate = m_MaxPowerGenerationRate * (_ComponentHealth.health / _ComponentHealth.health_initial);
     }
 }
Ejemplo n.º 5
0
 private void HandleCircuitryBreaking(CComponentInterface _Component)
 {
     if (CNetwork.IsServer)
     {
         m_PowerGenerator.DeactivatePowerGeneration();
     }
 }
Ejemplo n.º 6
0
    void Start()
    {
        m_TargetList   = new List <Transform>();
        m_eRepairState = ERepairState.RepairInactive;

        GetComponent <CToolInterface>().EventPrimaryActiveChange += (bool _bDown) =>
        {
            if (_bDown &&
                m_eRepairState == ERepairState.RepairInactive)
            {
                GameObject cTargetActorInteractable = GetComponent <CToolInterface>().OwnerPlayerActor.GetComponent <CPlayerInteractor>().TargetActorObject;

                if (cTargetActorInteractable != null)
                {
                    CComponentInterface cActorComponentInterface = cTargetActorInteractable.GetComponent <CComponentInterface>();

                    if (cActorComponentInterface != null &&
                        cActorComponentInterface.ComponentType == CComponentInterface.EType.CircuitryComp)
                    {
                        BeginRepair(cTargetActorInteractable);
                    }
                }
            }
            else if (m_eRepairState == ERepairState.RepairActive)
            {
                EndRepairs();
            }
        };
    }
Ejemplo n.º 7
0
	private void HandleCircuitryBreaking(CComponentInterface _Component)
	{
		if(CNetwork.IsServer)
		{
			m_PowerGenerator.DeactivatePowerGeneration();
		}
	}
Ejemplo n.º 8
0
	private void HandleCalibrationHealthChange(CComponentInterface _Component, CActorHealth _ComponentHealth)
	{
		if(CNetwork.IsServer)
		{
			m_PowerGenerator.PowerGenerationRate = m_MaxPowerGenerationRate * (_ComponentHealth.health / _ComponentHealth.health_initial);
		}
	}
Ejemplo n.º 9
0
 private void HandleCircuitryFixing(CComponentInterface _Component)
 {
     if (CNetwork.IsServer)
     {
         m_AtmosphereGenerator.ActivateGeneration();
     }
 }
Ejemplo n.º 10
0
    void OnHealthChange(CComponentInterface _Sender, CActorHealth _SenderHealth)
    {
        m_CurrentHealth  = _SenderHealth.health;
        m_PreviousHealth = _SenderHealth.health_previous;
        float maxHealth = _SenderHealth.health_initial;

        transform.FindChild("Model").renderer.material.color = Color.Lerp(Color.red, Color.green, m_CurrentHealth / maxHealth);
    }
Ejemplo n.º 11
0
	void OnHealthChange(CComponentInterface _Sender, CActorHealth _SenderHealth)
	{
		m_CurrentHealth = _SenderHealth.health;
		m_PreviousHealth = _SenderHealth.health_previous;
		float maxHealth = _SenderHealth.health_initial;
		
		transform.FindChild("Model").renderer.material.color = Color.Lerp(Color.red, Color.green, m_CurrentHealth / maxHealth);
	}
Ejemplo n.º 12
0
    public void RegisterAttachedComponent(CComponentInterface _cComponentInterface)
    {
        if (!m_mAttachedComponents.ContainsKey(_cComponentInterface.ComponentType))
        {
            m_mAttachedComponents.Add(_cComponentInterface.ComponentType, new List <GameObject>());
        }

        m_mAttachedComponents[_cComponentInterface.ComponentType].Add(_cComponentInterface.gameObject);
    }
Ejemplo n.º 13
0
    private void HandleMechanicalHealthChange(CComponentInterface _Component, CActorHealth _ComponentHealth)
    {
        if (CNetwork.IsServer)
        {
            // Get the combined health of the mechanical components
            float currentCombinedHealth = 0.0f;
            float combinedInitialHealth = 0.0f;

            currentCombinedHealth += m_MechanicalComponent1.GetComponent <CActorHealth>().health;
            currentCombinedHealth += m_MechanicalComponent2.GetComponent <CActorHealth>().health;

            combinedInitialHealth += m_MechanicalComponent1.GetComponent <CActorHealth>().health_initial;
            combinedInitialHealth += m_MechanicalComponent2.GetComponent <CActorHealth>().health_initial;

            m_PropulsionGenerator.PropulsionForce = m_MaxPropulsion * (currentCombinedHealth / combinedInitialHealth);
        }
    }
Ejemplo n.º 14
0
	private void HandleMechanicalHealthChange(CComponentInterface _Component, CActorHealth _ComponentHealth)
	{
		if(CNetwork.IsServer)
		{
			// Get the combined health of the mechanical components
			float currentCombinedHealth = 0.0f;
			float combinedInitialHealth = 0.0f;

			currentCombinedHealth += m_MechanicalComponent1.GetComponent<CActorHealth>().health;
			currentCombinedHealth += m_MechanicalComponent2.GetComponent<CActorHealth>().health;

			combinedInitialHealth += m_MechanicalComponent1.GetComponent<CActorHealth>().health_initial;
			combinedInitialHealth += m_MechanicalComponent2.GetComponent<CActorHealth>().health_initial;

			m_PropulsionGenerator.PropulsionForce = m_MaxPropulsion * (currentCombinedHealth / combinedInitialHealth);
		}
	}
Ejemplo n.º 15
0
	private void HandleComponentStateChange(CComponentInterface _Component)
	{
		if(CNetwork.IsServer)
		{
			int numWorkingComponents = NumWorkingComponents;
			
			// Calculate the charge capacity
			m_NaniteStorage.StoredNanites = m_MaxNaniteCapacity * (int)((float)numWorkingComponents / 2.0f);
			
			// Deactive the charge availablity
			if(numWorkingComponents == 0)
			{
				m_NaniteStorage.DeactivateNaniteAvailability();
			}
			else
			{
				if(!m_NaniteStorage.IsStorageAvailable)
					m_NaniteStorage.ActivateNaniteAvailability();
			}
		}
	}
Ejemplo n.º 16
0
	private void HandleCircuitryStateChange(CComponentInterface _Component)
	{
		if(CNetwork.IsServer)
		{
			int numWorkingComponents = NumWorkingCircuitryComponents;

			// Calculate the charge capacity
			m_PowerStorage.BatteryCapacity = m_MaxPowerBatteryCapacity * (float)numWorkingComponents / 2.0f;

			// Deactive the charge availablity
			if(numWorkingComponents == 0)
			{
				m_PowerStorage.DeactivateBatteryChargeAvailability();
			}
			else
			{
				if(!m_PowerStorage.IsBatteryChargeAvailable)
					m_PowerStorage.ActivateBatteryChargeAvailability();
			}
		}
	}
Ejemplo n.º 17
0
    private void HandleCircuitryStateChange(CComponentInterface _Component)
    {
        if (CNetwork.IsServer)
        {
            int numWorkingComponents = NumWorkingCircuitryComponents;

            // Calculate the charge capacity
            m_PowerStorage.BatteryCapacity = m_MaxPowerBatteryCapacity * (float)numWorkingComponents / 2.0f;

            // Deactive the charge availablity
            if (numWorkingComponents == 0)
            {
                m_PowerStorage.DeactivateBatteryChargeAvailability();
            }
            else
            {
                if (!m_PowerStorage.IsBatteryChargeAvailable)
                {
                    m_PowerStorage.ActivateBatteryChargeAvailability();
                }
            }
        }
    }
Ejemplo n.º 18
0
    private void HandleComponentStateChange(CComponentInterface _Component)
    {
        if (CNetwork.IsServer)
        {
            int numWorkingComponents = NumWorkingComponents;

            // Calculate the charge capacity
            m_NaniteStorage.StoredNanites = m_MaxNaniteCapacity * (int)((float)numWorkingComponents / 2.0f);

            // Deactive the charge availablity
            if (numWorkingComponents == 0)
            {
                m_NaniteStorage.DeactivateNaniteAvailability();
            }
            else
            {
                if (!m_NaniteStorage.IsStorageAvailable)
                {
                    m_NaniteStorage.ActivateNaniteAvailability();
                }
            }
        }
    }
Ejemplo n.º 19
0
 // Do the functionality in the onfix. This will start when the eventcomponentfix is triggered
 void OnFix(CComponentInterface _Sender)
 {
     //TODO swap between broken to fixed
 }
Ejemplo n.º 20
0
 // Member Methods
 // Do the functionality in the on break. This will start when the eventcomponentbreak is triggered
 void OnBreak(CComponentInterface _Sender)
 {
     // TODO: swap between fixed to broken
 }
Ejemplo n.º 21
0
 private void HandleMechanicalStateChange(CComponentInterface _Component)
 {
     UpdateDUI();
 }
Ejemplo n.º 22
0
	// Do the functionality in the onfix. This will start when the eventcomponentfix is triggered
	void OnFix(CComponentInterface _Sender)
	{
		//TODO swap between broken to fixed
		
	}
Ejemplo n.º 23
0
	// Member Methods
	// Do the functionality in the on break. This will start when the eventcomponentbreak is triggered
	void OnBreak(CComponentInterface _Sender)
	{
		// TODO: swap between fixed to broken
		
	}
Ejemplo n.º 24
0
 private void HandleCircuitryStateChange(CComponentInterface _Component)
 {
     UpdateDUI();
 }
Ejemplo n.º 25
0
 void OnComponentRepaired(CComponentInterface _Component)
 {
     m_bBlocked.Set(false);
 }
Ejemplo n.º 26
0
	private void HandleMechanicalStateChange(CComponentInterface _Component)
	{
		UpdateDUI();
	}
Ejemplo n.º 27
0
// Member Methods


    public List<GameObject> FindAttachedComponentsByType(CComponentInterface.EType _eAccessoryType)
    {
        if (!m_mAttachedComponents.ContainsKey(_eAccessoryType))
        {
            return (null);
        }

        return (m_mAttachedComponents[_eAccessoryType]);
    }
Ejemplo n.º 28
0
    public void RegisterAttachedComponent(CComponentInterface _cComponentInterface)
    {
        if (!m_mAttachedComponents.ContainsKey(_cComponentInterface.ComponentType))
        {
            m_mAttachedComponents.Add(_cComponentInterface.ComponentType, new List<GameObject>());
        }

        m_mAttachedComponents[_cComponentInterface.ComponentType].Add(_cComponentInterface.gameObject);
    }
Ejemplo n.º 29
0
 void OnComponentDamaged(CComponentInterface _Component)
 {
     m_bBlocked.Set(true);
 }
Ejemplo n.º 30
0
 void OnComponentRepaired(CComponentInterface _Component)
 {
     m_bBlocked.Set(false);
 }
Ejemplo n.º 31
0
	private void HandleCircuitryStateChange(CComponentInterface _Component)
	{
		UpdateDUI();
	}
Ejemplo n.º 32
0
 void OnComponentDamaged(CComponentInterface _Component)
 {
     m_bBlocked.Set(true);
 }