-
Notifications
You must be signed in to change notification settings - Fork 1
Buff items
Compared to UsableItems, a buff item is not added to the inventory and thus, cannot be used at any time by the player. Instead, buff items immediately apply an effect upon pickup. The buff items impact the player in various ways, such as the speed of the player, the player's total damage, or creating a pet for the player.
- The type: Buff items have the type
Type.BUFF_ITEM
- Picking up a buff item: The pickup method of the buff item is different from the UsableItems, as such, the
effect()
method of the item is immediately called in thepickup()
method of the item. - The specification: The specification of a buff item differs from UsableItems, where it includes "buff:" plus the buff item specification (eg. "buff:damagebuff")
- BuffItem.java: An abstract class for all BuffItems
-
ItemPickupComponent.java: Calls the
pickup()
method of the buff item
- When creating an energydrink, you must also specify what kind of speed power you would like it to have. This is either high, medium or low...
CollectibleFactory collectibleFactory = new CollectibleFactory()
Entity collectible = collectibleFactory.createCollectibleEntity("buff:energydrink:high")
//Creates an energy drink with "High" speed
- EnergyDrink.java: The class for an energy drink
- PlayerActions.java: Contains methods responsible for updating and obtaining the player's speed. These methods also help in updating the UI showing the player's speed.
- PlayerStatsDisplay: Contains methods that update the speed UI
- The "speedType" of an energy drink: An energy drink has three different speed types, including "low", "medium" and "high".
- The effect of the energy drink: Refer to
effect()
of the EnnergyDrink class Depending on the speedType of this specific energy drink, the associated 'speed' vector is added to the player's current speed. - Setting the speed depending on the type of energy drink: Refer to
setScalar()
of the EnergyDrink class. This method is called when theeffect()
method is called. It sets the specific speed effect based on the 'speedType' parameter that was obtained previously from the specification. - Different icons: Refer to
setIcon()
of the EnergyDrink class. This method is called when an EnergyDrink class is first initialized. It sets the icon of this energy drink based on the 'speedType' parameter that was obtained previously from the specification. As such, a "low" powered energy drink is blue, "medium" is purple and "high" is red.
This item is tested in EnergyDrinkTest.java
- The damage buff item is created using...
CollectibleFactory collectibleFactory = new CollectibleFactory()
Entity collectible = collectibleFactory.createCollectibleEntity("buff:damagebuff")
//Creates a new damage buff item
- DamageBuff.java: The class for a damage buff item
- The effect method: Refer to the
effect()
method of the DamageBuff class. Applies the effect to the player that increases total damage
This item is currently tested in DamageBuffTest.java
- The tombstone item is created using...
CollectibleFactory collectibleFactory = new CollectibleFactory()
Entity collectible = collectibleFactory.createCollectibleEntity("buff:tombstone")
//Creates a new tombstone buff item
- Effect of this item: Refer to
effect()
method. This method is called when the tombstone item is initialised. This method selects a random number then accesses therandomPetGenerator()
to declare the pet. This specification creates the entity of the pet in thePetFactory.java
which is then spawned by theeffect()
method. This can be seen below:
Heart.java
: The class for the Heart item, which increases the player's max health by a specified amount, up to a limit, and fully restores current health when picked up.
CombatStatsComponent.java
: Manages the player's health. The Heart item uses this component to get and set the player's current and maximum health.
Effect of this item: The effect()
method in the Heart class increases the player's maximum health by a specified amount, up to a set limit. It also restores the player's current health to the new maximum value after the increase.
This item is tested in HeartTest.java
DivinePotion.java
: The class for the Divine Potion item, which boosts the player's speed, increases health by a set amount, and ensures the health and the speed does not exceed the maximum health and the maximum speed limit respectively.
CombatStatsComponent.java
: Manages the player's health. The DivinePotion item uses this component to set the player's health.
PlayerActions.java
: Controls the player's movement and speed. The Divine Potion interacts with this component to apply a speed boost and manage speed constraints.
Effect of this item: The effect()
method in the Divine Potion class increases the player's health by a fixed amount using the Boost()
method and applies a speed boost using the speed()
method.
Boost()
:Increases the player's current health by a fixed amount, up to their maximum health limit.
speed()
:Applies a speed boost to the player, ensuring the speed doesn't exceed the maximum allowed limit.
This item is tested in DivinePotionTest.java
Design Choices
Utilities
Animals
Menus/screens
Character
- Character Animations
- Character's Inventory On Display
- Character's Inventory System
- Character's HealthBar
- Character's Interaction with Items
- Character achievements
- Saving Character
- Player-(and-other-NPC)-invincibility-frames
- Player Factory
- Scoring System
- Test Plan for Inventory System
- Test Plan for Player's Interaction with Items
- Test Plan for Player's Inventory Display
- Test Plan for Saving Character State
- Test Plan for Scoring System
Map
Weapon
- Weapon Overview
- Weapon Types
- Weapon Structure
- Weapon Stats Display
- Testing Plan for Weapon Factory
- Testing Plan for Firing Controller Component
- Testing Plan for Position Tracker Component
- Testing Plan for Weapon Animation Controller component
- Testing Plan for Concrete Melee Weapon class
- Testing Plan for Concrete Ranged Weapon class