MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / castPlayerFireball

Method castPlayerFireball

code/main/Quest.ts:257–276  ·  view source on GitHub ↗
(movement: Pos = new Pos(2, 0))

Source from the content-addressed store, hash-verified

255 }
256
257 public castPlayerFireball(movement: Pos = new Pos(2, 0)): void{
258 // Create the fireball
259 var fireball: Fireball = new Fireball(this,
260 this.getGame().getPlayer().getSpellCastingPosition(),
261 new Naming("A fireball", "a fireball"),
262 new Color(ColorType.PLAYER_FIREBALL),
263 new Pos((this.getGame().isEquipped("hat", "eqItemHatSorceressHat")? 6 : 4), (this.getGame().isEquipped("hat", "eqItemHatSorceressHat")? 3 : 2)),
264 45 * (Saving.loadBool("gridItemPossessedRedSharkFin")? 3 : 1),
265 this.getGame().getPlayer().getAndPossiblyCreateSpellCastingDamageReason(new Naming("A fireball", "a fireball"))
266 );
267
268 // No target
269 fireball.setTargetTypeNoTarget(movement);
270
271 // Add the entity
272 this.addEntity(fireball);
273
274 // Add a message to the log
275 this.getGame().getQuestLog().addMessage(new QuestLogMessage("You cast a fireball!"));
276 }
277
278 public castPlayerHealthPotion(): void{
279 this.getGame().getPlayer().heal((this.getGame().isEquipped("hat", "eqItemHatSorceressHat")? 200 : 100));

Callers 1

castPlayerPPotionMethod · 0.95

Calls 9

setTargetTypeNoTargetMethod · 0.95
addEntityMethod · 0.95
getPlayerMethod · 0.80
isEquippedMethod · 0.80
addMessageMethod · 0.80
getQuestLogMethod · 0.80
getGameMethod · 0.45

Tested by

no test coverage detected