public static Monster TrollInitialize(Monster a_monster) { if (a_monster.Lvl >= 6 && a_monster.Lvl <= 10) // Trolls in this are typically levels 6-10 { } else { RollingDie fourD = new RollingDie(4); a_monster.Lvl = 5 + fourD.Roll(); } a_monster.AC = 8; a_monster.HitDie = "d10 +2"; string timesroll = a_monster.Lvl.ToString(); string dieroll = timesroll + a_monster.HitDie; (int i1, int i2, int i3) = RollingDie.Diecheck(dieroll); if (i1 != 0) { RollingDie thisRoll = new RollingDie(i1, i2, i3); a_monster.MaxHp = thisRoll.Roll(); } a_monster.Hp = a_monster.MaxHp; a_monster.InitMod = 12; a_monster.NoOfAtt = 3; a_monster.DamPerAtt1 = "1d4 +3"; a_monster.DamPerAtt2 = "1d4 +3"; a_monster.DamPerAtt3 = "1d12 +4"; a_monster.DefeatMult = 1.6; //has multi-attacks plus Regeneration ability // need to put in code to clear other abilities here // & auto-add Regeneration Ability return(a_monster); }
private void PlayRollDiceBtn_Click(object sender, RoutedEventArgs e) { String diecheck = RollDiePlay.Text; (int i1, int i2, int i3) = RollingDie.Diecheck(diecheck); if (i1 != 0) { RollingDie thisRoll = new RollingDie(i1, i2, i3); // MessageBox.Show($"{thisRoll.Roll() } {RollDiePlay.Text }"); // we will make this talk out to a rolling chat box in a sec txtPlayerDialog.AppendText($" {thisRoll.Roll() } {RollDiePlay.Text } \n"); } }
public static Character RerollCharacter(Character chartoreroll) { RollingDie three6d = new RollingDie(6, 3); // this is the same as rolling a six sided dice three times and totalling chartoreroll.Str = three6d.Roll(); chartoreroll.Inte = three6d.Roll(); chartoreroll.Emp = three6d.Roll(); chartoreroll.Dex = three6d.Roll(); chartoreroll.Con = three6d.Roll(); chartoreroll.Chr = three6d.Roll(); return(chartoreroll); }
public virtual int MeleeAttack(Character Defender) { Defender.AC = 0; //this should be currently overridden for both monsters and characters Character recalcACObject = new Character(); Defender.AC = recalcACObject.ACRecalc(Defender); RollingDie twentyside = new RollingDie(20, 1); int tohit; int attRoll = twentyside.Roll(); if (Defender.AC < hitOn20) { tohit = 20 - (hitOn20 - Defender.AC); } else if (Defender.AC >= (hitOn20 + 5)) { tohit = 20 + ((Defender.AC - hitOn20) - 5); } else { tohit = 20; } // string damagerange = ""; // if (damagerange is null) int damage = 8; if (attRoll >= tohit) { Defender.Hp -= damage; // same as Defender.Hp = Defender.Hp - damage; if (Defender.Hp <= 0) // will change this to proper level for unconsciouness { // WriteLine($"{Defender.Name} has died."); Defender.IsAlive = false; } return(Defender.Hp); } else {// WriteLine($"{name} missed!"); return(Defender.Hp); } }
public virtual int MeleeAttack(Fant_Entity Defender) //this should be currently overridden for both monsters and charac { RollingDie twentyside = new RollingDie(20, 1); int tohit; int attRoll = twentyside.Roll(); if (Defender.AC < hitOn20) { tohit = 20 - (hitOn20 - Defender.AC); } else if (Defender.AC >= (hitOn20 + 5)) { tohit = 20 + ((Defender.AC - hitOn20) - 5); } else { tohit = 20; } if (attRoll >= tohit) { int damage = 8; //placeholder for damage Defender.Hp -= damage; } // same as Defender.Hp = Defender.Hp - damage; if (Defender.Hp <= 0) // will change this to proper level for unconsciouness { // WriteLine($"{Defender.Name} has died."); Defender.IsAlive = false; return(Defender.Hp); } else {// WriteLine($"{name} missed!"); return(Defender.Hp); } }
public static Character FighterInitialize(Character a_character) { if (a_character.Exp <= 375) //2000 the commented Xps are straight from AD&D atm but will change as time goes on, will also have a better { a_character.Lvl = 1; } // check when going between levels by gaining experience else if (a_character.Exp <= 1405) // 4000 might be funner to have this check a sql table so that players can easily edit it { a_character.Lvl = 2; } // atm just redone curve for fighter off an exponential kills needed at same level curve else if (a_character.Exp <= 3820) // 8000) for fighter and adjusted other calsses off that { a_character.Lvl = 3; } else if (a_character.Exp <= 8890) // 18000) { a_character.Lvl = 4; } else if (a_character.Exp <= 17945) //35000) { a_character.Lvl = 5; } else if (a_character.Exp <= 34460) //70000) { a_character.Lvl = 6; } else if (a_character.Exp <= 64070) //125000) { a_character.Lvl = 7; } else if (a_character.Exp <= 117800) // 250000) { a_character.Lvl = 8; } else if (a_character.Exp <= 211350) //500000) { a_character.Lvl = 9; } else if (a_character.Exp <= 367175) // 750000) { a_character.Lvl = 10; } else { a_character.Lvl = 11; } // gives initial level based on Experience points int HpConAdj = 0; if (a_character.Con <= 3) //Constitution Initial Hp bonuses different only for fighters I think { HpConAdj = -2; } else if (a_character.Con <= 6) { HpConAdj = -1; } else if (a_character.Con == 15) { HpConAdj = 1; } else if (a_character.Con == 16) { HpConAdj = 2; } else if (a_character.Con == 17) { HpConAdj = 3; } else if (a_character.Con == 18) { HpConAdj = 4; } if (a_character.Lvl <= 9) { RollingDie lvl10d = new RollingDie(10, a_character.Lvl); int BaseHp = lvl10d.Roll(); // just cause I wanna watch it clearly a_character.MaxHp = BaseHp + (a_character.Lvl * HpConAdj); // now adjusted for levels above 9 a_character.Hp = a_character.MaxHp; } else { RollingDie lvl10d = new RollingDie(10, a_character.Lvl); int BaseHp = lvl10d.Roll(); // just cause I wanna watch it clearly a_character.MaxHp = BaseHp + (a_character.Lvl * HpConAdj) + (3 * (a_character.Lvl - 9)); // now adjusted for levels above 9 a_character.Hp = a_character.MaxHp; } FighterRecalcHitOn20(a_character); return(a_character); }
public static Character RogueInitialize(Character a_character) { if (a_character.Exp <= 235) // 1250) this are straight from AD&D atm but will change as time goes on, will also have a better { a_character.Lvl = 1; } // check when going between levels by gaining experience else if (a_character.Exp <= 880) //2500) { a_character.Lvl = 2; } else if (a_character.Exp <= 2387) //5000) { a_character.Lvl = 3; } else if (a_character.Exp <= 4940) //10000) { a_character.Lvl = 4; } else if (a_character.Exp <= 10255) // 20000) { a_character.Lvl = 5; } else if (a_character.Exp <= 20922) // 42500) { a_character.Lvl = 6; } else if (a_character.Exp <= 35880) // 70000) { a_character.Lvl = 7; } else if (a_character.Exp <= 51832) // 110000) { a_character.Lvl = 8; } else if (a_character.Exp <= 75000) // 160000) { a_character.Lvl = 9; } else if (a_character.Exp <= 100500) //220000) { a_character.Lvl = 10; } else if (a_character.Exp <= 250000) //440000) { a_character.Lvl = 11; } else { a_character.Lvl = 12; } // gives initial level based on Experience points int HpConAdj = 0; if (a_character.Con <= 3) //Constitution Initial Hp bonuses different only for fighters I think { HpConAdj = -2; } else if (a_character.Con <= 6) { HpConAdj = -1; } else if (a_character.Con == 15) { HpConAdj = 1; } else if (a_character.Con >= 16) { HpConAdj = 2; } if (a_character.Lvl < 11) // as above level 11 just add hp I think { RollingDie lvl6d = new RollingDie(6, a_character.Lvl); int BaseHp = lvl6d.Roll(); // just cause I wanna watch it clearly a_character.MaxHp = BaseHp + (a_character.Lvl * HpConAdj); a_character.Hp = a_character.MaxHp; } else { RollingDie lvl6d = new RollingDie(6, a_character.Lvl); int BaseHp = lvl6d.Roll(); // just cause I wanna watch it clearly a_character.MaxHp = BaseHp + (a_character.Lvl * HpConAdj) + (2 * (a_character.Lvl - 11)); a_character.Hp = a_character.MaxHp; } RogueRecalcHitOn20(a_character); return(a_character); }
public static Character ClericInitialize(Character a_character) { if (a_character.Exp <= 280) //1500) this are straight from AD&D atm but will change as time goes on, will also have a better { a_character.Lvl = 1; } // check when going between levels by gaining experience else if (a_character.Exp <= 1055) //3000) { a_character.Lvl = 2; } else if (a_character.Exp <= 2865) // 6000) { a_character.Lvl = 3; } else if (a_character.Exp <= 6420) // 13000) { a_character.Lvl = 4; } else if (a_character.Exp <= 14100) // 27500) { a_character.Lvl = 5; } else if (a_character.Exp <= 28000) // 55000) { a_character.Lvl = 6; } else if (a_character.Exp <= 56380) //110000) { a_character.Lvl = 7; } else if (a_character.Exp <= 106020) //225000) { a_character.Lvl = 8; } else if (a_character.Exp <= 190215) // 450000) { a_character.Lvl = 9; } else if (a_character.Exp <= 330460) // 675000) { a_character.Lvl = 10; } else { a_character.Lvl = 11; } // gives initial level based on Experience points int HpConAdj = 0; if (a_character.Con <= 3) //Constitution Initial Hp bonuses different only for fighters I think { HpConAdj = -2; } else if (a_character.Con <= 6) { HpConAdj = -1; } else if (a_character.Con == 15) { HpConAdj = 1; } else if (a_character.Con >= 16) { HpConAdj = 2; } if (a_character.Lvl <= 9) { RollingDie lvl8d = new RollingDie(8, a_character.Lvl); // this is the same as rolling a eight sided dice times the level and totalling a_character.MaxHp = lvl8d.Roll() + (a_character.Lvl * HpConAdj); // *RollDie d8 + con adjustments } a_character.Hp = a_character.MaxHp; } else { RollingDie lvl8d = new RollingDie(8, a_character.Lvl); // this is the same as rolling a eight sided dice times the level and totalling a_character.MaxHp = lvl8d.Roll() + (a_character.Lvl * HpConAdj) + (2 * (a_character.Lvl - 9)); // *RollDie d8 + con adjustments } a_character.Hp = a_character.MaxHp; } ClericRecalcHiton20(a_character); return(a_character); }
public int characterAttackCalc(Fant_Entity Defender) { RollingDie twentyside = new RollingDie(20, 1); int tohit; int attRoll = twentyside.Roll(); if (Defender.AC < hitOn20) { tohit = 20 - (hitOn20 - Defender.AC); } else if (Defender.AC >= (hitOn20 + 5)) { tohit = 20 + ((Defender.AC - hitOn20) - 5); } else { tohit = 20; } if (attRoll >= tohit) { int damage = 0; string damagerange = ""; foreach (PhysObj CheckObject in this.Inventory) { if (CheckObject.IsEquipped == true && CheckObject.ObjType is "Weapon") // this was just a rough first concept check { damagerange = CheckObject.Damage; // need to allow for two handed etc etc etc (int i1, int i2, int i3) = RollingDie.Diecheck(damagerange); RollingDie thisRoll = new RollingDie(i1, i2, i3); damage = thisRoll.Roll(); } } int DamStrAdj = 0; // + str adj to damage if (this.Str <= 5) { DamStrAdj = -1; } else if (this.Str == 16 || this.Str == 17) { DamStrAdj = 1; } else if (this.Str >= 18) { DamStrAdj = 2; } damage = (damage + DamStrAdj); if (damage < 1) { damage = 1; } Defender.Hp -= damage; // same as Defender.Hp = Defender.Hp - damage; if (Defender.Hp <= 0) // will change this to proper level for unconsciouness { // WriteLine($"{Defender.Name} has died."); Defender.IsAlive = false; } return(Defender.Hp); } else {// WriteLine($"{name} missed!"); return(Defender.Hp); } }
public int monsterAttackCalc(Fant_Entity Defender) { int cumDamage = 0; RollingDie twentyside = new RollingDie(20, 1); int tohit; if (Defender.AC < hitOn20) { tohit = 20 - (hitOn20 - Defender.AC); } else if (Defender.AC >= (hitOn20 + 5)) { tohit = 20 + ((Defender.AC - hitOn20) - 5); } else { tohit = 20; } int attRoll = twentyside.Roll(); if (attRoll >= tohit) { string dieroll = this.damPerAtt1; (int i1, int i2, int i3) = RollingDie.Diecheck(dieroll); if (i1 != 0) { RollingDie thisRoll = new RollingDie(i1, i2, i3); int damage = thisRoll.Roll(); cumDamage += damage; } } if (this.NoOfAtt >= 2) { int attRoll2 = twentyside.Roll(); if (attRoll2 >= tohit) { string dieroll2 = this.damPerAtt2; (int i1, int i2, int i3) = RollingDie.Diecheck(dieroll2); if (i1 != 0) { RollingDie thisRoll = new RollingDie(i1, i2, i3); int damage2 = thisRoll.Roll(); cumDamage += damage2; } } } if (this.NoOfAtt >= 3) { int attRoll3 = twentyside.Roll(); if (attRoll3 >= tohit) { string dieroll3 = this.damPerAtt3; (int i1, int i2, int i3) = RollingDie.Diecheck(dieroll3); if (i1 != 0) { RollingDie thisRoll = new RollingDie(i1, i2, i3); int damage3 = thisRoll.Roll(); cumDamage += damage3; } } } Defender.Hp -= cumDamage; // same as Defender.Hp = Defender.Hp - damage; return(Defender.Hp); }
public static Character MageInitialize(Character a_character) { if (a_character.Exp <= 470) // 2500) // this are straight from AD&D atm but will change as time goes on, will also have a better { a_character.Lvl = 1; } // check when going between levels by gaining experience else if (a_character.Exp <= 1756) //5000) { a_character.Lvl = 2; } else if (a_character.Exp <= 4775) // 10000) { a_character.Lvl = 3; } else if (a_character.Exp <= 11110) // 22500) { a_character.Lvl = 4; } else if (a_character.Exp <= 20508) //40000) { a_character.Lvl = 5; } else if (a_character.Exp <= 29537) // 60000) { a_character.Lvl = 6; } else if (a_character.Exp <= 46130) // 90000) { a_character.Lvl = 7; } else if (a_character.Exp <= 63612) // 135000) { a_character.Lvl = 8; } else if (a_character.Exp <= 105675) // 250000) { a_character.Lvl = 9; } else if (a_character.Exp <= 183590) // 375000) { a_character.Lvl = 10; } else if (a_character.Exp <= 270000) //750000) { a_character.Lvl = 11; } else { a_character.Lvl = 12; } // gives initial level based on Experience points int HpConAdj = 0; if (a_character.Con <= 3) //Constitution Initial Hp bonuses different only for fighters I think { HpConAdj = -2; } else if (a_character.Con <= 6) { HpConAdj = -1; } else if (a_character.Con == 15) { HpConAdj = 1; } else if (a_character.Con >= 16) { HpConAdj = 2; } if (a_character.Lvl <= 11) // as above level 11 just add hp I think { RollingDie lvl4d = new RollingDie(4, a_character.Lvl); int BaseHp = lvl4d.Roll(); // just cause I wanna watch it clearly a_character.MaxHp = BaseHp + (a_character.Lvl * HpConAdj); a_character.Hp = a_character.MaxHp; } else { RollingDie lvl4d = new RollingDie(4, a_character.Lvl); int BaseHp = lvl4d.Roll(); // just cause I wanna watch it clearly a_character.MaxHp = BaseHp + (a_character.Lvl * HpConAdj) + (a_character.Lvl - 11); a_character.Hp = a_character.MaxHp; } MageRecalcHitOn20(a_character); return(a_character); }