Represents a student with coding expertise. Extends Adventurer
.
- happiness: Current happiness level.
- happinessMax: Maximum happiness.
- GPA: Academic performance (0-100).
- homework: List of homework assignments.
- preferredLanguage: Programming language preference.
CodeNerd(String name, int hp, String language)
Initializes a CodeNerd with a name, health points, and preferred programming language.
int getGPA()
: Returns the current GPA.void setGPA(int GPA)
: Sets the GPA.String getHomeworkSummary()
: Summarizes homework assignments.String doHomework(int index)
: Completes a homework assignment and adjusts GPA.String getSpecialName()
: Returns "Happiness".int getSpecial()
: Returns current happiness level.void setSpecial(int n)
: Updates happiness level.int getSpecialMax()
: Returns maximum happiness level.String attack(Adventurer other)
: Attacks an opponent.String support(Adventurer other)
: Supports another adventurer.String support()
: Restores own happiness and health.String specialAttack(Adventurer other)
: Performs a special attack.
Represents a school dean. Extends Adventurer
.
- happiness: Current happiness level.
- happinessMax: Maximum happiness.
Dean(String name, int hp)
Initializes a Dean with a name and health points.
String getSpecialName()
: Returns "Steal Your Airpods".int getSpecial()
: Returns current happiness level.void setSpecial(int n)
: Updates happiness level.int getSpecialMax()
: Returns maximum happiness level.String attack(Adventurer other)
: Attacks an opponent.String support(Adventurer other)
: Supports another adventurer.String support()
: Restores own happiness and health.String specialAttack(Adventurer other)
: Performs a special attack.
Represents a homework assignment.
- type: Type of homework (e.g., Math, Coding, History).
- duration: Time required to complete.
HW(String type, int duration)
Creates a homework assignment. Throws an exception for invalid types.
String getType()
: Returns the homework type.int getDuration()
: Returns the homework duration.void changeDuration(int n)
: Updates the duration.
Represents a student with math expertise. Extends Adventurer
.
- happiness: Current happiness level.
- happinessMax: Maximum happiness.
- GPA: Academic performance (0-100).
- homework: List of homework assignments.
MathNerd(String name, int hp)
Initializes a MathNerd with a name and health points.
- Inherits most methods from
CodeNerd
. String getSpecialName()
: Returns "Extra Credit".
Represents a student with history expertise. Extends Adventurer
.
- happiness: Current happiness level.
- happinessMax: Maximum happiness.
- GPA: Academic performance (0-100).
- homework: List of homework assignments.
HistoryNerd(String name, int hp)
Initializes a HistoryNerd with a name and health points.
- Inherits most methods from
CodeNerd
. String getSpecialName()
: Returns "National History Day Project".
Represents a teacher character. Extends Adventurer
.
- happiness: Current happiness level.
- happinessMax: Maximum happiness.
Teacher(String name, int hp)
Initializes a Teacher with a name and health points.
String getSpecialName()
: Returns "Teaching Power".int getSpecial()
: Returns current happiness level.void setSpecial(int n)
: Updates happiness level.int getSpecialMax()
: Returns maximum happiness level.String attack(Adventurer other)
: Attacks an opponent.String support(Adventurer other)
: Supports another adventurer.String support()
: Restores own happiness and health.String specialAttack(Adventurer other)
: Performs a special attack.