Example #1
0
        /// <summary>Spawns All player Crew</summary>
        /// <param name="_id">The player's ID.</param>
        /// <param name="_name">The member crew ID.</param>

        /* public void CallbackPlayerAttack(int _unitPosition, int _enemyPosition)
         * {
         *   GameObject _PlayerUnitGameObject = new GameObject();
         *   GameObject _EnemyUnitGameObject = new GameObject();
         *
         *   PlayerCrew.TryGetValue(_unitPosition, out _PlayerUnitGameObject);
         *   EnemyCrew.TryGetValue(_enemyPosition, out _EnemyUnitGameObject);
         *
         *
         *   Vector3 attackDir = (_EnemyUnitGameObject.transform.position - _PlayerUnitGameObject.transform.position).normalized;
         *   var Anim = _PlayerUnitGameObject.GetComponent<Animator>();
         *
         *   //Anim.
         * }*/



        public void CallbackPlayerAttack(int _unitPosition, int _enemyPosition) // Action onAttackComplete
        {
            Unit _PlayerUnitGameObject;
            Unit _EnemyUnitGameObject;

            PlayerUnitCrew.TryGetValue(_unitPosition, out _PlayerUnitGameObject);
            IAUnitCrew.TryGetValue(_enemyPosition, out _EnemyUnitGameObject);

            UnitBattle _UnitBattle = _PlayerUnitGameObject.InstantiatedUnit.GetComponent <UnitBattle>();
        }
Example #2
0
        public void IAUnitAttack(int IAAttackingUnit, int _TargetAttackedUnit, SpellTarget TargetPlayerOrIA, string SpellID)
        {
            Unit _IAUnitGameObject;

            switch (TargetPlayerOrIA)
            {
            case SpellTarget.IAUNIT:
                IAUnitCrew.TryGetValue(IAAttackingUnit, out _IAUnitGameObject);
                UnitBattle _IAUnitBattle = _IAUnitGameObject.InstantiatedUnit.GetComponent <UnitBattle>();
                _IAUnitBattle.IASpellAttack(SpellID, _TargetAttackedUnit, IAAttackingUnit);
                break;

            case SpellTarget.ALLY:
            case SpellTarget.SELF:
            default:
                /*EnemyUnitCrew.TryGetValue(IAAttackingUnit, out _UnitGameObject);
                 * UnitBattle _IAUnitBattle = _UnitGameObject.InstantiatedUnit.GetComponent<UnitBattle>();
                 * _IAUnitBattle.IAAttack(_TargetAttackedUnit);*/
                break;
            }
        }
Example #3
0
        public void PlayerUnitAttack(int PlayerAttackingUnit, int _TargetAttackedUnit, SpellTarget TargetPlayerOrIA, string SpellID)
        {
            Unit _PlayerUnitGameObject;

            switch (TargetPlayerOrIA)
            {
            case SpellTarget.IAUNIT:
                PlayerUnitCrew.TryGetValue(PlayerAttackingUnit, out _PlayerUnitGameObject);
                UnitBattle _PlayerUnitBattle = _PlayerUnitGameObject.InstantiatedUnit.GetComponent <UnitBattle>();
                _PlayerUnitBattle.PlayerSpellAttack(SpellID, _TargetAttackedUnit, PlayerAttackingUnit);
                break;

            case SpellTarget.ALLY:
            case SpellTarget.SELF:
            default:
                PlayerUnitCrew.TryGetValue(PlayerAttackingUnit, out _PlayerUnitGameObject);
                UnitBattle _PlayerUnitBattleBuff = _PlayerUnitGameObject.InstantiatedUnit.GetComponent <UnitBattle>();
                _PlayerUnitBattleBuff.PlayerSpellBuff(SpellID, _TargetAttackedUnit, PlayerAttackingUnit);
                break;
            }
        }