NPC.GetImpactPoint C# (CSharp) Method

GetImpactPoint() public method

public GetImpactPoint ( ) : Vector3
return Vector3
    public override Vector3 GetImpactPoint()
    {
        return NPC_Launcher.transform.position;
    }

Usage Example

    /// <summary>
    /// NPC hits another NPC
    /// </summary>
    /// <param name="targetNPC">Target NP.</param>
    /// <param name="originNPC">Origin NP.</param>
    public static void NPC_Hits_NPC(NPC targetNPC, NPC originNPC)
    {
        int Defence    = targetNPC.GetDefence();
        int Attack     = originNPC.GetAttack();
        int toHit      = Mathf.Max(Defence - Attack, 1);
        int roll       = Random.Range(-1, 31);
        int BaseDamage = Random.Range(1, originNPC.GetDamage() + 1);

        if (((roll >= toHit) || (roll >= 30)) && (roll > -1))
        {
            targetNPC.ApplyAttack((short)BaseDamage, originNPC.gameObject);
            Impact.SpawnHitImpact(Impact.ImpactBlood(), targetNPC.GetImpactPoint(), targetNPC.objInt().GetHitFrameStart(), targetNPC.objInt().GetHitFrameEnd());
            if (ObjectInteraction.PlaySoundEffects)
            {
                originNPC.objInt().aud.clip = GameWorldController.instance.getMus().SoundEffects[MusicController.SOUND_EFFECT_MELEE_HIT_1];
                originNPC.objInt().aud.Play();
            }
        }
    }
All Usage Examples Of NPC::GetImpactPoint