public int GetSaveValue(OSRIC_CLASS oc, OSRIC_SAVING_THROWS ost, int level) { RPGBaseTable<int> curSaveTable = SaveDict[oc]; int levelIndex=0; for(int i = 0; i<curSaveTable.IntYIndex.Length();i++) if(level<=curSaveTable.IntYIndex.ValueAtIndex(i)) { levelIndex = i; break; } switch(ost) { case OSRIC_SAVING_THROWS.saveRoSaWa: return curSaveTable.GetValue("aimed_magic_items",levelIndex); case OSRIC_SAVING_THROWS.saveBreath: return curSaveTable.GetValue("breath_weapons",levelIndex); case OSRIC_SAVING_THROWS.saveDeath: return curSaveTable.GetValue("death_paralysis_poison",levelIndex); case OSRIC_SAVING_THROWS.savePetPoly: return curSaveTable.GetValue("petrifaction_polymorph",levelIndex); case OSRIC_SAVING_THROWS.saveSpell: return curSaveTable.GetValue("spells",levelIndex); default: return 10; } }
public OSRICCharacterModifier(OSRIC_CHARACTER_VARIABLES _charVariable, OSRIC_SAVING_THROWS _savingThrow, OSRIC_ATTRIBUTES _attribute, OSRIC_ATTRIBUTE_MODIFIER_TYPE _type, int _value) { this.characterVariable = _charVariable; this.savingThrow = _savingThrow; this.attribute = _attribute; this.type = _type; this.name = "unkown"; this.value = _value; }
public OSRICCharacterModifier(JSONObject obj) { attribute = OSRICConstants.GetEnum<OSRIC_ATTRIBUTES>(obj["attribute"].str); type = OSRICConstants.GetEnum<OSRIC_ATTRIBUTE_MODIFIER_TYPE>(obj["type"].str); characterVariable = OSRICConstants.GetEnum<OSRIC_CHARACTER_VARIABLES> (obj["characterVariable"].str); savingThrow = OSRICConstants.GetEnum<OSRIC_SAVING_THROWS>(obj["savingThrow"].str); name = obj["name"].str; description = obj["description"].str; value = (int)obj["value"].n; duration = (int)obj["duration"].n; }