(stored: boolean)
| 142 | |
| 143 | // Private methods |
| 144 | private castSpell(stored: boolean): void{ |
| 145 | var ball: MonkeyWizardMagicalPurpleBall = new MonkeyWizardMagicalPurpleBall(this.getQuest(), |
| 146 | this.getGlobalPosition().plus(new Pos(3, 0)), |
| 147 | new Naming("An magical purple ball", "a magical purple ball"), |
| 148 | (stored? new Color(ColorType.MONKEY_WIZARD_BALL_STORED) : new Color(ColorType.MONKEY_WIZARD_BALL)), |
| 149 | new Pos(2, 1), |
| 150 | 15, |
| 151 | this.getAndPossiblyCreateSpellCastingDamageReason(new Naming("An magical purple ball", "a magical purple ball")), |
| 152 | (stored? 350 - this.bigTimer : null) |
| 153 | ); |
| 154 | |
| 155 | // If we're not going to be stored |
| 156 | if(stored == false){ |
| 157 | // Target the player |
| 158 | ball.setTargetTypeTargetEntity(this.getQuest().getGame().getPlayer()); |
| 159 | } |
| 160 | else{ |
| 161 | // Target the roof |
| 162 | ball.setTargetTypeTargetPosition(new Pos(Random.between(1, 99), Random.between(4, 9))); |
| 163 | } |
| 164 | |
| 165 | // Add it to the quest |
| 166 | this.getQuest().addEntity(ball); |
| 167 | } |
| 168 | |
| 169 | private dontMove(): void{ |
| 170 | this.getQuestEntityMovement().setOffset(new Pos(0, 0)); |
no test coverage detected