public CitizenSensoryPerception(Map AreaMap, Actor Parent)
     : base(Parent)
 {
     VisionRefreshRate = 500;
     Area = AreaMap;
     ActorsInSight = new List<Actor>();
 }
Пример #2
0
 public Form1()
 {
     InitializeComponent();
     Loop = new GameProject.GameLoop();
     Loop.GameLogic += new GameProject.GameLoop.GameLogic_delegate(Loop_GameLogic_handler);
     Loop.RenderScene += new GameProject.GameLoop.RenderScene_delegate(Loop_RenderScene);
     this.FormClosing += new FormClosingEventHandler(Form1_FormClosing);
     //this.Disposed += new EventHandler(Form1_Disposed);
     cam = new Camera(pb.Width, pb.Height);
     map = new Map(pb.Width, pb.Height, 10, 100,25);
     //cam.Zoom = 50;
     cam.CameraLocation = new Point(pb.Width / 2, pb.Height / 2);
     pb.Resize += new EventHandler(pb_Resize);
 }
Пример #3
0
        public Structure(int BuildingID, Map AreaMap)
        {
            Area = AreaMap;
            this.BuildingID = BuildingID;

            bool validpos = false;
            int counter = 0;

            while (!validpos)
            {
                PositionRect = new System.Drawing.Rectangle(Utilities.R(1, Area.Width - 1), Utilities.R(1, Area.Height - 1), Utilities.R(AreaMap.MinBuildingSize, AreaMap.MaxBuidingSize), Utilities.R(AreaMap.MinBuildingSize, AreaMap.MaxBuidingSize));
                _center = new GeomLib.Point2D(PositionRect.X + PositionRect.Width / 2, PositionRect.Y + PositionRect.Height / 2);
                validpos = !Area.IntersectsBuilding(PositionRect);
                counter += 1;
                if (counter > 50) throw new Exception("Cannot place this building");
            }

            Food = Utilities.R(5, 20);
            if (Utilities.RTFWeighted(AreaMap.GroceryPerc)) Food += Utilities.R(25, 1000);  //5% of stores are grocery stores.  They get extra food

            if (Utilities.RTFWeighted(AreaMap.HasGunPercentage))
            {
                //    'Location has a gun
                Guns = Utilities.R(1, 5);
                Ammo = Utilities.R(10, 100);
            }
            else if (Utilities.RTFWeighted(AreaMap.GunStorePercentage))
            {
                Guns = Utilities.R(AreaMap.GunStoreGunMin, AreaMap.GunStoreGunMax);
                Ammo = Utilities.R(AreaMap.GunStoreAmmoMin, AreaMap.GunStoreAmmoMax);
            }

            Secured = false;
            SecureStrength = 0;
            SecuringMaterials = Utilities.R(1, 50);
        }
Пример #4
0
 public HumanCitizen(Map map)
     : base()
 {
     this.Statistics = new CitizenStats();
     this.Locomotion = new CitizenLocomotion(this, map);
 }
Пример #5
0
 public CitizenLocomotion(Actor Parent, Map map)
     : base(Parent)
 {
     Area = map;
 }
Пример #6
0
 public UndeadCitizen(Map map)
     : base()
 {
     this.Statistics = new UndeadStats();
     this.Locomotion = new CitizenLocomotion(this, map);
 }