aboutsummaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorpiernov <piernov@piernov.org>2016-05-10 21:37:27 +0200
committerpiernov <piernov@piernov.org>2016-05-10 21:37:27 +0200
commit204e838a7794bbce0d44fc35efb367abb052d02f (patch)
tree3426fdb07b631690d28619c570139244803e5763 /js
parentf10c51f07a755d75a583f85316efbcd3bd1e4b6d (diff)
parent162b1de442bae3f02f14771eeb5f4f32868a97b3 (diff)
downloadcandybox-204e838a7794bbce0d44fc35efb367abb052d02f.tar.gz
candybox-204e838a7794bbce0d44fc35efb367abb052d02f.tar.bz2
candybox-204e838a7794bbce0d44fc35efb367abb052d02f.tar.xz
candybox-204e838a7794bbce0d44fc35efb367abb052d02f.zip
Merge branch 'alexichi' of /srv/git/candybox into alexichi
Diffstat (limited to 'js')
-rw-r--r--js/dungeon.js8
-rw-r--r--js/perso.js3
2 files changed, 9 insertions, 2 deletions
diff --git a/js/dungeon.js b/js/dungeon.js
index 2921c7d..7d97b49 100644
--- a/js/dungeon.js
+++ b/js/dungeon.js
@@ -69,6 +69,11 @@ function strike(ret,nb, f){
persoLife--;
document.getElementById("lifePerso").innerHTML = parseInt(persoLife);
}
+ data.hp=persoLife;
+ sendRequest("craftmine.php", "op=updatePerso&hp="+data.hp+"&maxHP="+data.maxHP+"&xp="+data.xp+"&lv="+data.level+"&power="+data.power
+ +"&bonusPower="+data.bonusPower, function(){
+ displayPerso(data.hp,data.maxHP,data.xp,data.level,data.power,data.bonusPower);
+ });
battle(ret,nb,f);
}
@@ -94,7 +99,8 @@ function endBattle(v,nb, f, ret){
displayExit();
sendRequest("craftmine.php", "op=sendDungeonProgress&floor="+f+"&mob="+nb);
}
- sendRequest("craftmine.php", "op=updatePerso&hp="+data.hp+"&maxHP="+data.maxHP+"&xp="+data.xp+"&lv="+data.level+"&power="+data.power+"&bonusPower="+data.bonusPower, function(){
+ sendRequest("craftmine.php", "op=updatePerso&hp="+data.hp+"&maxHP="+data.maxHP+"&xp="+data.xp+"&lv="+data.level+"&power="+data.power
+ +"&bonusPower="+data.bonusPower, function(){
displayPerso(data.hp,data.maxHP,data.xp,data.level,data.power,data.bonusPower);
});
}
diff --git a/js/perso.js b/js/perso.js
index 44b82eb..7977a9d 100644
--- a/js/perso.js
+++ b/js/perso.js
@@ -26,7 +26,8 @@ function levelUp(xp){
data.maxHP+=2;
}
//need to send the xp to the server
- sendRequest("craftmine.php", "op=updatePerso&hp="+data.hp+"&maxHP="+data.maxHP+"&xp="+data.xp+"&lv="+data.level+"&power="+data.power+"&bonusPower="+bonusPower, function(){
+ sendRequest("craftmine.php", "op=updatePerso&hp="+data.hp+"&maxHP="+data.maxHP+"&xp="+data.xp+"&lv="+data.level
+ +"&power="+data.power+"&bonusPower="+bonusPower, function(){
displayPerso(data.hp,data.maxHP,data.maxHP,data.xp,data.level,data.power,data.bonusPower);
});
}