public override void Set(string valueStr, string indexStr) { int index; if (ConstParser.TryParse(indexStr, out index)) { if (index >= 0 && index < arr.Length) { arr[index].Set(valueStr, null); } } }
public override void Set(string valueStr, string indexStr) { ConstParser.TryParse(valueStr, out value); }
protected override void HandleFunc(string funcName, string args) { string[] strs = args.Split(new char[] { ' ', ',', (char)0x9 }, StringSplitOptions.RemoveEmptyEntries); if (string.Compare(funcName, "Mdl_SetVisual", true) == 0) { if (strs.Length == 2) { properties["visual"].Set(strs[1], null); } } else if (string.Compare(funcName, "Mdl_SetVisualBody", true) == 0) { if (strs.Length == 8) { properties["bodymesh"].Set(strs[1], null); properties["bodytex"].Set(strs[2], null); properties["headmesh"].Set(strs[4], null); properties["headtex"].Set(strs[5], null); } } else if (string.Compare(funcName, "Mdl_SetModelFatness", true) == 0) { if (strs.Length == 2) { properties["fatness"].Set(strs[1], null); } } else if (string.Compare(funcName, "B_SetNpcVisual", true) == 0) { if (strs.Length == 6) { properties["visual"].Set("\"humans.mds\"", null); int gender, bodyTex; ConstParser.TryParse(strs[1], out gender); ConstParser.TryParse(strs[4], out bodyTex); if (gender == 0) // MALE { properties["bodymesh"].Set("\"hum_body_Naked0\"", null); } else { if (bodyTex >= 0 && bodyTex <= 3) { bodyTex += 4; } properties["bodymesh"].Set("\"Hum_Body_Babe0\"", null); } properties["bodytex"].Set(bodyTex.ToString(), null); properties["headmesh"].Set(strs[2], null); properties["headtex"].Set(strs[3], null); properties["armor"].Set(string.Format("\"{0}\"", strs[5]), null); // item instance } } else if (string.Compare(funcName, "Mdl_ApplyOverlayMds", true) == 0) { if (strs.Length == 2) { properties["overlay"].Set(strs[1], null); } } else if (string.Compare(funcName, "EquipItem", true) == 0) { if (strs.Length == 2 && !string.IsNullOrWhiteSpace(strs[1])) { equipment.Add(strs[1]); } } else { base.HandleFunc(funcName, args); } }