Пример #1
0
        public PropertyModifierSet GetModifierSetByIdAndLevel(int skillId, int skillLevel)
        {
            CombatTurn combatTurnByID = this.GetCombatTurnByID(skillId);

            if ((combatTurnByID == null) || (combatTurnByID.type != 5))
            {
                return(null);
            }
            int          id         = combatTurnByID.GetStage(3).value;
            AvatarAction actionById = this.GetActionById(id);

            if (actionById == null)
            {
                return(null);
            }
            AvatarAction.Event event2 = (actionById.events.Count != 0) ? actionById.events[0] : null;
            if ((event2 == null) || (event2.eventType != 4))
            {
                return(null);
            }
            ClientServerCommon.Buff buffById = this.GetBuffById(event2.buffId);
            if (buffById == null)
            {
                return(null);
            }
            return(buffById.GetModifierSetByLevelFilter(skillLevel));
        }
Пример #2
0
        private ClientServerCommon.Buff LoadBuffFromXml(SecurityElement element, int sourceTurnId)
        {
            ClientServerCommon.Buff buff = new ClientServerCommon.Buff {
                id                = StrParser.ParseHexInt(element.Attribute("Id"), 0),
                buffType          = TypeNameContainer <ClientServerCommon.Buff._BuffType> .Parse(element.Attribute("BuffType"), 1),
                superpositionType = TypeNameContainer <ClientServerCommon.Buff._SuperpositionType> .Parse(element.Attribute("SuperpositionType"), 1),
                conflictStrategy  = TypeNameContainer <ClientServerCommon.Buff._ConflictStrategy> .Parse(element.Attribute("ConflictStrategy"), 1),
                uiName            = StrParser.ParseStr(element.Attribute("UIName"), "")
            };
            if (element.Children != null)
            {
                foreach (SecurityElement element2 in element.Children)
                {
                    AvatarAction.Effect effect;
                    AvatarAction        action;
                    string tag = element2.Tag;
                    if (tag != null)
                    {
                        if (tag != "ModifierSet")
                        {
                            if (tag == "Effect")
                            {
                                goto Label_00F1;
                            }
                            if (tag == "Action")
                            {
                                goto Label_010A;
                            }
                        }
                        else
                        {
                            buff.modifierSets.Add(PropertyModifierSet.LoadFromXml(element2));
                        }
                    }
                    continue;
Label_00F1:
                    effect = this.LoadEffectFromXml(element2);
                    if (effect != null)
                    {
                        buff.effects.Add(effect);
                    }
                    continue;
Label_010A:
                    action = this.LoadActionFromXml(element2, sourceTurnId);
                    if (action != null)
                    {
                        buff.actions.Add(action);
                    }
                }
            }
            return(buff);
        }
Пример #3
0
        public AvatarAction GetActionById(int id)
        {
            AvatarAction action;

            if (AvatarAction.IsBuffActionID(id))
            {
                ClientServerCommon.Buff buffById = this.GetBuffById(ClientServerCommon.Buff.GetBuffIDFromBuffActionID(id));
                if (buffById == null)
                {
                    return(null);
                }
                return(buffById.GetActionById(ClientServerCommon.Buff.GetActionIDFromBuffActionID(id)));
            }
            if (!this._id_actionMap.TryGetValue(id, out action))
            {
                return(null);
            }
            return(action);
        }