private void ActHuman() { for (int i = 0; i < InfectedInRange(); i++) { panic = true; InfectedAttack(); } if (InfectedInSight() > 0) { panic = true; ticksNoZombie = 0; } else { ticksNoZombie++; if (ticksNoZombie > 10) { panic = false; } } if (sick) { sick = immune ? false : true; if (!sick) { return; } ticksSick++; speed = SpeedNum.Limp; health -= 3; if (rand.Next(100) < ticksSick) { infected = true; health += 50; } } else if (panic) { speed = (InfectedInRange() > 4)? SpeedNum.Sprint: SpeedNum.Run; dir = AimAwayFromInfected(); } else { speed = SpeedNum.Walk; if (rand.Next(10) < 5) { dir = (Direction)rand.Next(8); } if (rand.Next(100) > 50) { dir = AimAwayFromInfected(); } } Move(); }
public Human(World w, bool immunity) { Humans++; index = Humans; immune = immunity; world = w; x = rand.Next(world.Width - 10) + 5; y = rand.Next(world.Height - 10) + 5; health = 100; ticksSick = 0; dir = (Direction)rand.Next(7); speed = SpeedNum.Walk; alive = true; panic = false; }
public Human(World w, bool immunity) { Humans++; index = Humans; immune = immunity; world = w; x = rand.Next(world.Width-10)+5; y = rand.Next(world.Height-10)+5; health = 100; ticksSick = 0; dir = (Direction)rand.Next(7); speed = SpeedNum.Walk; alive = true; panic = false; }
private void ActInfected() { speed = ((speed != SpeedNum.Stop)? SpeedNum.Limp: SpeedNum.Stop); for (int i = 0; i < HumansInRange(); i++) { InfectedNom(); } for (int i = 0; i < InfectedInRange(); i++) { if (rand.Next(100) < 33) { InfectedAttack(); InfectedNom(); } } dir = AimAtHumans(); Move(); }
void ReleaseDesignerOutlets() { if (GameModeLabel != null) { GameModeLabel.Dispose(); GameModeLabel = null; } if (BGBox != null) { BGBox.Dispose(); BGBox = null; } if (TextArea != null) { TextArea.Dispose(); TextArea = null; } if (VerticalLine != null) { VerticalLine.Dispose(); VerticalLine = null; } if (HorizontalLine != null) { HorizontalLine.Dispose(); HorizontalLine = null; } if (AccuracyText != null) { AccuracyText.Dispose(); AccuracyText = null; } if (SpeedText != null) { SpeedText.Dispose(); SpeedText = null; } if (DurationText != null) { DurationText.Dispose(); DurationText = null; } if (AccuracyNum != null) { AccuracyNum.Dispose(); AccuracyNum = null; } if (SpeedNum != null) { SpeedNum.Dispose(); SpeedNum = null; } if (DurationNum != null) { DurationNum.Dispose(); DurationNum = null; } if (BGBoxWhite != null) { BGBoxWhite.Dispose(); BGBoxWhite = null; } if (InputBox != null) { InputBox.Dispose(); InputBox = null; } }
private void ActInfected() { speed = ((speed != SpeedNum.Stop)? SpeedNum.Limp: SpeedNum.Stop); for (int i = 0; i < HumansInRange(); i++) InfectedNom(); for (int i = 0; i < InfectedInRange(); i++) { if (rand.Next(100) < 33) { InfectedAttack(); InfectedNom(); } } dir = AimAtHumans(); Move(); }
private void ActHuman() { for (int i = 0; i < InfectedInRange(); i++) { panic = true; InfectedAttack(); } if (InfectedInSight() > 0) { panic = true; ticksNoZombie = 0; } else { ticksNoZombie++; if (ticksNoZombie > 10) panic = false; } if (sick) { sick = immune ? false : true; if (!sick) return; ticksSick++; speed = SpeedNum.Limp; health -= 3; if (rand.Next(100) < ticksSick) { infected = true; health += 50; } } else if (panic) { speed =(InfectedInRange() > 4)? SpeedNum.Sprint: SpeedNum.Run; dir = AimAwayFromInfected(); } else { speed = SpeedNum.Walk; if (rand.Next(10) < 5) dir = (Direction)rand.Next(8); if ( rand.Next(100) > 50) dir = AimAwayFromInfected(); } Move(); }