+ introduced "ismale"-attribute for humans
* humans can only mate with someone from the other sex x bugfixing for Windows (FontRendering setting) * some optimizations
This commit is contained in:
+7
-4
@@ -13,14 +13,16 @@ namespace vampi
|
||||
get { return this.infected; }
|
||||
}
|
||||
public static int legalSexAge = Settings.humanLegalSexAge;
|
||||
public static int vampireConversionRate = Settings.humanVampireConversionPercent;
|
||||
public static int vampireConversionRate = Settings.humanVampireConversionPercent;
|
||||
public bool ismale;
|
||||
|
||||
public Einwohner(Spielfeld sfeld)
|
||||
: base(sfeld) {
|
||||
this.typ = Typliste.EINWOHNER;
|
||||
this.maxAge = Settings.humanMaxAge;
|
||||
this.age = Program.random.Next(0, Settings.humanMaxInitAge);
|
||||
Einwohner.count++;
|
||||
Einwohner.count++;
|
||||
if (Program.random.Next(0, 100) < 85) this.ismale = true; else this.ismale = false;
|
||||
}
|
||||
|
||||
public void infect() {
|
||||
@@ -54,8 +56,9 @@ namespace vampi
|
||||
Spielfeld neighbor = this.sfeld.getNachbarfeld(i);
|
||||
if (neighbor != null && neighbor.Sfigur != null) {
|
||||
if (neighbor.Sfigur.Typ == Typliste.EINWOHNER) {
|
||||
if (neighbor.Sfigur.Age >= Einwohner.legalSexAge && (Settings.humanNormalCanReproduceWithInfected || !((Einwohner)neighbor.Sfigur).Infected)) {
|
||||
mateFound = true;
|
||||
if (neighbor.Sfigur.Age >= Einwohner.legalSexAge && (Settings.humanNormalCanReproduceWithInfected || !((Einwohner)neighbor.Sfigur).Infected)) {
|
||||
if (((Einwohner)neighbor.Sfigur).ismale != this.ismale)
|
||||
mateFound = true;
|
||||
}
|
||||
}
|
||||
} else if (neighbor != null && neighbor.Sfigur == null) {
|
||||
|
||||
Reference in New Issue
Block a user