Commit 8c92ab26 authored by Guillaume Hocquet's avatar Guillaume Hocquet
Browse files

Merge remote-tracking branch 'origin/master'

parents a8e65f76 cd147328
# Fichier contenant l'ensemble des species du jeu.
# Nombre de species total
3
4
#Ronflex - Character
C
......@@ -145,4 +145,51 @@ DARK
1
#abilityList
1
TEST_ATTACK_ABILITY
#--------------------------------------------------------------------
#Diagla - Character
C
#name
Diagla
#tilePropertyVector
2
SOLID
LIQUID
#collisionBox
R
15
15
#visilibity
R
200
200
#entityDisplayerType
DIAGLA
#triggers
0
#hitbox
R
10
10
#damageTypeVector
7
NEUTRAL
FIRE
ICE
THUNDER
WATER
LIGHT
DARK
#baseHP
10
#baseDef
1
#baseMental
1
#baseAtk
1
#baseIntel
1
#abilityList
1
TEST_ATTACK_ABILITY
\ No newline at end of file
package graphics.guiSkeleton.entityDisplayer;
import core.gamestate.Entity;
import graphics.guiSkeleton.entityDisplayer.entityDisplayerBank.ChatRoseEntityDisplayer;
import graphics.guiSkeleton.entityDisplayer.entityDisplayerBank.DiaglaEntityDisplayer;
import graphics.guiSkeleton.entityDisplayer.entityDisplayerBank.InvisibleEntityDisplayer;
import graphics.guiSkeleton.entityDisplayer.entityDisplayerBank.PonytaEntityDisplayer;
import graphics.guiSkeleton.entityDisplayer.entityDisplayerBank.RonflexEntityDisplayer;
import core.gamestate.Entity;
/**
* Created by dupriez on 25/11/15.
......@@ -33,6 +34,9 @@ public class EntityDisplayerProvider {
case PONYTA: {
return new PonytaEntityDisplayer(associatedEntity);
}
case DIAGLA: {
return new DiaglaEntityDisplayer(associatedEntity);
}
default: {
return new RonflexEntityDisplayer(associatedEntity);
}
......
......@@ -10,5 +10,6 @@ public enum EntityDisplayerType {
INVISIBLE,
RONFLEX,
CHATROSE,
PONYTA
PONYTA,
DIAGLA
}
package graphics.guiSkeleton.entityDisplayer.entityDisplayerBank;
import core.gamestate.Action;
import core.gamestate.Entity;
import graphics.graphical_utility.GraphicalBridgeConfiguration;
import graphics.guiSkeleton.entityDisplayer.EntityDisplayer;
import graphics.guiSkeleton.mapManagement.GraphicsMap;
import graphics.guiSkeleton.mapManagement.GraphicsMapPoint;
import graphics.guiSkeleton.mapManagement.PositionedSprite;
import graphics.guiSkeleton.sprites.Sprite;
import graphics.guiSkeleton.sprites.SpriteStorage;
/**
*
* @author Lucas Delcros
* Classe pour diagla (le boss) juste du copy-paste d'autres entits
*/
public class DiaglaEntityDisplayer extends EntityDisplayer{
private static final long serialVersionUID = 1L;
//The unique sprite of "Doty the Entity" (it is not animated)
int sprite_num; // le numéro d'image où on en est de l'animation
int sprite_height;
int sprite_width;
int nb_images[]=new int[Action.values().length];
final static int DEFAULT_SPRITE=1;
public DiaglaEntityDisplayer(Entity associatedEntity) {
super(associatedEntity);
sprite_num = 0;
sprite_height = 64;
sprite_width = 64;
nb_images[Action.WALK.ordinal()] = 2;
//QUickFix -Thomas
//0 -> 2
nb_images[Action.ATTACK.ordinal()] = /*0*/2;
nb_images[Action.HIT.ordinal()] = 2;
}
// TODO : change in action. Adaptation for multiaction.
@Override
public PositionedSprite getPositionedSprite(GraphicsMap graphicsMap) {
Sprite sprite = SpriteStorage.getInstance().getDiagla();
Entity entity = getAssociatedEntity();
GraphicsMapPoint entityPositionGraphicsMapPoint = GraphicalBridgeConfiguration.makeMapPointFromCoreCoordinates(entity.getX(), entity.getY());
//applying translation
GraphicsMapPoint spriteTopLeftGraphicsMapPoint = entityPositionGraphicsMapPoint.translate(- sprite_width/2, - sprite_height/2);
int direction = entity.getDirection().ordinal();
int x_sprite=0;
int y_sprite = direction * sprite_height;
int nbSprites=DEFAULT_SPRITE;
for(Action act : Action.values()){
if(entity.hasAction(act)){
nbSprites=nb_images[act.ordinal()];
break;
}
}
sprite_num=(sprite_num+1)%(10*nbSprites);
for(int u=0; u<nbSprites; u++) {
if (sprite_num < 10*u) x_sprite = x_sprite + sprite_width;
}
Sprite res = new Sprite((sprite.getSpriteImage()).getSubimage(x_sprite,y_sprite,sprite_height,sprite_width));
return PositionedSprite.PositionSprite(res, spriteTopLeftGraphicsMapPoint);
}
@Override
public char getTermSprite() {
return 'D';
}
}
......@@ -25,6 +25,7 @@ public class SpriteStorage {
healthBar1Container = new Sprite(ImageIO.read(UsedForLoadingSprites.getInstance().getClass().getResource("HealthBar1_Container.png")));
invisible = new Sprite(new BufferedImage(1,1,BufferedImage.TYPE_INT_ARGB));
ponyta = new Sprite(ImageIO.read(UsedForLoadingSprites.getInstance().getClass().getResource("ponyta.png")));
diagla = new Sprite(ImageIO.read(UsedForLoadingSprites.getInstance().getClass().getResource("diagla.png")));
} catch (IOException e) {
e.printStackTrace();
......@@ -37,6 +38,7 @@ public class SpriteStorage {
private Sprite ronflex;
private Sprite invisible;
private Sprite ponyta;
private Sprite diagla;
public Sprite getHealthBar1Container() {
return healthBar1Container;
......@@ -61,4 +63,8 @@ public class SpriteStorage {
public Sprite getPonyta() {
return ponyta;
}
public Sprite getDiagla(){
return diagla;
}
}
......@@ -93,6 +93,7 @@ public final class RoomBuilder {
break;
case END:
addStairs(map, mapB);
mapB.addEntity(SpeciesArray.create(((surface.j1+surface.j2)/2)*Point.TileScale,((surface.i1+surface.i2)/2)*Point.TileScale,100,"Diagla","Monster "+mapB.getMaxEntities()+1));
break;
case TORCHES:
addTorches(map);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment