Beispiel #1
0
    void GroundPoundEnemy()
    {
        //Used to look for health panel manager.  ALWAYS REMEMBER TO KEEP THE PARAMETERS IN ORDER.
        CharacterHealthPanelManager resultingHealthPanelManager = LinecastingUtilities.BasicLinecast(
            attachedCharacterInput.GetActualClass().transform.position,
            new Vector2(attachedCharacterInput.GetActualClass().transform.position.x, attachedCharacterInput.GetActualClass().transform.position.y - 3f),
            attachedCharacterInput.GetCombatantID()
            );

        if (resultingHealthPanelManager != null)
        {
            resultingHealthPanelManager.gameObject.GetComponent <ICombatant> ().GetActualClass().ApplyKnockbackToCharacter(new Vector2(knockback.x * attachedCharacterInput.GetActualClass().GetFacingDirection(), knockback.y));
            resultingHealthPanelManager.YouHaveBeenAttacked(attackPower);
        }
    }
Beispiel #2
0
    void AirSlashEnemy()
    {
        //Used to look for health panel manager.  ALWAYS REMEMBER TO KEEP THE PARAMETERS IN ORDER.
        CharacterHealthPanelManager resultingHealthPanelManager = LinecastingUtilities.BasicLinecast(
            attachedCharacterInput.GetActualClass().transform.position,
            new Vector2(attachedCharacterInput.GetActualClass().transform.position.x, attachedCharacterInput.GetActualClass().transform.position.y + 3f),
            attachedCharacterInput.GetCombatantID()
            );

        if (resultingHealthPanelManager != null)
        {
            //Has to be GetComponent <ICombatant> ().GetActualClass() instead of GetComponent <CharacterBaseActionClass> () because otherwise the soldier gets the NPC script intead.
            resultingHealthPanelManager.gameObject.GetComponent <ICombatant> ().GetActualClass().ApplyKnockbackToCharacter(new Vector2(knockback.x * attachedCharacterInput.GetActualClass().GetFacingDirection(), knockback.y));
            resultingHealthPanelManager.YouHaveBeenAttacked(attackPower);
        }
    }
Beispiel #3
0
    void AttackEnemyInFocus()
    {
        //Use the RaycastAttackUtilites class.
        CharacterHealthPanelManager resultingHealthPanelManager = LinecastingUtilities.FindEnemyViaLinecast(
            transform.position,
            distToEnemyLength,
            yOffsetToEnemy,
            enemyWithinAreaBounds,
            GetFacingDirection(),
            GetCombatantID()
            );

        if (resultingHealthPanelManager != null)
        {
            resultingHealthPanelManager.gameObject.GetComponent <CharacterBaseActionClass> ().ApplyKnockbackToCharacter(new Vector2(enemyKnockbackPower.x * GetFacingDirection(), enemyKnockbackPower.y));
            resultingHealthPanelManager.YouHaveBeenAttacked(enemyAttackingPower);
        }
    }
Beispiel #4
0
    void AttackEnemyInFocus()
    {
        //Used for finding the health panel manager via linecast.
        CharacterHealthPanelManager resultingHealthPanelManager = LinecastingUtilities.FindEnemyViaLinecast(
            transform.position,
            distToEnemyLength,
            0,
            enemyWithinAreaBounds,
            GetFacingDirection(),
            GetCombatantID()
            );

        if (resultingHealthPanelManager != null)
        {
            resultingHealthPanelManager.gameObject.GetComponent <Character> ().ApplyKnockback(new Vector2(enemyKnockbackPower.x * GetFacingDirection(), enemyKnockbackPower.y));
            resultingHealthPanelManager.YouHaveBeenAttacked(enemyAttackingPower);
        }
    }
Beispiel #5
0
    void AttackEnemyInFocus()
    {
        //Used to look for health panel manager.  ALWAYS REMEMBER TO KEEP THE PARAMETERS IN ORDER.
        Debug.Log("Ignoring " + attachedCharacterInput.GetCombatantID());
        CharacterHealthPanelManager resultingHealthPanelManager = LinecastingUtilities.FindEnemyViaLinecast(
            attachedCharacterInput.GetActualClass().transform.position,
            distToEnemyOffset,
            0,
            areaBounds,
            attachedCharacterInput.GetActualClass().GetFacingDirection(),
            attachedCharacterInput.GetCombatantID()
            );

        if (resultingHealthPanelManager != null)
        {
            resultingHealthPanelManager.gameObject.GetComponent <ICombatant> ().GetActualClass().ApplyKnockbackToCharacter(new Vector2(knockback.x * attachedCharacterInput.GetActualClass().GetFacingDirection(), knockback.y));
            resultingHealthPanelManager.YouHaveBeenAttacked(attackPower);
        }
    }