// Birth
DateObject now = new DateObject(Date.getInstance(0).getCurrentDate()); // TODO ugly
y = drawRow(g2d, y, firstColumn, "Born");
sb = new StringBuilder();
ICity birthPlace = data.getBirthPlace();
sb.append("on ").append(data.getBirthDate().toDisplayString()).append(" in ").append(birthPlace.getName()).append(", ");
sb.append("Age ").append(data.getAge(now));
y = drawRow(g2d, y, firstColumn, sb.toString());
y += positions.lineHeight;
y = drawRow(g2d, y, firstColumn, "Hometown");
y = drawRow(g2d, y, firstColumn, player.getHometown().getName());
y += positions.lineHeight;
sb = new StringBuilder();
sb.append("Social status in this town: ").append(city.getCity().getSocialRank());
y = drawRow(g2d, y, firstColumn, sb.toString());
IReputation rep = city.getCity().getReputation(player);
int repDiff = rep.getReputationDifference();
sb = new StringBuilder();
if (repDiff<0){
// reputation has sunk
if (repDiff<=-10 && repDiff>-25){
sb.append("Your reputation has sunken.");
} else if (repDiff>-10){
sb.append("Your reputation has sunken slightly");
} else {
sb.append("Your reputation has dropped");
}
} else if (repDiff>0){
// reputation has risen
if (repDiff>=10 && repDiff<25){
sb.append("Your reputation has risen");
} else if (repDiff<10){
sb.append("Your reputation has risen slightly");
} else {
sb.append("Your reputation has risen massivly");
}
} else {
sb.append("Your reputation in this city is unchanged");
}
y = drawRow(g2d, y, firstColumn, sb.toString());
if (rank!=ESocialRank.ALDERMAN && rank!=ESocialRank.MAYOR){
// draw string what is needed
ESocialRank nextRank = rank.getNextRank();
boolean needFortune = false;
if (player.getCompany().getCompanyValue()<nextRank.getCompanyValue()){
needFortune=true;
}
boolean needReputation=false;
if (city.getCity().getReputation(player).getPopularity()<nextRank.getSocialReputation()){
needReputation=true;
}
sb = new StringBuilder();
if (needFortune && needReputation){
sb.append("You need more fortune and respect in ").append(city.getCity().getName()).append(" to");
y = drawRow(g2d, y, firstColumn, sb.toString());
sb = new StringBuilder();
sb.append("advanve to the next social rank");
y = drawRow(g2d, y, firstColumn, sb.toString());
} else if (needFortune){
sb.append("You need more fortune in ").append(city.getCity().getName()).append(" to");
y = drawRow(g2d, y, firstColumn, sb.toString());
sb = new StringBuilder();
sb.append("advanve to the next social rank");
y = drawRow(g2d, y, firstColumn, sb.toString());
} else if (needReputation){
sb.append("You need more respect in ").append(city.getCity().getName()).append(" to");
y = drawRow(g2d, y, firstColumn, sb.toString());
sb = new StringBuilder();
sb.append("advanve to the next social rank");
y = drawRow(g2d, y, firstColumn, sb.toString());
} else {
y += positions.lineHeight;
y += positions.lineHeight;
}
} else {
y += positions.lineHeight;
y += positions.lineHeight;
}
// Draw underworld string
ICareer careerLevel = player.getCareerLevel();
String s;
if (careerLevel instanceof IMilitantCareer){
if (((EMilitantCareer)careerLevel)!=EMilitantCareer.BOISTEROUS &&
((EMilitantCareer)careerLevel)!=EMilitantCareer.BOLD ){
s = "The underworld fears you";
} else {
s = "The underworld avoids you";
}
} else {
s = "The underworld avoids you";
}
y = drawRow(g2d, y, firstColumn, s);
y += positions.lineHeight;
if (player.getSpouseData()!=null){
ISpouseData spouse = player.getSpouseData();
// Name
if (spouse.isMale()){
s = "Name of husband"; // TODO externalize
} else {
s = "Name of wife";
}
y = drawRow(g2d, y, firstColumn, s);
sb = new StringBuilder();
sb.append(spouse.getName()).append(" ").append(spouse.getLastName());
sb.append(", Age ").append(spouse.getAge(now));
y = drawRow(g2d, y, firstColumn, sb.toString());
y += positions.lineHeight;
// Birth
y = drawRow(g2d, y, firstColumn, "Born");
sb = new StringBuilder();
sb.append("on ").append(data.getBirthDate().toDisplayString()).append(" in ").append(birthPlace.getName());
y = drawRow(g2d, y, firstColumn, sb.toString());
y += positions.lineHeight;
y = drawRow(g2d, y, firstColumn, "Children");