(quest: Quest, pos: Pos)
| 3 | class JellyFish extends QuestEntity{ |
| 4 | // Constructor |
| 5 | constructor(quest: Quest, pos: Pos){ |
| 6 | super(quest, |
| 7 | pos, |
| 8 | new Naming("A jellyfish", "a jellyfish"), |
| 9 | new RenderArea(6, 5), |
| 10 | new Pos(0, 0), |
| 11 | new CollisionBoxCollection(new CollisionBox(this, new Pos(0, 1), new Pos(6, 1)), |
| 12 | new CollisionBox(this, new Pos(1, 2), new Pos(4, 1)), |
| 13 | new CollisionBox(this, new Pos(0, 3), new Pos(4, 1)), |
| 14 | new CollisionBox(this, new Pos(1, 4), new Pos(4, 1)) |
| 15 | ), |
| 16 | new QuestEntityMovement(new Pos(-1, 0)) |
| 17 | ); |
| 18 | |
| 19 | // Set destructible |
| 20 | this.setDestructible(true); |
| 21 | this.setMaxHp(42); |
| 22 | this.setHp(42); |
| 23 | |
| 24 | // Set the ascii art |
| 25 | this.getRenderArea().drawArray(Database.getAscii("places/quests/theSea/jellyFish")); |
| 26 | |
| 27 | // Set the transparency |
| 28 | this.setTransparency(new RenderTransparency(" ", "%")); |
| 29 | |
| 30 | // Set the weapon and its delay |
| 31 | this.addQuestEntityWeapon(new QuestEntityWeapon(this.getQuest(), this, new Naming("Poisoned tentacles", "poisoned tentacles"), new CollisionBoxCollection(new CollisionBox(this, new Pos(-1, -1), new Pos(8, 7))), 2)); |
| 32 | this.getLastQuestEntityWeapon().getCloseCombatDelay().setFixedDelay(0); |
| 33 | } |
| 34 | |
| 35 | // Public methods |
| 36 | public update(): void{ |
nothing calls this directly
no test coverage detected