Example #1
0
            public IEnumerator CreateNpcRoutine(string playerId, string characterId, Vitals.Template template, string prefab, Action<Character> action)
            {
                string uri = NetworkSettings.instance.BaseUri() + "/internal/create_npc";
                var form = new WWWForm();

                form.AddField("npcCharacterId", characterId);
                form.AddField("npcPlayerId", playerId);
                form.AddField("prefab", prefab);
                form.AddField("vitalsTemplate", (int)template);

                WWW www = new WWW(uri, form.data, form.headers);
                yield return www;

                if (www.error != null) {
                    Debug.Log(www.error);
                    action(null);
                } else {
                    Character character = new Character();
                    character.playerId = playerId;
                    character.id = characterId;
                    character.gameEntityPrefab = prefab;
                    character.vitalsTemplate = template;
                    action(character);
                }
            }
        private bool ValidateLimits(Vitals vital, Limits limit, ref PatientAlert patientAlert)
        {
            if (CheckRange(limit.MinValue, limit.MaxValue, vital.Value))
            {
                ValidateLimitType(vital, limit, ref patientAlert);
                return(true);
            }

            return(false);
        }
 private void ValidateAllLimits(Vitals vital, Device device, ref PatientAlert patientAlert)
 {
     foreach (var limit in device.Limits)
     {
         if (ValidateLimits(vital, limit, ref patientAlert))
         {
             return;
         }
     }
 }
 private void TryValidate(PatientAdmission patient, Vitals vital, ref PatientAlert patientAlert)
 {
     foreach (var patientDevice in patient.Devices)
     {
         if (patientDevice.DeviceId == vital.DeviceId)
         {
             ValidateDeviceRange(vital, patientDevice, ref patientAlert);
         }
     }
 }
Example #5
0
        public static void IsValidPatient(PatientDef patientDef, int expectedPatientId,
                                          string expectedPatientName,
                                          Vitals expectedVitals,
                                          bool assertSize,
                                          params ZAssert.IsValidItem <PhaseDef>[] phaseAsserts)
        {
            Assert.AreEqual(expectedPatientId, patientDef.Id);
            Assert.AreEqual(expectedPatientName, patientDef.Name);
            Assert.AreEqual(expectedVitals, patientDef.Vitals);

            ZAssert.IsValidItems(patientDef.PhaseDefs, assertSize, phaseAsserts);
        }
Example #6
0
    // Use this for initialization
    void Start()
    {
        //get some components & objects
        player       = GameObject.Find("Character");
        vitals       = player.GetComponent <Vitals>();
        camMouseLook = player.transform.Find("FPPCamera").GetComponent <CamMouseLook>();

        vitals.setBladderState(true);

        //set the initial position to the player position
        transform.position = player.transform.position;
    }
Example #7
0
        public async Task <IActionResult> PostVitals([FromBody] Vitals vitals)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.Vitals.Add(vitals);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetVitals", new { id = vitals.VitalsId }, vitals));
        }
Example #8
0
        public IActionResult Update(string id, Vitals vitalsIn)
        {
            var vitals = _vitalService.Get(id);

            if (vitals == null)
            {
                return(NotFound());
            }

            _vitalService.Update(id, vitalsIn);

            return(NoContent());
        }
Example #9
0
 private void GetComponents()
 {
     _jobManager          = FindObjectOfType <JobManager>();
     vitals               = GetComponent <Vitals>();
     aiVitals             = GetComponent <AiVitals>();
     fieldOfView          = GetComponent <FieldOfView>();
     inventory            = GetComponentInChildren <GenericInventory>();
     navAgent             = GetComponent <NavMeshAgent>();
     animator             = GetComponent <Animator>();
     weaponHolder         = GetComponent <WeaponHolder>();
     iKControl            = GetComponent <IKControl>();
     thirdPersonCharacter = GetComponent <ThirdPersonCharacter>();
 }
