Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
the_dungeon_project
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
genie_logiciel_2015
the_dungeon_project
Commits
38b72637
Commit
38b72637
authored
Jan 06, 2016
by
Theodore Lopez
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gitlab.crans.org/genie_logiciel_2015/the_dungeon_project
parents
86f0f945
76db9885
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
20 deletions
+21
-20
src/artificial_intelligence/AIEntities/AbstractEntity.java
src/artificial_intelligence/AIEntities/AbstractEntity.java
+11
-0
src/artificial_intelligence/AIEntities/BossEntity.java
src/artificial_intelligence/AIEntities/BossEntity.java
+2
-9
src/artificial_intelligence/AIEntities/StraightEntity.java
src/artificial_intelligence/AIEntities/StraightEntity.java
+1
-10
src/core/gamestate/GameContent.java
src/core/gamestate/GameContent.java
+7
-1
No files found.
src/artificial_intelligence/AIEntities/AbstractEntity.java
View file @
38b72637
...
...
@@ -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
()
{
}
...
...
src/artificial_intelligence/AIEntities/BossEntity.java
View file @
38b72637
...
...
@@ -39,7 +39,7 @@ public class BossEntity extends AbstractEntity {
Entity
victim
=
this
.
gameState
.
getAllEntities
().
get
(
victim_i
);
/* d_min minimum distance to not run away
* 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
=
Distance_to_victim
(
victim
);
if
(
d
<
d_min
){
...
...
@@ -56,14 +56,7 @@ public class BossEntity extends AbstractEntity {
}
else
{
Direction
dir
=
this
.
relayer
.
getCharacter
().
getDirection
();
double
r
=
random
();
if
(
r
<
0.8
){
for
(
int
i
=
0
;
i
<
1
;
i
++)
{
this
.
relayer
.
move
(
Direction
.
NONE
);
}
}
else
{
this
.
random_move
();}
this
.
waiting_move
();
}
...
...
src/artificial_intelligence/AIEntities/StraightEntity.java
View file @
38b72637
...
...
@@ -52,17 +52,8 @@ public class StraightEntity extends AbstractEntity {
}
}
else
{
Direction
d
=
this
.
relayer
.
getCharacter
().
getDirection
();
double
r
=
random
();
if
(
r
<
0.8
){
for
(
int
i
=
0
;
i
<
1
;
i
++)
{
this
.
relayer
.
move
(
d
);
}
this
.
waiting_move
();
}
else
{
this
.
random_move
();}
}
// attack
}
}
src/core/gamestate/GameContent.java
View file @
38b72637
...
...
@@ -43,8 +43,14 @@ public class GameContent implements Serializable{
for
(
Entity
e:
map
.
getEntities
()){
gameState
.
addEntity
(
e
);
Relayer
dmr
=
Relayers
.
addNewRelayer
(
e
);
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
posY
=(
map
.
getPositionPlayerStart
().
getJ
())*
Point
.
TileScale
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment