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

Method constructor

code/main/ObsidianBrick.ts:5–25  ·  view source on GitHub ↗
(quest: Quest, pos: Pos, hp: number)

Source from the content-addressed store, hash-verified

3class ObsidianBrick extends QuestEntitySpell{
4 // Constructor
5 constructor(quest: Quest, pos: Pos, hp: number){
6 super(quest,
7 pos,
8 new Naming("An obsidian brick", "an obsidian brick"),
9 null,
10 new Pos(0, 0),
11 new CollisionBoxCollection(new CollisionBox(this, new Pos(0, 0), new Pos(2, 1))),
12 new QuestEntityMovement()
13 );
14
15 // Set gravity
16 this.getQuestEntityMovement().setGravity(true);
17
18 // Set destructible
19 this.setDestructible(true);
20 this.setMaxHp(hp);
21 this.setHp(hp);
22
23 // Add the color
24 this.addColor(new QuestEntitySpellColor(this.getQuest(), new Pos(0, 0), new Pos(2, 1), new Color(ColorType.PLAYER_OBSIDIAN_BRICK)));
25 }
26}

Callers

nothing calls this directly

Calls 7

setGravityMethod · 0.80
setDestructibleMethod · 0.80
getQuestMethod · 0.80
setMaxHpMethod · 0.45
setHpMethod · 0.45
addColorMethod · 0.45

Tested by

no test coverage detected