Beispiel #1
0
    protected override void onStopped(SkillEffectStopReason stopReason)
    {
        if (getState(StateEnabled))
        {
            ErrorHandler.Parse(enable(false, stopReason));
        }

        // buff被回收时, 不会再继续触发效果.
        if (stopReason != SkillEffectStopReason.Recycled)
        {
            // 消失时的特效.
            SkillClientBehaviour.AddEffect2Object(mOwner, mBuffRes.endEffectID, mBuffRes.endEffectBindpoint, 0f);

            // buff死亡创建.
            // 对buff拥有者产生效果.
            SkillDetails.AddSkillEffectByResource(mAttackerAttr, mOwner, mBuffRes.effect2OwnerOnExpired);

            // 对buff拥有者周围产生效果.
            SkillDetails.SelectTargetAndAddSkillEffect(mAttackerAttr, mOwner.GetPosition(),
                                                       mOwner.GetDirection(),
                                                       mBuffRes.targetSelectionOnExpired, mBuffRes.effect2OthersOnExpired
                                                       );

            // 在buff拥有者周围进行创建.
            SkillDetails.CreateCreationAround(mAttackerAttr, mBuffRes.creationAroundOwnerOnExpired, mOwner.GetPosition(), mOwner.GetDirection());
        }

        base.onStopped(stopReason);
    }
Beispiel #2
0
    public void Update(uint elapsed)
    {
        if (nodes.Count <= 0)
        {
            return;
        }

        for (int i = 0; i < nodes.Count; ++i)
        {
            nodes[i].time -= elapsed;
            if (nodes[i].time <= 0)
            {
                exList.Add(nodes[i]);
            }
        }

        for (int i = 0; i < exList.Count; ++i)
        {
            BattleUnit unit = exList[i].mOwner;
            if (unit != null && !unit.IsDestory())
            {
                SkillDetails.AddMaterialBehaviour(unit, unit.GetHitMaterialEffectCdContainer(), exList[i].name, exList[i].impactDamageType, exList[i].dir);
            }

            nodes.Remove(exList[i]);
        }

        exList.Clear();
    }
    /// <summary>
    /// 根据参数, 创建技能效果, 并使之开始运行.
    /// </summary>
    /// <returns></returns>
    public ErrorCode CreateSkillEffect(SkillEffectInitParam param)
    {
        SkillEffect effect = SkillDetails.AllocSkillEffect(param);

        if (effect == null)
        {
            return(ErrorCode.InvalidParam);
        }

        if (!effect.Initialize(param))
        {
            return(ErrorCode.LogicError);
        }

        ErrorCode err = effect.Start(param);

        if (err == ErrorCode.Succeeded)
        {
            if (effect.NeedUpdate)
            {
                mContainer.Add(effect as SkillBuff);
            }
            else
            {
                effect.Stop(SkillEffectStopReason.Expired);
            }
        }

        return(err);
    }
Beispiel #4
0
    public override void Explode()
    {
        ErrorHandler.Parse(
            SkillDetails.CreateCreationAround(mBullet.FirerAttr, mBullet.CreationOnArrive, mBullet.GetPosition(), mBullet.GetDirection()),
            "failed to create creature on bullet arrived"
            );

        // 爆炸特效, 仅在子弹到达终点时播放, 即, 子弹没有命中足够的人.
        if (mBullet.CurrentHittedCount < mBullet.MaxHitCount)
        {
            SkillClientBehaviour.AddSceneEffect(mBullet.ExplodeEffect, mBullet.GetPosition(), mBullet.GetDirection());
        }

        // 用碰撞来模拟爆炸, 从而使得技能效果的方向沿着子弹的飞行方向.
        if (mBullet.TargetSelectionOnArrive != uint.MaxValue && mBullet.SkillEffectOnArrive != uint.MaxValue)
        {
            TargetSelectionTableItem targetSel = DataManager.TargetSelectionTable[mBullet.TargetSelectionOnArrive] as TargetSelectionTableItem;

            ArrayList targets = SkillUtilities.SelectTargets(mBullet.FirerAttr, mBullet.GetPosition(), mBullet.GetDirection(), targetSel);

            AttackerAttr other = mBullet.FirerAttr;
            other.SetEffectStartLocation(mBullet.GetPosition(), mBullet.GetDirection());

            foreach (BattleUnit t in targets)
            {
                SkillDetails.AddSkillEffectByResource(other, t, mBullet.SkillEffectOnArrive);
            }
        }
    }
Beispiel #5
0
    /// <summary>
    /// 技能进入使用状态(除逻辑错误外, 不会失败).
    /// </summary>
    public ErrorCode EnterUseState(Vector3 targetPosition)
    {
        ErrorCode err = canEnterState(ActionSkillState.Using, targetPosition);

        if (err != ErrorCode.Succeeded)
        {
            return(err);
        }

        // 技能可被打断, 表示是可以蓄力的.
        if (Interruptable)
        {
            mCharge = mStateTimer;
        }

        SkillTargetPosition = targetPosition;
        switch2State(ActionSkillState.Using);

        loadUseStateTasks();

        mTaskManager.Start();

        // 置CD.
        SkillDetails.OnActionEnterUseState(mOwner, mSkillUsing);

        // 进入使用状态时不会再设置朝向.

        return(ErrorCode.Succeeded);
    }
Beispiel #6
0
    public override bool RunScript(RandEventArg argument)
    {
        ErrorHandler.Parse(
            SkillDetails.AddSkillEffectByResource(OwnerAttribute, mOwner, skillEffectID),
            "SkillEffectGenerator: failed to add skill effect"
            );

        return(true);
    }
Beispiel #7
0
    public override bool RunScript(RandEventArg argument)
    {
        ErrorHandler.Parse(
            SkillDetails.CreateCreationAround(createrAttr, creationId, mOwner.GetPosition(), mOwner.GetDirection()),
            "failed to run script SS_DeathCreation"
            );

        return(true);
    }
Beispiel #8
0
    // 加effect
    private void AddPickerEffect()
    {
        if (mPicker == null || mPicker.IsDead() || mRes.skillEffect2Picker == uint.MaxValue)
        {
            return;
        }

        SkillDetails.AddSkillEffectByResource(new AttackerAttr(mPicker), mPicker, mRes.skillEffect2Picker);
    }
Beispiel #9
0
    public override bool RunScript(RandEventArg argument)
    {
        ErrorHandler.Parse(
            SkillDetails.SelectTargetAndAddSkillEffect(OwnerAttribute,
                                                       mOwner.GetPosition(),
                                                       mOwner.GetDirection(), targetSelection, skillEffect),
            "failed to run script SS_CorpseExplosion"
            );

        return(true);
    }
Beispiel #10
0
    protected override void onDie(AttackerAttr attackerAttr, ImpactDamageType impactDamageType)
    {
        SkillDetails.SelectTargetAndAddSkillEffect(mSummonerAttr, GetPosition(), GetDirection(),
                                                   mTrapResource.targetSelectionOnExplode,
                                                   mTrapResource.skillEffectOnExplode
                                                   );

        SkillClientBehaviour.AddSceneEffect(mTrapResource._3DEffectOnExplode, GetPosition());

        base.onDie(attackerAttr, impactDamageType);
    }
Beispiel #11
0
    public override bool RunScript(RandEventArg argument)
    {
        AtkOthersEventArg atkOthersArg = argument as AtkOthersEventArg;

        ErrorHandler.Parse(
            SkillDetails.AddSkillEffectByResource(OwnerAttribute,
                                                  atkOthersArg.Target,
                                                  skillEffectID),
            "failed to run script SS_SkillEffectPlacer"
            );

        return(true);
    }
    /// <summary>
    /// 处理使用者从startPositon, 沿direction方向位移distance距离的碰撞.
    /// </summary>
    private void displacementCollide(Vector3 startPosition, Vector3 direction, float distance)
    {
        mTargetSelectionOnExecute.RectWidth = distance;

        // 需要取得当前碰撞矩形的中点, 作为参数传入SelectTargets.
        float radDirection = Utility.Vector3ToRadian(direction);

        SkillDetails.SelectTargetAndAddSkillEffect(mAttackerAttr,
                                                   Utility.MoveVector3Towards(startPosition, radDirection, distance / 2f),
                                                   radDirection, mTargetSelectionOnExecute, mDisplacementResource.skillEffect2OthersOnExecute,
                                                   checkCollide
                                                   );
    }
