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

Method constructor

code/main/SmallestFish.ts:5–26  ·  view source on GitHub ↗
(quest: Quest, pos: Pos)

Source from the content-addressed store, hash-verified

3class SmallestFish extends QuestEntity{
4 // Constructor
5 constructor(quest: Quest, pos: Pos){
6 super(quest,
7 pos,
8 new Naming("A very small fish", "a very small fish"),
9 new RenderArea(3, 1),
10 new Pos(0, 0),
11 new CollisionBoxCollection(new CollisionBox(this, new Pos(0, 0), new Pos(3, 1))),
12 new QuestEntityMovement(new Pos(-1, 0))
13 );
14
15 // Set destructible
16 this.setDestructible(true);
17 this.setMaxHp(10);
18 this.setHp(10);
19
20 // Set the ascii art
21 this.getRenderArea().drawArray(Database.getAscii("places/quests/theSea/smallestFish"));
22
23 // Set the weapon and its delay
24 this.addQuestEntityWeapon(new QuestEntityWeapon(this.getQuest(), this, new Naming("Its fins", "its fins"), new CollisionBoxCollection(new CollisionBox(this, new Pos(-1, -1), new Pos(5, 2))), 1));
25 this.getLastQuestEntityWeapon().getCloseCombatDelay().setFixedDelay(6);
26 }
27}

Callers

nothing calls this directly

Calls 11

setDestructibleMethod · 0.80
drawArrayMethod · 0.80
getAsciiMethod · 0.80
addQuestEntityWeaponMethod · 0.80
getQuestMethod · 0.80
setFixedDelayMethod · 0.80
getCloseCombatDelayMethod · 0.80
setMaxHpMethod · 0.45
setHpMethod · 0.45
getRenderAreaMethod · 0.45

Tested by

no test coverage detected