Archived
1
0

+ 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:
2009-01-30 13:00:32 +01:00
parent fa5ad89d6b
commit 422210793e
5 changed files with 21 additions and 16 deletions
+7 -4
View File
@@ -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) {