()
| 43 | |
| 44 | // Private methods |
| 45 | private castWaterBall(): void{ |
| 46 | // Create the waterBall |
| 47 | var waterBall: Fireball = new Fireball(this.getQuest(), |
| 48 | this.getGlobalPosition().plus(new Pos(-2, this.getYCastingOffset())), |
| 49 | new Naming("A magical water ball", "a magical water ball"), |
| 50 | new Color(ColorType.SEAHORSE_WATER_BALL), |
| 51 | new Pos(2, 1), |
| 52 | 300, |
| 53 | this.getAndPossiblyCreateSpellCastingDamageReason(new Naming("A magical water ball", "a magical water ball")) |
| 54 | ); |
| 55 | |
| 56 | // No target |
| 57 | waterBall.setTargetTypeNoTarget(new Pos(-Random.between(2, 4), Random.fromArray([-1, 0, 1]))); |
| 58 | |
| 59 | // Add the entity |
| 60 | this.getQuest().addEntity(waterBall); |
| 61 | } |
| 62 | |
| 63 | private getYCastingOffset(): number{ |
| 64 | switch(this.getQuestEntityAnimation().getCurrentAsciiIndex()){ |
no test coverage detected