Skip to content

Invincibility Feature Companion

Daksh2607 edited this page Sep 14, 2023 · 2 revisions

Introduction

Invincibility grants companion temporary immunity from harm making the health, infinite for 10 seconds, allowing them to navigate treacherous environments, engage formidable foes, or simply savor moments of invulnerability. This mechanic can be a game-changer, offering companion both a sense of empowerment and the opportunity to tackle challenges in novel ways.

Usage

1. Temporary Protection from Damage:

Invincibility is employed to give a brief respite from enemy attacks or environmental hazards. For example, companion may become temporarily invincible when a key H is pressed, allowing companion without being harmed further.

ServiceLocator.getGameArea().getCompanion().getComponent(CombatStatsComponent.class).setHealth(maxHealth);

2.Strategic Use in Combat:

Players have to use the invincibility strategically , because it can only be used once in a game and for only 10 seconds. After 10 seconds the health of companion set back to 50.

Timer.schedule(new Task() {public void run() { ServiceLocator.getGameArea().getCompanion().getComponent(CombatStatsComponent.class).setHealth(50);} }, 10.0f);

Clone this wiki locally