SAe/SAe2.1/Case.java

80 lines
1.3 KiB
Java
Raw Permalink Normal View History

2023-05-19 17:13:41 +02:00
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;
public class Case {
protected int valeurX;
protected int valeurY;
public String type;
public int value;
public Case(int x, int y, String t){
this.valeurX = x;
this.valeurY = y;
this.type = t;
}
public String getLabel(){
return ("");
}
public String getLabelPv(){
return ("");
}
public int getValeurX(){
return this.valeurX;
}
public int getValeurY(){
return this.valeurY;
}
public int getValue(){
return this.value;
}
public void setValue(int val){
this.value = val;
}
public int getPv(){
return 0;
}
public void setPv(int pdv){
}
public Arme getArme(){
return new Arme(0, 0, 0);
}
public void setArme(int atk){
}
public boolean rencontrer(Case c){
return false;
}
public Case newRandomCase(int x, int y){
Random rand = new Random();
int aleatoire = rand.nextInt();
if(aleatoire < 0){
aleatoire = -aleatoire;
}
if (aleatoire % 2 == 0){
aleatoire = rand.nextInt();
if(aleatoire < 0){
aleatoire = -aleatoire;
}
return new Monstre(aleatoire % 40 + 1, x, y);
} else {
return new CaseBonus(x, y, "temp").newRandomCaseBonus(x, y);
}
}
}