// Use this for initialization void Start() { var dieDic = DieTypes.AttackDie; stats = gameObject.AddComponent <RPGDefaultStats>(); health = stats.GetStat <RPGVital>(RPGStatType.Health); willpower = stats.GetStat <RPGVital>(RPGStatType.Willpower); stamina = stats.GetStat <RPGVital>(RPGStatType.Stamina); dex = stats.GetStat <RPGAttribute>(RPGStatType.Dexterity); attackDie = stats.GetStat <RPGAttribute>(RPGStatType.DieType); level = stats.GetStat <RPGAttribute>(RPGStatType.Level); attack = stats.GetStat <RPGAttribute>(RPGStatType.Attack); will = stats.GetStat <RPGAttribute>(RPGStatType.Will); defense = stats.GetStat <RPGAttribute>(RPGStatType.Defense); alive = stats.GetStat <RPGAttribute>(RPGStatType.Alive); speed = stats.GetStat <RPGAttribute>(RPGStatType.Speed); evasion = stats.GetStat <RPGAttribute>(RPGStatType.Evasion); ///Modifiy base stats /// stamina.StatCurrentValue = 0; health.StatBaseValue = health.StatBaseValue; health.SetCurrentValueToMax(); attackDie.StatBaseValue = DieTypes.GetAttackDie(DieTypes.DieType.D4); dex.StatBaseValue = dex.StatBaseValue + 2; dex.UpdateLinkers(); }
// Use this for initialization void Start() { var dieDic = DieTypes.AttackDie; stats = gameObject.AddComponent <RPGDefaultStats>(); socialStats = gameObject.GetComponent <SocialStats>(); health = stats.GetStat <RPGVital>(RPGStatType.Health); willpower = stats.GetStat <RPGVital>(RPGStatType.Willpower); stamina = stats.GetStat <RPGVital>(RPGStatType.Stamina); dex = stats.GetStat <RPGAttribute>(RPGStatType.Dexterity); attackDie = stats.GetStat <RPGAttribute>(RPGStatType.DieType); level = stats.GetStat <RPGAttribute>(RPGStatType.Level); attack = stats.GetStat <RPGAttribute>(RPGStatType.Attack); will = stats.GetStat <RPGAttribute>(RPGStatType.Will); defense = stats.GetStat <RPGAttribute>(RPGStatType.Defense); alive = stats.GetStat <RPGAttribute>(RPGStatType.Alive); speed = stats.GetStat <RPGAttribute>(RPGStatType.Speed); evasion = stats.GetStat <RPGAttribute>(RPGStatType.Evasion); if (gameObject.GetComponent <CurrentState>().inCombat) { SetPlayerStatusBars(); } ///Modifiy base stats /// health.StatBaseValue += 10; health.SetCurrentValueToMax(); attackDie.StatBaseValue = DieTypes.GetAttackDie(DieTypes.DieType.D4); dex.StatBaseValue = dex.StatBaseValue + 1; dex.UpdateLinkers(); Debug.Log("Player health is: " + health.StatBaseValue); Debug.Log("Extroversion: " + socialStats.GetStat(SocialStats.SocialStatType.Extroversion).StatBaseValue); ///Tests socialStats.SocialStatChange(socialStats.GetStat(SocialStats.SocialStatType.Extroversion)); Debug.Log("Extroversion after increment: " + socialStats.GetStat(SocialStats.SocialStatType.Extroversion).StatValue); }
public void LoadCreature(Model.Creature creature) { ActorName = creature.ActorName; InitiativeMod = Methods.GetSignedNumberString(creature.InitiativeMod); SelectedCreatureType = CreatureTypes.IndexOf(Methods.GetCreatureTypeString(creature.Type)); ChallengeRating = creature.ChallengeRating.ToString(); AttackSets = creature.AttackSets; Strength = creature.Strength.ToString(); Dexterity = creature.Dexterity.ToString(); Constitution = creature.Constitution.ToString(); Intelligence = creature.Intelligence.ToString(); Wisdom = creature.Wisdom.ToString(); Charisma = creature.Charisma.ToString(); BaseAttackBonus = Methods.GetSignedNumberString(creature.BaseAttackBonus); GrappleModifier = Methods.GetSignedNumberString(creature.GrappleModifier); HitPoints = creature.HitPoints.ToString(); HitDice = creature.HitDice.ToString(); SelectedHitDie = DieTypes.IndexOf(Methods.GetDieTypeString(creature.HitDieType)); ArmorClass = creature.ArmorClass.ToString(); TouchArmorClass = creature.TouchArmorClass.ToString(); FlatFootedArmorClass = creature.FlatFootedArmorClass.ToString(); Speeds = creature.Speed; Space = creature.Space.ToString(); Reach = creature.Reach.ToString(); FortitudeSave = Methods.GetSignedNumberString(creature.FortitudeSave); ReflexSave = Methods.GetSignedNumberString(creature.ReflexSave); WillSave = Methods.GetSignedNumberString(creature.WillSave); Feats = creature.Feats; SelectedSize = Sizes.IndexOf(Methods.GetSizeString(creature.Size)); DamageReductions = creature.DamageReductions; Immunities = creature.Immunities; EnergyResistances = creature.EnergyResistances; SpellResistance = creature.SpellResistance.ToString(); FastHealing = creature.FastHealing.ToString(); SpecialAttacks = creature.SpecialAttacks; SpecialQualities = creature.SpecialQualities; }
public Model.Creature GetCreature() { bool askForInput = true; string feedback = null; Model.Creature creature = null; while (askForInput) { View.CreateCreatureWindow createCreatureWindow = new View.CreateCreatureWindow(feedback); createCreatureWindow.DataContext = this; if (createCreatureWindow.ShowDialog() == true) { try { Model.CreatureAttributes creatureAttributes = new Model.CreatureAttributes { InitiativeMod = Convert.ToInt32(InitiativeMod), Type = Methods.GetCreatureTypeFromString(CreatureTypes.ElementAt(SelectedCreatureType)), ChallengeRating = Convert.ToSingle(ChallengeRating), AttackSets = AttackSets, Strength = Convert.ToInt32(Strength), Dexterity = Convert.ToInt32(Dexterity), Constitution = Convert.ToInt32(Constitution), Intelligence = Convert.ToInt32(Intelligence), Wisdom = Convert.ToInt32(Wisdom), Charisma = Convert.ToInt32(Charisma), BaseAttackBonus = Convert.ToInt32(BaseAttackBonus), GrappleModifier = Convert.ToInt32(GrappleModifier), HitPoints = Convert.ToInt32(HitPoints), HitDice = Convert.ToInt32(HitDice), HitDieType = Methods.GetDieTypeFromString(DieTypes.ElementAt(SelectedHitDie)), ArmorClass = Convert.ToInt32(ArmorClass), TouchArmorClass = Convert.ToInt32(TouchArmorClass), FlatFootedArmorClass = Convert.ToInt32(FlatFootedArmorClass), Speed = Speeds, Space = Convert.ToInt32(Space), Reach = Convert.ToInt32(Reach), FortitudeSave = Convert.ToInt32(FortitudeSave), ReflexSave = Convert.ToInt32(ReflexSave), WillSave = Convert.ToInt32(WillSave), Feats = Feats, Size = Methods.GetSizeFromString(Sizes.ElementAt(SelectedSize)), DamageReductions = DamageReductions, Immunities = Immunities, EnergyResistances = EnergyResistances, SpellResistance = Convert.ToInt32(SpellResistance), FastHealing = Convert.ToInt32(FastHealing), SpecialAttacks = SpecialAttacks, SpecialQualities = SpecialQualities, }; creature = new Model.Creature(creatureAttributes) { ActorName = ActorName, }; askForInput = false; } catch (FormatException) { feedback = "Invalid format"; } } else { askForInput = false; } } return(creature); }