Ajout des capacités spéciales
This commit is contained in:
parent
80f7266ffb
commit
dc3414c023
@ -23,16 +23,27 @@ import main.GestionnaireJeu;
|
|||||||
public class LancerDes {
|
public class LancerDes {
|
||||||
private int resultat;
|
private int resultat;
|
||||||
private Contexte contexte;
|
private Contexte contexte;
|
||||||
public LancerDes(Contexte c){
|
private int typeDe;
|
||||||
contexte = c;
|
private int[] rolls;
|
||||||
|
|
||||||
|
private final static int LANCER_DE_4 = 0;
|
||||||
|
private final static int LANCER_DE_6 = 1;
|
||||||
|
private final static int LANCER_DES = 2;
|
||||||
|
|
||||||
|
public LancerDes(int typeDe, int[] rolls, Contexte c){
|
||||||
|
this.typeDe = typeDe;
|
||||||
|
this.rolls = rolls;
|
||||||
|
this.contexte = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
public VBox initLancer() {
|
public VBox initLancer() {
|
||||||
switch (contexte) {
|
switch (typeDe) {
|
||||||
case LANCER_DES_4:
|
case LANCER_DE_4:
|
||||||
return initLancerD4();
|
return initLancerD4();
|
||||||
case LANCER_DES_6:
|
case LANCER_DE_6:
|
||||||
return initLancerD6();
|
return initLancerD6();
|
||||||
|
case LANCER_DES:
|
||||||
|
return initLancerBoth();
|
||||||
default :
|
default :
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -53,19 +64,26 @@ public class LancerDes {
|
|||||||
btn.setOnAction((ActionEvent event) -> {
|
btn.setOnAction((ActionEvent event) -> {
|
||||||
btn.setDisable(true);// Disable Button
|
btn.setDisable(true);// Disable Button
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(.3), (actionEvent) -> {
|
Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(0.1), (actionEvent) -> {
|
||||||
int tempRandom = random.nextInt(4) + 1;
|
int tempRandom = random.nextInt(4)+1;
|
||||||
die.setDieFace(tempRandom);
|
die.setDieFace(tempRandom);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
timeline.setCycleCount(random.nextInt(20) + 1);
|
timeline.setCycleCount(20);
|
||||||
timeline.play();
|
timeline.play();
|
||||||
timeline.setOnFinished(actionEvent -> {
|
timeline.setOnFinished(actionEvent -> {
|
||||||
int res = die.getCurrentFace();
|
|
||||||
txt.setText("Vous avez obtenu "+res+"!");
|
die.setDieFace(rolls[0]);
|
||||||
resultat = res;
|
txt.setText("Vous avez obtenu "+rolls[0]);
|
||||||
GestionnaireJeu.notifyPlateau();
|
Timeline timeline2 = new Timeline(new KeyFrame(
|
||||||
});
|
Duration.millis(2000),
|
||||||
|
ae -> {
|
||||||
|
|
||||||
|
|
||||||
|
GestionnaireJeu.notifyPlateau();
|
||||||
|
}));
|
||||||
|
timeline2.play();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
HBox des = new HBox(stackpane);
|
HBox des = new HBox(stackpane);
|
||||||
@ -77,6 +95,50 @@ public class LancerDes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private VBox initLancerD6() {
|
private VBox initLancerD6() {
|
||||||
|
DieImages images = new DieImages();
|
||||||
|
Die die = new Die(images.getImages());
|
||||||
|
ImageView stackpane = die.getdieFace();
|
||||||
|
stackpane.setFitHeight(100);
|
||||||
|
stackpane.setFitWidth(100);
|
||||||
|
Button btn = new Button();
|
||||||
|
Text txt = new Text("Lancez le dés pour attaquer");
|
||||||
|
txt.setFont(Font.font(null, null, null, 12));
|
||||||
|
txt.setFill(Color.WHITE);
|
||||||
|
btn.setText("Lancer dés");
|
||||||
|
btn.setOnAction((ActionEvent event) -> {
|
||||||
|
btn.setDisable(true);// Disable Button
|
||||||
|
Random random = new Random();
|
||||||
|
Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(.1), (actionEvent) -> {
|
||||||
|
int tempRandom = random.nextInt(6)+1;
|
||||||
|
die.setDieFace(tempRandom);
|
||||||
|
}));
|
||||||
|
|
||||||
|
timeline.setCycleCount(20);
|
||||||
|
timeline.play();
|
||||||
|
timeline.setOnFinished(actionEvent -> {
|
||||||
|
|
||||||
|
die.setDieFace(rolls[0]);
|
||||||
|
txt.setText("Vous avez obtenu "+rolls[0]);
|
||||||
|
Timeline timeline2 = new Timeline(new KeyFrame(
|
||||||
|
Duration.millis(2000),
|
||||||
|
ae -> {
|
||||||
|
|
||||||
|
|
||||||
|
GestionnaireJeu.notifyPlateau();
|
||||||
|
}));
|
||||||
|
timeline2.play();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
HBox des = new HBox(stackpane);
|
||||||
|
des.setAlignment(Pos.CENTER);
|
||||||
|
VBox root = new VBox(txt,des, new StackPane(btn));
|
||||||
|
root.setAlignment(Pos.CENTER);
|
||||||
|
root.setSpacing(20);
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
|
||||||
|
private VBox initLancerBoth() {
|
||||||
DieImages images = new DieImages();
|
DieImages images = new DieImages();
|
||||||
Die die = new Die(images.getImages());
|
Die die = new Die(images.getImages());
|
||||||
Die die2 = new Die(images.getImages());
|
Die die2 = new Die(images.getImages());
|
||||||
@ -94,21 +156,33 @@ public class LancerDes {
|
|||||||
btn.setOnAction((ActionEvent event) -> {
|
btn.setOnAction((ActionEvent event) -> {
|
||||||
btn.setDisable(true);// Disable Button
|
btn.setDisable(true);// Disable Button
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(.3), (actionEvent) -> {
|
|
||||||
int tempRandom = random.nextInt(6) + 1;
|
Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(.1), (actionEvent) -> {
|
||||||
int tempRandom2 = random.nextInt(6) + 1;
|
int tempRandom = random.nextInt(4)+1;
|
||||||
|
int tempRandom2 = random.nextInt(6)+1;
|
||||||
die.setDieFace(tempRandom);
|
die.setDieFace(tempRandom);
|
||||||
die2.setDieFace(tempRandom2);
|
die2.setDieFace(tempRandom2);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
timeline.setCycleCount(random.nextInt(20) + 1);
|
timeline.setCycleCount(20);
|
||||||
timeline.play();
|
timeline.play();
|
||||||
timeline.setOnFinished(actionEvent -> {
|
timeline.setOnFinished(actionEvent -> {
|
||||||
int res = die.getCurrentFace()+die2.getCurrentFace();
|
|
||||||
txt.setText("Vous avez obtenu "+res+"!");
|
die.setDieFace(rolls[0]);
|
||||||
resultat = res;
|
die2.setDieFace(rolls[1]);
|
||||||
GestionnaireJeu.notifyPlateau();
|
|
||||||
});
|
int result = rolls[0]+rolls[1];
|
||||||
|
|
||||||
|
txt.setText("Vous avez obtenu "+result);
|
||||||
|
Timeline timeline2 = new Timeline(new KeyFrame(
|
||||||
|
Duration.millis(2000),
|
||||||
|
ae -> {
|
||||||
|
GestionnaireJeu.notifyPlateau();
|
||||||
|
|
||||||
|
}));
|
||||||
|
timeline2.play();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
HBox des = new HBox(stackpane, stackpane2);
|
HBox des = new HBox(stackpane, stackpane2);
|
||||||
|
@ -65,9 +65,9 @@ public class PlateauController implements Initializable {
|
|||||||
private Map<Carte,BufferedImage> mapRessourcesCartes;
|
private Map<Carte,BufferedImage> mapRessourcesCartes;
|
||||||
private Map<String,BufferedImage> mapRessourcesDosCartes;
|
private Map<String,BufferedImage> mapRessourcesDosCartes;
|
||||||
|
|
||||||
public static int DICE_SIX = 2;
|
public static int DICE_SIX = 1;
|
||||||
public static int DICE_QUATRE = 1;
|
public static int DICE_QUATRE = 0;
|
||||||
public static int DICE_BOTH = 0;
|
public static int DICE_BOTH = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initialise les données du plateau
|
* initialise les données du plateau
|
||||||
@ -333,9 +333,11 @@ public class PlateauController implements Initializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void rollDice(Joueur joueur, int typeDice, int[] rolls) {
|
public void rollDice(Joueur joueur, int typeDice, int[] rolls, Contexte c) {
|
||||||
|
|
||||||
|
|
||||||
|
this.ld=new LancerDes(typeDice,rolls,c);
|
||||||
|
JoueurIHM jihm = getJoueurIHM(joueur);
|
||||||
|
jihm.setZoneJoueur(ld.initLancer());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void afficherChoisir(Joueur j, Contexte contexte) throws IOException {
|
public void afficherChoisir(Joueur j, Contexte contexte) throws IOException {
|
||||||
@ -493,7 +495,7 @@ public class PlateauController implements Initializable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void close () throws IOException {
|
public void close() throws IOException {
|
||||||
final URL fxmlURL = PlateauController.class.getResource("/ihm/ressources/Menu.fxml");
|
final URL fxmlURL = PlateauController.class.getResource("/ihm/ressources/Menu.fxml");
|
||||||
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE);
|
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE);
|
||||||
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
|
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
|
||||||
@ -501,36 +503,17 @@ public class PlateauController implements Initializable {
|
|||||||
rootPane.getChildren().setAll(pane);
|
rootPane.getChildren().setAll(pane);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Integer getChoixLancerDes(Joueur joueur) {
|
|
||||||
JoueurIHM jihm = getJoueurIHM(joueur);
|
|
||||||
int result = this.ld.getResult();
|
|
||||||
this.ld = null;
|
|
||||||
jihm.getZoneJoueur().getChildren().setAll();
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void afficherLancerDes(Joueur j, Contexte c) throws IOException {
|
|
||||||
this.ld=new LancerDes(c);
|
|
||||||
JoueurIHM jihm = getJoueurIHM(j);
|
|
||||||
jihm.setZoneJoueur(ld.initLancer());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void afficherLT(Joueur j, CartePiochable cartePiochable) throws IOException {
|
public void afficherLT(Joueur j, CartePiochable cartePiochable) throws IOException {
|
||||||
|
|
||||||
Image i = getImageCarte(cartePiochable);
|
Image i = getImageCarte(cartePiochable);
|
||||||
ImageView iv = new ImageView(i);
|
ImageView iv = new ImageView(i);
|
||||||
Pane p = new Pane(iv);
|
Pane p = new Pane(iv);
|
||||||
PopUp pu = new PopUp(p,"Image");
|
PopUp pu = new PopUp(p,"Image");
|
||||||
pu.getStage().focusedProperty().addListener((obs,wasFocused,isNowFocused) -> {
|
pu.getStage().focusedProperty().addListener((obs,wasFocused,isNowFocused) -> {
|
||||||
|
|
||||||
if(!isNowFocused) {
|
if(!isNowFocused) {
|
||||||
GestionnaireJeu.notifyPlateau();
|
GestionnaireJeu.notifyPlateau();
|
||||||
pu.getStage().hide();
|
pu.getStage().hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
pu.display();
|
pu.display();
|
||||||
|
@ -10,6 +10,12 @@ import javafx.scene.control.Button;
|
|||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.image.Image;
|
import javafx.scene.image.Image;
|
||||||
import javafx.scene.image.ImageView;
|
import javafx.scene.image.ImageView;
|
||||||
|
import javafx.scene.layout.AnchorPane;
|
||||||
|
import javafx.scene.layout.Background;
|
||||||
|
import javafx.scene.layout.BackgroundImage;
|
||||||
|
import javafx.scene.layout.BackgroundPosition;
|
||||||
|
import javafx.scene.layout.BackgroundRepeat;
|
||||||
|
import javafx.scene.layout.BackgroundSize;
|
||||||
import main.GestionnaireJeu;
|
import main.GestionnaireJeu;
|
||||||
|
|
||||||
public class RecevoirCarte implements Initializable {
|
public class RecevoirCarte implements Initializable {
|
||||||
@ -31,6 +37,11 @@ public class RecevoirCarte implements Initializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setImageView(Image imageCarte) {
|
public void setImageView(Image imageCarte) {
|
||||||
this.imageView.setImage(imageCarte);
|
AnchorPane ap = (AnchorPane) imageView.getParent();
|
||||||
|
|
||||||
|
BackgroundImage myBI= new BackgroundImage(imageCarte,
|
||||||
|
BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT,
|
||||||
|
new BackgroundSize(BackgroundSize.AUTO,1.0,true,true,false,false));
|
||||||
|
ap.setBackground(new Background(myBI));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,27 +8,27 @@
|
|||||||
<?import javafx.scene.layout.VBox?>
|
<?import javafx.scene.layout.VBox?>
|
||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
|
|
||||||
<AnchorPane xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.RecevoirCarte">
|
<AnchorPane prefHeight="344.0" prefWidth="385.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.RecevoirCarte">
|
||||||
<children>
|
<children>
|
||||||
<SplitPane dividerPositions="0.6212121212121212" styleClass="background" stylesheets="@style/plateau.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<SplitPane dividerPositions="0.9921671018276762" styleClass="background" stylesheets="@style/plateau.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<items>
|
<items>
|
||||||
<AnchorPane>
|
<AnchorPane>
|
||||||
<children>
|
<children>
|
||||||
<VBox alignment="CENTER" spacing="30.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<VBox alignment="CENTER" spacing="30.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<children>
|
<children>
|
||||||
<Label fx:id="label" styleClass="text" text="Vous arrivez sur cette Carte Lieu" textOverrun="CLIP" wrapText="true">
|
<Label fx:id="label" minHeight="0.0" minWidth="0.0" styleClass="text" text="Glissez la barre" textOverrun="CLIP" wrapText="true">
|
||||||
<font>
|
<font>
|
||||||
<Font size="14.0" />
|
<Font size="14.0" />
|
||||||
</font>
|
</font>
|
||||||
</Label>
|
</Label>
|
||||||
<Button fx:id="okButton" mnemonicParsing="false" styleClass="bouton" text="Ok" />
|
<Button fx:id="okButton" minHeight="0.0" minWidth="0.0" mnemonicParsing="false" styleClass="bouton" text="Ok" />
|
||||||
</children>
|
</children>
|
||||||
</VBox>
|
</VBox>
|
||||||
</children>
|
</children>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
<AnchorPane>
|
<AnchorPane>
|
||||||
<children>
|
<children>
|
||||||
<ImageView fx:id="imageView" fitHeight="158.0" fitWidth="132.0" pickOnBounds="true" preserveRatio="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
<ImageView fx:id="imageView" pickOnBounds="true" preserveRatio="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||||
</children>
|
</children>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
</items>
|
</items>
|
||||||
|
@ -24,6 +24,8 @@ public class GestionnaireJeu {
|
|||||||
private Map<Integer, Joueur> mapJoueurs;
|
private Map<Integer, Joueur> mapJoueurs;
|
||||||
|
|
||||||
private RessourceLoader ressourceLoader;
|
private RessourceLoader ressourceLoader;
|
||||||
|
|
||||||
|
private static Thread lastThread;
|
||||||
|
|
||||||
private static Plateau plateau;
|
private static Plateau plateau;
|
||||||
public static PlateauController pc;
|
public static PlateauController pc;
|
||||||
@ -165,34 +167,14 @@ public class GestionnaireJeu {
|
|||||||
this.waitPlateau();
|
this.waitPlateau();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int jouerDes(Joueur joueur, Contexte c) {
|
|
||||||
|
public void rollDice(Joueur joueur, int typeDice, int ... rolls){
|
||||||
|
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
try {
|
pc.rollDice(joueur,typeDice,rolls, null);
|
||||||
pc.afficherLancerDes(joueur, c);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.waitPlateau();
|
this.waitPlateau();
|
||||||
|
|
||||||
final FutureTask<Integer> query = new FutureTask<Integer>(new Callable<Integer>() {
|
|
||||||
@Override
|
|
||||||
public Integer call() throws Exception {
|
|
||||||
return pc.getChoixLancerDes(joueur);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
Platform.runLater(query);
|
|
||||||
|
|
||||||
try {
|
|
||||||
return query.get();
|
|
||||||
} catch (InterruptedException | ExecutionException e) {
|
|
||||||
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Joueur choisirJoueur(Joueur joueur, List<Joueur> joueurs, Contexte contexte) {
|
public Joueur choisirJoueur(Joueur joueur, List<Joueur> joueurs, Contexte contexte) {
|
||||||
@ -226,10 +208,10 @@ public class GestionnaireJeu {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public void waitPlateau() {
|
public void waitPlateau() {
|
||||||
Thread currentThread = Thread.currentThread();
|
lastThread = Thread.currentThread();
|
||||||
synchronized(currentThread) {
|
synchronized(lastThread) {
|
||||||
try {
|
try {
|
||||||
currentThread.wait();
|
lastThread.wait();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -237,9 +219,10 @@ public class GestionnaireJeu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void notifyPlateau() {
|
public static void notifyPlateau() {
|
||||||
synchronized(plateau) {
|
synchronized(lastThread) {
|
||||||
plateau.notify();
|
lastThread.notify();
|
||||||
}
|
}
|
||||||
|
lastThread = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Type choisirCarte(Joueur joueur) {
|
public Type choisirCarte(Joueur joueur) {
|
||||||
@ -272,10 +255,7 @@ public class GestionnaireJeu {
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public void rollDice(Joueur joueur, int typeDice, int ... rolls){
|
|
||||||
|
|
||||||
pc.rollDice(joueur,typeDice,rolls);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConfiguration(Configuration c) {
|
public void setConfiguration(Configuration c) {
|
||||||
|
|
||||||
|
@ -68,10 +68,6 @@ public class Joueur {
|
|||||||
this.stats.put(key, valeur);
|
this.stats.put(key, valeur);
|
||||||
}
|
}
|
||||||
public void setStat(String key, int valeur) {
|
public void setStat(String key, int valeur) {
|
||||||
System.out.println(this.nom+" "+this);
|
|
||||||
if(key.contentEquals(PLAYER_HP)) {
|
|
||||||
this.plateau.alerationVie(this,valeur);
|
|
||||||
}
|
|
||||||
this.stats.put(key, valeur);
|
this.stats.put(key, valeur);
|
||||||
updateVictoirePlateau();
|
updateVictoirePlateau();
|
||||||
updateVie();
|
updateVie();
|
||||||
@ -112,7 +108,6 @@ public class Joueur {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getStat(String key) {
|
public int getStat(String key) {
|
||||||
|
|
||||||
if(stats.containsKey(key)) {
|
if(stats.containsKey(key)) {
|
||||||
return stats.get(key);
|
return stats.get(key);
|
||||||
}else {
|
}else {
|
||||||
@ -164,6 +159,9 @@ public class Joueur {
|
|||||||
public void addToStat(String key, int valeur)
|
public void addToStat(String key, int valeur)
|
||||||
{
|
{
|
||||||
int valeurBase = this.getStat(key);
|
int valeurBase = this.getStat(key);
|
||||||
|
if(key.contentEquals(PLAYER_HP)) {
|
||||||
|
this.plateau.alerationVie(this,valeur);
|
||||||
|
}
|
||||||
this.setStat(key,valeurBase+valeur);
|
this.setStat(key,valeurBase+valeur);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,8 +187,6 @@ public class Joueur {
|
|||||||
this.plateau = plateau2;
|
this.plateau = plateau2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void utiliserEffetLieu() {
|
public void utiliserEffetLieu() {
|
||||||
this.carteLieu.utiliser(this);
|
this.carteLieu.utiliser(this);
|
||||||
}
|
}
|
||||||
@ -246,10 +242,6 @@ public class Joueur {
|
|||||||
return this.plateau.choisir(this, activerEffetLieu);
|
return this.plateau.choisir(this, activerEffetLieu);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int lancerDes(Contexte typeLancer) {
|
|
||||||
return this.plateau.lancerDes(this, typeLancer);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object choisir(List<?> list,Class cls) {
|
public Object choisir(List<?> list,Class cls) {
|
||||||
return this.plateau.choisir(this,list, cls);
|
return this.plateau.choisir(this,list, cls);
|
||||||
}
|
}
|
||||||
@ -271,14 +263,10 @@ public class Joueur {
|
|||||||
this.plateau.retirerEquipementIHM(this,e);
|
this.plateau.retirerEquipementIHM(this,e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void utiliserCapacite() {
|
public void utiliserCapacite() {
|
||||||
if(revele) {
|
if(revele) {
|
||||||
this.cartePersonnage.utiliser();
|
this.cartePersonnage.utiliser();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -266,9 +266,7 @@ public class Plateau extends Thread{
|
|||||||
|
|
||||||
System.out.println(joueurs.size());
|
System.out.println(joueurs.size());
|
||||||
Joueur currentJoueur = this.joueurs.get(i % nbJoueurs);
|
Joueur currentJoueur = this.joueurs.get(i % nbJoueurs);
|
||||||
int lancer = currentJoueur.lancerDes(Contexte.LANCER_DES_4);
|
|
||||||
System.out.println("\n\n\n\n\n");
|
System.out.println("\n\n\n\n\n");
|
||||||
System.out.println(lancer);
|
|
||||||
System.out.println("Au tour de "+currentJoueur.getNom());
|
System.out.println("Au tour de "+currentJoueur.getNom());
|
||||||
System.out.println("Lancement des dés.");
|
System.out.println("Lancement des dés.");
|
||||||
deplacer(currentJoueur);
|
deplacer(currentJoueur);
|
||||||
@ -356,7 +354,6 @@ public class Plateau extends Thread{
|
|||||||
|
|
||||||
int roll4 =rollRandom(4);
|
int roll4 =rollRandom(4);
|
||||||
int roll6 = rollRandom(6);
|
int roll6 = rollRandom(6);
|
||||||
|
|
||||||
gj.rollDice(j, PlateauController.DICE_BOTH, roll4,roll6);
|
gj.rollDice(j, PlateauController.DICE_BOTH, roll4,roll6);
|
||||||
return Math.abs(roll4-roll6);
|
return Math.abs(roll4-roll6);
|
||||||
}
|
}
|
||||||
@ -383,7 +380,12 @@ public class Plateau extends Thread{
|
|||||||
|
|
||||||
public int sumRolls(Joueur j)
|
public int sumRolls(Joueur j)
|
||||||
{
|
{
|
||||||
return roll6(j) + roll4(j);
|
int roll4 =rollRandom(4);
|
||||||
|
int roll6 = rollRandom(6);
|
||||||
|
int sum = Math.abs(roll4+roll6);
|
||||||
|
gj.rollDice(j, PlateauController.DICE_BOTH, roll4,roll6);
|
||||||
|
return 3;
|
||||||
|
//return Math.abs(roll4+roll6);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Joueur> getJoueurs() {
|
public List<Joueur> getJoueurs() {
|
||||||
@ -477,8 +479,4 @@ public class Plateau extends Thread{
|
|||||||
gj.retirerEquipement(joueur,e);
|
gj.retirerEquipement(joueur,e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int lancerDes(Joueur joueur, Contexte typeLancer) {
|
|
||||||
return gj.jouerDes(joueur, typeLancer);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user