//update character
 private void button1_Click(object sender, EventArgs e)
 {
     foreach (Character update in CombatHolder._inCombatChars)
     {
         Character c = Utilities.GetCharByName(update.Name);
         CombatHolder.UpdateCharInventorySpellsSkillsEffectsAndStats(c);
     }
     updateRTBWithCharacternames();
     cboBoxInCombat.DataSource = CombatHolder.getInCombatCharNames();
 }
Ejemplo n.º 2
0
 public static void RemoveEffect(Effect toRem, Character c, bool isPermanent)
 {
     Utilities.forceTypesToConformToTag(toRem);
     if (isPermanent)
     {
         Effect toRemFromChar = c.Effects.Find(A => A.Equals(toRem));
         c.Effects.Remove(toRemFromChar);
         Utilities.SaveCharacter(c);
         CombatHolder.UpdateCharInventorySpellsSkillsEffectsAndStats(c);
     }
     else
     {
         Effect toRemFromChar = c.TemporaryEffects.Find(A => A.Equals(toRem));
         c.TemporaryEffects.Remove(toRemFromChar);
     }
 }
Ejemplo n.º 3
0
        public static void CreateEffect(Effect toAdd, Character c, bool isPermanent)
        {
            Utilities.forceTypesToConformToTag(toAdd);
            if (toAdd.effectStrength > 0)
            {
                List <Effect> toDecFrom = new List <Effect>();
                if (isPermanent)
                {
                    toDecFrom = c.Effects;
                }
                else
                {
                    toDecFrom = c.TemporaryEffects;
                }
                switch (toAdd.effectTag)
                {
                case EffectHolder.EffectTag.Bleed:
                    DecrementTaggedEffect(toAdd, true, toDecFrom);
                    Utilities.SaveCharacter(c);
                    CombatHolder.UpdateCharInventorySpellsSkillsEffectsAndStats(c);
                    return;

                case EffectHolder.EffectTag.Trauma:
                    DecrementTaggedEffect(toAdd, true, toDecFrom);
                    Utilities.SaveCharacter(c);
                    CombatHolder.UpdateCharInventorySpellsSkillsEffectsAndStats(c);
                    return;

                case EffectHolder.EffectTag.BoneImpairment:
                    DecrementTaggedEffect(toAdd, false, toDecFrom);
                    Utilities.SaveCharacter(c);
                    CombatHolder.UpdateCharInventorySpellsSkillsEffectsAndStats(c);
                    return;

                case EffectHolder.EffectTag.MuscleImpairment:
                    DecrementTaggedEffect(toAdd, false, toDecFrom);
                    Utilities.SaveCharacter(c);
                    CombatHolder.UpdateCharInventorySpellsSkillsEffectsAndStats(c);
                    return;

                case EffectHolder.EffectTag.NerveImpairment:
                    DecrementTaggedEffect(toAdd, false, toDecFrom);
                    Utilities.SaveCharacter(c);
                    CombatHolder.UpdateCharInventorySpellsSkillsEffectsAndStats(c);
                    return;

                case EffectHolder.EffectTag.Disorientation:
                    DecrementTaggedEffect(toAdd, true, toDecFrom);
                    Utilities.SaveCharacter(c);
                    CombatHolder.UpdateCharInventorySpellsSkillsEffectsAndStats(c);
                    return;

                case EffectHolder.EffectTag.NoTag:
                    break;
                }
            }
            if (isPermanent)
            {
                c.Effects.Add(toAdd);
                Utilities.SaveCharacter(c);
                CombatHolder.UpdateCharInventorySpellsSkillsEffectsAndStats(c);
            }
            else
            {
                c.TemporaryEffects.Add(toAdd);
            }
        }