/*
 * The MIT License
 *
 * Copyright 2016 MrMcX.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package dungeon;

import util.Dice;

/**
 * Stores information about a treasure
 * @author MrMcX
 */
public class Treasure {
    private String treasure;
    
    /**
     * Constructs a random treasure
     */
    public Treasure(){
        treasure = "";
        switch(Dice.Roll(20, 1)){
            case 1: 
                treasure = Dice.Roll(20, 1) + " Kreuzer";
                break;
            case 2: 
                treasure = Dice.Roll(20, 1) + " Heller";
                break;
            case 3: 
                treasure = Dice.Roll(20, 1) + " Silbertaler";
                break;
            case 4: 
                treasure = Dice.Roll(20, 1) + " Dukaten";
                break;
            case 5:
            case 6:
            case 7: 
                treasure = "eine Handvoll Schätze"; // TODO: generate real treasure here
                break;
            case 8:
            case 9: 
                treasure = "zwei Handvoll Schätze"; // TODO: generate real treasure here
                break;
            case 10:
                treasure = "uralte Waffe/Rüstung";        
                break;
            case 11: 
                treasure = "ziemlich neue Waffe/Rüstung";
                break;
            case 12: 
                treasure = "hervorragende Waffe/Rüstung";
                break;
            case 13: 
                treasure = Dice.Roll(6, 1) + " goldene Trinkpokale mit jeweils 5 kleinen Rubinen";
                break;
            case 14: 
                treasure = "Skelett mit einer kompletten Höhlenforscherausrüstung (Q7 127)";
                break;
            case 15: 
                treasure = "ein paar Holz-/Knochenwürfel";
                break;
            case 16: 
                treasure = "eine zerbrochene Phiole";
                break;
            case 17: 
                switch(Dice.Roll(6, 1)){
                    case 1:
                    case 2:
                    case 3: 
                        treasure = "eine Phiole mit einem Heiltrank darin";
                        break;
                    case 4: 
                        treasure = "eine Phiole mit einem Astraltrank darin";
                        break;
                    case 5: 
                        treasure = "eine Phiole mit einem Eigenschaftselixier darin";
                        break;
                    case 6: 
                        treasure = "eine Phiole mit einem Halbgift darin";
                        break;
                }
                break;
            case 18: 
                treasure = "Götterstatue/-amulett";
                break;
            case 19: 
                treasure = "magisches Artefakt, dessen Ladungen alle verbraucht sind";
                break;
            case 20: 
                treasure = "magisches Artefakt";
                break;
        }
    }
    
    @Override
    public String toString(){
        return treasure;
    }
}
