use of de.gg.game.model.entities.Character in project ProjektGG by eskalon.
the class CharacterFactory method createPlayerCharacter.
/**
* Creates a character for a player.
*
* @param random
* The random generator for this session.
* @param profession
* The player's profession.
* @param difficulty
* The game's difficulty level.
* @return the character.
*/
public static Character createPlayerCharacter(Random random, ProfessionType profession, GameDifficulty difficulty, boolean isMale, Religion religion, String name, String surname) {
Character c = new Character();
c.setAge(RandomUtils.getInt(random, 17, 23));
c.setGold(profession.getStartingGold() + difficulty.getAdditionalStartingGold());
c.setHighestPositionLevel(0);
c.setHp(RandomUtils.getInt(random, 96, 104));
c.setMale(isMale);
c.setMarried(false);
c.setName(name);
c.setReligion(religion);
c.setStatus(SocialStatus.NON_CITIZEN);
c.setSurname(surname);
c.setNPCTrait(null);
return c;
}
use of de.gg.game.model.entities.Character in project ProjektGG by eskalon.
the class RoundEndSystem method processPlayer.
public void processPlayer(short id, Player p) {
Character c = p.getCurrentlyPlayedCharacter(world);
// INHERITANCE TAX
if (p.getPreviouslyInheritedValue() > 0) {
c.setGold(c.getGold() - Math.round(p.getPreviouslyInheritedValue() * ((Integer) world.getLaws().get(LawType.INHERITANCE_TAX) / 100F)));
p.setPreviouslyInheritedValue(0);
}
// SOCIAL STATUS
if (c.getStatus().getLevel() < 3) {
// Patrician & Cavalier
SocialStatus superiorStatus = SocialStatus.values()[c.getStatus().getLevel() + 1];
if (p.getFortune(world) >= superiorStatus.getFortuneRequirement() && c.getHighestPositionLevel() >= superiorStatus.getPositionLevelRequirement()) {
//
c.setStatus(superiorStatus);
if (localPlayerId == id) {
// TODO notification!
}
}
}
// AP
p.setAvailableAp(p.getAvailableAp() + 4 + p.getSkills().getAgilitySkill());
}
Aggregations