/// <summary> /// This runs the simulation /// </summary> /// <returns>Always true. Metric is the wounds done before saves</returns> public bool Run(out int wounds) { wounds = 0; int remainingAttacks = Attacks; while (remainingAttacks > 0) { remainingAttacks--; int hitRoll = Dice.Roll(); if (hitRoll >= BladeHitOn) { int damRoll = Dice.Roll() + 1; if (damRoll >= BladeWoundOn) { wounds += BladeDamage; } if (damRoll >= 5) { remainingAttacks += 2; } } } remainingAttacks = 1; while (remainingAttacks > 0) { remainingAttacks--; int hitRoll = Dice.Roll(); if (hitRoll >= MawHitOn) { int damRoll = Dice.Roll() + 1; if (damRoll >= MawWoundOn) { wounds += Dice.Roll(); } if (damRoll >= 5) { remainingAttacks += 2; } } } return(false); }
static void Main() { ConsoleKey key; Console.WriteLine("Press ENTER to roll the dice..."); key = Console.ReadKey(true).Key; if (key == ConsoleKey.Enter) { Console.Clear(); Dice.Roll(); Main(); } }
/// <summary> /// This runs the simulation /// </summary> /// <returns>True if Irusk dies</returns> public bool Run(out int damage) { damage = 0; //damage damage += CataclysmStr - IruskBaseArmour + Dice.Roll(3); damage += CataclysmStr - IruskBaseArmour + Dice.Roll(3); //tough if (damage >= IruskHealth && Dice.Roll(1) < 4) { return(true); } return(false); }
/// <summary> /// This runs the simulation /// </summary> /// <returns>True if the caster dies</returns> public bool Run(out int damage) { damage = 0; //int currentFocus = Focus; Dice.RollD3() + Dice.Roll() + 2; int currentFocus = Dice.RollD3() + Dice.RollD3() + 2; while (currentFocus > 0) { currentFocus--; int hitRoll = MAT + Dice.Roll(2); if (IsBoostHit) { currentFocus--; hitRoll += Dice.Roll(1); } if (hitRoll >= TargetDef) { int damRoll = Dice.Roll(2) + Strength; if (IsBoostDam) { currentFocus--; damRoll += Dice.Roll(1); } if (IsWeaponMaster) { damRoll += Dice.Roll(1); } if (damRoll > TargetArm) { damage += damRoll - TargetArm; } } } if (damage >= TargetHealth) { return(true); } return(false); }
/// <summary> /// This runs the simulation /// </summary> /// <returns>True if Irusk dies</returns> public bool Run(out int metric) { metric = 0; bool crit; int hitRoll = Dice.Roll(5, 2, true, out crit); if (crit) { metric = 1; } if (hitRoll >= TargetDef) { return(true); } return(false); }
public bool Run(out int damage) { bool success = false; damage = 0; int seraphCurrentFury = SeraphFury; int shots = Dice.RollD3() + 1; for (int i = 0; i < shots; i++) { int hitRoll = Dice.Roll(2) + SeraphRAT; if (seraphCurrentFury > 0) { seraphCurrentFury--; hitRoll += Dice.Roll(); } if (hitRoll >= WitchDefence) { int damageRoll = Dice.Roll(2) + SeraphStrength; if (seraphCurrentFury > 0 && (AlwaysBoostDamage || i + seraphCurrentFury >= shots)) { seraphCurrentFury--; damageRoll += Dice.Roll(); } if (damageRoll > WitchArmour) damage += (damageRoll - WitchArmour); if (damage >= WitchHealth) success = true; } } return success; }
public bool Run(out int metric) { metric = 0; int butcherCurrentHealth = ButcherBaseHealth; int baldurCurrentFocus = BaldurBaseFocus; int butcherCurrentArm = ButcherBaseArmour + ButcherCampedFocus; int butcherCurrentDef = ButcherBaseDef; if (ButcherHasIF) { butcherCurrentDef += 3; } bool hasWeightOfStone = false; while (baldurCurrentFocus > 0) { //Buy the attack baldurCurrentFocus--; //check if we need to boost int hitRoll; if (butcherCurrentDef > BaldurMAT + 7 || !hasWeightOfStone && (butcherCurrentDef > BaldurMAT + 6)) { baldurCurrentFocus--; hitRoll = Dice.Roll(3); } else { hitRoll = Dice.Roll(2); } //Did it hit if (hitRoll + BaldurMAT >= butcherCurrentDef) { if (!hasWeightOfStone) { hasWeightOfStone = true; butcherCurrentDef -= 3; } int damageRoll; if (BoostDamage && baldurCurrentFocus > 0) { baldurCurrentFocus--; damageRoll = Dice.Roll(3); } else { damageRoll = Dice.Roll(2); } int damage = damageRoll + BaldurStrength - butcherCurrentArm; if (damage > 0) { metric += damage; butcherCurrentHealth -= damage; } } } return(butcherCurrentHealth <= 0); }
public int RollTwentySidedDice() { return(TwentySidedDice.Roll()); }
/// <summary> /// This runs the simulation /// </summary> /// <returns>True if the butcher dies</returns> public bool Run(out int damage) { bool success = false; damage = 0; int deathjackAttacks = DeathjackBaseAttacks; int deathjackHornAttacks = DeathjackBaseHornAttacks; int deathjackFocus = DeathjackBaseFocus; //Work out the butchers stats int butchersArmour = ButcherBaseArmour + 6 - ButcherFocusUsed; if (UseDeathShroud) { butchersArmour -= 2; } int butchersDefense = ButcherBaseDefense; if (UseIronFlesh) { butchersDefense += 3; butchersArmour -= 1; } if (UseWarDog) { butchersDefense += 2; } //Normal attacks while (deathjackAttacks > 0) { deathjackAttacks--; deathjackFocus--; //roll to hit int hitroll = DeathjackMat + Dice.Roll(3); if (hitroll >= butchersDefense) { deathjackFocus--; int damageroll = DeathjackBaseStrength + Dice.Roll(3); if (damageroll > butchersArmour) { damage += damageroll - butchersArmour; } } } //Horn attacks while (deathjackHornAttacks > 0) { deathjackHornAttacks--; deathjackFocus--; //roll to hit int hitroll = DeathjackMat + Dice.Roll(3); if (hitroll >= butchersDefense) { deathjackFocus--; int damageroll = DeathjackHornStrength + Dice.Roll(3); if (damageroll > butchersArmour) { damage += damageroll - butchersArmour; } } } //Bought attacks while (deathjackFocus > 0) { deathjackFocus--; //roll to hit int hitroll; if (deathjackFocus > 0) { hitroll = DeathjackMat + Dice.Roll(3); deathjackFocus--; } else { hitroll = DeathjackMat + Dice.Roll(2); } //roll wound if (hitroll >= butchersDefense) { int damageroll; if (deathjackFocus > 0) { damageroll = DeathjackBaseStrength + Dice.Roll(3); deathjackFocus--; } else { damageroll = DeathjackBaseStrength + Dice.Roll(2); } if (damageroll > butchersArmour) { damage += damageroll - butchersArmour; } } } return(damage >= ButcherHealth); }
/// <summary> /// This runs the simulation /// </summary> /// <returns>True if the butcher dies</returns> public bool Run(out int damage) { bool success = false; damage = 0; //Work out Caines stats int caineStrengthBonus = 0; if (UseSquire) { CaineFocus++; } if (UseRanger) { CaineRAT += 2; } if (HasConcealment) { if (TrueSightUpkept) { CaineFocus -= 1; } else { CaineFocus -= 2; } } //Work out the butchers stats int butchersArmour = ButcherBaseArmour + 6 - ButcherFocusUsed; int butchersDefense = ButcherBaseDefense; if (UseIronFlesh) { butchersDefense += 3; butchersArmour -= 1; } //Check if Caine has a shot while (CaineAttacks > 0 || CaineFocus > 0) { //record this shot if (CaineAttacks > 0) { CaineAttacks--; } else { CaineFocus--; } //roll the attack int attackRoll; if (BoostAttackRolls) { attackRoll = Dice.Roll(3); CaineFocus--; } else { attackRoll = Dice.Roll(2); } //see if the attack hits if (attackRoll + CaineRAT >= butchersDefense) { //roll the damage int damageRoll = Dice.Roll(2) + CaineBaseStrength + caineStrengthBonus; if (damageRoll > butchersArmour) { damage += damageRoll - butchersArmour; } //Strength goes up from feat caineStrengthBonus++; } //If the butcher is down, record kill if (damage >= ButcherHealth) { success = true; } } return(success); }
/// <summary> /// This runs the simulation /// </summary> /// <returns>True if Irusk dies</returns> public bool Run(out int damage) { damage = 0; int attackStr = 0; //caine damage += SlamStr - ButcherBaseArmour + Dice.Roll(2); int caineCurrentFocus = CaineBaseFocus; for (int i = 4; i >= 1; i--) { if (Dice.Roll(2) == 2) { continue; } if (caineCurrentFocus >= 1) { attackStr = CaineShotStr + Dice.Roll(3); caineCurrentFocus--; } else { attackStr = CaineShotStr + Dice.Roll(2); } if (attackStr > ButcherBaseArmour) { damage += attackStr - ButcherBaseArmour; } } //outriders for (int i = 3; i >= 1; i--) { if (Dice.Roll(2) == 2) { continue; } attackStr = OutriderStr + Dice.Roll(3); if (attackStr > ButcherBaseArmour) { damage += attackStr - ButcherBaseArmour; } } //nyss if (Dice.Roll(2) > 2) { attackStr = NyssCraStr + Dice.Roll(2); if (attackStr > ButcherBaseArmour) { damage += attackStr - ButcherBaseArmour; } } //result if (damage >= ButcherHealth) { return(true); } return(false); }