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

Method constructor

code/main/Wolf.ts:14–45  ·  view source on GitHub ↗
(quest: Quest, pos: Pos)

Source from the content-addressed store, hash-verified

12
13 // Constructor
14 constructor(quest: Quest, pos: Pos){
15 super(quest,
16 pos,
17 new Naming("A wolf", "a wolf"),
18 new RenderArea(7, 3),
19 new Pos(0, 0),
20 new CollisionBoxCollection(new CollisionBox(this, new Pos(0, 1), new Pos(7, 2))),
21 new QuestEntityMovement()
22 );
23
24 // At first, we're not taking the decision to begin running
25 this.takeTheDecisionToRunTimer = null;
26
27 // Set the area transparency
28 this.setTransparency(new RenderTransparency(" "));
29
30 // At first we're looking left and standing
31 this.setIsLookingLeft(true);
32 this.setIsStanding(true);
33
34 // Set gravity
35 this.getQuestEntityMovement().setGravity(true);
36
37 // Set destructible
38 this.setDestructible(true);
39 this.setMaxHp(45);
40 this.setHp(45);
41
42 // Set the weapon and its delay
43 this.addQuestEntityWeapon(new QuestEntityWeapon(this.getQuest(), this, new Naming("Its fangs", "its fangs"), new CollisionBoxCollection(new CollisionBox(this, new Pos(-1, 0), new Pos(9, 3))), 10));
44 this.getLastQuestEntityWeapon().getCloseCombatDelay().setFixedDelay(2);
45 }
46
47 // update()
48 public update(): void{

Callers

nothing calls this directly

Calls 13

setIsLookingLeftMethod · 0.95
setIsStandingMethod · 0.95
setTransparencyMethod · 0.80
setGravityMethod · 0.80
setDestructibleMethod · 0.80
addQuestEntityWeaponMethod · 0.80
getQuestMethod · 0.80
setFixedDelayMethod · 0.80
getCloseCombatDelayMethod · 0.80
setMaxHpMethod · 0.45

Tested by

no test coverage detected