Exemplo n.º 1
0
    public CharacterAttack GetCharacterAttack(int[] attackIDs)
    {
        CharacterAttack charAttack = new CharacterAttack();

        for (int i = 0; i < attackIDs.Length; ++i)
        {
            AttackInfo attackInfo = InfoManager.Instance.attackInfoDic[attackIDs[i]];

            AttackBase skill = null;

            switch (attackInfo.attackType)
            {
            case AttackType.Basic:
                skill = new BasicAttack();
                break;

            case AttackType.Throw:
                skill = new ThrowAttack();
                break;

            case AttackType.Spin:
                skill = new SpinAttack();
                break;

            case AttackType.Radiate:
                Debug.Log("radiate skill is not developed");
                skill = null;
                break;

            default:
                Debug.Log("Skill has no type");
                skill = null;
                break;
            }

            skill.SetSkillInfo(attackInfo.effectName,
                               attackInfo.skillPower,
                               attackInfo.minDistance,
                               attackInfo.coolTime);

            charAttack.AddAttack(skill);
        }

        return(charAttack);
    }
Exemplo n.º 2
0
        protected void ThrowItem()
        {
            var storageType = ActionHandStorageType.Instance;
            var actionHand  = Leader.Body.GetBodyStorage(storageType);
            var item        = actionHand.TakeItemFrom(0);

            actionHand.AddItemTo(Hand, 0);
            Hand = null;

            var action = new ThrowAttack((ThrowActionFactory)factorie.FightActions[42], Leader, storageType);

            action.Apply(MapDirection);

            if (item != null)
            {
                actionHand.AddItemTo(item, 0);
            }
        }