use of de.gg.game.model.types.SocialStatus in project ProjektGG by eskalon.
the class CharacterFactory method createCharacterForPosition.
public static Character createCharacterForPosition(Random random, PositionType posType) {
SocialStatus status;
switch(posType.getLevel()) {
default:
case 1:
case 2:
{
status = SocialStatus.CITIZEN;
break;
}
case 3:
{
status = RandomUtils.isTrue(random, 3) ? SocialStatus.PATRICIAN : SocialStatus.CITIZEN;
break;
}
case 4:
case 5:
{
status = SocialStatus.PATRICIAN;
break;
}
case 6:
{
status = RandomUtils.isTrue(random, 2) ? SocialStatus.PATRICIAN : SocialStatus.CAVALIER;
break;
}
case 7:
{
status = SocialStatus.CAVALIER;
break;
}
case 8:
{
status = RandomUtils.isTrue(random, 3) ? SocialStatus.CAVALIER : SocialStatus.BARON;
break;
}
case 9:
{
status = SocialStatus.BARON;
break;
}
}
Character c = createCharacterWithStatus(random, status);
c.setHighestPositionLevel(posType.getLevel());
c.setPosition(posType);
return c;
}
use of de.gg.game.model.types.SocialStatus 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