Potions and Armour Update (User Testing Inspiration Code) - UQdeco2800/2022-studio-2 GitHub Wiki
Introduction
This page will detail the development of Potions and Armour and their updates in Sprint 4. This is based off tasks in the Sprint 4 Task Ticket. https://github.com/UQdeco2800/2022-studio-2/issues/293
Potions
The main updates to potions were based off potion types which were popular in user testing during the 3rd sprint which were slightly buggy, non-functional, or too similar to other potions.
User Testing
According to User Testing, the number of potions per level per unique potion was found to be in the range of 4 to 6, due to this 6 potions of each type were implemented in the level.
Code
Placing Potions into the game roughly followed this pattern where the entity name, type and GridPoint 2 locations are changed per potion
private void spawnSpeedPotion() {
Entity speedPotion = PotionFactory.createSpeedPotion();
itemsOnMap.add(speedPotion);
spawnEntityAt(speedPotion, new GridPoint2(90, 11), true, true);
}
The last of the potions were updated to be functional. These included Defence Potion and Stamina Potion
Defence Potion
public static Entity createDefencePotion() { Entity potion = createBasePotion() .addComponent(new TextureRenderComponent("images/Potions/defence_potion.png")) .addComponent(new PotionEffectComponent(PhysicsLayer.PLAYER, "damageReduction")); potion.getComponent(TextureRenderComponent.class).scaleEntity(); potion.scaleHeight(1.5f); return potion; }
The defence potion works by making the player block a specific amount of damage. This replaced DamageReductionPotion as it essentially worked the same way.
Stamina Potion
public static Entity createStaminaPotion() {
Entity staminaPotion = createBasePotion()
.addComponent(new TextureRenderComponent("images/Potions/swiftness_potion.png"
))
.addComponent(new PotionEffectComponent(PhysicsLayer.PLAYER, "stamina"));
staminaPotion.getComponent(TextureRenderComponent.class).scaleEntity();
staminaPotion.scaleHeight(1.0f);
return staminaPotion;
}
The stamina potion worked in a similar manner to health potion in that it increased the players stamina by a specific amount instead of health. This is useful for the lower levels to allow the player to dash at important time during the final boss fight.
Armour
The main updates to Armour were the functionality for Damage Reduction and Damage Return(a feature which was kept due to its uniqueness), as well as implementing a new armour image for the last armour type. According to Sprint 3, it was found that 2 unique armour types per level were wanted by the majority of people. This sprint focused on improving that armour type, referred to as DarkArmour, to be more adequate for the game, balance wise and bug wise.
User testing
It was found that many of the users wanted a cool corrupted type of armour. For this reason, the Greek Armour type was converted in a magically corrupted purple armour set.
Armour Design
After user testing found that a corrupted armour type was suggested, several design were looked over in similar pixel art games such as Minecraft and Terraria. By comparing Shadow Armour from Terraria, inspiration was found for a similar armour type.
In this way, the Greek Armour was edited from the original to a more purplish type of armour.
Original
Corrupted
Code
The code focused on implementing the functionality for ApplyArmourEffect which allows armour to work as intended with Damage Reduction and Damage Return
public void applyArmourEffect(Entity armour, boolean equip) {
ArmourStatsComponent armourStats;
PlayerModifier pmComponent = entity.getComponent(PlayerModifier.class);
//Applying the weight of the armour to player
if ((armourStats = armour.getComponent(ArmourStatsComponent.class)) != null) {
if (equip) {
pmComponent.createModifier(PlayerModifier.MOVESPEED,
(-(float) armourStats.getWeight() / 10), false, 0);
pmComponent.createModifier(PlayerModifier.DMGREDUCTION,
(float)armourStats.getPhyResistance(), false, 0);
pmComponent.createModifier(PlayerModifier.DMGRETURN,
(float)armourStats.getDmgReturn(), false, 0);
} else {
pmComponent.createModifier(PlayerModifier.MOVESPEED, 3 * (float) armourStats.getWeight() / 10, false, 0);
pmComponent.createModifier(PlayerModifier.DMGREDUCTION,
-(float)armourStats.getPhyResistance(), false, 0);
}
}
}
This code allows the player to be affected by the different modifiers applied to them by the different Armour attributes
Future Directions
Some future directions include: Putting a visible armour pixel art onto the player model both in-game and in the inventory, Expanding the armour and potion types to more unique types as well.
Future directions may also include animations and art for the different potion types and armour types, as well as sounds to give a more fulfilling experience.
Author
Lachlan McDonald, 45320932 (merty009#1029, https://github.com/Lukeyone)