()
| 235 | } |
| 236 | |
| 237 | public castPlayerEraseMagic(): void{ |
| 238 | // Will be true if at least one spell was erased |
| 239 | var magicErased: boolean = false; |
| 240 | |
| 241 | // Set dead to all the spells |
| 242 | for(var i = 0; i < this.getEntities().length; i++){ |
| 243 | if(this.getEntities()[i].getIsASpell()){ |
| 244 | this.getEntities()[i].setDead(true); |
| 245 | magicErased = true; |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | // If some spell was erase, we successfully casted the spell |
| 250 | if(magicErased) |
| 251 | this.getGame().getQuestLog().addMessage(new QuestLogMessage("You cast an erase magic spell!")); |
| 252 | // Else, it didn't work |
| 253 | else |
| 254 | this.getGame().getQuestLog().addMessage(new QuestLogMessage("You failed to cast an erase magic spell : there's no magic to erase.")); |
| 255 | } |
| 256 | |
| 257 | public castPlayerFireball(movement: Pos = new Pos(2, 0)): void{ |
| 258 | // Create the fireball |
nothing calls this directly
no test coverage detected