Compare commits
9 Commits
dbf4114857
...
cf1a8e9cc3
| Author | SHA1 | Date | |
|---|---|---|---|
| cf1a8e9cc3 | |||
| ff6af4948d | |||
| 2ca4213ec3 | |||
| 59fec89325 | |||
| e0c4396432 | |||
| 39212794fd | |||
| 6ac654cc3a | |||
| f82e550ad3 | |||
|
|
372df074b4 |
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
.gitignore
|
||||
.env
|
||||
.idea/*
|
||||
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
6
.idea/misc.xml
generated
Normal file
6
.idea/misc.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_22" default="true" project-jdk-name="openjdk-22 (2)" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/Java_Petit_projet.iml" filepath="$PROJECT_DIR$/Java_Petit_projet.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
124
.idea/uiDesigner.xml
generated
Normal file
124
.idea/uiDesigner.xml
generated
Normal file
@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
11
Java_Petit_projet.iml
Normal file
11
Java_Petit_projet.iml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
BIN
out/production/Java_Petit_projet/Main.class
Normal file
BIN
out/production/Java_Petit_projet/Main.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/events/Event.class
Normal file
BIN
out/production/Java_Petit_projet/events/Event.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/heroes/Hero.class
Normal file
BIN
out/production/Java_Petit_projet/heroes/Hero.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/heroes/jobs/Job.class
Normal file
BIN
out/production/Java_Petit_projet/heroes/jobs/Job.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/heroes/jobs/Mage.class
Normal file
BIN
out/production/Java_Petit_projet/heroes/jobs/Mage.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/heroes/jobs/Rogue.class
Normal file
BIN
out/production/Java_Petit_projet/heroes/jobs/Rogue.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/heroes/jobs/Warrior.class
Normal file
BIN
out/production/Java_Petit_projet/heroes/jobs/Warrior.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/heroes/races/Dwarf.class
Normal file
BIN
out/production/Java_Petit_projet/heroes/races/Dwarf.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/heroes/races/Elf.class
Normal file
BIN
out/production/Java_Petit_projet/heroes/races/Elf.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/heroes/races/Human.class
Normal file
BIN
out/production/Java_Petit_projet/heroes/races/Human.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/heroes/races/Ork.class
Normal file
BIN
out/production/Java_Petit_projet/heroes/races/Ork.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/heroes/races/Race.class
Normal file
BIN
out/production/Java_Petit_projet/heroes/races/Race.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/items/Equipment.class
Normal file
BIN
out/production/Java_Petit_projet/items/Equipment.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/items/Item.class
Normal file
BIN
out/production/Java_Petit_projet/items/Item.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/items/chests/Chest.class
Normal file
BIN
out/production/Java_Petit_projet/items/chests/Chest.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/items/chests/LeatherArmor.class
Normal file
BIN
out/production/Java_Petit_projet/items/chests/LeatherArmor.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/items/chests/MailChest.class
Normal file
BIN
out/production/Java_Petit_projet/items/chests/MailChest.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/items/chests/PlateArmor.class
Normal file
BIN
out/production/Java_Petit_projet/items/chests/PlateArmor.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/items/chests/RobeMage.class
Normal file
BIN
out/production/Java_Petit_projet/items/chests/RobeMage.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
out/production/Java_Petit_projet/items/helmets/Hat.class
Normal file
BIN
out/production/Java_Petit_projet/items/helmets/Hat.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/items/helmets/Helm.class
Normal file
BIN
out/production/Java_Petit_projet/items/helmets/Helm.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/items/helmets/Helmet.class
Normal file
BIN
out/production/Java_Petit_projet/items/helmets/Helmet.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/items/helmets/NoHelmet.class
Normal file
BIN
out/production/Java_Petit_projet/items/helmets/NoHelmet.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/items/shields/Shield.class
Normal file
BIN
out/production/Java_Petit_projet/items/shields/Shield.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/items/weapons/Weapon.class
Normal file
BIN
out/production/Java_Petit_projet/items/weapons/Weapon.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/rules/Action.class
Normal file
BIN
out/production/Java_Petit_projet/rules/Action.class
Normal file
Binary file not shown.
BIN
out/production/Java_Petit_projet/systems/Game.class
Normal file
BIN
out/production/Java_Petit_projet/systems/Game.class
Normal file
Binary file not shown.
@ -2,7 +2,7 @@ import systems.Game;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
System.out.print("Hello and welcome!");
|
||||
System.out.print("Hello and welcome! Test Gitea");
|
||||
Game game = new Game();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,213 @@
|
||||
package heroes;
|
||||
|
||||
import heroes.jobs.Job;
|
||||
import heroes.races.Race;
|
||||
import items.helmets.Helmet;
|
||||
import items.shields.Shield;
|
||||
import items.chests.*;
|
||||
import items.weapons.Weapon;
|
||||
|
||||
public class Hero {
|
||||
protected String name;
|
||||
protected Race race;
|
||||
protected Job job;
|
||||
protected Helmet helmet;
|
||||
protected Chest chest;
|
||||
protected Weapon weapon;
|
||||
protected Shield shield;
|
||||
protected int healthBaseLevel;
|
||||
protected int strengthBaseLevel;
|
||||
protected int dexterityBaseLevel;
|
||||
protected int intelligenceBaseLevel;
|
||||
protected int defenseBaseLevel;
|
||||
protected int health;
|
||||
protected int strength;
|
||||
protected int dexterity;
|
||||
protected int intelligence;
|
||||
protected int defense;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Race getRace() {
|
||||
return race;
|
||||
}
|
||||
|
||||
public void setRace(Race race) {
|
||||
this.race = race;
|
||||
if (race != null){
|
||||
race.adjustStats(this);
|
||||
}
|
||||
}
|
||||
|
||||
public Job getJob() {
|
||||
return job;
|
||||
}
|
||||
|
||||
public void setJob(Job job) {
|
||||
this.job = job;
|
||||
if (job != null){
|
||||
job.adjustStats(this);
|
||||
}
|
||||
}
|
||||
|
||||
public int getHealthBaseLevel() {
|
||||
return healthBaseLevel;
|
||||
}
|
||||
|
||||
public void setHealthBaseLevel(int healthBaseLevel) {
|
||||
this.healthBaseLevel = healthBaseLevel;
|
||||
}
|
||||
|
||||
public int getStrengthBaseLevel() {
|
||||
return strengthBaseLevel;
|
||||
}
|
||||
|
||||
public void setStrengthBaseLevel(int strengthBaseLevel) {
|
||||
this.strengthBaseLevel = strengthBaseLevel;
|
||||
}
|
||||
|
||||
public int getDexterityBaseLevel() {
|
||||
return dexterityBaseLevel;
|
||||
}
|
||||
|
||||
public Helmet getHelmet() {
|
||||
return helmet;
|
||||
}
|
||||
|
||||
public void setHelmet(Helmet helmet) {
|
||||
this.helmet = helmet;
|
||||
}
|
||||
|
||||
public Chest getChest() {
|
||||
return chest;
|
||||
}
|
||||
|
||||
public void setChest(Chest chest) {
|
||||
this.chest = chest;
|
||||
}
|
||||
|
||||
public Weapon getWeapon() {
|
||||
return weapon;
|
||||
}
|
||||
|
||||
public void setWeapon(Weapon weapon) {
|
||||
this.weapon = weapon;
|
||||
}
|
||||
|
||||
public Shield getShield() {
|
||||
return shield;
|
||||
}
|
||||
|
||||
public void setShield(Shield shield) {
|
||||
this.shield = shield;
|
||||
}
|
||||
|
||||
public void setDexterityBaseLevel(int dexterityBaseLevel) {
|
||||
this.dexterityBaseLevel = dexterityBaseLevel;
|
||||
}
|
||||
|
||||
public int getIntelligenceBaseLevel() {
|
||||
return intelligenceBaseLevel;
|
||||
}
|
||||
|
||||
public void setIntelligenceBaseLevel(int intelligenceBaseLevel) {
|
||||
this.intelligenceBaseLevel = intelligenceBaseLevel;
|
||||
}
|
||||
|
||||
public int getDefenseBaseLevel() {
|
||||
return defenseBaseLevel;
|
||||
}
|
||||
|
||||
public void setDefenseBaseLevel(int defenseBaseLevel) {
|
||||
this.defenseBaseLevel = defenseBaseLevel;
|
||||
}
|
||||
|
||||
public int getHealth() {
|
||||
return health;
|
||||
}
|
||||
|
||||
public void setHealth(int health) {
|
||||
this.health = health;
|
||||
}
|
||||
|
||||
public int getStrength() {
|
||||
return strength;
|
||||
}
|
||||
|
||||
public void setStrength(int strength) {
|
||||
this.strength = strength;
|
||||
}
|
||||
|
||||
public int getDexterity() {
|
||||
return dexterity;
|
||||
}
|
||||
|
||||
public void setDexterity(int dexterity) {
|
||||
this.dexterity = dexterity;
|
||||
}
|
||||
|
||||
public int getIntelligence() {
|
||||
return intelligence;
|
||||
}
|
||||
|
||||
public void setIntelligence(int intelligence) {
|
||||
this.intelligence = intelligence;
|
||||
}
|
||||
|
||||
public int getDefense() {
|
||||
return defense;
|
||||
}
|
||||
|
||||
public void setDefense(int defense) {
|
||||
this.defense = defense;
|
||||
}
|
||||
|
||||
public Hero() {
|
||||
this.setName("Hero");
|
||||
this.setRace(null);
|
||||
this.setJob(null);
|
||||
this.setHealthBaseLevel(100);
|
||||
this.setStrengthBaseLevel(10);
|
||||
this.setDexterityBaseLevel(10);
|
||||
this.setIntelligenceBaseLevel(10);
|
||||
this.setDefenseBaseLevel(10);
|
||||
setHealth(this.getHealthBaseLevel());
|
||||
setStrength(this.getStrengthBaseLevel());
|
||||
setDexterity(this.getDexterityBaseLevel());
|
||||
setIntelligence(this.getIntelligenceBaseLevel());
|
||||
setDefense(this.getDefenseBaseLevel());
|
||||
}
|
||||
|
||||
public Hero(String name) {
|
||||
this.setName(name);
|
||||
this.setRace(null);
|
||||
this.setJob(null);
|
||||
this.setHealthBaseLevel(100);
|
||||
this.setStrengthBaseLevel(10);
|
||||
this.setDexterityBaseLevel(10);
|
||||
this.setIntelligenceBaseLevel(10);
|
||||
this.setDefenseBaseLevel(10);
|
||||
setHealth(this.getHealthBaseLevel());
|
||||
setStrength(this.getStrengthBaseLevel());
|
||||
setDexterity(this.getDexterityBaseLevel());
|
||||
setIntelligence(this.getIntelligenceBaseLevel());
|
||||
setDefense(this.getDefenseBaseLevel());
|
||||
}
|
||||
|
||||
public void printStats() {
|
||||
System.out.println("Caractéristiques de " + this.getName() + " :");
|
||||
// System.out.println("Classe : " + this.getJob().getName());
|
||||
// System.out.println("Race : " + this.getRace().getName());
|
||||
System.out.println("Point de vie : " + this.getHealth());
|
||||
System.out.println("Force : " + this.getStrength());
|
||||
System.out.println("Dextérité : " + this.getDexterity());
|
||||
System.out.println("Intelligence : " + this.getIntelligence());
|
||||
System.out.println("Défense : " + this.getDefense());
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,5 +2,16 @@ package heroes.jobs;
|
||||
|
||||
import heroes.Hero;
|
||||
|
||||
public abstract class Job extends Hero {
|
||||
public abstract class Job {
|
||||
public String jobName;
|
||||
|
||||
public String getJobName() {
|
||||
return jobName;
|
||||
}
|
||||
|
||||
public void setJobName(String jobName) {
|
||||
this.jobName = jobName;
|
||||
}
|
||||
|
||||
public abstract void adjustStats(Hero hero);
|
||||
}
|
||||
|
||||
16
src/heroes/jobs/Mage.java
Normal file
16
src/heroes/jobs/Mage.java
Normal file
@ -0,0 +1,16 @@
|
||||
package heroes.jobs;
|
||||
|
||||
import heroes.Hero;
|
||||
|
||||
public class Mage extends Job{
|
||||
public Mage() {
|
||||
this.setJobName("Mage");
|
||||
}
|
||||
@Override
|
||||
public void adjustStats(Hero hero) {
|
||||
hero.setHealth(hero.getHealthBaseLevel() - 10);
|
||||
hero.setStrength(hero.getStrengthBaseLevel() - 10);
|
||||
hero.setDefense(hero.getDefenseBaseLevel() - 5);
|
||||
hero.setIntelligence(hero.getIntelligenceBaseLevel() + 20);
|
||||
}
|
||||
}
|
||||
16
src/heroes/jobs/Rogue.java
Normal file
16
src/heroes/jobs/Rogue.java
Normal file
@ -0,0 +1,16 @@
|
||||
package heroes.jobs;
|
||||
|
||||
import heroes.Hero;
|
||||
|
||||
public class Rogue extends Job{
|
||||
public Rogue() {
|
||||
this.setJobName("Voleur");
|
||||
}
|
||||
@Override
|
||||
public void adjustStats(Hero hero) {
|
||||
hero.setHealth(hero.getHealthBaseLevel() - 10);
|
||||
hero.setStrength(hero.getStrengthBaseLevel() + 5);
|
||||
hero.setDexterity(hero.getDexterityBaseLevel() + 20);
|
||||
hero.setIntelligence(hero.getIntelligenceBaseLevel() - 5);
|
||||
}
|
||||
}
|
||||
17
src/heroes/jobs/Warrior.java
Normal file
17
src/heroes/jobs/Warrior.java
Normal file
@ -0,0 +1,17 @@
|
||||
package heroes.jobs;
|
||||
|
||||
import heroes.Hero;
|
||||
|
||||
public class Warrior extends Job {
|
||||
public Warrior() {
|
||||
this.setJobName("Guerrier");
|
||||
}
|
||||
@Override
|
||||
public void adjustStats(Hero hero) {
|
||||
hero.setHealth(hero.getHealthBaseLevel() + 10);
|
||||
hero.setStrength(hero.getStrengthBaseLevel() + 10);
|
||||
hero.setDefense(hero.getDefenseBaseLevel() + 10);
|
||||
hero.setDexterity(hero.getDexterityBaseLevel() - 5);
|
||||
hero.setIntelligence(hero.getIntelligenceBaseLevel() - 5);
|
||||
}
|
||||
}
|
||||
18
src/heroes/races/Dwarf.java
Normal file
18
src/heroes/races/Dwarf.java
Normal file
@ -0,0 +1,18 @@
|
||||
package heroes.races;
|
||||
|
||||
import heroes.Hero;
|
||||
|
||||
public class Dwarf extends Race{
|
||||
public Dwarf() {
|
||||
this.setRaceName("Nain");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustStats(Hero hero) {
|
||||
hero.setHealth(hero.getHealthBaseLevel() + 10);
|
||||
hero.setStrength(hero.getStrengthBaseLevel() + 10);
|
||||
hero.setDefense(hero.getDefenseBaseLevel() + 10);
|
||||
hero.setDexterity(hero.getDexterityBaseLevel() - 15);
|
||||
hero.setIntelligence(hero.getIntelligenceBaseLevel() - 10);
|
||||
}
|
||||
}
|
||||
18
src/heroes/races/Elf.java
Normal file
18
src/heroes/races/Elf.java
Normal file
@ -0,0 +1,18 @@
|
||||
package heroes.races;
|
||||
|
||||
import heroes.Hero;
|
||||
|
||||
public class Elf extends Race{
|
||||
public Elf() {
|
||||
this.setRaceName("Elfe");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustStats(Hero hero) {
|
||||
hero.setHealth(hero.getHealthBaseLevel() - 5);
|
||||
hero.setStrength(hero.getStrengthBaseLevel() - 5);
|
||||
hero.setDefense(hero.getDefenseBaseLevel() - 5);
|
||||
hero.setDexterity(hero.getDexterityBaseLevel() + 10);
|
||||
hero.setIntelligence(hero.getIntelligenceBaseLevel() + 10);
|
||||
}
|
||||
}
|
||||
18
src/heroes/races/Human.java
Normal file
18
src/heroes/races/Human.java
Normal file
@ -0,0 +1,18 @@
|
||||
package heroes.races;
|
||||
|
||||
import heroes.Hero;
|
||||
|
||||
public class Human extends Race{
|
||||
public Human() {
|
||||
this.setRaceName("Human");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustStats(Hero hero) {
|
||||
hero.setHealth(hero.getHealthBaseLevel() + 5);
|
||||
hero.setStrength(hero.getStrengthBaseLevel() + 5);
|
||||
hero.setDefense(hero.getDefenseBaseLevel() + 5);
|
||||
hero.setDexterity(hero.getDexterityBaseLevel() + 5);
|
||||
hero.setIntelligence(hero.getIntelligenceBaseLevel() + 5);
|
||||
}
|
||||
}
|
||||
18
src/heroes/races/Ork.java
Normal file
18
src/heroes/races/Ork.java
Normal file
@ -0,0 +1,18 @@
|
||||
package heroes.races;
|
||||
|
||||
import heroes.Hero;
|
||||
|
||||
public class Ork extends Race {
|
||||
public Ork() {
|
||||
this.setRaceName("Orc");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustStats(Hero hero) {
|
||||
hero.setHealth(hero.getHealthBaseLevel() + 10);
|
||||
hero.setStrength(hero.getStrengthBaseLevel() + 10);
|
||||
hero.setDefense(hero.getDefenseBaseLevel() + 10);
|
||||
hero.setDexterity(hero.getDexterityBaseLevel() - 5);
|
||||
hero.setIntelligence(hero.getIntelligenceBaseLevel() - 10);
|
||||
}
|
||||
}
|
||||
@ -2,5 +2,15 @@ package heroes.races;
|
||||
|
||||
import heroes.Hero;
|
||||
|
||||
public abstract class Race extends Hero {
|
||||
public abstract class Race {
|
||||
public String raceName;
|
||||
|
||||
public String getRaceName(){
|
||||
return raceName;
|
||||
}
|
||||
|
||||
public void setRaceName(String raceName) {
|
||||
this.raceName = raceName;
|
||||
}
|
||||
public abstract void adjustStats(Hero hero);
|
||||
}
|
||||
|
||||
8
src/items/Equipment.java
Normal file
8
src/items/Equipment.java
Normal file
@ -0,0 +1,8 @@
|
||||
package items;
|
||||
|
||||
import heroes.Hero;
|
||||
|
||||
public abstract class Equipment {
|
||||
public String name;
|
||||
public abstract void equip(Hero hero);
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
package items.armors;
|
||||
|
||||
import items.Item;
|
||||
|
||||
abstract class Armor extends Item {
|
||||
}
|
||||
6
src/items/chests/Chest.java
Normal file
6
src/items/chests/Chest.java
Normal file
@ -0,0 +1,6 @@
|
||||
package items.chests;
|
||||
|
||||
import items.Equipment;
|
||||
|
||||
public abstract class Chest extends Equipment {
|
||||
}
|
||||
15
src/items/chests/LeatherArmor.java
Normal file
15
src/items/chests/LeatherArmor.java
Normal file
@ -0,0 +1,15 @@
|
||||
package items.chests;
|
||||
|
||||
import heroes.Hero;
|
||||
|
||||
public class LeatherArmor extends Chest {
|
||||
public LeatherArmor() {
|
||||
this.name = "Tunique de Cuir";
|
||||
}
|
||||
|
||||
public void equip(Hero hero) {
|
||||
hero.setChest(this);
|
||||
hero.setDefense(hero.getDefense() + 10);
|
||||
hero.setDexterity(hero.getDexterity() + 5);
|
||||
}
|
||||
}
|
||||
15
src/items/chests/MailChest.java
Normal file
15
src/items/chests/MailChest.java
Normal file
@ -0,0 +1,15 @@
|
||||
package items.chests;
|
||||
|
||||
import heroes.Hero;
|
||||
|
||||
public class MailChest extends Chest {
|
||||
public MailChest() {
|
||||
this.name = "Cotte de Mailles";
|
||||
}
|
||||
|
||||
public void equip(Hero hero) {
|
||||
hero.setChest(this);
|
||||
hero.setDefense(hero.getDefense() + 15);
|
||||
hero.setDexterity(hero.getDexterity() - 5);
|
||||
}
|
||||
}
|
||||
16
src/items/chests/PlateArmor.java
Normal file
16
src/items/chests/PlateArmor.java
Normal file
@ -0,0 +1,16 @@
|
||||
package items.chests;
|
||||
|
||||
import heroes.Hero;
|
||||
|
||||
public class PlateArmor extends Chest {
|
||||
public PlateArmor() {
|
||||
this.name = "Armure de plaque";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void equip(Hero hero) {
|
||||
hero.setChest(this);
|
||||
hero.setDefense(hero.getDefense() + 20);
|
||||
hero.setDexterity(hero.getDexterity() - 10);
|
||||
}
|
||||
}
|
||||
16
src/items/chests/RobeMage.java
Normal file
16
src/items/chests/RobeMage.java
Normal file
@ -0,0 +1,16 @@
|
||||
package items.chests;
|
||||
|
||||
import heroes.Hero;
|
||||
|
||||
public class RobeMage extends Chest {
|
||||
public RobeMage() {
|
||||
this.name = "Robe de Mage";
|
||||
}
|
||||
|
||||
public void equip(Hero hero) {
|
||||
hero.setChest(this);
|
||||
hero.setDefense(hero.getDefense() - 5);
|
||||
hero.setDexterity(hero.getDexterity() -5);
|
||||
hero.setIntelligence(hero.getIntelligence() + 15);
|
||||
}
|
||||
}
|
||||
17
src/items/helmets/Hat.java
Normal file
17
src/items/helmets/Hat.java
Normal file
@ -0,0 +1,17 @@
|
||||
package items.helmets;
|
||||
|
||||
import heroes.Hero;
|
||||
|
||||
public class Hat extends Helmet {
|
||||
public Hat() {
|
||||
this.name = "Hat";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void equip(Hero hero) {
|
||||
hero.setHelmet(this);
|
||||
hero.setDefense(hero.getDefense() + 5);
|
||||
hero.setIntelligence(hero.getIntelligence() + 5);
|
||||
hero.setDexterity(hero.getDexterity() - 5);
|
||||
}
|
||||
}
|
||||
16
src/items/helmets/Helm.java
Normal file
16
src/items/helmets/Helm.java
Normal file
@ -0,0 +1,16 @@
|
||||
package items.helmets;
|
||||
|
||||
import heroes.Hero;
|
||||
|
||||
public class Helm extends Helmet {
|
||||
public Helm() {
|
||||
this.name = "Heaume";
|
||||
}
|
||||
|
||||
public void equip(Hero hero) {
|
||||
hero.setHelmet(this);
|
||||
hero.setDefense(hero.getDefense() + 15);
|
||||
hero.setDexterity(hero.getDexterity() - 5);
|
||||
hero.setIntelligence(hero.getIntelligence() - 5);
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
package items.helmets;
|
||||
|
||||
import items.Item;
|
||||
import items.Equipment;
|
||||
|
||||
public abstract class Helmet extends Item {
|
||||
public abstract class Helmet extends Equipment {
|
||||
}
|
||||
|
||||
13
src/items/helmets/NoHelmet.java
Normal file
13
src/items/helmets/NoHelmet.java
Normal file
@ -0,0 +1,13 @@
|
||||
package items.helmets;
|
||||
|
||||
import heroes.Hero;
|
||||
|
||||
public class NoHelmet extends Helmet {
|
||||
public NoHelmet() {
|
||||
this.name = "Rien";
|
||||
}
|
||||
|
||||
public void equip(Hero hero) {
|
||||
hero.setHelmet(this);
|
||||
}
|
||||
}
|
||||
6
src/items/weapons/Weapon.java
Normal file
6
src/items/weapons/Weapon.java
Normal file
@ -0,0 +1,6 @@
|
||||
package items.weapons;
|
||||
|
||||
import items.Equipment;
|
||||
|
||||
public abstract class Weapon extends Equipment {
|
||||
}
|
||||
@ -1,4 +1,252 @@
|
||||
package systems;
|
||||
|
||||
import heroes.Hero;
|
||||
import heroes.jobs.*;
|
||||
import heroes.races.*;
|
||||
import items.chests.LeatherArmor;
|
||||
import items.chests.MailChest;
|
||||
import items.chests.PlateArmor;
|
||||
import items.chests.RobeMage;
|
||||
import items.helmets.Hat;
|
||||
import items.helmets.Helm;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Game {
|
||||
|
||||
public Scanner scanner = new Scanner(System.in);
|
||||
|
||||
public Game() {
|
||||
System.out.println("Bienvenue dans ce projet fou ! Veux-tu créer ton personnage ?");
|
||||
System.out.println("1.Oui\n2.Non");
|
||||
String startGame = scanner.next();
|
||||
switch (startGame.toLowerCase()) {
|
||||
case "oui", "yes", "y", "o" -> createCharacter();
|
||||
case "non", "no", "n" -> {
|
||||
System.out.println("Très bien, à bientôt !");
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void createCharacter() {
|
||||
System.out.println("Quel est le nom de ton personnage ?");
|
||||
String name = scanner.next();
|
||||
System.out.println("Ton personnage s'appelle " + name + " ! Veux-tu le modifier ? \n1.Oui\n2.Non");
|
||||
String choice = scanner.next();
|
||||
switch (choice.toLowerCase()) {
|
||||
case "oui", "yes", "y", "o" -> {
|
||||
createCharacter();
|
||||
}
|
||||
case "non", "no", "n" -> {
|
||||
System.out.println("Très bien, " + name + ".");
|
||||
Hero hero = new Hero(name);
|
||||
hero.printStats();
|
||||
selectJob(hero);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void selectJob(Hero hero) {
|
||||
System.out.println("Quelle classe veux-tu choisir ? Un guerrier ? (G), un mage ? (M), un voleur ? (V)");
|
||||
String job = scanner.next();
|
||||
switch (job.toLowerCase()) {
|
||||
case "guerrier", "g" -> {
|
||||
hero.setJob(new Warrior());
|
||||
System.out.println("Tu as choisi la classe de guerrier !");
|
||||
}
|
||||
case "mage", "m" -> {
|
||||
hero.setJob(new Mage());
|
||||
System.out.println("Tu as choisi la classe de mage !");
|
||||
}
|
||||
case "voleur", "v" -> {
|
||||
hero.setJob(new Rogue());
|
||||
System.out.println("Tu as choisi la classe de voleur !");
|
||||
}
|
||||
}
|
||||
System.out.println("Voici les caractéristiques de ton personnage :");
|
||||
hero.printStats();
|
||||
System.out.println(hero.getJob().getJobName());
|
||||
System.out.println("Veux-tu continuer ?\n1.Oui\n2.Non");
|
||||
String choice = scanner.next();
|
||||
switch (choice.toLowerCase()) {
|
||||
case "oui", "yes", "y", "o" -> selectRace(hero);
|
||||
case "non", "no", "n" -> selectJob(hero);
|
||||
}
|
||||
}
|
||||
|
||||
private void selectRace(Hero hero) {
|
||||
System.out.println("Veux-tu jouer un nain ? (N), un orc ? (O), un elfe (E) ou un humain (H) ?");
|
||||
String choice = scanner.next();
|
||||
switch (choice.toLowerCase()) {
|
||||
case "nain", "n" -> {
|
||||
hero.setRace(new Dwarf());
|
||||
System.out.println("Tu as choisi d'être un nain !");
|
||||
}
|
||||
case "orc", "o" -> {
|
||||
hero.setRace(new Ork());
|
||||
System.out.println("Tu as choisi d'être un orc !");
|
||||
}
|
||||
case "elfe", "e" -> {
|
||||
hero.setRace(new Elf());
|
||||
System.out.println("Tu as choisi d'être un elfe !");
|
||||
}
|
||||
case "humain", "h" -> {
|
||||
hero.setRace(new Human());
|
||||
System.out.println("Tu as choisi d'être un humain !");
|
||||
}
|
||||
}
|
||||
System.out.println("Voici les caractéristiques de ton personnage :");
|
||||
hero.printStats();
|
||||
System.out.println(hero.getRace().getRaceName() + "\n" + hero.getJob().getJobName());
|
||||
System.out.println("Veux-tu continuer ?\n1.Oui\n2.Non");
|
||||
String choice2 = scanner.next();
|
||||
switch (choice2.toLowerCase()) {
|
||||
case "oui", "yes", "y", "o" -> {
|
||||
System.out.println("Très bien, Et maintenant, ton équipement.");
|
||||
equipHelmet(hero);
|
||||
}
|
||||
case "non", "no", "n" -> selectRace(hero);
|
||||
}
|
||||
}
|
||||
private void equipHelmet(Hero hero) {
|
||||
System.out.println("Veux-tu équiper un casque ?\n1.Oui\n2.Non");
|
||||
String choice = scanner.next();
|
||||
switch (choice.toLowerCase()) {
|
||||
case "oui", "yes", "y", "o" -> {
|
||||
System.out.println("D'accord, lequel ? Un Heaume ? (H), un Chapeau ? (C) ?, ou rien ?");
|
||||
String helmet = scanner.next();
|
||||
switch (helmet.toLowerCase()) {
|
||||
case "heaume", "h" -> {
|
||||
hero.setHelmet(new Helm());
|
||||
hero.getHelmet().equip(hero);
|
||||
System.out.println("Tu as équipé un heaume !");
|
||||
}
|
||||
case "chapeau", "c" -> {
|
||||
hero.setHelmet(new Hat());
|
||||
hero.getHelmet().equip(hero);
|
||||
System.out.println("Tu as équipé un chapeau !");
|
||||
}
|
||||
case "none", "rien", "r", "n" -> System.out.println("Très bien, tu n'as pas équipé de casque.");
|
||||
default -> {
|
||||
System.out.println("Je n'ai pas compris ta réponse.");
|
||||
equipHelmet(hero);
|
||||
}
|
||||
}
|
||||
}
|
||||
case "non", "no", "n" -> {
|
||||
System.out.println("Très bien, tu n'as pas équipé de casque.");
|
||||
}
|
||||
}
|
||||
hero.printStats();
|
||||
System.out.println(hero.getRace().getRaceName() + "\n" + hero.getJob().getJobName());
|
||||
System.out.println("Veux-tu continuer ?\n1.Oui\n2.Non");
|
||||
String choice2 = scanner.next();
|
||||
switch (choice2.toLowerCase()) {
|
||||
case "oui", "yes", "y", "o" -> equipArmor(hero);
|
||||
case "non", "no", "n" -> equipHelmet(hero);
|
||||
}
|
||||
}
|
||||
private void equipArmor(Hero hero) {
|
||||
System.out.println("Veux-tu t'équiper d'une armure ?\n1.Oui\n2.Non");
|
||||
String choice = scanner.next();
|
||||
switch (choice.toLowerCase()) {
|
||||
case "oui", "yes", "y", "o" -> {
|
||||
System.out.println("D'accord, lequel ? Une armure en plaque (P) ? Une cotte de mail (M) ? Une tunique en cuir (T) ? Une robe de mage (R) ?");
|
||||
String armor = scanner.next();
|
||||
switch (armor.toLowerCase()) {
|
||||
case "plaque", "plate", "p", "armor", "armure" -> {
|
||||
hero.setChest(new PlateArmor());
|
||||
hero.getChest().equip(hero);
|
||||
System.out.println("Tu t'es équipé d'une armure en plaque !");
|
||||
}
|
||||
case "tunique","tunic", "t", "leather", "cuir" -> {
|
||||
hero.setChest(new LeatherArmor());
|
||||
hero.getChest().equip(hero);
|
||||
System.out.println("Tu t'es équipé d'une tunique de cuir !");
|
||||
}
|
||||
case "mail","mailles", "m", "cotte", "chest" -> {
|
||||
hero.setChest(new MailChest());
|
||||
hero.getChest().equip(hero);
|
||||
System.out.println("Tu t'es équipé d'une tunique de cuir !");
|
||||
}
|
||||
case "robe","mage", "r" -> {
|
||||
hero.setChest(new RobeMage());
|
||||
hero.getChest().equip(hero);
|
||||
System.out.println("Tu t'es équipé d'une tunique de cuir !");
|
||||
}
|
||||
case "none", "rien" -> {
|
||||
System.out.println("Tu veux VRAIMENT y aller à poil ?");
|
||||
String validate = scanner.next();
|
||||
switch (validate.toLowerCase()) {
|
||||
case "oui", "yes", "y", "o" -> System.out.println("Ah bah d'accord le nudiste ...");
|
||||
case "non", "no", "n" -> equipArmor(hero);
|
||||
}
|
||||
}
|
||||
default -> {
|
||||
System.out.println("Je n'ai pas compris ta réponse.");
|
||||
equipHelmet(hero);
|
||||
}
|
||||
}
|
||||
}
|
||||
case "non", "no", "n" -> System.out.println("Très bien, tu n'as pas équipé d'armure.");
|
||||
}
|
||||
hero.printStats();
|
||||
System.out.println(hero.getRace().getRaceName() + "\n" + hero.getJob().getJobName());
|
||||
System.out.println("Veux-tu continuer ?\n1.Oui\n2.Non");
|
||||
String choice2 = scanner.next();
|
||||
switch (choice2.toLowerCase()) {
|
||||
case "oui", "yes", "y", "o" -> equipWeapon(hero);
|
||||
case "non", "no", "n" -> equipArmor(hero);
|
||||
}
|
||||
}
|
||||
|
||||
private void equipWeapon(Hero hero){
|
||||
System.out.println("Veux-tu t'équiper d'une arme ?\n1.Oui\n2.Non");
|
||||
String choice = scanner.next();
|
||||
switch (choice.toLowerCase()) {
|
||||
case "oui", "yes", "y", "o" -> {
|
||||
System.out.println("D'accord, lequel ? Une épée (E) ? Un bâton (B) ? Un arc (A) ? Une dague (D) ?");
|
||||
String weapon = scanner.next();
|
||||
switch (weapon.toLowerCase()) {
|
||||
case "sword", "epee", "e" -> {
|
||||
hero.setWeapon(new Sword());
|
||||
hero.getWeapon().equip(hero);
|
||||
System.out.println("Tu t'es équipé d'une épée !");
|
||||
}
|
||||
case "staff", "baton", "b" -> {
|
||||
hero.setWeapon(new Staff());
|
||||
hero.getWeapon().equip(hero);
|
||||
System.out.println("Tu t'es équipé d'un bâton !");
|
||||
}
|
||||
case "bow", "arc", "a" -> {
|
||||
hero.setWeapon(new Bow());
|
||||
hero.getWeapon().equip(hero);
|
||||
System.out.println("Tu t'es équipé d'un arc !");
|
||||
}
|
||||
case "dagger", "dague", "d" -> {
|
||||
hero.setWeapon(new Dagger());
|
||||
hero.getWeapon().equip(hero);
|
||||
System.out.println("Tu t'es équipé d'une dague !");
|
||||
}
|
||||
case "none", "rien" -> {
|
||||
System.out.println("Tu veux VRAIMENT y aller à mains nues ?");
|
||||
String validate = scanner.next();
|
||||
switch (validate.toLowerCase()) {
|
||||
case "oui", "yes", "y", "o" -> System.out.println("Ah bah d'accord le nudiste ...");
|
||||
case "non", "no", "n" -> equipWeapon(hero);
|
||||
}
|
||||
}
|
||||
default -> {
|
||||
System.out.println("Je n'ai pas compris ta réponse.");
|
||||
equipWeapon(hero);
|
||||
}
|
||||
}
|
||||
}
|
||||
case "non", "no", "n" -> System.out.println("Très bien, tu n'as pas équipé d'arme.");
|
||||
}
|
||||
hero.printStats();
|
||||
System.out.println(hero.getRace().getRaceName() + "\n" + hero.getJob().getJobName());
|
||||
System.out.println("Veux-tu continuer ?\n1.Oui\n2.Non");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user