Ejemplo n.º 1
0
        public override void OnStart()
        {
            /* Zara Initialization code start =======>> */

            // Initialize Zara randomizer
            _random = new Random(DateTime.Now.Millisecond);
            ZaraEngine.Helpers.InitializeRandomizer((a, b) => (float)(a + ((b - a) * _random.NextDouble())));

            _dateTime  = DateTime.Now;
            _timeOfDay = TimesOfDay.Evening;
            _health    = new HealthController(this);
            _body      = new BodyStatusController(this);
            _weather   = new WeatherDescription();
            _player    = new PlayerStatus();
            _inventory = new InventoryController(this);

            _body.Initialize();
            _health.Initialize();

            /* <<======= Zara Initialization code end */

            #region Demo App Init

            // Defaults
            _weather.SetTemperature(24f);
            _weather.SetWindSpeed(8f);
            _weather.SetRainIntensity(0.06f);

            #endregion
        }
Ejemplo n.º 2
0
    public override void _Ready()
    {
        /* Zara Initialization code start =======>> */

        ZaraEngine.Helpers.InitializeRandomizer(_random.RandfRange);

        _dateTime  = DateTime.Now;
        _timeOfDay = TimesOfDay.Evening;
        _health    = new HealthController(this);
        _body      = new BodyStatusController(this);
        _weather   = new WeatherDescription();
        _player    = new PlayerStatus();
        _inventory = new InventoryController(this);

        _body.Initialize();
        _health.Initialize();

        /* <<======= Zara Initialization code end */

        #region Demo App Init

        // Defaults
        _weather.SetTemperature(21f);
        _weather.SetWindSpeed(10f);
        _weather.SetRainIntensity(0.12f);

        #endregion
    }
Ejemplo n.º 3
0
    public void Initialize(WeatherDescription weather, Func <DateTime?> getDateTimeFunc, Func <TimesOfDay> getTimeOfDayFunc)
    {
        _getDateTimeFunc  = getDateTimeFunc;
        _getTimeOfDayFunc = getTimeOfDayFunc;

        /* Zara Initialization code start =======>> */

        _health    = new HealthController(this);
        _body      = new BodyStatusController(this);
        _weather   = weather;
        _player    = new PlayerStatus();
        _inventory = new InventoryController(this);
        _body.Initialize();
        _health.Initialize();

        /* <<======= Zara Initialization code end */
    }
Ejemplo n.º 4
0
    // Start is called before the first frame update
    void Start()
    {
        /* Zara Initialization code start =======>> */

        ZaraEngine.Helpers.InitializeRandomizer(UnityEngine.Random.Range);

        _dateTime  = DateTime.Now;
        _timeOfDay = TimesOfDay.Evening;
        _health    = new HealthController(this);
        _body      = new BodyStatusController(this);
        _weather   = new WeatherDescription();
        _player    = new PlayerStatus();
        _inventory = new InventoryController(this);

        _body.Initialize();
        _health.Initialize();

        /* <<======= Zara Initialization code end */

        #region Demo app init

        // Let's add some items to the inventory to play with in this demo

        var flaskWithWater = new ZaraEngine.Inventory.Flask();

        flaskWithWater.FillUp(WorldTime.Value);
        //flaskWithWater.Disinfect(WorldTime.Value);

        _jacket = new ZaraEngine.Inventory.WaterproofJacket();
        _pants  = new ZaraEngine.Inventory.WaterproofPants();
        _boots  = new ZaraEngine.Inventory.RubberBoots();
        _hat    = new ZaraEngine.Inventory.LeafHat();

        _inventory.AddItem(flaskWithWater);

        _inventory.AddItem(_jacket);
        _inventory.AddItem(_pants);
        _inventory.AddItem(_boots);
        _inventory.AddItem(_hat);

        var meat = new ZaraEngine.Inventory.Meat {
            Count = 1
        };

        // We just gathered two of spoiled Meat.
        meat.AddGatheringInfo(WorldTime.Value.AddHours(-5), 2);

        // We just gathered one item of fresh Meat. These will spoil in MinutesUntilSpoiled game minutes.
        meat.AddGatheringInfo(WorldTime.Value, 1);

        _inventory.AddItem(new ZaraEngine.Inventory.Cloth {
            Count = 20
        });
        _inventory.AddItem(meat);
        _inventory.AddItem(new ZaraEngine.Inventory.AntisepticSponge {
            Count = 5
        });
        _inventory.AddItem(new ZaraEngine.Inventory.Bandage {
            Count = 5
        });
        _inventory.AddItem(new ZaraEngine.Inventory.Acetaminophen {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.Antibiotic {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.Aspirin {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.EmptySyringe {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.Loperamide {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.Oseltamivir {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.Sedative {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.AtropineSolution {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.EpinephrineSolution {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.AntiVenomSolution {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.DoripenemSolution {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.MorphineSolution {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.DisinfectingPellets {
            Count = 5
        });

        RefreshConsumablesUICombo();
        RefreshToolsUICombo();

        // Defaults
        _weather.SetTemperature(27f);
        _weather.SetWindSpeed(2f);
        _weather.SetRainIntensity(0f);

        #endregion
    }
Ejemplo n.º 5
0
    // Start is called before the first frame update
    void Start()
    {
        /* Zara Initialization code start =======>> */

        ZaraEngine.Helpers.InitializeRandomizer((a, b) => UnityEngine.Random.Range(a, b));

        _dateTime  = DateTime.Now;
        _timeOfDay = TimesOfDay.Evening;
        _health    = new HealthController(this);
        _body      = new BodyStatusController(this);
        _weather   = new WeatherDescription();
        _player    = new PlayerStatus();
        _inventory = new InventoryController(this);

        ClothesGroups.Initialize(this);

        _body.Initialize();
        _health.Initialize();

        /* <<======= Zara Initialization code end */

        // Let's add some items to the inventory to play with in this demo

        var flaskWithWater = new ZaraEngine.Inventory.Flask();

        flaskWithWater.FillUp(WorldTime.Value);
        //flaskWithWater.Disinfect(WorldTime.Value);

        _jacket = new ZaraEngine.Inventory.WaterproofJacket();
        _pants  = new ZaraEngine.Inventory.WaterproofPants();
        _boots  = new ZaraEngine.Inventory.RubberBoots();
        _hat    = new ZaraEngine.Inventory.LeafHat();

        _inventory.AddItem(flaskWithWater);

        _inventory.AddItem(_jacket);
        _inventory.AddItem(_pants);
        _inventory.AddItem(_boots);
        _inventory.AddItem(_hat);

        _inventory.AddItem(new ZaraEngine.Inventory.Cloth {
            Count = 20
        });
        _inventory.AddItem(new ZaraEngine.Inventory.Meat {
            Count = 3
        });
        _inventory.AddItem(new ZaraEngine.Inventory.Bandage {
            Count = 5
        });
        _inventory.AddItem(new ZaraEngine.Inventory.Acetaminophen {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.Antibiotic {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.Aspirin {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.EmptySyringe {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.Loperamide {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.Oseltamivir {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.Sedative {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.AtropineSolution {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.EpinephrineSolution {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.AntiVenomSolution {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.DoripenemSolution {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.MorphineSolution {
            Count = 10
        });
        _inventory.AddItem(new ZaraEngine.Inventory.DisinfectingPellets {
            Count = 5
        });

        RefreshConsumablesUICombo();
        RefreshToolsUICombo();

        // Defaults
        _weather.SetTemperature(27f);
        _weather.SetWindSpeed(0.1f);
        _weather.SetRainIntensity(0f);
    }