Search in sources :

Example 11 with Character

use of io.github.spugn.Sargo.Objects.Character in project S-argo by Expugn.

the class RecordCrystal method randGoldCharacter.

@Override
protected Character randGoldCharacter() {
    int randIndex = GOLD_BANNERS.get(RNG.nextInt(GOLD_BANNERS.size()));
    Banner randBanner = BANNERS.get(randIndex - 1);
    List<Character> randCharacters = randBanner.getCharacters();
    return randCharacters.get(RNG.nextInt(randCharacters.size()));
}
Also used : Character(io.github.spugn.Sargo.Objects.Character) Banner(io.github.spugn.Sargo.Objects.Banner)

Example 12 with Character

use of io.github.spugn.Sargo.Objects.Character in project S-argo by Expugn.

the class RecordCrystalv2 method randGoldCharacter.

@Override
protected Character randGoldCharacter() {
    int randIndex = GOLD_BANNERS_V2.get(RNG.nextInt(GOLD_BANNERS_V2.size()));
    Banner randBanner = BANNERS.get(randIndex - 1);
    List<Character> randCharacters = randBanner.getCharacters();
    return randCharacters.get(RNG.nextInt(randCharacters.size()));
}
Also used : Character(io.github.spugn.Sargo.Objects.Character) Banner(io.github.spugn.Sargo.Objects.Banner)

Example 13 with Character

use of io.github.spugn.Sargo.Objects.Character in project S-argo by Expugn.

the class SAOGameFifthAnniversaryStepUp method randGoldCharacter.

@Override
protected Character randGoldCharacter() {
    int randIndex = GOLD_BANNERS.get(RNG.nextInt(GOLD_BANNERS.size()));
    Banner randBanner = BANNERS.get(randIndex - 1);
    List<Character> randCharacters = randBanner.getCharacters();
    return randCharacters.get(RNG.nextInt(randCharacters.size()));
}
Also used : Character(io.github.spugn.Sargo.Objects.Character) Banner(io.github.spugn.Sargo.Objects.Banner)

Example 14 with Character

use of io.github.spugn.Sargo.Objects.Character in project S-argo by Expugn.

the class StepUpv2 method randGoldCharacter.

@Override
protected Character randGoldCharacter() {
    int randIndex = GOLD_BANNERS.get(RNG.nextInt(GOLD_BANNERS.size()));
    Banner randBanner = BANNERS.get(randIndex - 1);
    List<Character> randCharacters = randBanner.getCharacters();
    return randCharacters.get(RNG.nextInt(randCharacters.size()));
}
Also used : Character(io.github.spugn.Sargo.Objects.Character) Banner(io.github.spugn.Sargo.Objects.Banner)

Example 15 with Character

use of io.github.spugn.Sargo.Objects.Character in project S-argo by Expugn.

the class StepUpv3 method randGoldCharacter.

@Override
protected Character randGoldCharacter() {
    /* GET A RANDOM GOLD VARIANT CHARACTER, IF THERE IS A PLATINUM
           VARIANT OF THAT CHARACTER IN THE BANNER THEN GET A NEW CHARACTER. */
    Character c = null;
    boolean charInBanner = true;
    int randIndex;
    Banner randBanner;
    List<Character> randCharacters;
    boolean sameName;
    boolean samePrefix;
    while (charInBanner) {
        randIndex = GOLD_BANNERS_V2.get(RNG.nextInt(GOLD_BANNERS_V2.size()));
        randBanner = BANNERS.get(randIndex - 1);
        randCharacters = randBanner.getCharacters();
        c = randCharacters.get(RNG.nextInt(randCharacters.size()));
        for (Character bc : SELECTED_BANNER.getCharacters()) {
            sameName = c.getName().equalsIgnoreCase(bc.getName());
            samePrefix = c.getPrefix().equalsIgnoreCase(bc.getPrefix());
            if (!(sameName && samePrefix)) {
                charInBanner = false;
            } else {
                charInBanner = true;
                break;
            }
        }
    }
    return c;
}
Also used : Character(io.github.spugn.Sargo.Objects.Character) Banner(io.github.spugn.Sargo.Objects.Banner)

Aggregations

Character (io.github.spugn.Sargo.Objects.Character)25 Banner (io.github.spugn.Sargo.Objects.Banner)13 ImageEditor (io.github.spugn.Sargo.Utilities.ImageEditor)3 Weapon (io.github.spugn.Sargo.Objects.Weapon)2 UserParser (io.github.spugn.Sargo.XMLParsers.UserParser)2 FailedToReadBannerFileException (io.github.spugn.Sargo.Exceptions.FailedToReadBannerFileException)1 GitHubImage (io.github.spugn.Sargo.Utilities.GitHubImage)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 DecimalFormat (java.text.DecimalFormat)1 Random (java.util.Random)1 XMLEventReader (javax.xml.stream.XMLEventReader)1 XMLInputFactory (javax.xml.stream.XMLInputFactory)1 XMLStreamException (javax.xml.stream.XMLStreamException)1 Attribute (javax.xml.stream.events.Attribute)1 EndElement (javax.xml.stream.events.EndElement)1 StartElement (javax.xml.stream.events.StartElement)1