Example #1
0
        public override bool Parse(Hashtable info)
        {
            if (!base.Parse(info))
            {
                return(false);
            }

            Attributes = CombatUtil.ParseCombatantAttributes(info, null);

            return(true);
        }
Example #2
0
        public override bool Parse(Hashtable info)
        {
            if (!base.Parse(info))
            {
                return(false);
            }

            Data       = CombatUtil.ParseCombatantData(info["data"] as Hashtable, null);
            Attributes = CombatUtil.ParseCombatantAttributes(info["status"] as Hashtable, null);

            return(true);
        }
Example #3
0
        public static CombatantAttributes ParseCombatantAttributes(IDictionary info, CombatantAttributes fill)
        {
            if (fill == null)
            {
                fill = new CombatantAttributes();
            }

            var enumerator = sAttrTypeDic.GetEnumerator();

            while (enumerator.MoveNext())
            {
                var pair = enumerator.Current;
                if (!info.Contains(pair.Key))
                {
                    continue;
                }

                CombatantAttributes.eAttribute attr = pair.Value;
                switch (attr)
                {
                case CombatantAttributes.eAttribute.CanNormalAttack:
                case CombatantAttributes.eAttribute.CanRevive:
                case CombatantAttributes.eAttribute.CanUseComboSkill:
                case CombatantAttributes.eAttribute.CanUseManualSkill:
                case CombatantAttributes.eAttribute.Slow:
                case CombatantAttributes.eAttribute.FreezeHitReaction:
                    fill.SetBoolAttr(attr, bool.Parse(info[pair.Key].ToString()));
                    break;

                default:
                    fill.SetIntAttr(attr, int.Parse(info[pair.Key].ToString()));
                    break;
                }
            }

            return(fill);
        }
 public CommUpdateCombatant(Combatant combatant, CombatantAttributes attribute, object attributeNewValue)
 {
     this.combatant = combatant;
     this.attribute = attribute;
     this.attributeNewValue = attributeNewValue;
 }
Example #5
0
 public void setAttribute(CombatantAttributes attribute, object value)
 {
     switch (attribute)
     {
         case CombatantAttributes.cName:
             CName = (string)value;
             break;
         case CombatantAttributes.pName:
             PName = (string)value;
             break;
         case CombatantAttributes.hp:
             HP = (float)value;
             break;
         case CombatantAttributes.initiative:
             Initiative = (float)value;
             break;
         case CombatantAttributes.aC:
             AC = (float)value;
             break;
         case CombatantAttributes.aB:
             AB = (float)value;
             break;
         case CombatantAttributes.maxHP:
             MaxHP = (float)value;
             break;
         case CombatantAttributes.initMod:
             InitMod = (float)value;
             break;
         case CombatantAttributes.fort:
             Fort = (float)value;
             break;
         case CombatantAttributes.refl:
             Refl = (float)value;
             break;
         case CombatantAttributes.will:
             Will = (float)value;
             break;
         case CombatantAttributes.listen:
             setSkillRank(eSkills.Listen, (int)value);
             break;
         case CombatantAttributes.sense:
             setSkillRank(eSkills.Sense_Motive, (int)value);
             break;
         case CombatantAttributes.spot:
             setSkillRank(eSkills.Spot, (int)value);
             break;
         case CombatantAttributes.isNPC:
             IsNPC = (bool)value;
             break;
         case CombatantAttributes.gold:
             Gold = (float)value;
             break;
         case CombatantAttributes.xp:
             XP = (float)value;
             break;
         default:
             break;
     }
 }
Example #6
0
        public object getAttribute(CombatantAttributes attribute)
        {
            switch (attribute)
            {
                case CombatantAttributes.cName:
                    return CName;
                case CombatantAttributes.pName:
                    return PName;
                case CombatantAttributes.hp:
                    return HP;
                case CombatantAttributes.initiative:
                    return Initiative;
                case CombatantAttributes.aC:
                    return AC;
                case CombatantAttributes.aB:
                    return AB;
                case CombatantAttributes.maxHP:
                    return MaxHP;
                case CombatantAttributes.initMod:
                    return InitMod;
                case CombatantAttributes.fort:
                    return Fort;
                case CombatantAttributes.refl:
                    return Refl;
                case CombatantAttributes.will:
                    return Will;
                case CombatantAttributes.listen:
                    return getSkillRank(eSkills.Listen);
                case CombatantAttributes.sense:
                    return getSkillRank(eSkills.Sense_Motive);
                case CombatantAttributes.spot:
                    return getSkillRank(eSkills.Spot);
                case CombatantAttributes.isNPC:
                    return IsNPC;
                case CombatantAttributes.gold:
                    return Gold;
                case CombatantAttributes.xp:
                    return XP;

                default:
                    return null;

            }
        }