Commit d3d7651f authored by Louis Cohen's avatar Louis Cohen

Merge branch 'master' of gitlab.crans.org:genie_logiciel_2015/the_dungeon_project

parents 56ab0184 ededcfb8
......@@ -140,6 +140,9 @@ public class Being extends Entity {
* @return true if this is dead. false otherwise.
*/
public boolean takeDamage(int damage){
if(damage>0) {
addAction(Action.HIT);
}
HP=Math.min(maxHP, Math.max(HP-damage, 0));
if (HP==0){
Event event = new ToServerDeathEvent(this.getID());
......
......@@ -204,6 +204,9 @@ public class IGPpanel extends graphics.guiSkeleton.guiPanel.GUIPanel{
private ActionListener exitButtonListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
for(int i = 0; i<nbf; i++){
prflabel[i].setBackground(GUIColorsAndFonts.buttonBackground1);
}
BehaviourHolder.getInstance().SetFollowerBehaviour(fob);
getGraphicsMaster().changeGUIStateTo(GraphicsMaster.GUIStates.MAIN_MENU);
BehaviourHolder.getInstance().GetFollowerBehaviour().PrintElements();
......
......@@ -27,7 +27,13 @@ public class TestIGP {
public static void main(String argv[]) throws ParseException {
System.out.println("Bonjour");
Script parser = new Script(stringToStream("attaque ennemi (avec PV < 50% et (avec DEF < 50 ou non possedant potion)) ou avec DEF = 50"));
parser.Instruction();
try {
parser.Instruction();
} catch(ParseException e) {
System.out.println("ParseException error");
} catch(TokenMgrError e) {
System.out.println("TokenMgrError error");
}
Zone zone = EmptyZone.getEmptyZone();
TilePropertyVector tpv = new TilePropertyVector();
EntityDisplayerType edt=EntityDisplayerType.valueOf("PONYTA");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment