Skip to content

Commit

Permalink
Merge pull request #6 from JavaSTMN/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
David Molinari authored Dec 3, 2018
2 parents e3cfea3 + b397664 commit e5bfe66
Show file tree
Hide file tree
Showing 64 changed files with 1,887 additions and 226 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ local.properties
.scala_dependencies
.worksheet

/.metadata/
Binary file added assets/img/BelweBdBTBold.ttf
Binary file not shown.
Binary file added assets/img/Cards/Heroes/bouchara.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/Cards/Heroes/chauvinator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Cards/Heroes/doge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Cards/Heroes/martin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Cards/Heroes/murisasco.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/Cards/Sbirs/3K.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/Cards/Sbirs/Furry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/Cards/Sbirs/Garou.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/Cards/Sbirs/Ivan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Cards/Sbirs/Kevin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/Cards/Sbirs/Lapeyrle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/Cards/Sbirs/Lithium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Cards/Sbirs/Meh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Cards/Sbirs/Nick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/Cards/Sbirs/SbireFeminin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Cards/Sbirs/SbireFeminin2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Cards/Sbirs/Tortank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Cards/Sbirs/alazar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Cards/Sbirs/kingsman.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/Cards/Sbirs/mamie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Cards/Sbirs/slime_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Cards/Sbirs/x3K.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Cards/Sbirs/xFurry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Cards/Sbirs/xGarou.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Cards/Sbirs/xIvan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/Cards/Sbirs/xLapeyrle.png
Binary file added assets/img/Cards/Sbirs/xLithium.png
Binary file added assets/img/Cards/Sbirs/xSbireFeminin.png
Binary file added assets/img/Cards/Sbirs/xmamie.png
Binary file added assets/img/Cards/Sbirs/xslime_1.png
Binary file added assets/img/Cards/Sbirs/xslime_2.png
Binary file added assets/img/Cards/Sbirs/xslime_3.png
Binary file modified assets/img/Cards/Spells/Cafe.png
Binary file modified assets/img/Cards/Spells/Katon.png
Binary file modified assets/img/Cards/Spells/Multi-Clonage.png
Binary file modified assets/img/Cards/Spells/Raiton.png
Binary file modified assets/img/Cards/Spells/rasengan.png
Binary file added assets/img/Cards/Spells/xCafe.png
Binary file added assets/img/Cards/Spells/xKaton.png
Binary file added assets/img/Cards/Spells/xMulti-Clonage.png
Binary file added assets/img/Cards/Spells/xRaiton.png
Binary file added assets/img/Cards/Spells/xrasengan.png
Binary file added assets/img/Cards/deck.png
Binary file modified assets/img/background.jpg
6 changes: 6 additions & 0 deletions src/core/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@
/Hero.class
/Player.class
/Mana.class
/GameManager$1.class
/GameManager$2.class
/GameManager$3.class
/GameManager$4.class
/GameManager$5.class
/GameManager$6.class
11 changes: 10 additions & 1 deletion src/core/Card.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public abstract class Card {
private int mana;
private Image image;
private String effect;
private boolean attack;



Expand All @@ -15,7 +16,7 @@ public Card(String name, int mana, Image image, String effect) {
this.mana = mana;
this.image = image;
this.effect = effect;

attack = false;
}
/**
*
Expand All @@ -25,6 +26,14 @@ public String getName() {
return this.name;
}


public boolean isAttack() {
return attack;
}
public void setAttack(boolean a) {
this.attack = a;
}

public String getEffect() {
return this.effect;
}
Expand Down
64 changes: 63 additions & 1 deletion src/core/Deck.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,52 @@
package core;

import java.awt.Image;
import java.awt.event.ActionListener;
import java.util.ArrayList;

import javax.swing.ImageIcon;

import tool.ImagePaths;

public class Deck {

private Hero hero;
private final int _NB_MAX_CARD = 10 ;
private final int _NB_MAX_CARD = 20 ;
private ArrayList<Card> cards;

public Deck() {
cards = new ArrayList<Card>();
}

public Deck(int test) {
cards = new ArrayList<Card>();
if(test == 1) {
ImageIcon imageIcon = new ImageIcon(ImagePaths._HERO_GLORIA);
Image imgGloria = imageIcon.getImage();
hero = new Hero("Gloria", imgGloria);
} else {
ImageIcon imageIcon = new ImageIcon(ImagePaths._HERO_LSD);
Image imgLsd = imageIcon.getImage();
hero = new Hero("Lsd", imgLsd);
}

Image sbire_slime = new ImageIcon(ImagePaths._SLIME_3).getImage();
Image spell_katon = new ImageIcon(ImagePaths._SPELL_KATON).getImage();
Image spell_rasengan = new ImageIcon(ImagePaths._SPELL_RASENGAN).getImage();

cards.add(new Monster("slime",1, sbire_slime,"Slurp",1,3));
cards.add(new Monster("slime",1, sbire_slime,"Slurp",1,3));
cards.add(new Monster("slime",1, sbire_slime,"Slurp",1,3));
cards.add(new Monster("slime",1, sbire_slime,"Slurp",1,3));
cards.add(new Monster("slime",1, sbire_slime,"Slurp",1,3));
cards.add(new Spell("katon",2, spell_katon,"Inflige 2 point(s) de dégats", 2));
cards.add(new Spell("katon",2, spell_katon,"Inflige 2 point(s) de dégats", 2));
cards.add(new Spell("katon",2, spell_katon,"Inflige 2 point(s) de dégats", 2));
cards.add(new Spell("katon",2, spell_katon,"Inflige 2 point(s) de dégats", 2));
cards.add(new Spell("rasengan",4, spell_rasengan,"Inflige 2 points de dégats à tous les serviteurs adverses", 2));

}


public ArrayList<Card> getCards() {
return cards;
Expand All @@ -23,6 +62,16 @@ public void addCardToDeck(Card card) {
this.cards.add(card);
}

public boolean canAddCardToDeck(Card card) {
int cpt = 0;
for(Card myCard : this.cards) {
if(myCard.getName() == card.getName())
cpt++;
}
return (cpt<3)?true:false;

}


public void removeCardFromDeck(Card card) {
this.cards.remove(card);
Expand All @@ -38,6 +87,19 @@ public void setHero(Hero hero) {
public int get_NB_MAX_CARD() {
return _NB_MAX_CARD;
}

public int getNbCards() {
return this.cards.size();
}

public String getCardsToString() {
String res = "";
for( Card myCard : this.cards) {
res += " - "+myCard.getMana()+" | "+ myCard.getName()+"\n";
}
return res;
}



}
Loading

0 comments on commit e5bfe66

Please sign in to comment.