Beispiel #13
0
    private bool CreateCreation(ObjectBase obj, ArrayList param)
    {
        if (param.Count == 0)
        {
            return(false);
        }

        uint creationResID = Convert.ToUInt32(param[0]);

        return(ErrorHandler.Parse(SkillDetails.CreateCreationAround(
                                      new AttackerAttr(obj as BattleUnit), creationResID,
                                      obj.GetPosition(), obj.GetDirection())
                                  ));
    }
Beispiel #14
0
    /// <summary>
    /// 给当前单位添加技能效果.
    /// </summary>
    /// <param name="attackerAttr">为this添加技能效果的单位的属性</param>
    /// <param name="type">效果类型</param>
    /// <param name="resID">效果ID</param>
    /// <returns></returns>
    public ErrorCode AddSkillEffect(AttackerAttr attackerAttr, SkillEffectType type, uint resID)
    {
        // 是否死亡.
        if (IsDead())
        {
            return(ErrorCode.TargetIsDead);
        }

        // 由单位的本身类型, 决定的是否免疫给类型的技能效果.
        if (SkillEffectImmunity(type))
        {
            return(ErrorCode.AddEffectFailedSkillEffectImmunity);
        }

        if (SkillUtilities.IsHarmfulEffect(type, resID) && IsInviolable())
        {
            return(ErrorCode.AddEffectFailedSkillEffectImmunity);
        }

        ErrorCode err = ErrorCode.ConfigError;

        switch (type)
        {
        case SkillEffectType.Spasticity:
            #region Pending
            err = SkillDetails.StartSpasticity(mActionCenter, attackerAttr, resID, ref mSpasticityCd);
            #endregion Pending
            break;

        case SkillEffectType.Displacement:
            err = SkillDetails.StartDisplace(mActionCenter, attackerAttr, resID);
            break;

        case SkillEffectType.Buff:
        case SkillEffectType.Impact:
            err = SkillDetails.StartSkillEffect(attackerAttr, mSkillEffectManager, type, resID);
            break;

        default:
            break;
        }

        if (err == ErrorCode.Succeeded && type == SkillEffectType.Buff)
        {
            onSkillBuffAdded((uint)resID);
        }

        return(err);
    }
Beispiel #15
0
    public override void Explode()
    {
        ErrorHandler.Parse(
            SkillDetails.CreateCreationAround(mBullet.FirerAttr, mBullet.CreationOnArrive, mBullet.GetPosition(), mBullet.GetDirection()),
            "failed to create creature on bullet arrived"
            );

        SkillClientBehaviour.AddSceneEffect(mBullet.ExplodeEffect, mBullet.GetPosition(), mBullet.GetDirection());

        // 检查该种子弹是否可以产生爆炸伤害.
        SkillDetails.SelectTargetAndAddSkillEffect(
            mBullet.FirerAttr, mBullet.GetPosition(), mBullet.GetDirection(),
            mBullet.TargetSelectionOnArrive,
            mBullet.SkillEffectOnArrive
            );
    }
Beispiel #16
0
    /// <summary>
    /// 从graphCenter, 沿dirRadian方向, 通过targetSel选择目标, 并给选择到的目标添加skillEffectID标识的技能效果.
    /// </summary>
    /// <returns>命中目标个数</returns>
    private uint collideAt(Vector3 graphCenter, float dirRadian, TargetSelectionTableItem targetSel, uint skillEffectID)
    {
        ArrayList targets = SkillUtilities.SelectTargets(mFirerAttr, graphCenter, dirRadian, targetSel);

        SkillUtilities.FilterTargetsBy(targets, checkHitObject);

        AttackerAttr other = mFirerAttr;

        other.SetEffectStartLocation(graphCenter, dirRadian);

        foreach (BattleUnit t in targets)
        {
            SkillDetails.AddSkillEffectByResource(other, t, skillEffectID);
        }

        return((uint)targets.Count);
    }
