Last active
October 2, 2016 00:09
-
-
Save Celeo/b0ea01b31d11661db199803f9ee412e3 to your computer and use it in GitHub Desktop.
EVE Online ECM chance calculations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<title>ECM Calculations</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.1/vue.js"></script> | |
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.7/css/materialize.min.css"> | |
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.7/js/materialize.min.js"></script> | |
<body class="grey lighten-2"> | |
<br><br><br><br> | |
<div class="container"> | |
<div id="app"> | |
<div class="card z-depth-3"> | |
<div class="card-content"> | |
<span class="card-title">ECM Calculations</span> | |
<div class="row"> | |
<div class="input-field col s2 offset-s1"> | |
<input v-model="ecm_strength" class="validate" type="number"> | |
<label>ECM Strength</label> | |
</div> | |
<div class="input-field col s2"> | |
<input v-model="sensor_strength" class="validate" type="number"> | |
<label>Target Sensor Strength</label> | |
</div> | |
<div class="input-field col s2"> | |
<input v-model="jammer_count" class="validate" type="number"> | |
<label>Jammer Count</label> | |
</div> | |
<div class="input-field col s4"> | |
<select v-model="ship" class="browser-default"> | |
<option value="22.8">Guardian w/o ECCM</option> | |
<option value="44.7">Guardian w/ local ECCM</option> | |
<option value="50.2">Guardian w/ remote ECCM</option> | |
<option value="24">Oneiros w/o ECCM</option> | |
<option value="47">Oneiros w/ local ECCM</option> | |
<option value="52.8">Oneiros w/ remote ECCM</option> | |
<option value="33.6">Bhaalgorn w/o ECCM</option> | |
<option value="65.9">Bhaalgorn w/ 1 local ECCM</option> | |
<option value="121">Bhaalgorn w/ 2 local ECCM</option> | |
<option value="73.9">Bhaalgorn w/ remote ECCM</option> | |
<option value="20">T1C w/o ECCM</option> | |
<option value="26.4">T2C w/o ECCM</option> | |
<option value="20">T3C w/o ECCM (DPS)</option> | |
<option value="42">T3C w/o ECCM (Jams)</option> | |
<option value="18">Hic w/o ECCM</option> | |
<option value="30">Recon w/o ECCM</option> | |
<option value="5">T1 Einherji</option> | |
<option value="6">T2 Einherji</option> | |
</select> | |
<button class="btn green" @click="override_strength"> | |
<i class="material-icons left">loop</i> | |
Use ship strength | |
</button> | |
</div> | |
</div> | |
<div class="row"> | |
<div class="col s6 offset-s3"> | |
<table class="bordered"> | |
<thead> | |
<tr> | |
<th> | |
<th> | |
<tbody> | |
<tr> | |
<th>Jams chance per cycle (20 seconds) | |
<td>{{ chance_per_cycle }} | |
<tr> | |
<th>James chance per minute | |
<td>{{ chance_per_minute }} | |
</table> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<script> | |
new Vue({ | |
el: '#app', | |
data: { | |
ecm_strength: 5, | |
sensor_strength: 22.8, | |
jammer_count: 5, | |
ship: 22.8 | |
}, | |
computed: { | |
chance_per_cycle: function() { | |
let chance = (1 - Math.pow((1 - this.ecm_strength / this.sensor_strength), this.jammer_count)) * 100 | |
return chance > 100 ? 100 : chance.toFixed(2) | |
}, | |
chance_per_minute: function() { | |
let chance = this.chance_per_cycle * 3 | |
return chance > 100 ? 100 : chance.toFixed(2) | |
} | |
}, | |
methods: { | |
override_strength: function() { | |
this.sensor_strength = this.ship | |
} | |
} | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment