Commit 38b72637 authored by Theodore Lopez's avatar Theodore Lopez
parents 86f0f945 76db9885
...@@ -261,6 +261,17 @@ public abstract class AbstractEntity extends Thread { ...@@ -261,6 +261,17 @@ public abstract class AbstractEntity extends Thread {
} }
} }
public void waiting_move(){
Direction dir = this.relayer.getCharacter().getDirection();
double r = random();
if(r<0.8){
for(int i=0; i<1;i++) {
this.relayer.move(dir);
}
}
else{this.random_move();}
}
public void act() { public void act() {
} }
......
...@@ -39,7 +39,7 @@ public class BossEntity extends AbstractEntity { ...@@ -39,7 +39,7 @@ public class BossEntity extends AbstractEntity {
Entity victim = this.gameState.getAllEntities().get(victim_i); Entity victim = this.gameState.getAllEntities().get(victim_i);
/* d_min minimum distance to not run away /* d_min minimum distance to not run away
* dmax maximum distance to not get closer*/ * dmax maximum distance to not get closer*/
double d_min = 32*3; // tiles of length 32 : so 3 and 7 tiles double d_min = 32*5; // tiles of length 32 : so 5 and 14 tiles
double d_max = 32*14; double d_max = 32*14;
double d = Distance_to_victim(victim); double d = Distance_to_victim(victim);
if(d<d_min){ if(d<d_min){
...@@ -56,14 +56,7 @@ public class BossEntity extends AbstractEntity { ...@@ -56,14 +56,7 @@ public class BossEntity extends AbstractEntity {
} }
else{ else{
Direction dir = this.relayer.getCharacter().getDirection(); this.waiting_move();
double r = random();
if(r<0.8){
for(int i=0; i<1;i++) {
this.relayer.move(Direction.NONE);
}
}
else{this.random_move();}
} }
......
...@@ -52,17 +52,8 @@ public class StraightEntity extends AbstractEntity { ...@@ -52,17 +52,8 @@ public class StraightEntity extends AbstractEntity {
} }
} }
else{ else{
Direction d = this.relayer.getCharacter().getDirection(); this.waiting_move();
double r = random();
if(r<0.8){
for(int i=0; i<1;i++) {
this.relayer.move(d);
}
}
else{this.random_move();}
} }
// attack // attack
} }
} }
...@@ -43,7 +43,13 @@ public class GameContent implements Serializable{ ...@@ -43,7 +43,13 @@ public class GameContent implements Serializable{
for(Entity e:map.getEntities()){ for(Entity e:map.getEntities()){
gameState.addEntity(e); gameState.addEntity(e);
Relayer dmr = Relayers.addNewRelayer(e); Relayer dmr = Relayers.addNewRelayer(e);
AIControler.add(this,dmr, EnumBehaviourType.Boss); String name = dmr.getCharacter().getSpeciesName();
if(name.equals("Ronflex")){
AIControler.add(this,dmr, EnumBehaviourType.Boss);
}
else{
AIControler.add(this,dmr, EnumBehaviourType.Straight);
}
} }
} }
int posX=(map.getPositionPlayerStart().getI())*Point.TileScale; int posX=(map.getPositionPlayerStart().getI())*Point.TileScale;
......
Markdown is supported
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