Example #10
0
 public string GetJSONVitals(DataTable dtVitals, string EMRPatientID, string RequestID, string EMRID, string ModuleID, string UserID)
 {
     try
     {
         Vitals objVitals  = new Vitals();
         string JSONString = objVitals.GenerateAPIJSONString(dtVitals, EMRPatientID, RequestID, EMRID, ModuleID, UserID);
         return(JSONString);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #11
0
 private void Start()
 {
     canJump = true;
     Physics.IgnoreLayerCollision(8, 9);
     rb                   = GetComponent <Rigidbody>();
     regSpeed             = movementSpeed;
     vitals               = GetComponent <Vitals>();
     playerHealth         = vitals.GetCurrentHealth();
     _dodgeTime           = dodgeTime;
     bobSpeed             = anim.speed;
     healthAmount.text    = "(" + playerHealth.ToString() + ")";
     healthBar.fillAmount = 1;
 }
 private void ValidateDeviceRange(Vitals vital, Device device, ref PatientAlert patientAlert)
 {
     if (!CheckRange(device.MinInputValue, device.MaxInputValue, vital.Value))
     {
         patientAlert.CriticalAlerts.Add(new DeviceAlert
         {
             DeviceId = device.DeviceId,
             Value    = vital.Value,
             Message  = "Device Malfunction : Value out of valid input range."
         });
         return;
     }
     ValidateAllLimits(vital, device, ref patientAlert);
 }
Example #13
0
        /// <summary>
        /// Tells whether the character has a certain amount of vital power or not
        /// </summary>
        public bool HaveVitalPower(Vitals vital, int value)
        {
            switch (vital)
            {
                case Vitals.Health:
                    // to avoid death
                    return currentHealth > value;

                case Vitals.Power:
                    return currentPower >= value;
            }

            return false;
        }
Example #14
0
 public ActionResult Edit(int id, Vitals smodel)
 {
     try
     {
         VitalsMasterDbHandle sdb = new VitalsMasterDbHandle();
         sdb.UpdateDetails(smodel);
         return(RedirectToAction("VitalsList"));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
         return(View());
     }
 }
Example #15
0
        public VitalStatus CheckVitalStatus(Vitals info)
        {
            var VitalStatusResult = new VitalStatus();

            var infoProperties = GetProperties <Vitals>();

            foreach (var prop in infoProperties)
            {
                var Resultprop = typeof(VitalStatus).GetProperty(prop.Name);
                Resultprop.SetValue(VitalStatusResult,
                                    CheckVitalInRange(prop, prop.GetValue(info, null)));
            }
            return(VitalStatusResult);
        }
Example #16
0
    void Update()
    {
        if (agent.isActiveAndEnabled)
        {
            HandleState();
            Vitals.ConsumeEnergy(0.8f);
            Fitness += 0.01f;
        }

        Vitals.ConsumeEnergy(agent.velocity.magnitude * GetHeight() * 0.001f);
        if (Vitals.IsStarving())
        {
            Die();
        }
    }
Example #17
0
        public void TC002_TestGetVitals()
        {
            //Arrange
            Monit monit = Monit.GetInstance(@"Monit");

            //Act
            Vitals vitals = monit.GetVitals;

            //Assert
            Assert.IsNotNull(vitals.CPU);
            Assert.IsNotNull(vitals.CPU.Sys);
            Assert.IsNotNull(vitals.Disk);
            Assert.IsNotNull(vitals.Load);
            Assert.IsNotNull(vitals.Memory);
        }
Example #18
0
        /// <summary>
        /// Handles the GameAction 0x44 - RaiseVital network message from client
        /// </summary>
        public bool HandleActionRaiseVital(PropertyAttribute2nd vital, uint amount)
        {
            if (!Vitals.TryGetValue(vital, out var creatureVital))
            {
                log.Error($"{Name}.HandleActionRaiseVital({vital}, {amount}) - invalid vital");
                return(false);
            }

            if (amount > AvailableExperience)
            {
                // there is a client bug for vitals only,

                // where the client will enable the button to raise a vital by 10
                // if the player only has enough AvailableExperience to raise it by 1

                ChatPacket.SendServerMessage(Session, $"Your attempt to raise {vital.ToSentence()} has failed.", ChatMessageType.Broadcast);

                log.Error($"{Name}.HandleActionRaiseVital({vital}, {amount}) - amount > AvailableExperience ({AvailableExperience})");
                return(false);
            }

            var prevRank = creatureVital.Ranks;

            if (!SpendVitalXp(creatureVital, amount))
            {
                return(false);
            }

            Session.Network.EnqueueSend(new GameMessagePrivateUpdateVital(this, creatureVital));

            if (prevRank != creatureVital.Ranks)
            {
                // checks if max rank is achieved and plays fireworks w/ special text
                var suffix = "";
                if (creatureVital.IsMaxRank)
                {
                    // fireworks
                    PlayParticleEffect(PlayScript.WeddingBliss, Guid);
                    suffix = $" and has reached its upper limit";
                }

                var sound = new GameMessageSound(Guid, Sound.RaiseTrait);
                var msg   = new GameMessageSystemChat($"Your base {vital.ToSentence()} is now {creatureVital.Base}{suffix}!", ChatMessageType.Advancement);

                Session.Network.EnqueueSend(sound, msg);
            }
            return(true);
        }
Example #19
0
    void Start()
    {
        vitals    = gameObject.GetComponent <Vitals>();
        inventory = gameObject.GetComponent <Inventory>();

        //General script, all players have this.
        movement = gameObject.GetComponentInParent <PlayerMovement>();

        //Player script, only the local player has this.
        controller = gameObject.GetComponentInParent <PlayerController>();
        tracker    = gameObject.GetComponentInParent <ActionTracker>();
        hud        = gameObject.GetComponent <PlayerHUD>();

        //Shadow script, only the opponent player (shadow) has this.
        replay = gameObject.GetComponentInParent <ActionReplay>();
    }
Example #20
0
 public void DamageShield(Vitals vital, ref int amount)
 {
     if (Type == StatusTypes.Shield)
     {
         shield[(int)vital] -= amount;
         if (shield[(int)vital] <= 0)
         {
             amount             = -shield[(int)vital]; //Return piercing damage.
             shield[(int)vital] = 0;
             TryRemoveStatus();
         }
         else
         {
             amount = 0; //Sheild is stronger than the damage dealt, so no piercing damage.
         }
     }
 }
Example #21
0
    // Use this for initialization
    private void Start()
    {
        //get some components & objects
        GameObject player = GameObject.Find("Character");

        vitals = player.GetComponent <Vitals>();
        vitals.setDrunkState(true);

        FPPCamera = player.transform.Find("FPPCamera").GetComponent <Camera>();

        //get the 2 sub images within the drunk canvas object
        drunkOverlay = transform.Find("DrunkOverlay").GetComponent <Image>();
        drunkFade    = transform.Find("Fade").GetComponent <Image>();

        //get the initial fov
        initialFOV = FPPCamera.fieldOfView;
    }
Example #22
0
    void Start()
    {
        player          = GameObject.FindGameObjectWithTag("Player");
        menu            = GameObject.FindGameObjectWithTag("Menu");
        inventory       = GameObject.FindGameObjectWithTag("Inventory");
        death           = GameObject.FindGameObjectWithTag("Death");
        craftingMenu    = GameObject.FindGameObjectWithTag("CraftingMenu");
        craftingSubmenu = GameObject.FindGameObjectWithTag("CraftingSubmenu");
        world           = GameObject.FindGameObjectWithTag("World");
        toolsManager    = GameObject.FindGameObjectWithTag("ToolsManager");


        //Scripts:
        spawnStuff         = world.GetComponent <SpawnStuff>();
        vitals             = player.GetComponent <Vitals>();
        toolsManagerScript = toolsManager.GetComponent <ToolsManagerScript>();
        inventoryScript    = player.GetComponent <Inventory>();
    }
Example #23
0
        public DataTable GetVitals(string patientid, string stagingdbconnectionstring, string requestid)
        {
            try
            {
                DataTable dtMedicationData = new DataTable();

                parameters["patientid"] = patientid;

                Vitals objVitals = new Vitals();
                dtMedicationData = objVitals.GetData(parameters);

                return(dtMedicationData);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #24
0
 private void Start()
 {
     _uiManager      = FindObjectOfType <UIManager>();
     _rigidbody      = GetComponent <Rigidbody>();
     _playerInteract = GetComponent <PlayerInteract>();
     vitals          = GetComponent <Vitals>();
     _playerMovement = GetComponent <PlayerMovement>();
     _playerLives    = GetComponent <PlayerLives>();
     try
     {
         _currentBigPlatform = Instantiate(bigPlatform);
         bigPlatformManager  = _currentBigPlatform.GetComponent <BigPlatformManager>();
     }
     catch
     {
         // ignored
     }
 }
Example #25
0
    // Use this for initialization
    private void Start()
    {
        //find the vitals script and sets an inital value
        GameObject player = GameObject.Find("Character");

        vitals = player.GetComponent <Vitals>();
        vitals.setEnergyState(true);

        //get some initial references
        energyOverlay    = transform.Find("Fade").GetComponent <Image>();
        FPPCamera        = player.transform.Find("FPPCamera").GetComponent <Camera>();
        playerController = player.GetComponent <PlayerController>();

        //get the initial fov
        initialFOV = FPPCamera.fieldOfView;

        normalSpeed = playerController.getNormalSpeed();
        sprintSpeed = playerController.getSprintSpeed();
    }
Example #26
0
    private void Awake()
    {
        if (GameObject.FindGameObjectWithTag("Player").transform != null)
        {
            target       = GameObject.FindGameObjectWithTag("Player").transform;
            targetVitals = target.GetComponent <Vitals>();

            myCollision     = GetComponent <CapsuleCollider>().radius;
            targetCollision = GetComponent <CapsuleCollider>().radius;

            hasTarget = true;
        }

        int skinIndex;

        skinIndex = Random.Range(0, skinToChoose.Length);

        skinToChoose[skinIndex].gameObject.SetActive(true);
    }
Example #27
0
        private Hero GenerateHeroS(Race race, Gender gender, GenerateNamePreference generateNamePreference)
        {
            try
            {
                var physicalAttributes = new PhysicalAttributes(race);

                var progression   = new Progression();
                var vitals        = new Vitals();
                var traits        = new Traits();
                var generatedName = nameGenerator.GenerateName(gender, generateNamePreference);

                var hero = new Hero(generatedName, race, physicalAttributes, vitals, progression, traits);

                return(hero);
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }
Example #28
0
        private PatientVitals StringToVitals(string input)
        {
            string[]      inputArray = input.Split('/');
            PatientVitals vitals     = new PatientVitals
            {
                PatientId = inputArray[0],
                Vitals    = new List <Vitals>()
            };

            for (var i = 2; i < inputArray.Length - 1; i++)
            {
                Vitals info = new Vitals {
                    DeviceId = inputArray[i]
                };
                i++;

                info.Value = Convert.ToDouble(inputArray[i]);
                vitals.Vitals.Add(info);
            }
            return(vitals);
        }
Example #29
0
 public ActionResult Create(Vitals smodel)
 {
     try
     {
         if (ModelState.IsValid)
         {
             VitalsMasterDbHandle sdb = new VitalsMasterDbHandle();
             if (sdb.AddVitals(smodel))
             {
                 ViewBag.Message = "Vitals Details Added Successfully";
                 ModelState.Clear();
             }
         }
         return(View());
     }
     catch (Exception ex)
     {
         ex.StackTrace.ToString();
         return(View());
     }
 }
 private static void ValidateLimitType(Vitals vital, Limits limit, ref PatientAlert patientAlert)
 {
     if (limit.Type == LimitType.Critical)
     {
         patientAlert.CriticalAlerts.Add(new DeviceAlert
         {
             DeviceId = vital.DeviceId,
             Message  = limit.Message,
             Value    = vital.Value
         });
     }
     else if (limit.Type == LimitType.Warning)
     {
         patientAlert.WarningAlerts.Add(new DeviceAlert
         {
             DeviceId = vital.DeviceId,
             Message  = limit.Message,
             Value    = vital.Value
         });
     }
 }
Example #31
0
        public ActionResult Vitals(Vitals objDoctor)
        {
            SqlConnection con = new SqlConnection(cs);

            try
            {
                con.Open();
                SqlCommand cmd = new SqlCommand("spInsertVitalsMaster", con)
                {
                    CommandType = CommandType.StoredProcedure
                };

                cmd.Parameters.AddWithValue("@BloodPressure", objDoctor.BloodPressure);
                cmd.Parameters.AddWithValue("@Temperature", objDoctor.Temperature);
                cmd.Parameters.AddWithValue("@Pulse", objDoctor.Pulse);
                cmd.Parameters.AddWithValue("@DoctorName", objDoctor.DoctorName);
                cmd.Parameters.AddWithValue("@PatientName", objDoctor.PatientName);
                cmd.Parameters.AddWithValue("@HospitalId", objDoctor.HospitalId);
                cmd.Parameters.AddWithValue("@EntryDate", DateTime.Now);
                cmd.Parameters.AddWithValue("@EntryBy", objDoctor.EntryBy);
                int i = cmd.ExecuteNonQuery();
                if (i >= 1)
                {
                    ViewBag.SuccessMessage = "success";
                }
                else
                {
                    ViewBag.ErrorMessage = "Failed";
                }
            }
            catch (SqlException ex)
            { }
            finally
            {
                con.Close();
            }
            ModelState.Clear();
            return(View());
        }
Example #32
0
 public virtual void SaveVitals(ref Vitals.Builder vitals)
 {
     vitals.SetHealth(this.health);
 }
Example #33
0
 public virtual void LoadVitals(Vitals vitals)
 {
     this.health = vitals.Health;
     if (this.health <= 0f)
     {
         Debug.Log(string.Concat("LOAD VITALS - HEALTH WAS ", this.health));
         this.health = 1f;
     }
 }
Example #34
0
 public void LoadVitals(Vitals vitals)
 {
     this.caloricLevel = vitals.Calories;
     this.waterLevelLitre = vitals.Hydration;
     this.radiationLevel = vitals.Radiation;
     this.antiRads = vitals.RadiationAnti;
     this.coreTemperature = vitals.Temperature;
 }
Example #35
0
 private void setupVitals()
 {
     for(int cnt=0; cnt<_vital.Length; cnt++){
         _vital[cnt] = new Vitals();
     }
     setupVitalModifiers();
 }
    public void SetupVitals()
    {
        for (int cnt = 0; cnt <_vital.Length; cnt++) {
            _vital [cnt] = new Vitals ();
            _vital[cnt].Name = ((VitalName)cnt).ToString();
        }

        SetupVitalsModifiers ();
    }
Example #37
0
 public void SetVitals(Vitals vitals)
 {
     this.vitals = vitals;
 }
Example #38
0
 public void CreateNpc(string playerId, string characterId, Vitals.Template template, string prefab, Action<Character> action)
 {
     StartCoroutine(CreateNpcRoutine(playerId, characterId, template, prefab, action));
 }
 public Patient()
 {
     geo = new Location();
     vitals = new Vitals();
 }
Example #40
0
 public void SaveVitals(ref Vitals.Builder vitals)
 {
     vitals.SetCalories(this.caloricLevel);
     vitals.SetHydration(this.waterLevelLitre);
     vitals.SetRadiation(this.radiationLevel);
     vitals.SetRadiationAnti(this.antiRads);
     vitals.SetTemperature(this.coreTemperature);
 }