mirror of
https://github.com/RussellChamp/armsman.git
synced 2026-10-27 22:42:30 +00:00
Finished Rapid Shot and Manyshot
This commit is contained in:
1 parent
37c946f299
commit
e8d58b8326
2 files changed
+103
-18
No files matched your search
+56
-9
@@ -117,6 +117,8 @@ float MainWindow::get_damage(bool crit = false)
|
|||||||
damage += 7; //2d6
|
damage += 7; //2d6
|
||||||
if(ui->weapon_wounding->checkState())
|
if(ui->weapon_wounding->checkState())
|
||||||
damage += 1; //1 point bleed
|
damage += 1; //1 point bleed
|
||||||
|
if(ui->feat_sneakattack->isChecked())
|
||||||
|
damage += ui->feat_sneak_attack_bonus->value() * 3.5; //sneak bonus d6
|
||||||
damage += ui->misc_bonus_damage_noncrit->value();
|
damage += ui->misc_bonus_damage_noncrit->value();
|
||||||
|
|
||||||
return damage;
|
return damage;
|
||||||
@@ -203,8 +205,12 @@ void MainWindow::calculate_stuff()
|
|||||||
weapon_damage.append(" + 2d6 (Anarchic/Axiomatic)");
|
weapon_damage.append(" + 2d6 (Anarchic/Axiomatic)");
|
||||||
if(ui->weapon_vicious->checkState())
|
if(ui->weapon_vicious->checkState())
|
||||||
weapon_damage.append(" + 2d6 (Vicious)");
|
weapon_damage.append(" + 2d6 (Vicious)");
|
||||||
|
if(ui->feat_sneakattack->isChecked())
|
||||||
|
weapon_damage.append(" + " + QString::number(ui->feat_sneak_attack_bonus->value()) + "d6 (Sneak Attack)");
|
||||||
if(ui->weapon_wounding->checkState())
|
if(ui->weapon_wounding->checkState())
|
||||||
weapon_damage.append(" +1 bleed (Wounding)");
|
weapon_damage.append(" +1 bleed (Wounding, stacks)");
|
||||||
|
if(ui->feat_bleedingattack->isChecked())
|
||||||
|
weapon_damage.append(" + " + QString::number(ui->feat_sneak_attack_bonus->value()) + " bleed (Bleeding Attack)");
|
||||||
|
|
||||||
weapon_damage.append(")");
|
weapon_damage.append(")");
|
||||||
|
|
||||||
@@ -234,6 +240,12 @@ void MainWindow::calculate_stuff()
|
|||||||
if(ui->feat_criticalfocus->checkState())
|
if(ui->feat_criticalfocus->checkState())
|
||||||
crit_confirm_bonus += 4;
|
crit_confirm_bonus += 4;
|
||||||
|
|
||||||
|
if(ui->buff_haste->isChecked())
|
||||||
|
hit_bonus += 1;
|
||||||
|
|
||||||
|
if(attack_type == "Rapid Shot")
|
||||||
|
hit_bonus -= 2;
|
||||||
|
|
||||||
int guidance_bonus = 0;
|
int guidance_bonus = 0;
|
||||||
if(ui->buff_guidance->isChecked()) //only works on first attack
|
if(ui->buff_guidance->isChecked()) //only works on first attack
|
||||||
guidance_bonus = 1;
|
guidance_bonus = 1;
|
||||||
@@ -247,10 +259,18 @@ void MainWindow::calculate_stuff()
|
|||||||
attacks_num++;
|
attacks_num++;
|
||||||
|
|
||||||
if((attack_type == "Full Attack" || attack_type == "Power Attack" || attack_type == "Vital Strike" || attack_type == "Improved Vital Strike"
|
if((attack_type == "Full Attack" || attack_type == "Power Attack" || attack_type == "Vital Strike" || attack_type == "Improved Vital Strike"
|
||||||
|| attack_type == "Greater Vital Strike") && ui->attack_2_bonus->value() > 0)
|
|| attack_type == "Greater Vital Strike" || attack_type == "Rapid Shot" || attack_type == "Manyshot") && ui->attack_2_bonus->value() > 0)
|
||||||
{
|
|
||||||
if(attack_type == "Full Attack" && (ui->weapon_speed->isChecked() || ui->buff_haste->isChecked()))
|
|
||||||
{
|
{
|
||||||
|
if((attack_type == "Full Attack" || attack_type == "Manyshot") && (ui->weapon_speed->isChecked() || ui->buff_haste->isChecked()))
|
||||||
|
{ //perform an extra attack during "Full Attack" or "Manyshot" when you either have a weapon with speed or are haste'd
|
||||||
|
attacks.append("/+" + QString::number(ui->attack_1_bonus->value() + hit_bonus));
|
||||||
|
hit_chance.append("/" + QString::number(get_hitchance(ui->attack_1_bonus->value() + hit_bonus, enemy_ac)) + "%");
|
||||||
|
crit_chance.append("/" + QString::number(get_critchance(ui->attack_1_bonus->value() + hit_bonus, crit_confirm_bonus, crit_min_bound, enemy_ac)) + "%");
|
||||||
|
crit_chance_all.append("/" + QString::number(get_critchance(ui->attack_1_bonus->value() + hit_bonus, crit_confirm_bonus, crit_min_bound, enemy_ac, true)) + "%");
|
||||||
|
attacks_num++;
|
||||||
|
}
|
||||||
|
if(attack_type == "Rapid Shot")
|
||||||
|
{ //perform an extra attack when using "Manyshot"
|
||||||
attacks.append("/+" + QString::number(ui->attack_1_bonus->value() + hit_bonus));
|
attacks.append("/+" + QString::number(ui->attack_1_bonus->value() + hit_bonus));
|
||||||
hit_chance.append("/" + QString::number(get_hitchance(ui->attack_1_bonus->value() + hit_bonus, enemy_ac)) + "%");
|
hit_chance.append("/" + QString::number(get_hitchance(ui->attack_1_bonus->value() + hit_bonus, enemy_ac)) + "%");
|
||||||
crit_chance.append("/" + QString::number(get_critchance(ui->attack_1_bonus->value() + hit_bonus, crit_confirm_bonus, crit_min_bound, enemy_ac)) + "%");
|
crit_chance.append("/" + QString::number(get_critchance(ui->attack_1_bonus->value() + hit_bonus, crit_confirm_bonus, crit_min_bound, enemy_ac)) + "%");
|
||||||
@@ -293,6 +313,10 @@ void MainWindow::calculate_stuff()
|
|||||||
|
|
||||||
float damage_noncrit = get_damage();
|
float damage_noncrit = get_damage();
|
||||||
float damage_crit = get_damage(true);
|
float damage_crit = get_damage(true);
|
||||||
|
float manyshot_bonus = 0;
|
||||||
|
float damage_expected = 0;
|
||||||
|
float damage_total = 0;
|
||||||
|
|
||||||
if(attack_type == "Vital Strike")
|
if(attack_type == "Vital Strike")
|
||||||
{
|
{
|
||||||
//roll the damage dice again for the vital strike
|
//roll the damage dice again for the vital strike
|
||||||
@@ -322,19 +346,42 @@ void MainWindow::calculate_stuff()
|
|||||||
damage_noncrit *= 2;
|
damage_noncrit *= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(attack_type == "Manyshot")
|
||||||
|
{
|
||||||
|
if(ui->stat_dex_mod->value() < 3)
|
||||||
|
ui->warnings->setText("Warning: Manyshot requires a dex of at least 17");
|
||||||
|
manyshot_bonus = damage_noncrit;
|
||||||
|
if(ui->feat_sneakattack->isChecked())
|
||||||
|
manyshot_bonus -= 3.5 * ui->feat_sneak_attack_bonus->value(); //sneak is only counted once
|
||||||
|
results.append("Average damage (non-crit): " + QString::number(damage_noncrit + manyshot_bonus, 'g', 4) + " (first shot) / " + QString::number(damage_noncrit, 'g', 4) + " (other shots)" +
|
||||||
|
"\nAverage damage (crit): " + QString::number(damage_crit + manyshot_bonus, 'g', 4) + " (first shot) / " + QString::number(damage_crit, 'g', 4) + " (other shots)" +
|
||||||
|
"\n");
|
||||||
|
damage_expected = (damage_noncrit + manyshot_bonus + (damage_crit - damage_noncrit) * get_critchance(ui->attack_1_bonus->value() + hit_bonus + guidance_bonus, crit_confirm_bonus, crit_min_bound, enemy_ac)/100.0) * get_hitchance(ui->attack_1_bonus->value() + hit_bonus + guidance_bonus, enemy_ac)/100.0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
results.append("Average damage (non-crit): " + QString::number(damage_noncrit, 'g', 4) +
|
results.append("Average damage (non-crit): " + QString::number(damage_noncrit, 'g', 4) +
|
||||||
"\nAverage damage (crit): " + QString::number(damage_crit, 'g', 4) +
|
"\nAverage damage (crit): " + QString::number(damage_crit, 'g', 4) +
|
||||||
"\n");
|
"\n");
|
||||||
//Expected damage per turn = (average non-crit damage + bonus crit damage * chance to crit)* chance to hit
|
//Expected damage per turn = (average non-crit damage + bonus crit damage * chance to crit)* chance to hit
|
||||||
// = (non-crit + (crit - non-crit) * crit chance) * hit chance
|
// = (non-crit + (crit - non-crit) * crit chance) * hit chance
|
||||||
float damage_expected = (damage_noncrit + (damage_crit - damage_noncrit) * get_critchance(ui->attack_1_bonus->value() + hit_bonus + guidance_bonus, crit_confirm_bonus, crit_min_bound, enemy_ac)/100.0) * get_hitchance(ui->attack_1_bonus->value() + hit_bonus + guidance_bonus, enemy_ac)/100.0;
|
damage_expected = (damage_noncrit + (damage_crit - damage_noncrit) * get_critchance(ui->attack_1_bonus->value() + hit_bonus + guidance_bonus, crit_confirm_bonus, crit_min_bound, enemy_ac)/100.0) * get_hitchance(ui->attack_1_bonus->value() + hit_bonus + guidance_bonus, enemy_ac)/100.0;
|
||||||
float damage_total = damage_expected;
|
}
|
||||||
|
damage_total = damage_expected;
|
||||||
results.append("Expected damage: " + QString::number(damage_expected, 'g', 4));
|
results.append("Expected damage: " + QString::number(damage_expected, 'g', 4));
|
||||||
|
|
||||||
|
|
||||||
if(attack_type == "Full Attack" || attack_type == "Power Attack" || attack_type == "Vital Strike" || attack_type == "Improved Vital Strike"
|
if(attack_type == "Full Attack" || attack_type == "Power Attack" || attack_type == "Vital Strike" || attack_type == "Improved Vital Strike"
|
||||||
|| attack_type == "Greater Vital Strike")
|
|| attack_type == "Greater Vital Strike" || attack_type == "Rapid Shot" || attack_type == "Manyshot")
|
||||||
{
|
{
|
||||||
if(attack_type == "Full Attack" && (ui->weapon_speed->isChecked() || ui->buff_haste->isChecked()))
|
if((attack_type == "Full Attack" || attack_type == "Rapid Shot") && (ui->weapon_speed->isChecked() || ui->buff_haste->isChecked()))
|
||||||
|
{
|
||||||
|
damage_expected = (damage_noncrit + (damage_crit - damage_noncrit) * get_critchance(ui->attack_1_bonus->value() + hit_bonus, crit_confirm_bonus, crit_min_bound, enemy_ac)/100.0) * get_hitchance(ui->attack_1_bonus->value() + hit_bonus, enemy_ac)/100.0;
|
||||||
|
results.append("/" + QString::number(damage_expected, 'g', 4));
|
||||||
|
damage_total += damage_expected;
|
||||||
|
}
|
||||||
|
if(attack_type == "Rapid Shot")
|
||||||
{
|
{
|
||||||
damage_expected = (damage_noncrit + (damage_crit - damage_noncrit) * get_critchance(ui->attack_1_bonus->value() + hit_bonus, crit_confirm_bonus, crit_min_bound, enemy_ac)/100.0) * get_hitchance(ui->attack_1_bonus->value() + hit_bonus, enemy_ac)/100.0;
|
damage_expected = (damage_noncrit + (damage_crit - damage_noncrit) * get_critchance(ui->attack_1_bonus->value() + hit_bonus, crit_confirm_bonus, crit_min_bound, enemy_ac)/100.0) * get_hitchance(ui->attack_1_bonus->value() + hit_bonus, enemy_ac)/100.0;
|
||||||
results.append("/" + QString::number(damage_expected, 'g', 4));
|
results.append("/" + QString::number(damage_expected, 'g', 4));
|
||||||
@@ -519,7 +566,7 @@ void MainWindow::on_weapon_ranged_clicked(bool checked)
|
|||||||
ui->weapon_wounding->setChecked(false); ui->weapon_wounding->setEnabled(false);
|
ui->weapon_wounding->setChecked(false); ui->weapon_wounding->setEnabled(false);
|
||||||
|
|
||||||
ui->attack_type->clear();
|
ui->attack_type->clear();
|
||||||
ui->attack_type->insertItems(0, QStringList() << "Basic Attack" << "Full Attack" << "Rapid Shot" << "Many Shot");
|
ui->attack_type->insertItems(0, QStringList() << "Basic Attack" << "Full Attack" << "Rapid Shot" << "Manyshot");
|
||||||
ui->attack_type->setCurrentIndex(1);
|
ui->attack_type->setCurrentIndex(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+47
-9
@@ -623,8 +623,8 @@ Shocking Burst</string>
|
|||||||
<rect>
|
<rect>
|
||||||
<x>20</x>
|
<x>20</x>
|
||||||
<y>30</y>
|
<y>30</y>
|
||||||
<width>713</width>
|
<width>762</width>
|
||||||
<height>131</height>
|
<height>151</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
@@ -645,13 +645,6 @@ Shocking Burst</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="QCheckBox" name="feat_greaterweaponfocus">
|
|
||||||
<property name="text">
|
|
||||||
<string>Greater Weapon Focus</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="3">
|
<item row="0" column="3">
|
||||||
<widget class="QCheckBox" name="feat_weaponspecialization">
|
<widget class="QCheckBox" name="feat_weaponspecialization">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -669,6 +662,13 @@ Shocking Burst</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QCheckBox" name="feat_greaterweaponfocus">
|
||||||
|
<property name="text">
|
||||||
|
<string>Greater Weapon Focus</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
<item>
|
<item>
|
||||||
@@ -751,6 +751,44 @@ Shocking Burst</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="feat_sneakattack">
|
||||||
|
<property name="text">
|
||||||
|
<string>Sneak Attack (+</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="feat_sneak_attack_bonus">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_25">
|
||||||
|
<property name="text">
|
||||||
|
<string>d6)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QCheckBox" name="feat_bleedingattack">
|
||||||
|
<property name="text">
|
||||||
|
<string>Bleeding Attack</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
Reference in new issue
Block a user