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

Method update

code/main/QuestEntity.ts:444–465  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

442 }
443
444 public update(): void{
445 // We handle berserk mode
446 if(this.berserk){
447 if(this.berserkDuration > 0){
448 this.berserkDuration -= 1;
449 }
450 else{
451 this.stopBerserk();
452 }
453 }
454
455 // We handle animation
456 this.handleAnimation();
457
458 // We handle gravity, and then movement if gravity had no effect
459 this.noMovementLastUpdate = true;
460 if(this.handleGravity() == false)
461 this.handleMovement();
462
463 // We handle combat
464 this.handleCombat();
465 }
466
467 // Default behaviour of this function : displaying a simple death message in the quest log
468 public willDie(): void{

Callers 3

handleAnimationMethod · 0.45
handleMovementMethod · 0.45
tryToUpdateHealthBarMethod · 0.45

Calls 5

stopBerserkMethod · 0.95
handleAnimationMethod · 0.95
handleGravityMethod · 0.95
handleMovementMethod · 0.95
handleCombatMethod · 0.95

Tested by

no test coverage detected