Items - UQcsse3200/2024-studio-1 GitHub Wiki

Items

Items appear throughout the level and can be picked up by the player. To pick up an item, the player must come into contact with the specific item and press 'E'. A variety of items are available, each with unique effects on the player. Some items are used immediately upon pickup, while others are stored in the player's Inventory for future use, depending on the item type.

Creating an item entity

To create an item entity, use the createCollectibleEntity(String specification) method from the CollectibleFactory. Pass the specific item details as a unique string. Some example specifications include: buff:energydrink:low buff:energydrink:medium buff:energydrink:high item:shieldpotion item:bandage item:medkit item:reroll item:beartrap

Usable items vs Buff items

Usable items are stored in the player's inventory after being picked up. They can be activated later by pressing the corresponding keys (1-9), with 'R' being reserved for the reroll item. Usable items include the medkit, bandage, shield potion, reroll, bear trap, target dummy, big red button, and teleporter.

Buff items, on the other hand, are automatically activated upon pickup, applying their effects directly to the player without being stored in the inventory. Buff items include the energy drink, damage buff, syringe, heart, feather, tombstone, divine potion, ring of fire, and bleed buff.

Description of the Usable item effects

Medkit and Bandage

Medkits and bandages are items that increase the player's health by a Large Boost of 100 and a Small Boost of 20 respectively. A cap is made on the health so that these health boost items can only increase the player's health to a maximum of player's current maximum health.

Syringe

Syringe is an item that when picked up by the player, immediately increases the health of player by 50 and work as an instant health booster. The item is not capped by any maximum health. It extends the Buff Item.

Shield potion

The shield potion is an item that grants the player temporary immunity against damage. The shield protects the player from taking two hits, after which, the shield is 'broken' and the player loses immunity.

Bear Trap

The bear trap item allows the player to deploy a bear trap entity. The Bear Trap is designed to immobilize and damage enemy entities in the game. When activated, it deals damage to the enemy and immobilizes them for a set duration. Pets or friendly entities are unaffected by the trap, ensuring it only targets hostile creatures. The trap is a one-time-use item, disappearing after it is triggered, and it cannot be reused once deployed.

Target Dummy

The target dummy item enables the player to deploy a target dummy entity, which attracts enemies to attack it. The target dummy can be destroyed after taking a certain amount of damage, serving as a decoy to distract enemies from the player.

Reroll item

The Reroll item is a usable item that gets added to the player's inventory upon pickup. It is applied to other items to give the player the chance to obtain or "reroll" a different item. The player presses "R" to use the reroll item, and it can only be used when in collision with another item.

Big Red Button

The Big Red Button is a usable item that allows the player to kill all enemies in the current room immediately.

Teleporter

The teleporter item is a purple button that when used transports the player directly to the boss room bypassing all previous battles.

Description of the Buff item effects

Energy drink

The Energy drink is an item that when picked up by the player, immediately increases the speed of the player by a set value. The effect of this item lasts the duration of the whole level. Currently, there are three types of energy drink speed boosts: "low", "medium" and "high". Currently, the "low" boost will add 3% of the original speed on top of the current speed, "medium" with 5% and "high" with 10%. Depending on the energy drink type, the icon will have a different colour. Currently, the player has a max boost of x0.5, which means 0.5% of the base speed + base speed. The base speed is unique to the character chosen. When the current speed is at it's max level, picking up additional energy drink items will have no effect.

Damage Buff

The Damage buff is an item that when used will increase your total/ player damage by increments of 5 with a cap of 200 additional damage. This allows the player to increase damage dealt per attack. It extends Buff Item.

Heart

The Heart item increases the player's maximum health by 50, up to a cap of 150. When the player picks up this item, their current health is fully restored to the new maximum value. This effect ensures that the player is better equipped to withstand damage in future encounters. The Heart item interacts directly with the player's CombatStatsComponent, which manages the player's health attributes. It does not have any special effects when dropped, as its boost is applied immediately upon pickup.

DivinePotion

The Divine Potion provides both a health boost and a temporary speed increase. It instantly increases the player's current health by 30, up to their maximum health. Additionally, it enhances the player's movement speed by 25%, ensuring that the speed does not exceed a fixed cap. The potion interacts with both the CombatStatsComponent for health management and the PlayerActions component for speed modification. This dual effect makes it a powerful item for both survivability and quick mobility during gameplay.

Tombstone

The tombstone item is a class-specific item for the necromancer that will spawn a pet to fight alongside the necromancer as they progress through the levels. The Tombstone can spawn; bats, rats, bears, dogs, snakes and minotaurs through the use of a random number generator.

Ring Of Fire

The Ring of Fire is an item that spawns a protective ring around the player that will deal damage to enemies that get within melee distance. The ring of fire traverses rooms but has a set health bar that can be depleted.

Feather

The Feather is a rare item dropped by the Birdman boss. When collected, it grants the player a 20% boost to their critical hit chance, enhancing their ability to deal extra damage in combat.

Bleed Buff

The Bleed Buff is a Boss Drop item, unlocked after defeating the werewolf boss. It grants additional bleed damage, applied when using specific weapons. Enemies hit by a bleed weapon lose 5% of their health per second for 5 seconds.

Overview of UI element

Below the health stats, there are two progress bars. The upper-most bar shows the speed statistics, and below is the damage buff. The speed statistics show the total amount of extra speed that the player has accumulated so far. Upon picking up an energy drink, this progress bar will update by the percentage that the boost is worth (eg. +3% speed will update from x0.0 to x0.03).