use of io.github.spugn.Sargo.Objects.Character in project S-argo by Expugn.
the class RecordCrystalv4 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()));
}
use of io.github.spugn.Sargo.Objects.Character in project S-argo by Expugn.
the class StepUp 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()));
}
use of io.github.spugn.Sargo.Objects.Character in project S-argo by Expugn.
the class CharacterScout method generateImageStrings.
/**
* Same function as {@link #generateImageString()} but for eleven characters.
* @see #generateImageString()
*/
private void generateImageStrings() {
boolean foundDuplicate = false;
for (int i = 0; i < 11; i++) {
if (!USER.getCharacterBox().isEmpty()) {
for (Character userCharacter : USER.getCharacterBox()) {
if (userCharacter.getPrefix().equals(characters.get(i).getPrefix()) && userCharacter.getRarity() == characters.get(i).getRarity() && userCharacter.getName().equals(characters.get(i).getName())) {
foundDuplicate = true;
giveHackingCrystals(characters.get(i));
characterString += "~~" + characters.get(i).toString() + "~~" + "\n";
if (generateImage && !IMAGE_DISABLED)
new ImageEditor().drawCharacterImage(characters.get(i).getImagePath(), characters.get(i).getRarity(), true, IS_RARITY_STARS, tempUserDirectory + "/temp_" + i + ".png");
}
}
if (!foundDuplicate) {
USER.addCharacter(characters.get(i));
characterString += "**" + characters.get(i).toString() + "**\n";
if (generateImage && !IMAGE_DISABLED)
new ImageEditor().drawCharacterImage(characters.get(i).getImagePath(), characters.get(i).getRarity(), false, IS_RARITY_STARS, tempUserDirectory + "/temp_" + i + ".png");
}
foundDuplicate = false;
} else {
USER.addCharacter(characters.get(i));
characterString += "**" + characters.get(i).toString() + "**\n";
if (generateImage && !IMAGE_DISABLED)
new ImageEditor().drawCharacterImage(characters.get(i).getImagePath(), characters.get(i).getRarity(), false, IS_RARITY_STARS, tempUserDirectory + "/temp_" + i + ".png");
}
imageStrings[i] = tempUserDirectory + "/temp_" + i + ".png";
}
}
use of io.github.spugn.Sargo.Objects.Character in project S-argo by Expugn.
the class CharacterScout method getCharacter.
/**
* Determines which character is added to the user's collection
* depending on the rarity value given.
*
* @param rarity The rarity value of the character.
* @return A new {@link Character} from the banner or from
* the collection of copper or silver characters.
*/
private Character getCharacter(int rarity) {
Character character;
if (rarity == 2) {
CopperCharacter cC = new CopperCharacter();
character = cC.getCharacter(RNG.nextInt(cC.getSize()));
} else if (rarity == 3) {
SilverCharacter sC = new SilverCharacter();
character = sC.getCharacter(RNG.nextInt(sC.getSize()));
} else if (rarity == 4) {
if (guaranteedScout) {
double d = RNG.nextDouble();
if (d < 0.6) {
character = goldCharacters.get(RNG.nextInt(goldCharacters.size()));
} else {
character = randGoldCharacter();
}
} else {
if (goldCharacters.size() > 0) {
character = goldCharacters.get(RNG.nextInt(goldCharacters.size()));
} else {
character = randGoldCharacter();
}
}
} else {
if (guaranteedScout) {
double d = RNG.nextDouble();
if (d < 0.6) {
character = platinumCharacters.get(RNG.nextInt(platinumCharacters.size()));
} else {
character = randGoldCharacter();
}
} else {
character = platinumCharacters.get(RNG.nextInt(platinumCharacters.size()));
}
}
return character;
}
use of io.github.spugn.Sargo.Objects.Character in project S-argo by Expugn.
the class Event 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()));
}
Aggregations