diff --git a/src/jsds.js b/src/jsds.js
index 251a8db..2b416c1 100644
--- a/src/jsds.js
+++ b/src/jsds.js
@@ -248,10 +248,25 @@
$('#uiatt').html(outstr);
- $('#att').bind("change", function() {cur_sel.att=this.value;});
+ $('#att').bind("change", function() {
+ cur_sel.att=this.value;
+ cur_sel.printoutput();
+ });
$('#defendible').bind("change",
- function() { cur_sel.defendible = (this.value === "true" ? true : false);});
+ function() {
+ cur_sel.defendible = (this.value === "true" ? true : false);
+ cur_sel.printoutput();
+ });
$("#"+this.att).get(0).selected="true";
+ },
+
+ calc_dist: function() {
+ var g = this.graphelement;
+ g.calc_center();
+ var dx = Math.abs(g.cx - g.old_pos["cx"]);
+ var dy = Math.abs(g.cy - g.old_pos.cy);
+ var distpx= Math.sqrt(dx*dx + dy*dy);
+ return (distpx/meters).toFixed(1);
}
});
@@ -323,6 +338,7 @@
outstr += this.info.cname + " (gespielt von "+this.info.pname +")
";
outstr += "Greift derzeit durch " + this.att + " mit einer Stärke von "
+ this.battle[this.att] + " an.
";
+ outstr += "Ist "+this.calc_dist()+"m von der alten Position entfernt (max ??)
";
outstr += "Verteidigungsstärke: " + this.battle.defense + "
";
outstr += "Kraftpunkte: " + this.life;
outstr += "