Skip to content

Commit

Permalink
Merge pull request #5 from JavaSTMN/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
David Molinari authored Nov 19, 2018
2 parents 3153777 + 9a934c3 commit e3cfea3
Show file tree
Hide file tree
Showing 24 changed files with 222 additions and 75 deletions.
Binary file added assets/img/Cards/Heroes/Gloria.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/LSD.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/Spells/Cafe.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/Spells/Katon.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/Spells/Multi-Clonage.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/Spells/Raiton.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/Spells/rasengan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/img/Cards/Spells/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions src/core/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
/Hand.class
/Hero.class
/Player.class
/Mana.class
15 changes: 3 additions & 12 deletions src/core/Card.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@

public abstract class Card {
private String name;
private String description;
private int mana;
private Image image;
private String effect;



public Card(String name, String description, int mana, Image image, String effect) {
public Card(String name, int mana, Image image, String effect) {
this.name = name;
this.description = description;
this.mana = mana;
this.image = image;
this.effect = effect;
Expand All @@ -31,13 +29,6 @@ public String getEffect() {
return this.effect;
}

/**
*
* @return
*/
public String getDescription() {
return this.description;
}
/**
*
* @return
Expand All @@ -51,14 +42,14 @@ public void action() {
/**
* @return
*/
public Image getImgPath() {
public Image getImg() {
return this.image;
}
/**
*
* @param imgPath
*/
public void setImgPath(Image image) {
public void setImg(Image image) {
this.image = image;
}

Expand Down
38 changes: 9 additions & 29 deletions src/core/Deck.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,17 @@

public class Deck {

private String label;
private String heroType;
private Hero hero;
private final int _NB_MAX_CARD = 10 ;
private ArrayList<Card> cards;


public ArrayList<Card> getCards() {
return cards;
}
public void setCards(ArrayList<Card> cards) {
this.cards = cards;
}


/**
*
* @param label
* @param heroType
* @param nb
* @param cards
*/
public Deck(String label, String heroType, int nb, ArrayList<Card> cards) {
this.label = label;
this.heroType = heroType;
this.cards = cards;

}


/**
* @param deck
* @param card
Expand All @@ -43,17 +27,13 @@ public void addCardToDeck(Card card) {
public void removeCardFromDeck(Card card) {
this.cards.remove(card);
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getHeroType() {
return heroType;

public Hero getHero() {
return hero;
}
public void setHeroType(String heroType) {
this.heroType = heroType;

public void setHero(Hero hero) {
this.hero = hero;
}
public int get_NB_MAX_CARD() {
return _NB_MAX_CARD;
Expand Down
23 changes: 22 additions & 1 deletion src/core/GameManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ public class GameManager {
private Player playerOne;
private Player playerTwo;

public GameManager(Player playerOne, Player playerTwo) {
this.playerOne = playerOne;
this.playerTwo = playerTwo;
}


public void startGame() {
//TODO hah
System.out.println(playerOne.toString());
System.out.println(playerTwo.toString());
}

public void endGame() {
Expand All @@ -19,4 +24,20 @@ public void endRound() {
//TODO
}

public Player getPlayerOne() {
return playerOne;
}

public void setPlayerOne(Player playerOne) {
this.playerOne = playerOne;
}

public Player getPlayerTwo() {
return playerTwo;
}

public void setPlayerTwo(Player playerTwo) {
this.playerTwo = playerTwo;
}

}
21 changes: 17 additions & 4 deletions src/core/Hand.java
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
package core;

import java.util.ArrayList;
import java.util.Collections;

public class Hand {

private int maxCard;
private ArrayList<Card> cards;

public Hand() {
public Hand(ArrayList<Card> cards) {
this.cards = cards;
}
public void shuffleCards(ArrayList<Card> cards) {
//TODO Shuffle ArrayList
public void shuffleCards() {
Collections.shuffle(this.cards);
}

public void displayCard(Card card) {
//TODO Display a card, meh
// Afficher la carte dans la main

}

public void moveCard(Card card) {
//TODO Move a specific card, meh
}
public int getMaxCard() {
return maxCard;
}
public void setMaxCard(int maxCard) {
this.maxCard = maxCard;
}
public ArrayList<Card> getCards() {
return cards;
}
public void setCards(ArrayList<Card> cards) {
this.cards = cards;
}

}
25 changes: 20 additions & 5 deletions src/core/Hero.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public class Hero {
public static int _NB_MAX_HP = 20;

public Hero(String name, Image img) {
this.name = name;
this.hp = _NB_MAX_HP;
this.setName(name);
this.setHp(_NB_MAX_HP);
this.img = img;
}

Expand All @@ -20,15 +20,30 @@ public Image getImage() {
}

public void die() {
// TODO
}

public void gainHp(int hp) {
this.hp += hp;
this.setHp(this.getHp() + hp);
}

public void loseHp(int hp) {
this.hp -= hp;
this.setHp(this.getHp() - hp);
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public int getHp() {
return hp;
}

public void setHp(int hp) {
this.hp = hp;
}

}
6 changes: 3 additions & 3 deletions src/core/Mana.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package core;

public class Mana {
private int _MAX_CRYSTALS;
private int _MAX_MANA;
private int manaTurn;
private int manaMaxByTurn;

public Mana(int init) {
this._MAX_CRYSTALS = 10;
this._MAX_MANA = 10;
this.manaTurn = init;
this.manaMaxByTurn = init;
}

//Fonction qui ajoute du mana a chaque tour
public void addManaTurn(int number) {
this.manaMaxByTurn = this.manaMaxByTurn + number;
this.manaMaxByTurn = (this.manaMaxByTurn >= _MAX_CRYSTALS)?_MAX_CRYSTALS:this.manaMaxByTurn;
this.manaMaxByTurn = (this.manaMaxByTurn >= _MAX_MANA)?_MAX_MANA:this.manaMaxByTurn;
}

//Fonction qui enleve les cristaux
Expand Down
27 changes: 24 additions & 3 deletions src/core/Monster.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
import java.awt.Image;

public class Monster extends Card implements ICard, IAttackingCard{


private int hp;
private int damage;

public Monster(String name, String description, int mana, Image image, String effect) {
super(name, description, mana, image, effect);
// TODO Auto-generated constructor stub
public Monster(String name, int mana, Image image, String effect, int damage, int hp) {
super(name, mana, image, effect);
this.hp = hp;
this.damage = damage;
}

public void action() {
Expand All @@ -31,6 +36,22 @@ public void attack(Card card) {

}

public void removeHP(int number) {
this.hp -= number;
}

public void addHP(int number) {
this.hp += number;
}

public void removeAttack(int number) {
this.damage -= number;
}

public void addAttack(int number) {
this.damage += number;
}




Expand Down
1 change: 1 addition & 0 deletions src/core/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ public Hero getHero() {
public void setHero(Hero hero) {
this.hero = hero;
}

}
4 changes: 2 additions & 2 deletions src/core/Spell.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

public class Spell extends Card implements ICard, IAttackingCard {

public Spell(String name, String description, int mana, Image image, String effect) {
super(name, description, mana, image, effect);
public Spell(String name, int mana, Image image, String effect) {
super(name, mana, image, effect);
// TODO Auto-generated constructor stub
}

Expand Down
2 changes: 2 additions & 0 deletions src/ihm/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
/JPersoButton.class
/CreateDeck$3.class
/CreateDeck$4.class
/CreateDeck$5.class
/CreateDeck$6.class
Loading

0 comments on commit e3cfea3

Please sign in to comment.