Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #206 from JonasKaad/final-demo-branch
Browse files Browse the repository at this point in the history
Small bug fixes to game
  • Loading branch information
JonasKaad authored May 16, 2022
2 parents 800e356 + d120529 commit f115775
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ private boolean getUseAlphaBetaPruning() {
return defaultUseAlphaBetaPruning;
}
Object abObj = settings.getSetting(SettingsRegistry.getInstance().getAIAlphaBetaSetting());
if (!(abObj instanceof Integer)) {
return defaultUseAlphaBetaPruning;
}
return (boolean) abObj;
}

Expand Down
48 changes: 24 additions & 24 deletions Map/src/main/resources/maps/ForestOverworld.tmx
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,33 @@
63,1,1,1,1,1,1,13,1,199,102,212,102,102,102,102,102,102,102,199,202,199,199,186,187,199,96,96,96,96,96,96,96,96,96,96,33,96,96,22,11,11,24,96,33,96,1,27,1,1,1,37,70,71,72,33,1,37,1,1,96,1,1,61,
63,1,1,96,1,1,1,3,1,199,102,102,102,102,102,102,102,102,102,102,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,48,96,96,33,96,96,34,11,48,96,1,1,1,1,27,1,82,83,84,33,91,92,1,96,1,1,1,61,
63,1,1,1,1,1,1,1,1,199,102,102,102,102,102,102,212,102,102,199,1,200,1,200,1,200,96,96,96,96,96,96,96,96,96,96,96,96,96,33,96,22,48,96,96,1,1,1,1,1,1,1,96,1,1,33,103,104,1,96,1,1,1,61,
63,1,1,1,1,1,96,1,1,1,199,102,212,102,102,102,102,102,199,25,200,201,200,1,201,1,1,1,1,1,1,1,1,1,1,3,96,22,11,48,96,33,96,1,1,1,1,1,1,1,2,1,96,1,1,33,1,1,179,179,179,180,1,61,
63,1,1,1,1,3,1,1,1,1,1,199,102,102,102,102,212,199,1,1,1,1,1,200,1,1,1,1,1,1,1,1,1,1,1,3,96,33,96,96,96,33,96,1,1,1,1,37,1,1,1,3,1,91,92,33,25,243,1,179,179,180,1,61,
63,1,1,1,1,1,1,1,1,1,1,1,199,199,199,199,199,1,1,1,1,1,1,1,1,1,1,1,13,1,1,38,1,1,1,3,96,33,96,96,96,45,96,1,3,1,2,1,1,1,1,1,1,103,104,33,1,1,243,1,166,167,168,61,
63,1,1,1,1,1,96,1,1,1,199,102,212,102,102,102,102,102,199,25,200,201,200,1,201,1,1,1,1,1,1,1,1,1,1,3,96,22,11,48,96,33,96,1,1,1,58,59,60,1,2,1,96,1,1,33,1,1,179,179,179,180,1,61,
63,1,1,1,1,3,1,1,1,1,1,199,102,102,102,102,212,199,1,1,1,1,1,200,1,1,1,1,1,1,1,1,1,1,1,3,96,33,96,96,96,33,96,1,1,1,70,71,72,1,1,3,1,91,92,33,25,243,1,179,179,180,1,61,
63,1,1,1,1,1,1,1,1,1,1,1,199,199,199,199,199,1,1,1,1,1,1,1,1,1,1,1,13,1,1,38,1,1,1,3,96,33,96,96,96,45,96,1,3,1,82,83,84,1,1,1,1,103,104,33,1,1,243,1,166,167,168,61,
63,96,96,3,1,1,1,96,27,108,1,1,1,1,2,1,1,3,13,1,1,58,59,60,1,1,13,1,1,1,1,1,25,1,1,1,96,33,96,1,55,56,57,1,1,1,1,1,55,56,56,56,57,1,25,33,1,25,55,56,56,56,57,61,
63,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,15,1,1,70,71,72,1,25,1,13,1,25,1,1,1,1,1,1,55,87,57,37,67,96,69,1,1,1,1,1,67,52,53,54,69,1,1,33,1,1,67,52,53,54,69,61,
63,1,1,3,1,25,1,1,1,96,1,1,108,1,1,25,1,1,1,1,1,82,83,84,1,1,1,1,58,59,60,1,1,1,108,1,67,1,69,27,79,80,81,13,1,1,3,1,67,64,65,66,69,1,1,33,1,3,67,64,65,66,69,61,
63,1,1,2,1,1,1,37,1,1,108,1,1,1,1,58,59,60,1,1,1,1,58,59,60,1,1,1,70,71,72,1,1,1,1,1,79,80,81,1,2,25,1,3,1,1,1,1,67,76,77,78,69,1,1,33,1,1,67,76,77,78,69,61,
63,1,1,1,37,96,1,1,1,1,96,1,1,1,1,70,71,72,1,1,1,1,70,71,72,1,1,1,82,83,84,1,1,1,1,1,1,13,1,38,1,1,1,1,1,1,1,1,96,1,17,1,81,1,1,45,1,13,79,1,17,1,81,61,
63,1,1,1,1,1,1,1,1,1,1,108,1,1,1,82,83,84,1,1,1,1,82,83,84,1,1,2,1,1,1,1,13,1,1,14,14,1,1,1,1,1,1,1,1,1,58,59,60,1,42,7,7,7,7,31,7,7,7,7,44,1,1,61,
63,1,1,1,1,1,1,1,25,96,1,1,1,1,1,1,13,1,1,15,1,1,1,1,1,58,59,60,1,1,58,59,60,1,39,1,14,14,39,39,1,1,1,13,1,1,70,71,72,1,1,1,1,1,1,41,1,3,1,1,1,1,96,61,
63,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,25,1,1,1,1,1,70,71,72,1,1,70,71,72,1,1,1,39,39,39,14,1,1,1,1,1,1,82,83,84,90,90,90,90,90,90,90,90,90,90,90,90,90,1,61,
63,1,1,37,1,1,1,1,1,1,1,1,1,1,25,1,2,1,58,59,60,1,1,1,1,82,83,84,25,1,82,83,84,1,1,1,1,1,1,14,14,1,37,1,1,1,1,1,96,90,136,136,136,136,136,136,136,136,136,136,136,90,96,61,
63,3,1,1,1,1,1,1,1,37,1,1,1,1,1,1,1,1,70,71,72,1,58,59,60,1,1,1,1,3,1,1,1,1,58,59,60,1,1,1,1,1,1,1,1,1,1,1,96,90,136,124,125,125,124,124,124,125,124,124,136,90,1,61,
63,1,1,1,1,96,3,1,1,1,1,1,1,2,1,1,1,14,82,83,84,1,70,71,72,1,1,1,1,1,58,59,60,1,70,71,72,1,2,1,25,1,1,1,1,25,1,1,96,90,136,124,112,112,112,112,113,112,112,124,136,90,96,61,
63,1,1,1,1,1,1,1,1,1,1,2,1,3,1,1,1,1,1,1,1,1,82,83,84,1,25,1,1,1,70,71,72,1,82,83,84,1,1,1,1,1,1,1,1,13,1,37,96,90,136,125,112,113,113,112,88,89,112,125,136,90,1,61,
63,3,1,1,1,1,1,1,1,1,1,1,25,1,1,1,1,1,1,1,1,1,1,1,1,1,58,59,60,1,82,83,84,1,1,1,1,25,1,1,1,1,38,1,1,1,1,1,96,90,136,125,112,88,89,112,100,101,112,125,136,90,96,61,
63,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,3,1,1,1,1,1,1,70,71,72,25,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,96,90,136,124,112,100,101,112,113,112,112,124,136,90,1,61,
63,38,1,1,1,1,1,1,1,1,1,15,1,1,1,1,25,1,13,1,1,58,59,60,37,1,82,83,84,1,1,1,2,1,1,13,1,1,1,1,39,1,1,1,1,1,1,2,96,90,136,124,112,113,113,112,112,112,112,124,136,90,96,61,
63,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,70,71,72,1,1,1,1,1,1,1,1,1,1,1,38,1,1,1,1,1,1,1,2,38,38,1,1,96,90,136,124,124,124,124,124,124,124,124,124,136,90,1,61,
63,1,1,1,1,1,1,1,1,1,1,1,25,1,1,1,1,1,1,1,1,82,83,84,1,1,1,1,1,1,1,2,1,1,1,1,1,1,25,1,14,1,1,39,1,1,1,1,96,90,136,136,136,136,136,136,136,136,136,136,136,90,96,61,
63,1,1,37,1,1,1,1,37,1,1,1,1,1,1,1,1,1,1,1,1,1,38,1,55,56,56,56,57,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,96,90,90,90,90,90,90,90,90,90,90,90,90,90,1,61,
63,1,1,1,1,1,13,1,1,1,1,1,1,37,1,1,1,1,2,3,1,1,1,1,67,1,1,1,69,1,1,25,1,1,25,1,3,1,37,1,39,1,1,1,1,1,14,1,96,1,1,1,1,1,1,17,1,1,1,1,1,1,96,61,
63,1,1,27,1,1,1,1,1,1,1,25,1,1,25,1,55,56,57,13,1,1,1,1,67,1,39,1,69,1,2,1,1,1,1,1,1,1,13,1,1,1,1,13,1,1,1,1,96,37,211,1,3,1,1,21,1,1,1,211,1,1,25,61,
63,1,1,37,1,1,37,1,1,1,1,1,1,1,1,1,67,1,69,1,1,25,3,1,67,1,1,1,69,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,55,56,56,56,56,56,56,57,1,3,33,1,3,1,1,1,211,1,61,
63,178,179,179,179,179,179,178,167,168,1,1,58,59,60,96,79,99,81,220,219,219,219,219,79,80,140,80,81,1,2,37,1,1,1,1,1,1,13,1,1,1,1,1,1,67,157,158,159,160,1,1,103,56,56,87,56,56,56,56,56,57,96,61,
63,1,1,157,158,159,160,1,25,55,56,57,70,71,72,1,1,29,1,1,1,1,1,1,1,1,1,1,96,1,1,1,1,1,55,56,57,1,2,1,37,1,1,1,1,67,169,170,171,172,1,39,1,1,1,45,1,1,1,25,1,103,57,61,
63,96,96,169,170,171,172,211,211,67,1,69,82,83,84,1,1,29,1,1,1,1,1,1,1,1,1,2,96,96,96,96,1,1,67,1,69,1,1,1,1,1,1,1,1,67,181,182,183,184,1,1,1,1,1,29,39,1,108,1,1,25,103,61,
63,1,1,1,58,59,60,1,1,1,1,108,1,1,1,82,83,84,1,1,1,1,82,83,84,1,1,2,1,1,1,1,13,1,1,14,14,1,1,1,1,1,58,59,60,1,58,59,60,1,42,7,7,7,7,31,7,7,7,7,44,1,1,61,
63,1,1,1,70,71,72,1,25,96,58,59,60,1,1,1,13,1,1,15,1,1,1,1,1,58,59,60,1,1,58,59,60,1,39,1,14,14,39,39,1,1,70,71,72,1,70,71,72,1,1,1,1,1,1,41,1,3,1,1,1,1,96,61,
63,1,1,1,82,83,84,1,1,1,70,71,72,1,1,1,1,1,1,25,1,1,1,1,1,70,71,72,1,1,70,71,72,1,1,1,39,39,39,14,1,1,82,83,84,1,82,83,84,90,90,90,90,90,90,90,90,90,90,90,90,90,1,61,
63,1,1,37,1,1,1,1,1,1,82,83,84,1,58,59,60,1,58,59,60,1,1,1,1,82,83,84,25,1,82,83,84,1,1,1,1,1,1,14,14,1,37,1,1,1,1,1,96,90,136,136,136,136,136,136,136,136,136,136,136,90,96,61,
63,3,1,1,1,1,1,1,1,37,1,1,1,1,70,71,72,1,70,71,72,1,58,59,60,1,1,1,1,3,1,1,1,1,58,59,60,1,1,1,1,58,59,60,1,1,1,1,96,90,136,124,125,125,124,124,124,125,124,124,136,90,1,61,
63,58,59,60,1,96,3,1,1,58,59,60,1,2,82,83,84,14,82,83,84,1,70,71,72,1,1,1,1,1,58,59,60,1,70,71,72,1,2,1,25,70,71,72,1,25,1,1,96,90,136,124,112,112,112,112,113,112,112,124,136,90,96,61,
63,70,71,72,1,1,1,1,1,70,71,72,1,3,1,1,1,1,1,1,1,1,82,83,84,1,25,1,1,1,70,71,72,1,82,83,84,1,1,1,1,82,83,84,1,13,1,37,96,90,136,125,112,113,113,112,88,89,112,125,136,90,1,61,
63,82,83,84,1,1,1,1,1,82,83,84,25,1,1,58,59,60,1,1,1,1,1,1,1,1,58,59,60,1,82,83,84,1,1,1,1,25,1,1,1,1,38,1,1,1,1,1,96,90,136,125,112,88,89,112,100,101,112,125,136,90,96,61,
63,1,1,1,1,58,59,60,1,1,1,58,59,60,1,70,71,72,1,3,1,1,1,1,1,1,70,71,72,25,1,1,1,1,2,1,1,58,59,60,2,1,1,1,1,1,1,1,96,90,136,124,112,100,101,112,113,112,112,124,136,90,1,61,
63,38,1,1,1,70,71,72,1,1,1,70,71,72,1,82,83,84,13,1,1,58,59,60,37,1,82,83,84,1,1,1,2,1,1,13,1,70,71,72,39,1,1,1,1,1,1,2,96,90,136,124,112,113,113,112,112,112,112,124,136,90,96,61,
63,1,1,2,1,82,83,84,1,1,1,82,83,84,1,1,1,1,2,1,1,70,71,72,1,1,1,1,1,1,1,58,59,60,1,38,1,82,83,84,1,1,1,2,38,38,1,1,96,90,136,124,124,124,124,124,124,124,124,124,136,90,1,61,
63,58,59,60,1,1,1,1,1,1,1,1,25,1,1,1,1,1,58,59,60,82,83,84,1,1,1,1,1,1,1,70,71,72,1,1,1,1,25,1,14,1,1,39,1,1,1,1,96,90,136,136,136,136,136,136,136,136,136,136,136,90,96,61,
63,70,71,72,1,1,1,1,37,1,58,59,60,1,1,1,1,1,70,71,72,1,38,1,55,56,56,56,57,1,1,82,83,84,1,1,1,58,59,60,1,1,1,1,1,1,1,1,96,90,90,90,90,90,90,90,90,90,90,90,90,90,1,61,
63,82,83,84,1,1,13,1,1,1,70,71,72,37,1,1,1,1,82,83,84,1,1,1,67,1,1,1,69,1,1,25,1,1,25,1,3,70,71,72,39,1,1,1,1,1,14,1,96,1,1,1,1,1,1,17,1,1,1,1,1,1,96,61,
63,1,1,27,1,1,1,1,1,1,82,83,84,1,25,1,55,56,57,13,1,1,1,1,67,1,39,1,69,1,2,58,59,60,1,1,1,82,83,84,1,58,59,60,1,1,1,1,96,37,211,1,3,1,1,21,1,1,1,211,1,1,25,61,
63,1,1,37,1,1,37,1,1,1,1,1,1,1,1,1,67,1,69,1,1,25,3,1,67,1,1,1,69,1,1,70,71,72,1,1,1,1,1,1,1,70,71,72,1,55,56,56,56,56,56,56,57,1,3,33,1,3,1,1,1,211,1,61,
63,178,179,179,179,179,179,178,167,168,1,1,58,59,60,96,79,99,81,220,219,219,219,219,79,80,140,80,81,1,2,82,83,84,1,1,1,1,13,1,1,82,83,84,1,67,157,158,159,160,1,1,103,56,56,87,56,56,56,56,56,57,96,61,
63,1,1,157,158,159,160,1,1,55,56,57,70,71,72,1,1,29,1,1,1,1,1,1,1,1,1,1,96,1,1,1,1,1,55,56,57,1,2,1,37,1,1,1,1,67,169,170,171,172,1,39,1,1,1,45,1,1,1,25,1,103,57,61,
63,96,96,169,170,171,172,1,1,67,1,69,82,83,84,1,1,29,1,1,1,1,1,1,1,1,1,2,96,96,96,96,1,1,67,1,69,1,1,1,1,1,1,1,1,67,181,182,183,184,1,1,1,1,1,29,39,1,108,1,1,25,103,61,
63,96,96,181,182,183,184,1,26,79,80,81,1,2,1,1,1,29,37,1,1,1,1,1,1,2,1,96,28,28,16,16,96,1,79,99,81,116,49,50,50,50,50,50,51,67,1,1,42,7,7,8,1,1,1,21,1,1,1,1,1,1,1,61,
63,1,1,1,1,29,1,38,1,1,1,1,1,96,1,1,1,29,1,1,37,188,189,1,1,1,96,40,40,28,40,40,16,96,37,29,1,1,61,85,86,62,62,62,63,79,80,80,80,80,80,80,80,80,80,99,80,80,80,80,80,80,80,61,
63,58,59,60,1,29,1,25,1,25,241,3,1,1,1,242,1,29,1,1,1,1,1,188,189,96,16,28,28,40,40,40,16,28,96,29,1,25,61,97,98,62,62,62,63,1,1,1,1,1,1,1,13,1,15,33,2,1,1,1,1,1,1,61,
Expand All @@ -54,7 +54,7 @@
63,1,1,1,1,1,1,14,26,14,1,1,1,1,1,1,1,29,1,1,1,25,1,58,59,60,96,28,28,40,28,28,16,96,1,29,13,1,61,62,62,62,85,86,63,1,1,1,1,1,25,1,1,1,1,1,1,1,211,1,1,1,1,61,
63,1,1,1,1,1,2,3,1,3,1,1,1,1,1,1,1,29,1,1,1,1,1,70,71,72,1,96,40,40,16,16,96,2,55,87,57,1,61,62,62,62,97,98,63,1,211,1,1,1,1,1,1,2,1,1,3,1,1,1,1,1,1,61,
63,1,37,1,1,1,1,1,2,2,96,1,1,1,3,27,1,29,1,55,56,57,96,82,83,84,2,1,96,96,96,96,1,1,67,1,69,116,73,74,74,74,74,74,75,1,1,1,3,1,1,1,1,1,1,2,1,1,1,1,1,1,13,61,
63,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,14,29,1,67,1,69,96,96,1,1,1,1,1,1,1,1,1,1,79,80,81,1,13,1,1,1,1,1,1,49,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,51,61,
63,58,59,59,59,59,59,59,59,59,59,59,59,59,59,60,14,29,1,67,1,69,96,96,1,1,1,1,1,1,1,1,1,1,79,80,81,1,13,1,1,1,1,1,1,49,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,51,61,
63,70,71,71,71,71,71,71,71,71,71,71,71,71,71,72,55,87,57,79,80,81,1,1,1,39,1,1,1,1,13,1,1,1,1,1,26,1,1,1,1,1,1,1,1,61,62,62,62,62,62,62,62,62,62,62,85,86,62,62,62,62,63,61,
63,70,71,71,71,71,71,71,71,71,71,71,71,71,71,72,67,1,69,1,1,1,2,1,1,1,1,1,1,1,1,1,1,13,1,1,1,1,1,1,1,37,1,1,1,61,85,86,62,62,62,62,85,86,62,62,97,98,62,62,62,62,63,61,
63,70,71,71,71,71,71,71,71,71,71,71,71,71,71,72,79,80,81,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,61,97,98,62,85,86,62,97,98,62,85,86,62,62,62,85,86,63,61,
Expand Down Expand Up @@ -122,7 +122,7 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,198,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,198,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,58,59,59,59,59,59,59,59,59,59,59,59,59,59,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,70,0,0,0,0,0,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,70,0,0,0,0,0,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,70,0,0,0,0,0,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public void start(GameData gameData, World world) {
ArrayList<IMonster> monstersInSecretVending = new ArrayList<>();
monstersInSecretVending.add(monsterRegistry.getMonster(3 % monsterRegistry.getMonsterAmount()));
Entity secretVendingMachine = createVendingMachine(gameData, 37, 21, monstersInSecretVending);
Entity healingMachine4 = createHealingMachine(gameData, 22, 15);

world.addEntity(vendingMachine1);
world.addEntity(healingMachine1);
Expand All @@ -59,6 +60,7 @@ public void start(GameData gameData, World world) {
world.addEntity(vendingMachine3);
world.addEntity(healingMachine3);
world.addEntity(secretVendingMachine);
world.addEntity(healingMachine4);

entities.add(vendingMachine1);
entities.add(healingMachine1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ public void process(GameData gameData, World world) {
entityPart.process(gameData, world, npc);
}

updateShape(npc, current);
updateShape(npc);
}
}

private void updateShape(Entity entity, String current) {
private void updateShape(Entity entity) {

PositionPart positionPart = entity.getPart(PositionPart.class);
float x = positionPart.getX();
Expand Down
27 changes: 23 additions & 4 deletions NPC/src/main/java/dk/sdu/mmmi/modulemon/NPC/NPCPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public class NPCPlugin implements IGamePluginService{

List<Entity> npcs;
IMonsterRegistry monsterRegistry;
int[] team0 = new int[]{0, 2};
int[] team1 = new int[]{3, 4, 5};
int[] team2 = new int[]{3, 2, 4, 5, 1};

@Override
public void start(GameData gameData, World world) {
Expand Down Expand Up @@ -83,9 +86,9 @@ private void createNPCs() {


if(monsterRegistry != null) {
addMonsterTeam(npcs.get(0), new int[]{0, 2});
addMonsterTeam(npcs.get(1), new int[]{3, 4, 5});
addMonsterTeam(npcs.get(2), new int[]{3, 2, 4, 5, 1});
addMonsterTeam(npcs.get(0), team0);
addMonsterTeam(npcs.get(1), team1);
addMonsterTeam(npcs.get(2), team2);
}
}
public void addMonsterTeam(Entity entity, int[] ints) {
Expand All @@ -96,6 +99,22 @@ public void addMonsterTeam(Entity entity, int[] ints) {
entity.add(new MonsterTeamPart(monsterList));
}

public int[] getTeam(String team){
int[] real_team = new int[]{0};
switch (team) {
case "team0":
real_team = team0;
break;
case "team1":
real_team = team1;
break;
case "team2":
real_team = team2;
break;
}
return real_team;
}

@Override
public void stop(GameData gameData, World world) {
System.out.println("NPCPlugin stop");
Expand All @@ -110,7 +129,7 @@ public void setMonsterRegistryService(IMonsterRegistry monsterRegistry) {
this.monsterRegistry = monsterRegistry;
if (npcs != null) {
for (int i = 0; i < npcs.size(); i++) {
addMonsterTeam(npcs.get(i), new int[]{i});
addMonsterTeam(npcs.get(i), getTeam("team" + i));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

public class PlayerControlSystem implements IEntityProcessingService {

String current = "up";
String current = "down";

@Override
public void process(GameData gameData, World world) {
Expand Down

0 comments on commit f115775

Please sign in to comment.