public void interagirPorte(boolean b) { if (partieActuelle.getJoueurActuel().getPa() > 0) { consommationDePA = partieActuelle.getMaVille().actionnerPorte(b); consommerPA(); } else { Outils.affichage(Journal.consulterDescription(5), this.getMonInterface()); } }
public void actionBoire(boolean b) { if (b) { if (partieActuelle.getJoueurActuel().getSac().size() < 10) { partieActuelle .getJoueurActuel() .getSac() .add(partieActuelle.getMaVille().remplirGourde(this.partieActuelle)); } else { Outils.affichage(Journal.consulterDescription(8), this.getMonInterface()); } } }
public void actionManger(boolean b) { if (b) { if (partieActuelle.getJoueurActuel().getSac().size() < 10) { Item ration = partieActuelle.getMaVille().prendreRation(this.partieActuelle); if (ration.getNom().equals(Journal.consulterDescription(51))) { partieActuelle.getJoueurActuel().getSac().add(ration); } } else { // Outils.affichage(Journal.consulterDescription(8),this.getMonInterface()); } } }
public void accesObjet(boolean b, int a, Jeu partie) { if (a == 1) { if (b) { if (partie.getJoueurActuel().getSac().size() < 10) { partie.getJoueurActuel().getSac().add(partie.getMaVille().prendreRation(partie)); monInterface .getNbRation() .setText("" + (Integer.parseInt(monInterface.getNbRation().getText()) + 1)); monInterface .getNbObjet() .setText("" + (Integer.parseInt(monInterface.getNbObjet().getText()) + 1)); } else { Outils.affichage(Journal.consulterDescription(8), this.getMonInterface()); } } } else { if (b) { if (partieActuelle.getJoueurActuel().getSac().isEmpty() || partieActuelle.getJoueurActuel().getSac().size() < 10) { partieActuelle .getJoueurActuel() .getSac() .add(partieActuelle.getMaVille().prendreBoisson(this.partieActuelle)); monInterface .getNbEnergie() .setText("" + (Integer.parseInt(monInterface.getNbEnergie().getText()) + 1)); monInterface .getNbObjet() .setText("" + (Integer.parseInt(monInterface.getNbObjet().getText()) + 1)); } else { Outils.affichage(Journal.consulterDescription(8), this.getMonInterface()); } } } // partieActuelle.getMonInterface().setCpt(partieActuelle.getMonInterface().getCpt()-11); // menuNiveauUn('I'); }
public void prendreObjet(int num) { if (partieActuelle.getJoueurActuel().getIndiceCase() == 338) { if (partieActuelle .getMaVille() .getEntrepot()[num] .getNom() .equals(Journal.consulterDescription(51))) { accesObjet( (Outils.affichage(Journal.consulterDescription(17), 1, this.getMonInterface()) == 0), 1, partieActuelle); // partieActuelle.getMonInterface().setCpt(partieActuelle.getMonInterface().getCpt()+1); } else { if (partieActuelle .getMaVille() .getEntrepot()[num] .getNom() .equals(Journal.consulterDescription(53))) { accesObjet( (Outils.affichage(Journal.consulterDescription(18), 2, this.getMonInterface()) == 0), 2, partieActuelle); // partieActuelle.getMonInterface().setCpt(partieActuelle.getMonInterface().getCpt()+1); } else { Outils.affichage(Journal.consulterDescription(19), this.getMonInterface()); // partieActuelle.getMonInterface().setCpt(partieActuelle.getMonInterface().getCpt()-10); // menuNiveauUn('I'); } } } else { } }
public void prendreGourde(boolean b) { if (b) { if (partieActuelle.getJoueurActuel().getSac().size() < 10) { partieActuelle .getJoueurActuel() .getSac() .add(partieActuelle.getMaVille().remplirGourde(this.partieActuelle)); monInterface .getNbGourde() .setText("" + (Integer.parseInt(monInterface.getNbGourde().getText()) + 1)); monInterface .getNbObjet() .setText("" + (Integer.parseInt(monInterface.getNbObjet().getText()) + 1)); } else { Outils.affichage(Journal.consulterDescription(8), this.getMonInterface()); } } }
public void accederDefense() { monInterface.getPage1().setText(partieActuelle.getMaVille().afficherConstruction()); Outils.affichage( Journal.consulterDescription(21) + partieActuelle.getMaVille().defenseVille(), this.getMonInterface()); }
public void outilDeplacement(boolean absysse, boolean positif) { int getVal; boolean test; int indice; int getxyville; int getxy; if (absysse) { getxyville = partieActuelle.getGrille().getxVille(); getxy = partieActuelle.getJoueurActuel().getAbsysseActuelle(); if (positif) { getVal = 1; indice = 1; test = getxy < 24; } else { getVal = -1; indice = -1; test = getxy > 0; } } else { getxyville = partieActuelle.getGrille().getyVille(); getxy = partieActuelle.getJoueurActuel().getOrdonneeActuelle(); if (positif) { getVal = 1; indice = -25; test = getxy < 0; } else { getVal = -1; indice = 25; test = getxy > -24; } } if (test) { if (!partieActuelle.getMaVille().getOuverturePorte()) { if (getxy + getVal == getxyville) { Outils.affichage(Journal.consulterDescription(11), this.getMonInterface()); } else { if (getxy == getxyville) { Outils.affichage(Journal.consulterDescription(12), this.getMonInterface()); } else { if (absysse) { partieActuelle .getJoueurActuel() .setCoordonneeActuelle( partieActuelle.getJoueurActuel().getAbsysseActuelle() + getVal, partieActuelle.getJoueurActuel().getOrdonneeActuelle()); } else { partieActuelle .getJoueurActuel() .setCoordonneeActuelle( partieActuelle.getJoueurActuel().getAbsysseActuelle(), partieActuelle.getJoueurActuel().getOrdonneeActuelle() + getVal); } partieActuelle .getJoueurActuel() .setIndiceCase(partieActuelle.getJoueurActuel().getIndiceCase() + indice); partieActuelle .getMonInterface() .getFondMini() .setIcon( new ImageIcon( getClass() .getResource( "/hordegraphique/images/" + partieActuelle .getGrille() .getTabCase() .get(partieActuelle.getJoueurActuel().getIndiceCase()) .getFond() + ".jpg"))); partieActuelle .getMonInterface() .getPosition() .setText(partieActuelle.getJoueurActuel().renvoyerCoordonnees()); if (partieActuelle.getJoueurActuel().getIndiceCase() == 338) { partieActuelle.getMonInterface().getButCarte().setText(" | VILLE | "); partieActuelle.getMonInterface().getExterieur().setVisible(false); partieActuelle.getMonInterface().getInterieur().setVisible(true); } else { if (!partieActuelle .getGrille() .getTabCase() .get(partieActuelle.getJoueurActuel().getIndiceCase()) .getFouillee()) { partieActuelle.getMonInterface().getButCarte().setText(" | | "); } else { partieActuelle .getMonInterface() .getButCarte() .setText( "|" + partieActuelle .getGrille() .getTabCase() .get(partieActuelle.getJoueurActuel().getIndiceCase()) .itemCarte() + "|"); } partieActuelle.getMonInterface().getExterieur().setVisible(true); partieActuelle.getMonInterface().getInterieur().setVisible(false); } consommationDePA = true; } } } else { if (absysse) { partieActuelle .getJoueurActuel() .setCoordonneeActuelle( partieActuelle.getJoueurActuel().getAbsysseActuelle() + getVal, partieActuelle.getJoueurActuel().getOrdonneeActuelle()); } else { partieActuelle .getJoueurActuel() .setCoordonneeActuelle( partieActuelle.getJoueurActuel().getAbsysseActuelle(), partieActuelle.getJoueurActuel().getOrdonneeActuelle() + getVal); } partieActuelle .getJoueurActuel() .setIndiceCase(partieActuelle.getJoueurActuel().getIndiceCase() + indice); partieActuelle .getMonInterface() .getFondMini() .setIcon( new ImageIcon( getClass() .getResource( "/hordegraphique/images/" + partieActuelle .getGrille() .getTabCase() .get(partieActuelle.getJoueurActuel().getIndiceCase()) .getFond() + ".jpg"))); partieActuelle .getMonInterface() .getPosition() .setText(partieActuelle.getJoueurActuel().renvoyerCoordonnees()); if (partieActuelle.getJoueurActuel().getIndiceCase() == 338) { partieActuelle.getMonInterface().getButCarte().setText(" | VILLE | "); partieActuelle.getMonInterface().getExterieur().setVisible(false); partieActuelle.getMonInterface().getInterieur().setVisible(true); } else { if (!partieActuelle .getGrille() .getTabCase() .get(partieActuelle.getJoueurActuel().getIndiceCase()) .getFouillee()) { partieActuelle.getMonInterface().getButCarte().setText(" | | "); } else { partieActuelle .getMonInterface() .getButCarte() .setText( "|" + partieActuelle .getGrille() .getTabCase() .get(partieActuelle.getJoueurActuel().getIndiceCase()) .itemCarte() + "|"); } partieActuelle.getMonInterface().getExterieur().setVisible(true); partieActuelle.getMonInterface().getInterieur().setVisible(false); } consommationDePA = true; } } }