Beispiel #17
0
    /// <summary>
    /// 任何一个新的技能都从该方法进入实际的状态.
    /// </summary>
    private ErrorCode startSkill(Vector3 targetPosition)
    {
        SkillDetails.OnSkillStarted(mOwner, mSkillUsing);

        if (mSkillUsing.skillRes.chargeTime != 0)
        {
            SkillTargetPosition = targetPosition;
            switch2State(ActionSkillState.Charging);
            loadClientBehaviourTask(mSkillUsing.skillRes.chargeBehaviour);
            mTaskManager.Start();

            return(ErrorCode.Succeeded);
        }

        // 没有准备时间, 直接进入使用状态.
        return(EnterUseState(targetPosition));
    }
Beispiel #18
0
    protected override void onStopped(bool finished)
    {
        if (mSkillUsing.skillRes.buffToSkillUser != uint.MaxValue)
        {
            ErrorHandler.Parse(
                mOwner.RemoveSkillBuffByResID(mSkillUsing.skillRes.buffToSkillUser),
                "failed to remove skill buff on skill stopped"
                );
        }

        if (finished)
        {
            SkillDetails.OnSkillFinished(mOwner, mSkillUsing);
        }

        mSkillUsing = null;
    }
Beispiel #19
0
    /// <summary>
    /// buff的dot效果, 每隔指定时间, 产生一次效果.
    /// </summary>
    /// <param name="param"></param>
    private void buffDotEffect(object param)
    {
        // dot的计时不会停止, 但是到了产生效果的时间时, 需要检查当前buff是否启用.
        if (getState(StateEnabled))
        {
            ErrorHandler.Parse(
                SkillDetails.AddSkillEffectByResource(mAttackerAttr, mOwner, mBuffRes.dotEffect2Owner),
                "failed to add dot effect to buff owner"
                );

            SkillDetails.SelectTargetAndAddSkillEffect(mAttackerAttr, mOwner.GetPosition(),
                                                       mOwner.GetDirection(),
                                                       mBuffRes.dotEffectTargetSelection,
                                                       mBuffRes.dotEffect2Others
                                                       );
        }
    }
    protected override void onStopped(bool finished)
    {
        base.onStopped(finished);

        if (finished)
        {
            // 结束时给自己的效果.
            SkillDetails.AddSkillEffectByResource(mAttackerAttr, mOwner, mDisplacementResource.skillEffect2SelfOnArrive);

            // 结束时给目标的效果.
            SkillDetails.SelectTargetAndAddSkillEffect(mAttackerAttr,
                                                       mOwner.GetPosition(), mOwner.GetDirection(), mDisplacementResource.targetSelectionOnArrive,
                                                       mDisplacementResource.skillEffect2OthersOnArrive);

            // 在位移目标的周围创建.
            SkillDetails.CreateCreationAround(mAttackerAttr, mDisplacementResource.creationOnArrive, mOwner.GetPosition(), mOwner.GetDirection());
        }
    }
Beispiel #21
0
    override public void Destroy()
    {
        if (mBattleUintAI != null)
        {
            mBattleUintAI.Destory();
            mBattleUintAI = null;
        }

        if (mActionCenter != null)
        {
            mActionCenter.Destroy();
            mActionCenter = null;
        }

        if (mSkillEffectManager != null)
        {
            SkillDetails.OnSkillEffectOwnerEvent(mSkillEffectManager, SkillEffectOwnerEventDef.OwnerLeaveScene);
            mSkillEffectManager.Destroy();
            mSkillEffectManager = null;
        }

        mActiveFlagsContainer = null;
        mRandEventContainer   = null;

        mHitMaterialEffectCdContainer = null;

        mProperty = null;

        mUIShield = null;

        base.Destroy();



        for (int i = 0; i < mAttachMents.Length; ++i)
        {
            AttachMent attach = mAttachMents[i];
            if (attach != null && attach.visual != null)
            {
                attach.visual.Destroy();
            }
            mAttachMents[i] = null;
        }
    }
Beispiel #22
0
    /// <summary>
    /// 产生技能效果, 被task回调.
    /// </summary>
    private void skillTakeEffect(object obj)
    {
        // 将目标点缩放到最大距离和最小距离之间.
        Vector3 targetPosition = SkillUtilities.RoundTargetPosition(mSkillUsing.skillRes.minRange, mSkillUsing.skillRes.maxRange,
                                                                    mOwner.GetPosition(), SkillTargetPosition);

        uint skillId = dbgSkillResId;

        ErrorHandler.Parse(
            SkillDetails.SkillTakeEffect(mOwner, mSkillUsing.skillRes, targetPosition)
            );

        if (!IsRunning)
        {
            ErrorHandler.Parse(ErrorCode.ConfigError, "技能" + skillId + "被自身所带效果异常终止!");
        }
        else if (FirstUseState)
        {
            SkillDetails.OnSkillEffected(mOwner, mSkillUsing);
        }
    }
Beispiel #23
0
    /// <summary>
    /// 对targetPosition使用skill技能.
    /// </summary>
    private ErrorCode StartSkill(BattleUnitSkill skill, Vector3 targetPosition)
    {
        if (skill == null)
        {
            return(ErrorCode.InvalidParam);
        }

        if (skill.IsRegularAttack)
        {
            if (!CanRegularAttack())
            {
                return(ErrorCode.UnableToAttack);
            }
        }
        else if (!CanUseSkill())
        {
            return(ErrorCode.UnableToUseSkill);
        }

        return(SkillDetails.StartSkillAction(mActionCenter, skill, targetPosition));
    }
Beispiel #24
0
    /// <summary>
    /// 添加出生技能效果, 不会检查是否可以添加该效果.
    /// </summary>
    /// <param name="summonerAttr">召唤者的属性, 如果没有召唤者, 那么通过this构造该结构</param>
    protected ErrorCode AddBornSkillEffect(AttackerAttr summonerAttr, SkillEffectType type, uint resID)
    {
        ErrorCode err = ErrorCode.ConfigError;

        switch (type)
        {
        case SkillEffectType.Displacement:
            err = SkillDetails.StartDisplace(mActionCenter, summonerAttr, resID);
            break;

        case SkillEffectType.Buff:
        case SkillEffectType.Impact:
            err = SkillDetails.StartSkillEffect(summonerAttr, mSkillEffectManager, type, resID);
            break;

        default:
            break;
        }

        return(err);
    }
Beispiel #25
0
    /// <summary>
    /// 添加材质特效和声音.
    /// </summary>
    public ErrorCode AddMaterialBehaviour(MaterialBehaviourDef name, ImpactDamageType impactDamageType, float dir)
    {
        // 无效的伤害类型.
        if (impactDamageType >= ImpactDamageType.Count)
        {
            return(ErrorCode.Succeeded);
        }

        if (name != MaterialBehaviourDef.OnMaterialDie && IsDead())
        {
            return(ErrorCode.TargetIsDead);
        }

        if (name == MaterialBehaviourDef.OnMaterialDie)
        {
            uint materialID = GetMaterialResourceID();

            if (materialID == uint.MaxValue)
            {
                ErrorHandler.Parse(ErrorCode.ConfigError, dbgGetIdentifier() + " 没有材质!");
                return(ErrorCode.ConfigError);
            }

            MaterialTableItem material = DataManager.MaterialTable[materialID] as MaterialTableItem;
            if (material == null)
            {
                SkillUtilities.ResourceNotFound("material", materialID);
                return(ErrorCode.ConfigError);
            }

            if (material.deathEffectWaitTime > 0)
            {
                Scene.GetDelayBehaviourManager().AddDelayBehaviour(this, name, impactDamageType, dir, material.deathEffectWaitTime);
                return(ErrorCode.Succeeded);
            }
        }

        return(SkillDetails.AddMaterialBehaviour(this, mHitMaterialEffectCdContainer, name, impactDamageType, dir));
    }
