void Start() { _target = FindObjectOfType<HeroController> ().gameObject; _actionToPassCombat = _autoAction; _EntityController = this.gameObject.GetComponent<EntityMain> (); m_aniController = gameObject.GetComponent<AniStateController> (); if (m_aniController == null) Debug.LogWarning ("No Animation Controller on Enemy!"); }
public EntityWrapper( EntityMain Entity, ActionType Action ) // Ancestor Caster { _entity = Entity; _actionType = Action; // _castingAncestor = Caster; // TODO: Reactive casting Ancestor, was only turned off for testing }
public void CompileStatsFromAncestors() { // Setup base values of Hero before adding Ancestor additions // TODO: just use entityMain values instead of duplicating for herocontroller // TODO: add ancestor action points and attack rate to HeroController _localEntityMain = gameObject.GetComponent<EntityMain> (); if (_localEntityMain != null) { for (int i = 0; i < _ancestorList.Count; i++) { Ancestor currentItem = _ancestorList[i]; _localEntityMain._armor += currentItem._armorAddition; _localEntityMain._health += currentItem._healthAddition; _localEntityMain._damage += currentItem._damageAddition; // TODO: Add extra values to local entity } _localEntityMain._armorMax = _localEntityMain._armor; _localEntityMain._healthMax = _localEntityMain._health; _localEntityMain._damageMax = _localEntityMain._damage; } // if (_localEntityMain != null) // { // _health = _localEntityMain._health; // m_maxHealth = _localEntityMain._healthMax; // _armor = _localEntityMain._armor; // m_maxArmor = _localEntityMain._armorMax; // _damage = _localEntityMain._damage; // m_maxDamage = _localEntityMain._healthMax; // // // process Ancestor List and add up values // if ( _ancestorList.Count > 0 ) // { // for (int i = 0; i < _ancestorList.Count; i++) // { // Ancestor currentItem = _ancestorList[i]; // // _armor += currentItem._armorAddition; // _health += currentItem._healthAddition; // } // // _localEntityMain._health = _health; // _localEntityMain._armor = _armor; // // Debug.Log("Updated Hero states based on Ancestors"); // // } // else // { // Debug.LogWarning("No Ancestor List to process for HeroController"); // } // } // else // { // Debug.LogError("Couldn't find an EntityMain script on Hero gameobject"); // } }
public void SetCasterReceiver(GameObject caster, GameObject receiver) { // TODO: Have list for multiple receivers // if (_actionCaster != caster) // { // _actionCaster = caster; // } // if (_actionReceiver != receiver) // { // _actionReceiver = receiver; // } _actionCaster = caster; _actionReceiver = receiver; if (_actionCaster != null && _actionReceiver != null) { m_actionCasterEntity = _actionCaster.GetComponent<EntityMain> (); m_actionReceiverEntity = _actionReceiver.GetComponent<EntityMain> (); Debug.Log ("Set Caster and Receiver"); } else { Debug.LogWarning ("No Caster and Receiver Set!"); } }