Advertisement
Guest User

Untitled

a guest
Jan 28th, 2015
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.31 KB | None | 0 0
  1. import static gdi.MakeItSimple.*;
  2. public class RPG {
  3.     /** 0 = Stärke
  4.      *  1 = Konstitution
  5.      *  2 = Geschicklichkeit
  6.      *  3 = Intelligenz
  7.      *  4 = Willenskraft
  8.      *  5 = Klasse
  9.      *  6 = Geschlecht
  10.      **/
  11.     public int[] stat = new int[7];
  12.    
  13.    
  14.     public void charakterErstellung(){
  15.        
  16.         //Geschlechtabfrage
  17.         println("Bist du eine Frau, ein Mann oder ein Hermaphrodit?");
  18.         String temp = readLine();
  19.         while(stat[6]!= 0 || stat[6]!= 1 || stat[6]!= 2 ){
  20.             if(temp.equals("Frau")){
  21.                 stat[6]=1;
  22.             }else if(temp.equals("Mann")){
  23.                 stat[6]=0; 
  24.             }else if(temp.equals("Hermaphrodit")){
  25.                 stat[6]=2;
  26.             }else {
  27.                 println("Kein gültige Eingabe");
  28.                 println("Bist du eine Frau, ein Mann oder ein Hermaphrodit?");
  29.                 temp = readLine();
  30.             }
  31.  
  32.         }
  33.        
  34.         //Klassenabfrage
  35.         stat[5]= 6;
  36.         println("Wähle eine Klasse: Krieger, Bogenschütze, Magier");
  37.         temp = readLine();
  38.         while(stat[5]== 6){
  39.             if(temp.equals("Krieger")){
  40.                 stat[5]=0;
  41.             }else if(temp.equals("Bogenschütze")){
  42.                 stat[5]=1; 
  43.             }else if(temp.equals("Magier")){
  44.                 stat[5]=2;
  45.             }else {
  46.                 println("Kein gültige Eingabe");
  47.                 println("Wähle eine Klasse: Krieger");
  48.                 temp = readLine();
  49.             }
  50.  
  51.         }
  52.     }
  53.         public static void main(String[] args) {
  54.             RPG rpg = new RPG();
  55.             rpg.charakterErstellung();
  56.  
  57.         }
  58.  
  59.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement