void DisplayTrapProperties(Traps Trap)
 {
     CalculateTrapStats(Trap);
     TrapStatsBox.Text = Trap.Name + "\n\nDMG: " + Trap.DiceNum + "D" + Trap.DiceSize + "+" + Trap.Modifier + "\nSave Type: " + Trap.SaveType +
                         "\nSave Target: " + Trap.SaveTarget + "\n\nAverage Damage: " + Trap.AvgDamage + "\nMinimum Damage: " + Trap.MinDamage + "\nMaximum Damage: " +
                         Trap.MaxDamage + "\n\nXP Value: " + Trap.XPValue;
 }
Exemplo n.º 2
0
        static void LoadTraps(XmlNode Node)
        {
            int ChildCount = Convert.ToInt32(Node.Attributes[0].Value);
            int Count      = 0;

            Traps[] TrapTemp = new Traps[ChildCount];
            foreach (XmlNode Child in Node.ChildNodes)
            {
                TrapTemp[Count]             = new Traps();
                TrapTemp[Count].Name        = Child.Attributes[0].Value;
                TrapTemp[Count].DiceNum     = Convert.ToInt32(Child.Attributes[1].Value);
                TrapTemp[Count].DiceSize    = Convert.ToInt32(Child.Attributes[2].Value);
                TrapTemp[Count].Modifier    = Convert.ToInt32(Child.Attributes[3].Value);
                TrapTemp[Count].SaveType    = Child.Attributes[4].Value;
                TrapTemp[Count].SaveTarget  = Convert.ToInt32(Child.Attributes[5].Value);
                TrapTemp[Count].SaveSuccess = Child.Attributes[6].Value;
                TrapTemp[Count].SaveFail    = Child.Attributes[7].Value;
                TrapTemp[Count].XPValue     = Convert.ToInt32(Child.Attributes[8].Value);
                Count += 1;
            }
            foreach (Traps Trap in TrapTemp)
            {
                Traps.Add(Trap);
            }
        }
 void SetTrapControls(Traps Trap)
 {
     SaveTypeCBox.Text   = Trap.SaveType;
     SaveTargetNUD.Value = Trap.SaveTarget;
     DiceNumberNUD.Value = Trap.DiceNum;
     DiceSizeNUD.Value   = Trap.DiceSize;
     ModifierNUD.Value   = Trap.Modifier;
 }
        void CalculateTrapStats(Traps Trap)
        {
            float Temp = ((((float)Trap.DiceSize + (float)1) / (float)2) * (float)Trap.DiceNum) + (float)Trap.Modifier;

            Trap.AvgDamage = Convert.ToInt32(Temp);
            Trap.MinDamage = Trap.DiceNum + Trap.Modifier;
            Trap.MaxDamage = (Trap.DiceNum * Trap.DiceSize) + Trap.Modifier;
            Temp           = ((float)Trap.MinDamage + (float)Trap.AvgDamage + (float)Trap.MaxDamage + (float)Trap.SaveTarget) / 4;
            Trap.XPValue   = Convert.ToInt32(Temp);
        }
Exemplo n.º 5
0
 public void NewTrap(Traps TrapObj)
 {
     Trap.Name        = TrapObj.Name;
     Trap.DiceNum     = TrapObj.DiceNum;
     Trap.DiceSize    = TrapObj.DiceSize;
     Trap.Modifier    = TrapObj.Modifier;
     Trap.SaveType    = TrapObj.SaveType;
     Trap.SaveTarget  = TrapObj.SaveTarget;
     Trap.SaveSuccess = TrapObj.SaveSuccess;
     Trap.SaveFail    = TrapObj.SaveFail;
 }
 void DisplaySuccessFailText(Traps Trap)
 {
     SaveSuccesTBox.Text = Trap.SaveSuccess;
     SaveFailTBox.Text   = Trap.SaveFail;
 }