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

Method constructor

code/main/Devil.ts:15–50  ·  view source on GitHub ↗
(quest: Quest, pos: Pos, minY: number, maxY: number)

Source from the content-addressed store, hash-verified

13
14 // Constructor
15 constructor(quest: Quest, pos: Pos, minY: number, maxY: number){
16 super(quest,
17 pos,
18 new Naming("The devil", "the devil"),
19 new RenderArea(16, 16),
20 new Pos(0, 0),
21 new CollisionBoxCollection(new CollisionBox(this, new Pos(4, 0), new Pos(8, 5))),
22 new QuestEntityMovement()
23 );
24
25 // Set from parameters
26 this.minY = minY;
27 this.maxY = maxY;
28
29 // At first we're going down
30 this.setGoingDown(true);
31
32 // Init the flames array
33 this.flames = [];
34
35 // Set gravity
36 this.getQuestEntityMovement().setGravity(false);
37
38 // Set destructible
39 this.setDestructible(true);
40 this.setMaxHp(666);
41 this.setHp(666);
42
43 // Set the transparent character and draw
44 this.setTransparency(new RenderTransparency(" ", "%"));
45 this.reDraw();
46
47 // Set the weapon and its delay
48 this.addQuestEntityWeapon(new QuestEntityWeapon(this.getQuest(), this, new Naming("Evilness", "evilness"), new CollisionBoxCollection(new CollisionBox(this, new Pos(-1, -1), new Pos(18, 18))), 500));
49 this.getLastQuestEntityWeapon().getCloseCombatDelay().setBetweenDelay(0, 5);
50 }
51
52 // inflictDamage()
53 public inflictDamage(damage: number, reason: QuestEntityDamageReason): void{

Callers

nothing calls this directly

Calls 13

setGoingDownMethod · 0.95
reDrawMethod · 0.95
setGravityMethod · 0.80
setDestructibleMethod · 0.80
setTransparencyMethod · 0.80
addQuestEntityWeaponMethod · 0.80
getQuestMethod · 0.80
setBetweenDelayMethod · 0.80
getCloseCombatDelayMethod · 0.80
setMaxHpMethod · 0.45

Tested by

no test coverage detected