Beispiel #26
0
            } // @ public SkillDetails GetMagicSkillDetail(MagicSkill skill)

            /// <summary>
            /// Will get combat skill details about the passed combat skill
            /// </summary>
            /// <param name="skill">Combat skill to get details about</param>
            /// <returns></returns>
            public SkillDetails GetCombatSkillDetails(CombatSkill skill)
            {
                // Get combat skill information from fface
                PlayerCombatSkills combatSkills = GetPlayerInformation().CombatSkills;

                // value of specific combat skill
                int value = 0;

                // see which skill is selected
                switch (skill)
                {
                case CombatSkill.Archery:
                    value = combatSkills.Archery;
                    break;

                case CombatSkill.Axe:
                    value = combatSkills.Axe;
                    break;

                case CombatSkill.Club:
                    value = combatSkills.Club;
                    break;

                case CombatSkill.Dagger:
                    value = combatSkills.Dagger;
                    break;

                case CombatSkill.Evasion:
                    value = combatSkills.Evasion;
                    break;

                case CombatSkill.GreatAxe:
                    value = combatSkills.GreatAxe;
                    break;

                case CombatSkill.GreatKatana:
                    value = combatSkills.GreatKatana;
                    break;

                case CombatSkill.GreatSword:
                    value = combatSkills.GreatSword;
                    break;

                case CombatSkill.Guarding:
                    value = combatSkills.Guarding;
                    break;

                case CombatSkill.HandToHand:
                    value = combatSkills.HandToHand;
                    break;

                case CombatSkill.Katana:
                    value = combatSkills.Katana;
                    break;

                case CombatSkill.Marksmanship:
                    value = combatSkills.Marksmanship;
                    break;

                case CombatSkill.Parrying:
                    value = combatSkills.Parrying;
                    break;

                case CombatSkill.Polearm:
                    value = combatSkills.Polearm;
                    break;

                case CombatSkill.Scythe:
                    value = combatSkills.Scythe;
                    break;

                case CombatSkill.Shield:
                    value = combatSkills.Shield;
                    break;

                case CombatSkill.Staff:
                    value = combatSkills.Staff;
                    break;

                case CombatSkill.Sword:
                    value = combatSkills.Sword;
                    break;

                case CombatSkill.Throwing:
                    value = combatSkills.Throwing;
                    break;

                default:
                    throw new ArgumentException("Unknown combat skill passed to GetCombatSkillDetails()");
                } // @ switch (skill)

                SkillDetails details = new SkillDetails();

                details.Level     = (value & 0xFFF);
                details.Capped    = Convert.ToBoolean(((value & 0x8000) >> 15));
                details.SkillType = MagicOrCombat.Combat;
                details.Skill     = (int)skill;

                return(details);
            } // @ public SkillDetails GetCombatSkillDetail(CombatSkill skill)
Beispiel #27
0
            /// <summary>
            /// Will get magic skill details about the passed magic skill
            /// </summary>
            /// <param name="skill">Magic skill to get details about</param>
            /// <returns></returns>
            public SkillDetails GetMagicSkillDetails(MagicSkill skill)
            {
                // Get magic skill information from fface
                PlayerMagicSkills magicSkills = GetPlayerInformation().MagicSkills;

                // value of specific magic skill
                int value = 0;

                // see which skill is selected
                switch (skill)
                {
                    case MagicSkill.BlueMagic:
                        value = magicSkills.BlueMagic;
                        break;
                    case MagicSkill.Dark:
                        value = magicSkills.Dark;
                        break;
                    case MagicSkill.Divine:
                        value = magicSkills.Divine;
                        break;
                    case MagicSkill.Elemental:
                        value = magicSkills.Elemental;
                        break;
                    case MagicSkill.Enfeebling:
                        value = magicSkills.Enfeebling;
                        break;
                    case MagicSkill.Enhancing:
                        value = magicSkills.Enhancing;
                        break;
                    case MagicSkill.Healing:
                        value = magicSkills.Healing;
                        break;
                    case MagicSkill.Ninjitsu:
                        value = magicSkills.Ninjitsu;
                        break;
                    case MagicSkill.Singing:
                        value = magicSkills.Singing;
                        break;
                    case MagicSkill.String:
                        value = magicSkills.String;
                        break;
                    case MagicSkill.Summoning:
                        value = magicSkills.Summon;
                        break;
                    case MagicSkill.Wind:
                        value = magicSkills.Wind;
                        break;
                    default:
                        throw new ArgumentException("Unknown magic skill passed to GetMagicSkillDetails()");

                } // @ switch (skill)

                SkillDetails details = new SkillDetails();
                details.Level = (value & 0xFFF);
                details.Capped = Convert.ToBoolean(((value & 0x8000) >> 15));
                details.SkillType = MagicOrCombat.Magic;
                details.Skill = (int)skill;
                return details;
            }
Beispiel #28
0
            /// <summary>
            /// Will get combat skill details about the passed combat skill
            /// </summary>
            /// <param name="skill">Combat skill to get details about</param>
            /// <returns></returns>
            public SkillDetails GetCombatSkillDetails(CombatSkill skill)
            {
                // Get combat skill information from fface
                PlayerCombatSkills combatSkills = GetPlayerInformation().CombatSkills;
                // value of specific combat skill
                int value = 0;

                // see which skill is selected
                switch (skill)
                {
                    case CombatSkill.Archery:
                        value = combatSkills.Archery;
                        break;
                    case CombatSkill.Axe:
                        value = combatSkills.Axe;
                        break;
                    case CombatSkill.Club:
                        value = combatSkills.Club;
                        break;
                    case CombatSkill.Dagger:
                        value = combatSkills.Dagger;
                        break;
                    case CombatSkill.Evasion:
                        value = combatSkills.Evasion;
                        break;
                    case CombatSkill.GreatAxe:
                        value = combatSkills.GreatAxe;
                        break;
                    case CombatSkill.GreatKatana:
                        value = combatSkills.GreatKatana;
                        break;
                    case CombatSkill.GreatSword:
                        value = combatSkills.GreatSword;
                        break;
                    case CombatSkill.Guarding:
                        value = combatSkills.Guarding;
                        break;
                    case CombatSkill.HandToHand:
                        value = combatSkills.HandToHand;
                        break;
                    case CombatSkill.Katana:
                        value = combatSkills.Katana;
                        break;
                    case CombatSkill.Marksmanship:
                        value = combatSkills.Marksmanship;
                        break;
                    case CombatSkill.Parrying:
                        value = combatSkills.Parrying;
                        break;
                    case CombatSkill.Polearm:
                        value = combatSkills.Polearm;
                        break;
                    case CombatSkill.Scythe:
                        value = combatSkills.Scythe;
                        break;
                    case CombatSkill.Shield:
                        value = combatSkills.Shield;
                        break;
                    case CombatSkill.Staff:
                        value = combatSkills.Staff;
                        break;
                    case CombatSkill.Sword:
                        value = combatSkills.Sword;
                        break;
                    case CombatSkill.Throwing:
                        value = combatSkills.Throwing;
                        break;
                    default:
                        throw new ArgumentException("Unknown combat skill passed to GetCombatSkillDetails()");

                } // @ switch (skill)

                SkillDetails details = new SkillDetails();
                details.Level = (value & 0xFFF);
                details.Capped = Convert.ToBoolean(((value & 0x8000) >> 15));
                details.SkillType = MagicOrCombat.Combat;
                details.Skill = (int)skill;

                return details;
            }
Beispiel #29
0
 /// <summary>
 /// 添加randEventResourceID指定的skillrandevent资源.
 /// </summary>
 /// <param name="buffRes">来自哪个buff.</param>
 /// <param name="buffCreaterAttr">buff创建者的属性</param>
 public ErrorCode AddRandEvent(SkillBuffTableItem buffRes, AttackerAttr buffCreaterAttr)
 {
     return(SkillDetails.AddRandEvent(this, mRandEventContainer, buffRes, buffCreaterAttr));
 }
Beispiel #30
0
 public ErrorCode RemoveRandEvent(SkillBuffTableItem buffRes, SkillEffectStopReason stopReason)
 {
     return(SkillDetails.RemoveRandEvent(this, mRandEventContainer, buffRes, stopReason));
 }
Beispiel #31
0
 /// <summary>
 /// 检测并在当前角色应用随机事件.
 /// </summary>
 /// <param name="attackerAttr">触发该事件的角色的属性</param>
 /// <param name="skillCommonResID">触发该事件的技能ID</param>
 /// <param name="type">事件触发类型</param>
 public void ApplyRandEvent(BattleUnit theOther, RandEventTriggerType type, RandEventArg argument)
 {
     SkillDetails.ApplyRandEvent(theOther, this, mRandEventContainer, type, argument);
 }
Beispiel #32
0
    protected virtual void onDie(AttackerAttr killerAttr, ImpactDamageType impactDamageType)
    {
        MaterialTableItem material = null;
        uint materialID            = GetMaterialResourceID();

        if (materialID != uint.MaxValue)
        {
            material = DataManager.MaterialTable[materialID] as MaterialTableItem;
        }
        bool operate = false;

        //根据材质修正尸体的存在时间
        if (impactDamageType < ImpactDamageType.Count)
        {
            if (material != null)
            {
                MaterialItem item = material.items[(int)impactDamageType];
                if (item.deatdelay >= 0)
                {
                    mWaitTime      = item.deatdelay;
                    mDisappearTime = 0;
                    operate        = true;
                }
            }
        }

        if (!operate)
        {
            mWaitTime      = mMaxWaitDisappearTime;
            mDisappearTime = mMaxDisappearTime;
        }

        // 检查击杀的随机事件.
        BattleUnit killer = killerAttr.CheckedAttackerObject();

        // 检查是否是自杀.
        if (killer != null && InstanceID != killerAttr.AttackerID)
        {
            killer.OnKillOther(killerAttr, this);
        }

        // 系统回收不触发死亡事件, 自杀依然触发.
        // 如果凶手通过随机事件杀死this, 那么不触发this的随机事件.
        if (killerAttr.AttackerID != uint.MaxValue && !killerAttr.StructMadeByRandEvent)
        {
            ApplyRandEvent(killer, RandEventTriggerType.OnBeKilled, new OnBeKilledEventArg(killerAttr));
        }

        // 通知skilleffect的清理.
        SkillDetails.OnSkillEffectOwnerEvent(mSkillEffectManager, SkillEffectOwnerEventDef.OwnerDie);

        if (material != null && impactDamageType < ImpactDamageType.Count)
        {
            MaterialItem item = material.items[(int)impactDamageType];
            if (item.mtl)
            {
                ////火死亡
                if (impactDamageType == ImpactDamageType.Fire)
                {
                    SetDeathMaterial("burn_out");
                }
                ////毒死亡
                if (impactDamageType == ImpactDamageType.Poison)
                {
                    SetDeathMaterial("poison");
                }
                //冰死亡
                if (impactDamageType == ImpactDamageType.Frost)
                {
                    SetDeathMaterial("iceimpact");
                }
            }
        }

        // 死亡特效, 声音, 动作等.
        // 当所有的效果, 动作都结束时, 开始死亡动作.
        if (mActionCenter != null)
        {
            ErrorHandler.Parse(
                mActionCenter.StartAction(new ActionDieInitParam()
            {
                attackerAttr = killerAttr, damageType = impactDamageType
            }),
                "failed to create action die"
                );
        }

        DieAward(killerAttr.AttackerID);
    }