public Attribute(ATTRIBUTES type, uint value) { Type = type; Value = value; switch (type) { case ATTRIBUTES.IQ: Description = "Intelligence Quotient (I.Q.): Indicates the intelligence of the character. The exact I.Q. is equal to the I.Q. attribute multiplied times ten. "; Description += "Characters with an I.Q.of 17 or better will receive a one time bonus added to all the character's skill percentages."; BonusDescription = "I.Q. add to all skills. One time bonus."; DisplayTxt = "I.Q."; break; case ATTRIBUTES.ME: Description = "Mental Endurance (M.E.): Measures the amount of mental and emotional stress the character can withstand."; BonusDescription = "M.E. save vs. psychic attack/insanity"; DisplayTxt = "M.E."; break; case ATTRIBUTES.MA: Description = "Mental Affinity (M.A.): Shows the character's personal charm and charisma. Natural leaders, with an M.A. of 17 or higher, have a bonus to invoke trust or intimidation in others."; BonusDescription = "M.A. trust/intimidate"; DisplayTxt = "M.A."; break; case ATTRIBUTES.PS: Description = "Physical Strength (P.S.): This is the raw physical power of the character."; BonusDescription = "P. S. Hand to Hand Combat: Damage"; DisplayTxt = "P.S."; break; case ATTRIBUTES.PP: Description = "Physical Prowess (P.P.): Shows the degree of dexterity and agility of the character. A P.P.of 17 or higher is rewarded with bonuses to dodge, parry and strike."; BonusDescription = "P.P. parry , dodge and strike bonus"; DisplayTxt = "P.P."; break; case ATTRIBUTES.PE: Description = "Physical Endurance (P.E.): Demonstrates the character's stamina and durability. "; Description += "The amount of physical punishment, and resistance to fatigue and disease, are determined by P.E. A character can carry the maximum weight load for the P.E. times 4 minutes. "; Description += "Carrying the maximum weight while running or fighting can only be done for the P.E. times 2 minutes. "; Description += "If a character lifts the maximum weight, then it can only be held for as many melee rounds (15 seconds each) as the character has points of P.E. "; Description += "A character can run at maximum speed for one minute for each point of P.E. Characters with a P.E. of 17 or better receive bonuses to save vs.coma, death, toxins, and magic."; BonusDescription = "P.E. save vs. coma/death | save vs. poison & Magic"; DisplayTxt = "P.E."; break; case ATTRIBUTES.PB: Description = "Physical Beauty (P.B.): Is an indication of the physical attractiveness of the character. A P.B. of 17 or better will be rewarded with a bonus to charm or impress."; BonusDescription = "P.B. charm/impress"; DisplayTxt = "P.B."; break; case ATTRIBUTES.Spd: Description = "Speed (Spd): Specifically, this is the character's maximum running speed. The Spd. times 20 is the number of yards or meters that the character can run in one minute."; BonusDescription = "Spd: No special bonuses other than the raw, natural ability to run."; DisplayTxt = "Spd"; break; } }
/// <summary> /// Retrieves a FORMPOST from the database (by id) and binds the /// results to the given EL model (if permitted to access) /// </summary> /// <param name="model"></param> /// <param name="attr"></param> /// <param name="id"></param> private void attachFormPost(EL model, ATTRIBUTES attr, int id) { if (id > 0) { FormPost data = (FormPost)db.dbSets["FormPost"].Find(id); if (data.authorId == User.Identity.Name || data.isPublic == 1) { XmlDocument xml = new XmlDocument(); xml.LoadXml(data.xmlResults); XmlNodeList node = xml.SelectNodes("/root/*"); foreach (XmlNode xn in node) { attr.Add(xn.Name, xn.InnerText); } } } }
public void setItemValue(string key, ATTRIBUTES attrib, string value) { if (h_items.ContainsKey(key) && h_items[key] != null) { string[] values = (string[])h_items[key]; values[(int)attrib] = value; h_items[key] = values; } else { string[] values = new string[COUNT_ATTRIBS]; values[(int)attrib] = value; h_items.Add(key, values); } }
public string getItemValue(string key, ATTRIBUTES attrib) { string[] values = (string[])h_items[key]; return (string)values[(int)attrib]; }
//Helper method to add any new modifiers to the list protected void CheckAttributes(ATTRIBUTES o) { //Determine what buffs need to be added switch (o) { case ATTRIBUTES.BEAST: if (p_Attributes[o] >= 6) { current_Mods[11] = CHARACTER_MODIFIER.BEAST_3; } else if (p_Attributes[o] >= 4) { current_Mods[11] = CHARACTER_MODIFIER.BEAST_2; } else if (p_Attributes[o] >= 2) { current_Mods[11] = CHARACTER_MODIFIER.BEAST_1; } else { current_Mods[11] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.ELDRITCH: if (p_Attributes[o] >= 4) { current_Mods[12] = CHARACTER_MODIFIER.ELDRITCH_2; } else if (p_Attributes[o] >= 2) { current_Mods[12] = CHARACTER_MODIFIER.ELDRITCH_1; } else { current_Mods[12] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.FELWALKER: if (p_Attributes[o] >= 6) { current_Mods[13] = CHARACTER_MODIFIER.FELWALKER_2; } else if (p_Attributes[o] >= 3) { current_Mods[13] = CHARACTER_MODIFIER.FELWALKER_1; } else { current_Mods[13] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.HUMAN: if (p_Attributes[o] >= 4) { player_Mod = PLAYER_MODIFIER.HUMAN_2; } else if (p_Attributes[o] >= 2) { player_Mod = PLAYER_MODIFIER.HUMAN_1; } else { player_Mod = PLAYER_MODIFIER.NULL; } break; case ATTRIBUTES.INSECTOID: if (p_Attributes[o] >= 4) { current_Mods[14] = CHARACTER_MODIFIER.INSECTOID; } else { current_Mods[14] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.NAUTICAL: if (p_Attributes[o] >= 3) { current_Mods[15] = CHARACTER_MODIFIER.NAUTICAL; } else { current_Mods[15] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.VAMPIRE: if (p_Attributes[o] >= 4) { current_Mods[16] = CHARACTER_MODIFIER.VAMPIRE_2; } else if (p_Attributes[o] >= 2) { current_Mods[16] = CHARACTER_MODIFIER.VAMPIRE_1; } else { current_Mods[16] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.WIGHT: if (p_Attributes[o] >= 6) { current_Mods[17] = CHARACTER_MODIFIER.WIGHT_3; } else if (p_Attributes[o] >= 4) { current_Mods[17] = CHARACTER_MODIFIER.WIGHT_2; } else if (p_Attributes[o] >= 2) { current_Mods[17] = CHARACTER_MODIFIER.WIGHT_1; } else { current_Mods[17] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.WOODLAND: if (p_Attributes[o] >= 4) { current_Mods[18] = CHARACTER_MODIFIER.WOODLAND_2; } else if (p_Attributes[o] >= 2) { current_Mods[18] = CHARACTER_MODIFIER.WOODLAND_1; } else { current_Mods[18] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.WYRM: if (p_Attributes[o] >= 2) { current_Mods[19] = CHARACTER_MODIFIER.WYRM; } else { current_Mods[19] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.BLIGHTCRAFTER: if (p_Attributes[o] >= 6) { current_Mods[0] = CHARACTER_MODIFIER.BLIGHT_3; } else if (p_Attributes[o] >= 4) { current_Mods[0] = CHARACTER_MODIFIER.BLIGHT_2; } else if (p_Attributes[o] >= 2) { current_Mods[0] = CHARACTER_MODIFIER.BLIGHT_1; } else { current_Mods[0] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.BOUNTYHUNTER: if (p_Attributes[o] >= 4) { current_Mods[1] = CHARACTER_MODIFIER.BOUNTY_2; } else if (p_Attributes[o] >= 2) { current_Mods[1] = CHARACTER_MODIFIER.BOUNTY_1; } else { current_Mods[1] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.BULWARK: if (p_Attributes[o] >= 3) { current_Mods[2] = CHARACTER_MODIFIER.BULWARK; } else { current_Mods[2] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.FANATIC: if (p_Attributes[o] >= 4) { current_Mods[3] = CHARACTER_MODIFIER.FANATIC_2; } else if (p_Attributes[o] >= 2) { current_Mods[3] = CHARACTER_MODIFIER.FANATIC_1; } else { current_Mods[3] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.PHALANX: if (p_Attributes[o] >= 6) { current_Mods[4] = CHARACTER_MODIFIER.PHALANX_3; } else if (p_Attributes[o] >= 4) { current_Mods[4] = CHARACTER_MODIFIER.PHALANX_2; } else if (p_Attributes[o] >= 2) { current_Mods[4] = CHARACTER_MODIFIER.PHALANX_1; } else { current_Mods[4] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.SHADOWHAND: if (p_Attributes[o] >= 6) { current_Mods[5] = CHARACTER_MODIFIER.SHADOWHAND_3; } else if (p_Attributes[o] >= 4) { current_Mods[5] = CHARACTER_MODIFIER.SHADOWHAND_2; } else if (p_Attributes[o] >= 2) { current_Mods[5] = CHARACTER_MODIFIER.SHADOWHAND_1; } else { current_Mods[5] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.SILENCER: if (p_Attributes[o] >= 1) { current_Mods[6] = CHARACTER_MODIFIER.SILENCER; } else { current_Mods[6] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.SWARMLORD: if (p_Attributes[o] >= 6) { current_Mods[7] = CHARACTER_MODIFIER.SWARMLORD_3; } else if (p_Attributes[o] >= 4) { current_Mods[7] = CHARACTER_MODIFIER.SWARMLORD_2; } else if (p_Attributes[o] >= 2) { current_Mods[7] = CHARACTER_MODIFIER.SWARMLORD_1; } else { current_Mods[7] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.WARLOCK: if (p_Attributes[o] >= 4) { current_Mods[8] = CHARACTER_MODIFIER.WARLOCK_2; } else if (p_Attributes[o] >= 2) { current_Mods[8] = CHARACTER_MODIFIER.WARLOCK_1; } else { current_Mods[8] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.WITCHDOCTOR: if (p_Attributes[o] >= 4) { current_Mods[9] = CHARACTER_MODIFIER.WITCHDOCTOR_2; } else if (p_Attributes[o] >= 2) { current_Mods[9] = CHARACTER_MODIFIER.WITCHDOCTOR_1; } else { current_Mods[9] = CHARACTER_MODIFIER.NULL; } break; case ATTRIBUTES.ZEALOT: if (p_Attributes[o] >= 4) { current_Mods[10] = CHARACTER_MODIFIER.ZEALOT; } else { current_Mods[10] = CHARACTER_MODIFIER.NULL; } break; } }
/// <summary> /// Construct a generic MODEL /// </summary> /// <param name="attributes"></param> public MODEL(ATTRIBUTES attributes = null, ATTRIBUTES data = null, ATTRIBUTES meta = null) { this.attributes = attributes == null ? new ATTRIBUTES() : attributes; this.data = data == null ? new ATTRIBUTES() : data; this.meta = meta == null ? new ATTRIBUTES() : meta; }
public static string AttributeNameToString(ATTRIBUTES zAttribute) { switch (zAttribute) { case ATTRIBUTES.VIGOR: return "VIGOR"; case ATTRIBUTES.DESTREZA: return "DESTREZA"; case ATTRIBUTES.INTELIGENCIA: return "INTELIGENCIA"; case ATTRIBUTES.PRESENCIA: return "PRESENCIA"; } return "???"; }