-
Notifications
You must be signed in to change notification settings - Fork 0
/
Potion.java
103 lines (89 loc) · 3.19 KB
/
Potion.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package MiniGameProject.Items.Weapons;
import MiniGameProject.Item;
/**
* Class that allows the creation of instances of Potion.
* @author Zachary House
* @version 04/09/18
*/
public class Potion implements Item
{
/** The initial name given to the potion, cannot be changed. */
private String initialName;
/** The description of the potion. */
private String potionDescription;
/** The effect that the potion will have on its target. */
private String potionEffect;
/** The magnitude or extent of the effect of the potion.
* For example, Health Potions could heal either 5 or 10 Health Points ( HP ).
* Another example, damage potions could deal 10 or 20 damage. */
private double effectMagnitude;
/** The amount of turns during which a potion's effect will take place. */
private int effectDuration;
/** The initial weight given to the potion. */
private double weight;
// The number representing how many of this potion there are in the inventory.
// protected int numberOfPotionsInTheStack = 1;
/** Constructor used to create an instance of Potion.
* @param name The initial name given to the potion, cannot be changed.
* @param description The description of the potion.
* @param effect The effect that the potion will have on its target.
* @param effectMagnitude The magnitude or extent of the effect of the potion.
* @param effectDuration The amount of turns during which a potion's effect will take place.
* @param weight The initial weight given to the potion. */
public Potion( String name, String description, String effect, double effectMagnitude, int effectDuration, double weight)
{
this.initialName = name;
this.potionDescription = description;
this.potionEffect = effect;
this.effectMagnitude = effectMagnitude;
this.effectDuration = effectDuration;
this.weight = weight;
}
@Override
public String getInitialName()
{
return this.initialName;
}
@Override
public String getDescription()
{
return this.potionDescription;
}
@Override
public double getInitialWeight()
{
return this.weight;
}
/** @return Returns the effect of the potion. */
public String getPotionEffect()
{
return this.potionEffect;
}
/** @return Returns the magnitude/extent of the effect of the potion. */
public double getEffectMagnitude()
{
return this.effectMagnitude;
}
/** @return Returns the duration of the of the potion. */
public int getEffectDuration()
{
return this.effectDuration;
}
// @Override
// public int getAmount()
// {
// return this.numberOfPotionsInTheStack;
// }
//
// /** @return Returns the O of the potion. */
// public void increaseNumberOfPotions()
// {
// this.numberOfPotionsInTheStack++;
// }
//
// /** @return Returns the O of the potion. */
// public void decreaseNumberOfPotions()
// {
// this.numberOfPotionsInTheStack--;
// }
}