-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
29 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 1 addition & 23 deletions
24
src/main/java/ru/itmo/roguelike/characters/mobs/strategy/BossBehavior.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,5 @@ | ||
package ru.itmo.roguelike.characters.mobs.strategy; | ||
|
||
import ru.itmo.roguelike.field.Field; | ||
import ru.itmo.roguelike.utils.IntCoordinate; | ||
public class BossBehavior extends AggressiveBehavior { | ||
|
||
public class BossBehavior extends MobWithTarget { | ||
private final Field field; | ||
|
||
public BossBehavior(Field field) { | ||
this.field = field; | ||
} | ||
|
||
@Override | ||
public IntCoordinate getPath() { | ||
if (target == null) { | ||
return IntCoordinate.getZeroPosition(); | ||
} | ||
|
||
final IntCoordinate diff = new IntCoordinate(target.getPosition()); | ||
diff.substract(self.getPosition()); | ||
if (diff.lenL2() < self.getRadius()) { | ||
return diff.signum(); | ||
} | ||
|
||
return IntCoordinate.getZeroPosition(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters