public void ResetChracterOptions(OSRICAttributeModel oam) { oam.characterClass = OSRIC_CLASS.None; oam.characterRace = OSRIC_RACE.Human; oam.characterAlignment = OSRIC_ALIGNMENT.Neutral; oam.characterGender = OSRIC_GENDER.Male; }
public static void AddRaceAdjustments(OSRICAttributeModel oam, OSRIC_RACE newOR) { List<OSRICCharacterModifier> accumulator = new List<OSRICCharacterModifier>(); OSRICCharacterModifier tempMod; switch(newOR) { case OSRIC_RACE.Dwarf: tempMod = new OSRICCharacterModifier(OSRIC_CHARACTER_VARIABLES.attribute, OSRIC_ATTRIBUTES.Constitution, OSRIC_ATTRIBUTE_MODIFIER_TYPE.Racial, 1); accumulator.Add(tempMod); tempMod = new OSRICCharacterModifier(OSRIC_CHARACTER_VARIABLES.attribute, OSRIC_ATTRIBUTES.Charisma, OSRIC_ATTRIBUTE_MODIFIER_TYPE.Racial, -1); accumulator.Add(tempMod); break; case OSRIC_RACE.Elf: tempMod = new OSRICCharacterModifier(OSRIC_CHARACTER_VARIABLES.attribute, OSRIC_ATTRIBUTES.Dexterity, OSRIC_ATTRIBUTE_MODIFIER_TYPE.Racial, 1); accumulator.Add(tempMod); tempMod = new OSRICCharacterModifier(OSRIC_CHARACTER_VARIABLES.attribute, OSRIC_ATTRIBUTES.Constitution, OSRIC_ATTRIBUTE_MODIFIER_TYPE.Racial, -1); accumulator.Add(tempMod); break; case OSRIC_RACE.Gnome: break; case OSRIC_RACE.HalfElf: break; case OSRIC_RACE.Halfling: tempMod = new OSRICCharacterModifier(OSRIC_CHARACTER_VARIABLES.attribute, OSRIC_ATTRIBUTES.Dexterity, OSRIC_ATTRIBUTE_MODIFIER_TYPE.Racial, 1); accumulator.Add(tempMod); tempMod = new OSRICCharacterModifier(OSRIC_CHARACTER_VARIABLES.attribute, OSRIC_ATTRIBUTES.Strength, OSRIC_ATTRIBUTE_MODIFIER_TYPE.Racial, -1); accumulator.Add(tempMod); // Broken here int conAdjust = -1*(int)((float)oam.Con/3.5); tempMod = new OSRICCharacterModifier(OSRIC_CHARACTER_VARIABLES.savingthrow, OSRIC_SAVING_THROWS.saveRoSaWa, OSRIC_ATTRIBUTES.Constitution, OSRIC_ATTRIBUTE_MODIFIER_TYPE.Racial, conAdjust); accumulator.Add(tempMod); tempMod = new OSRICCharacterModifier(OSRIC_CHARACTER_VARIABLES.savingthrow, OSRIC_SAVING_THROWS.saveSpell, OSRIC_ATTRIBUTES.Constitution, OSRIC_ATTRIBUTE_MODIFIER_TYPE.Racial, conAdjust); accumulator.Add(tempMod); tempMod = new OSRICCharacterModifier(OSRIC_CHARACTER_VARIABLES.savingthrow, OSRIC_SAVING_THROWS.saveDeath, OSRIC_ATTRIBUTES.Constitution, OSRIC_ATTRIBUTE_MODIFIER_TYPE.Racial, conAdjust); accumulator.Add(tempMod); break; case OSRIC_RACE.HalfOrc: tempMod = new OSRICCharacterModifier(OSRIC_CHARACTER_VARIABLES.attribute, OSRIC_ATTRIBUTES.Strength, OSRIC_ATTRIBUTE_MODIFIER_TYPE.Racial, 1); accumulator.Add(tempMod); tempMod = new OSRICCharacterModifier(OSRIC_CHARACTER_VARIABLES.attribute, OSRIC_ATTRIBUTES.Constitution, OSRIC_ATTRIBUTE_MODIFIER_TYPE.Racial, 1); accumulator.Add(tempMod); tempMod = new OSRICCharacterModifier(OSRIC_CHARACTER_VARIABLES.attribute, OSRIC_ATTRIBUTES.Charisma, OSRIC_ATTRIBUTE_MODIFIER_TYPE.Racial, -2); accumulator.Add(tempMod); break; case OSRIC_RACE.Human: break; } foreach(OSRICCharacterModifier ocm in accumulator) { oam.AddRacialModifier(ocm); } // Debug.Log("Modifier List: " + oam.CharacterModifiers.ModifierList.Count.ToString()); }
public HashSet<OSRIC_RACE> AvailableRaces(OSRICAttributeModel _atm) { HashSet<OSRIC_RACE> retSet = new HashSet<OSRIC_RACE>(); // retSet.Add (OSRIC_RACE.Human); // retSet.Add (OSRIC_RACE.HalfElf); // retSet.Add (OSRIC_RACE.Dwarf); // retSet.Add (OSRIC_RACE.Elf); // retSet.Add (OSRIC_RACE.Gnome); // retSet.Add (OSRIC_RACE.Halfling); // retSet.Add (OSRIC_RACE.HalfOrc); int val; foreach (OSRIC_RACE race in Enum.GetValues(typeof(OSRIC_RACE))) { if(race==OSRIC_RACE.Human) { retSet.Add(race); continue; } val = raceMinMax.GetYIndexOf(race.GetDesc()); if (_atm.Str < raceMinMax.GetValue("str_min", val)) continue; if(_atm.Dex < raceMinMax.GetValue("dex_min", val)) continue; if(_atm.Int < raceMinMax.GetValue("int_min", val)) continue; if(_atm.Wis < raceMinMax.GetValue("wis_min", val)) continue; if(_atm.Con < raceMinMax.GetValue("con_min", val)) continue; if(_atm.Cha < raceMinMax.GetValue("cha_min", val)) continue; retSet.Add(race); } return retSet; }
public HashSet<OSRIC_CLASS> AvailableClassesByRace(OSRICAttributeModel _atm) { HashSet<OSRIC_CLASS> retSet = new HashSet<OSRIC_CLASS>(); bool available; foreach(OSRIC_CLASS oc in Enum.GetValues(typeof(OSRIC_CLASS))) { if(oc==OSRIC_CLASS.None) { retSet.Add(oc); continue; } available = raceClassMatrix.GetValue(_atm.characterRace.GetDesc(),raceClassMatrix.GetYIndexOf(oc.GetDesc())); if(available) retSet.Add(oc); } return retSet; }
public HashSet<OSRIC_CLASS> AvailableClassesByAttributes(OSRICAttributeModel _atm) { HashSet<OSRIC_CLASS> retSet = new HashSet<OSRIC_CLASS>(); bool addClass; foreach(OSRIC_CLASS oc in Enum.GetValues(typeof(OSRIC_CLASS))) { if(oc == OSRIC_CLASS.None) { retSet.Add(oc); continue; } int classIndex = classMinimums.GetYIndexOf(oc.GetDesc()); addClass = true; foreach(OSRIC_ATTRIBUTES oa in Enum.GetValues(typeof(OSRIC_ATTRIBUTES))) { if(_atm.GetBaseAttribute(oa)<classMinimums.GetValue(oa.GetDesc(),classIndex)) addClass = false; } if(addClass) retSet.Add(oc); } return retSet; }
public bool AreAttributesViable(OSRICAttributeModel oam) { if(AvailableClassesByAttributes(oam).Count>1) return true; return false; }
public RPGCharacterModel() { attributes = new OSRICAttributeModel(this); }