mw:Hausregeln/Waffenreichweitenrechner
< mw:Hausregeln
Version vom 27. Mai 2022, 11:40 Uhr von Schevv (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „<div class="replaceme"><nowiki> <script type="text/javascript"> function calculateNewRangeNormal(a0, a2, a4, a8) { var b0 = a0 * 0.66; var b1 = b0 + (a2 -…“)
<script type="text/javascript">
function calculateNewRangeNormal(a0, a2, a4, a8)
{
var b0 = a0 * 0.66;
var b1 = b0 + (a2 - a0) * 0.25;
var b2 = b0 + (a2 - a0) * 0.75;
var b3 = a2 + (a4 - a2) * 0.2;
var b4 = a2 + (a4 - a2) * 0.6;
var b5 = a4;
var b6 = a4 + 0.2 * (a8 - a4);
var b7 = a4 + 0.4 * (a8 - a4);
var b8 = a4 + 0.6 * (a8 - a4);
var b9 = a4 + 0.8 * (a8 - a4);
var b10 = a8;
document.getElementById("newRange").innerHTML = Math.round(b0) + " / " + Math.round(b1) + " / " + Math.round(b2) + " / " + Math.round(b3) + " / " + Math.round(b4) + " / " + Math.round(b5) + " / " + Math.round(b6) + " / " + Math.round(b7) + " / " + Math.round(b8) + " / " + Math.round(b9) + " / " + Math.round(b10);
}
function calculateNewRangeHard(a0, a3, a6, a11)
{
var b0 = a0 * 0.5;
var b1 = a0;
var b2 = a0 + (a3 - a0) * 0.3333;
var b3 = a0 + (a3 - a0) * 0.6666;
var b4 = a3;
var b5 = a3 + (a6 - a3) * 0.3333;
var b6 = a3 + (a6 - a3) * 0.6666;
var b7 = a6;
var b8 = a6 + (a11 - a6) * 0.2;
var b9 = a6 + (a11 - a6) * 0.4;
var b10 = a6 + (a11 - a6) * 0.6;
var b11 = a6 + (a11 - a6) * 0.8;
var b12 = a11;
document.getElementById("newRange").innerHTML = Math.round(b0) + " / " + Math.round(b1) + " / " + Math.round(b2) + " / " + Math.round(b3) + " / " + Math.round(b4) + " / " + Math.round(b5) + " / " + Math.round(b6) + " / " + Math.round(b7) + " / " + Math.round(b8) + " / " + Math.round(b9) + " / " + Math.round(b10) + " / " + Math.round(b11) + " / " + Math.round(b12);
}
function calculateNewRange()
{
var short = (document.weaponRangeCalculator.short.value != '') ? parseInt(document.weaponRangeCalculator.short.value, 10) : 0;
var medium = (document.weaponRangeCalculator.medium.value != '') ? parseInt(document.weaponRangeCalculator.medium.value, 10) : 0;
var long = (document.weaponRangeCalculator.long.value != '') ? parseInt(document.weaponRangeCalculator.long.value, 10) : 0;
var extreme = (document.weaponRangeCalculator.extreme.value != '') ? parseInt(document.weaponRangeCalculator.extreme.value, 10) : 0;
if (document.weaponRangeCalculator.rangeModeHard.checked)
calculateNewRangeHard(short, medium, long, extreme);
else
calculateNewRangeNormal(short, medium, long, extreme);
}
</script>
<form name="weaponRangeCalculator" action="#">
<table style="text-align: center">
<tr><td rowspan="2">Waffenreichweite<br/>nach Buch</td><td>Kurz</td><td>Mittel</td><td>Lang</td><td>Extrem</td><td></td></tr>
<tr><td><input type="text" size="3" maxlength="3" value="" name="short" onchange="calculateNewRange()" onKeyUp="calculateNewRange()" /></td><td><input type="text" size="3" maxlength="3" value="" name="medium" onchange="calculateNewRange()" onKeyUp="calculateNewRange()" /></td><td><input type="text" size="3" maxlength="3" value="" name="long" onchange="calculateNewRange()" onKeyUp="calculateNewRange()" /></td><td><input type="text" size="3" maxlength="3" value="" name="extreme" onchange="calculateNewRange()" onKeyUp="calculateNewRange()" /></td><td><input type="checkbox" name="rangeModeHard" onChange="calculateNewRange()" /> ungenaue Waffe</td></tr>
</table>
Reichweite nach Hausregeln: <span id="newRange"> </span>
<br/><input type="button" name="do" value="Berechnen" />
</form>
Dieser Rechner berechnet die Waffenreichweite nach Hausregeln aus den Werten, wie sie in den MW-Büchern angegeben sind. Einfach die Reichweitenwerte in die entsprechenden Felder eintragen und die Hausregelversion wird automatisch generiert. Falls die Waffe laut Buch die erschwerten Reichweitenmodifikationen von +0/+3/+6/+11 hat, wie z.B. die Sternsnacht-Pistole oder Schrotflinten, muss noch das Häkchen bei ungenaue Waffe gesetzt werden.