Skip to content
Snippets Groups Projects
Commit 37a43672 authored by Francois .D's avatar Francois .D
Browse files

fix combat et plateau

parent 37ecb49c
No related branches found
No related tags found
No related merge requests found
......@@ -18,9 +18,13 @@ public class Plateau {
plateau[i][j].fillRegion();
}
}
int rd1 = (int)random.nextInt(10)+10;
int rd2 = (int)random.nextInt(30);
this.getCase(rd1, rd2).setItem(new Crown(this.getCase(0, 0)));
int rd1;
int rd2;
do {
rd1 = (int)random.nextInt(10)+10;
rd2 = (int)random.nextInt(30);
this.getCase(rd1, rd2).setItem(new Crown(this.getCase(0, 0)));
} while (this.getCase(rd1, rd2).getType() != Type.GRASS);
}
public Case getCase(int x, int y) {
return plateau[x/5][y/5].region[x%5][y%5];
......
......@@ -9,9 +9,7 @@ public class Combattre {
uniteDef.setArmor(uniteDef.getArmor()-uniteAttq.getDamage());
if (isAlive(uniteDef)) {
//TODO: peut tre mettre moins de dgat pour l'unit qui dfend
uniteAttq.setArmor(uniteAttq.getArmor()-uniteDef.getDamage());
//TODO: attention au archer !
isAlive(uniteAttq);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment