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

Method castWaterBall

code/main/SeaSnake.ts:45–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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()){

Callers 1

updateMethod · 0.95

Calls 7

getYCastingOffsetMethod · 0.95
setTargetTypeNoTargetMethod · 0.95
getQuestMethod · 0.80
plusMethod · 0.80
getGlobalPositionMethod · 0.80
addEntityMethod · 0.80

Tested by

no test coverage detected