init 1.1.2
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace EmeraldAI
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to allow AI to detect which objects/abilities they should avoid.
|
||||
/// The AbilityTarget is used to determine which target the ability is intended for.
|
||||
/// </summary>
|
||||
public interface IAvoidable
|
||||
{
|
||||
Transform AbilityTarget { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 12b93e20d734af046bd4c989dfaf3e8a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,41 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace EmeraldAI
|
||||
{
|
||||
/// <summary>
|
||||
/// An interafce script used for monitoring and tracking a target's combat actions (as well as its damage position). This allows other AI to see any target's information through functions.
|
||||
/// Note: This interface is required (on 3rd party or custom character controllers) to use the blocking and dodging features for player targets.
|
||||
/// </summary>
|
||||
public interface ICombat
|
||||
{
|
||||
/// <summary>
|
||||
/// Used for getting the transform of the target.
|
||||
/// </summary>
|
||||
Transform TargetTransform();
|
||||
|
||||
/// <summary>
|
||||
/// Used for getting the damage position of the target.
|
||||
/// </summary>
|
||||
Vector3 DamagePosition();
|
||||
|
||||
/// <summary>
|
||||
/// Used for detecting when a target is attacking.
|
||||
/// </summary>
|
||||
bool IsAttacking();
|
||||
|
||||
/// <summary>
|
||||
/// Used for detecting when a target is blocking.
|
||||
/// </summary>
|
||||
bool IsBlocking();
|
||||
|
||||
/// <summary>
|
||||
/// Used for detecting when a target is dodging.
|
||||
/// </summary>
|
||||
bool IsDodging();
|
||||
|
||||
/// <summary>
|
||||
/// Used through Emerald AI to trigger stunned mechanics, however, can also be extended to trigger stunned mechanics through custom character controllers, given they have them.
|
||||
/// </summary>
|
||||
void TriggerStun(float StunLength);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aef9b7ce85ce4d847aa3aff4791502a6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,72 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace EmeraldAI
|
||||
{
|
||||
/// <summary>
|
||||
/// An interafce script used for monitoring and tracking a target. This allows other AI to see any target's information by using customizable functions.
|
||||
/// </summary>
|
||||
public interface IDamageable
|
||||
{
|
||||
/// <summary>
|
||||
/// Used for passing damage to any script that has an IDamageable component.
|
||||
/// </summary>
|
||||
void Damage(int DamageAmount, Transform AttackerTransform = null, int RagdollForce = 100, bool CriticalHit = false);
|
||||
|
||||
int Health { get; set; }
|
||||
|
||||
int StartHealth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Used for tracking active damage over time effects on targets.
|
||||
/// </summary>
|
||||
List<string> ActiveEffects { get; set; }
|
||||
}
|
||||
|
||||
public static class IDamageableHelper
|
||||
{
|
||||
public static bool IsDead (this GameObject receiver)
|
||||
{
|
||||
var m_IDamageable = receiver.GetComponent<IDamageable>();
|
||||
if (m_IDamageable != null) return m_IDamageable.Health <= 0;
|
||||
else return false;
|
||||
}
|
||||
|
||||
public static bool CheckAbilityActiveEffects (this GameObject receiver, EmeraldAbilityObject AbilityData)
|
||||
{
|
||||
var m_IDamageable = receiver.GetComponent<IDamageable>();
|
||||
if (m_IDamageable != null)
|
||||
{
|
||||
return !m_IDamageable.ActiveEffects.Contains(AbilityData.AbilityName) && AbilityData.AbilityName != string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddAbilityActiveEffect(this GameObject receiver, EmeraldAbilityObject AbilityData)
|
||||
{
|
||||
var m_IDamageable = receiver.GetComponent<IDamageable>();
|
||||
if (m_IDamageable != null)
|
||||
{
|
||||
if (!m_IDamageable.ActiveEffects.Contains(AbilityData.AbilityName) && AbilityData.AbilityName != string.Empty)
|
||||
{
|
||||
m_IDamageable.ActiveEffects.Add(AbilityData.AbilityName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void RemoveAbilityActiveEffect(this GameObject receiver, EmeraldAbilityObject AbilityData)
|
||||
{
|
||||
var m_IDamageable = receiver.GetComponent<IDamageable>();
|
||||
if (m_IDamageable != null)
|
||||
{
|
||||
if (m_IDamageable.ActiveEffects.Contains(AbilityData.AbilityName) && AbilityData.AbilityName != string.Empty)
|
||||
{
|
||||
m_IDamageable.ActiveEffects.Remove(AbilityData.AbilityName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b70d1ee666095e4d8c4cb388d716643
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public interface IFaction
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the object's faction index (based on the Faction Data's Faction Name List).
|
||||
/// </summary>
|
||||
int GetFaction();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ccf922b652ff97459885a7bffdf355b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user