Пример #1
0
    private void bulletHit()
    {
        bool needAttack = false;

        if (_scene.isDriveAll())
        {
            needAttack = true;
        }
        else
        {
            //客户端驱动
            if (_data.isInitiative)
            {
                CUnitBulletHitRequest.create(_unit.instanceID, _data.id, _data.level, _data.targetData).send();
            }
            else
            {
                if (_unit.isSelfDriveAttackHapen())
                {
                    needAttack = true;
                }
            }
        }

        if (needAttack)
        {
            if (_config.attackID > 0)
            {
                _unit.fight.createAndExecuteAttack(_config.attackID, _data.level, _data.targetData);
            }
        }
    }
Пример #2
0
    /// <summary>
    /// 创建实例
    /// </summary>
    public static CUnitBulletHitRequest create(int instanceID, int bulletID, int bulletLevel, SkillTargetData target)
    {
        CUnitBulletHitRequest re = (CUnitBulletHitRequest)BytesControl.createRequest(dataID);

        re.instanceID  = instanceID;
        re.bulletID    = bulletID;
        re.bulletLevel = bulletLevel;
        re.target      = target;
        return(re);
    }