public virtual Blood SetMainFlow(Blood fromPredecessor) { if (fromPredecessor.GasFree == false || fromPredecessor.ChemicalCompositionOk != true) { DetectedGasOrContaminatedBlood = true; } else { DetectedGasOrContaminatedBlood = false; } return fromPredecessor; }
public override void OnGaveMeleeAttack(Mobile defender) { base.OnGaveMeleeAttack(defender); double effectChance = .20; if (Controlled && ControlMaster != null) { if (ControlMaster is PlayerMobile) { if (defender is PlayerMobile) { effectChance = .01; } else { effectChance = .80; } } } BaseCreature bc_Defender = defender as BaseCreature; PlayerMobile pm_Defender = defender as PlayerMobile; double diseaseValue = defender.GetSpecialAbilityEntryValue(SpecialAbilityEffect.Disease); if (diseaseValue > 0) { return; } if (Utility.RandomDouble() <= effectChance) { for (int a = 0; a < 3; a++) { Blood disease = new Blood(); disease.Hue = 2052; disease.Name = "disease"; Point3D diseaseLocation = new Point3D(X + Utility.RandomList(-1, 1), Y + Utility.RandomList(-1, 1), Z); SpellHelper.AdjustField(ref diseaseLocation, Map, 12, false); disease.MoveToWorld(diseaseLocation, defender.Map); } SpecialAbilities.DiseaseSpecialAbility(1.0, this, defender, 20, 60, 0x62B, true, "", "They has infected you with a horrific disease!"); } }
public override bool OnBeforeDeath() { for (int a = 0; a < 50; a++) { Blood bones = new Blood(); bones.Hue = 0; bones.Name = "bones"; bones.ItemID = Utility.RandomList(6929, 6930, 6937, 6938, 6933, 6934, 6935, 6936, 6939, 6940, 6880, 6881, 6882, 6883); Point3D bonesLocation = new Point3D(Location.X + Utility.RandomMinMax(-4, 4), Location.Y + Utility.RandomMinMax(-4, 4), Location.Z + 2); bones.MoveToWorld(bonesLocation, Map); } Effects.PlaySound(Location, Map, 0x1C7); return(base.OnBeforeDeath()); }
void OnCollisionEnter(Collision col) { if (col.gameObject.tag == "Enemy") { Blood blood = col.gameObject.GetComponent <Blood>(); blood.blood = blood.blood - 300; } { if (Destroywhentouch) { Instantiate(ExplosionEffect); } Destroy(gameObject); } }
}//Redo using IVAccess Object. This whole thing is spiralling private bool TranfuseBlood() { Blood incBlood = (Blood)_fluid; if (_patient.Body.Blood.BloodTypeCompatibility(incBlood.bloodType)) { Console.WriteLine("Blood Transfusion Compatible"); //Temp } else { //Handle Transfusion reaction here _patient.Body.Blood.HasTransfusionReaction = true; Console.WriteLine("Blood Transfusion Incompatible"); } return(_patient.Body.Blood.AddFluid(_fluid)); }
protected override bool OnMove(Direction d) { if (Utility.RandomDouble() <= .25) { Blood blood = new Blood(); blood.ItemID = Utility.RandomList(4651, 4652, 4653, 4654); blood.Hue = 2623; blood.Name = "slime"; blood.MoveToWorld(Location, Map); Effects.PlaySound(Location, Map, Utility.RandomList(0x5D9, 0x5DB)); } return(base.OnMove(d)); }
// Token: 0x06000099 RID: 153 RVA: 0x00004024 File Offset: 0x00002224 private void EmitInfectedEffects() { EmitSounds(); if (InfectedDeathWavePrefab != null) { GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(InfectedDeathWavePrefab, transform.position + EffectsOffset, Quaternion.identity); } gameObject.transform.SetXLocalScale(1.25f); gameObject.transform.SetYLocalScale(1.25f); Blood.SpawnRandomBlood(transform.position + EffectsOffset); if (DeathPuffPrefab != null) { UnityEngine.Object.Instantiate <GameObject>(DeathPuffPrefab, transform.position + EffectsOffset, Quaternion.identity); } ShakeCamera(ShakeType.EnemyKillShake); }
public void takeHit(float angle) { if (canBeHitByPlayer) { lifePoints -= 1; bloodSpawner.numberParticuleToPop += 1; bloodSpawner.canSpawn = true; } if (canGenerateProjectile) { //System.Diagnostics.Debug.WriteLine("Totem touched by playerattacksensor"); Projectile proj = new Blood(body.Position * Bloodbender.meterToPixel, 10, angle, 400f); body.FixtureList[0].IgnoreCollisionWith(proj.body.FixtureList[0]); Bloodbender.ptr.listGraphicObj.Add(proj); } }
public async Task <IActionResult> Edit([Bind("BloodId,BloodName")] Blood blood) { /*Check Session */ var page = "91"; var typeofuser = ""; var PermisionAction = ""; // CheckSession if (string.IsNullOrEmpty(HttpContext.Session.GetString("Username"))) { Alert("คุณไม่มีสิทธิ์ใช้งานหน้าดังกล่าว", NotificationType.error); return(RedirectToAction("Index", "Home")); } else { typeofuser = HttpContext.Session.GetString("TypeOfUserId"); PermisionAction = HttpContext.Session.GetString("PermisionAction"); if (PermisionHelper.CheckPermision(typeofuser, PermisionAction, page) == false) { Alert("คุณไม่มีสิทธิ์ใช้งานหน้าดังกล่าว", NotificationType.error); return(RedirectToAction("Index", "Home")); } } /*Check Session */ if (ModelState.IsValid) { try { _context.Update(blood); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BloodExists(blood.BloodId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(RedirectToAction("Index", "Home")); }
public Blood SetBloodFlow(Blood fromPredecessor) { Blood toSuccessor; if (fromPredecessor.Water > 0 || fromPredecessor.BigWasteProducts > 0) { toSuccessor=fromPredecessor; if (IncomingQuantityOfDialyzingFluid > 0) toSuccessor.Temperature = IncomingFluidTemperature; //otherwise keep blood temperature // First step: Filtrate Blood if (IncomingQuantityOfDialyzingFluid >= toSuccessor.SmallWasteProducts) { toSuccessor.SmallWasteProducts = 0; } else { toSuccessor.SmallWasteProducts -= IncomingQuantityOfDialyzingFluid; } // Second step: Ultra Filtration // To satisfy the incoming suction rate we must take the fluid from the blood. // The ultrafiltrationRate is the amount of fluid we take from the blood-side. var ultrafiltrationRate = IncomingSuctionRateOnDialyzingFluidSide - IncomingQuantityOfDialyzingFluid; if (ultrafiltrationRate >= 0) { if (ultrafiltrationRate < toSuccessor.BigWasteProducts) { toSuccessor.BigWasteProducts -= ultrafiltrationRate; } else { // Remove water instead of BigWasteProducts // Assume Water >= (ultrafiltrationRate - toSuccessor.BigWasteProducts) toSuccessor.Water -= (ultrafiltrationRate - toSuccessor.BigWasteProducts); toSuccessor.BigWasteProducts = 0; } } } else { toSuccessor=fromPredecessor; } if (!MembraneIntact) { toSuccessor.ChemicalCompositionOk = false; } return toSuccessor; }
void OnTriggerEnter(Collider other) { if (other.CompareTag("Player") || other.CompareTag("Enemy")) { float damage = Mathf.Round(Random.Range(10f, 20f)); Blood blood = other.gameObject.GetComponent <Blood>(); blood.DrawLife(damage); if (other.CompareTag("Enemy")) { if (blood.blood <= 0) { Destroy(other.gameObject); } } } }
// Token: 0x0600009C RID: 156 RVA: 0x00004300 File Offset: 0x00002500 private void EmitLargeInfectedEffects() { EmitSounds(); if (this.DeathPuffPrefab != null) { GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.DeathPuffPrefab, base.transform.position + this.EffectsOffset, Quaternion.identity); gameObject.transform.localScale = new Vector3(2f, 2f, gameObject.transform.GetZLocalScale()); } this.ShakeCamera(ShakeType.AverageShake); if (this.InfectedDeathWavePrefab != null) { GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(this.InfectedDeathWavePrefab, base.transform.position + this.EffectsOffset, Quaternion.identity); gameObject2.transform.SetXLocalScale(2f); gameObject2.transform.SetYLocalScale(2f); } Blood.SpawnRandomBlood(base.transform.position + this.EffectsOffset); }
public Blood GetByGroup(string bloodGroup) { string query = "SELECT * FROM blood_inventory WHERE Name = " + bloodGroup; MySqlDataReader reader = DataAccess.GetData(query); Blood blood = null; if (reader.HasRows) { blood = new Blood(); blood.BloodGroup = reader["Blood_Group"].ToString(); blood.Quantity = Convert.ToInt32(reader["Quantity"]); } return(blood); }
protected virtual void OnTriggerEnter2D(Collider2D collider2D) { if (collider2D.gameObject.tag.Equals("Player") && player.body == collider2D) { DemagingPlayer(); rigidBody2d.constraints = RigidbodyConstraints2D.FreezeAll; } Bullet bullet = collider2D.gameObject.GetComponent <Bullet>(); if (bullet && canHit) { Blood tempBlood = Instantiate(blood, new Vector3(bullet.transform.position.x, bullet.transform.position.y, -1f), Quaternion.identity); bloods.Add(tempBlood); tempBlood.SetZombie(this); } }
private void DonorRegister_Click(object sender, EventArgs e) { DonorsService donorsService = new DonorsService(); Donors donors = new Donors(); Blood blood = new Blood(); int count = Convert.ToInt32(donorsService.RowCount()); donors.Id = count += 101; donors.Name = DonorName.Text; donors.Address = DonorAddress.Text; donors.Age = Convert.ToInt32(DonorAge.Text); donors.Gender = (string)DonorGender.SelectedItem; donors.Phone = DonorPhone.Text; donors.Email = DonorEmail.Text; donors.BloodGroup = (string)DonorBloodGroup.SelectedItem; donors.Weight = Convert.ToInt32(DonorWeight.Text); DateTime dateTime = DateTime.UtcNow.Date; donors.Date = dateTime.ToString("yyyy/MM/dd"); BloodService bloodService = new BloodService(); string bloodGroup = (string)DonorBloodGroup.SelectedItem; int quantity = bloodService.GetCurrentQuantity(bloodGroup); quantity += 1; bloodService.Add(bloodGroup, quantity); if (donorsService.SendDonorEmail(donors.Email) && DonorPhone.Text.Length == 11) { if (donorsService.Add(donors) > 0) { MessageBox.Show("Record Added!"); } } else { MessageBox.Show("Error! Please Check your Mail or Provide a Valid Phone number"); } }
public HttpResponseMessage MakeBloodExamination(dynamic obj) { string exam_id = obj.exam_id.Value; string wbc = obj.wbc.Value; string neut_percent = obj.neut_percent.Value; string lymph_percent = obj.lymph_percent.Value; string mono_percent = obj.mono_percent.Value; string eo_percent = obj.eo_percent.Value; string baso_percent = obj.baso_percent.Value; string neut_num = obj.neut_num.Value; string lymph_num = obj.lymph_num.Value; string mono_num = obj.mono_num.Value; string eo_num = obj.eo_num.Value; string baso_num = obj.baso_num.Value; string rbc = obj.rbc.Value; string hgb = obj.hgb.Value; string hct = obj.hct.Value; string mcv = obj.mcv.Value; string mch = obj.mch.Value; string mchc = obj.mchc.Value; string rdw_cv = obj.rdw_cv.Value; string rdw_sd = obj.rdw_sd.Value; string plt = obj.plt.Value; string mpv = obj.mpv.Value; string pdw = obj.pdw.Value; string pct = obj.pct.Value; HttpResponseMessage response = new HttpResponseMessage(); Blood blood = new Blood(); try { blood = JsonConvert.DeserializeAnonymousType(JsonObjectConverter.ObjectToJson(obj), blood); // Blood表插入 ExaminerHelper.MakeBloodExamination(blood); } catch (Exception e) { response.Content = new StringContent(e.Message); response.StatusCode = HttpStatusCode.BadRequest; } return(response); }
// Blooding agent public void isBlooding(float dTime) { if (_timer < _timeBlooding) { _timer += dTime; Blood blood = this.gameObject.AddComponent <Blood>(); blood.create(this.gameObject.transform.position, bloodDirection); } else if (this.gameObject.GetComponent <Blood>()) { Blood currentBlood = this.gameObject.GetComponent <Blood>(); if (currentBlood._canBeDestroy) { currentBlood.destroy(); Destroy(currentBlood); } } }
void CheckGroundStatus() { RaycastHit hitInfo; #if UNITY_EDITOR // helper to visualise the ground check ray in the scene view Debug.DrawLine(pointFootLeft.transform.position + (Vector3.up * 0.1f), transform.position + (Vector3.up * 0.1f) + (Vector3.down * m_GroundCheckDistance)); Debug.DrawLine(pointFootLeft.transform.position + (Vector3.up * 0.1f), transform.position + (Vector3.up * 0.1f) + (Vector3.down * m_GroundCheckDistance)); #endif // 两只脚底的碰撞检测 if (Physics.Raycast(pointFootLeft.transform.position + (Vector3.up * 0.1f), Vector3.down, out hitInfo, m_GroundCheckDistance) || Physics.Raycast(pointFootLeft.transform.position + (Vector3.up * 0.1f), Vector3.down, out hitInfo, m_GroundCheckDistance)) { m_GroundNormal = hitInfo.normal; //碰撞表面的法向量 m_IsGrounded = true; m_Animator.applyRootMotion = true; //允许动画运动 // 坠落相关: if (timer > 0.1f) { audioSource.PlayOneShot(soundLand); if (timer > 0.8f) { if (timer < 1.2f) { Blood.ShowBlood(0.2f); Health.Reduce(2); } else { Blood.ShowBlood(0.4f); Health.Reduce(10); } } } timer = 0.0f; } else { m_IsGrounded = false; m_GroundNormal = Vector3.up; m_Animator.applyRootMotion = false; //禁止动画运动(只能原地播放) } }
public void SetMainFlow(Blood toSuccessor, Blood fromPredecessor) { if (ValveState == ValveState.Open) { toSuccessor.CopyValuesFrom(DelayedBlood); } else { toSuccessor.HasHeparin = true; toSuccessor.Water = 0; toSuccessor.SmallWasteProducts = 0; toSuccessor.BigWasteProducts = 0; toSuccessor.ChemicalCompositionOk = true; toSuccessor.GasFree = true; toSuccessor.Pressure = QualitativePressure.NoPressure; toSuccessor.Temperature = QualitativeTemperature.BodyHeat; } DelayedBlood.CopyValuesFrom(fromPredecessor); }
public void Die() { died = true; GetComponent <Image>().raycastTarget = false; if ((harmless || !gameController.action) && !gameController.learning) { TweenAlpha twA = TweenAlpha.Begin(gameObject, 0.5f, 0.0f); twA.from = 0.5f; twA.SetOnFinished(() => { Destroy(gameObject); }); return; } float z = type == TargetType.Right ? -15 : 15; Blood.SetActive(true); Vector3 pos = Blood.transform.localPosition; pos.x = 15 * Mathf.Sign(z); Blood.transform.localPosition = pos; TweenRotation twR = TweenRotation.Begin(Body, 0.05f, Quaternion.Euler(0, 0, z)); twR.quaternionLerp = true; twR.method = UITweener.Method.EaseIn; twR.style = UITweener.Style.PingPong; twR.onLoop = () => { twR.style = UITweener.Style.Once; }; twR.SetOnFinished(() => { TweenAlpha twA = TweenAlpha.Begin(gameObject, 0.5f, 0.0f); //twA.from = 0.5f; twA.SetOnFinished(() => { Destroy(gameObject); }); }); }
public ActionResult GetBlood(string id) { List <Blood> Dlist = new List <Blood>(); using (var ctx = new HospitalContext()) { var k = ctx.Blood.Where(c => c.BloodGroup == id).Select(c => new { c.Name, c.Address, c.Phone }).ToList(); foreach (var dc in k) { Blood d = new Blood(); d.Name = dc.Name; d.Address = dc.Address; d.Phone = dc.Phone; Dlist.Add(d); } } return(Json(Dlist)); }
public IHttpActionResult PutBlood(BloodModel bloodModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { var bloodDataExist = db.Bloods.FirstOrDefault(w => w.Id == bloodModel.Id); if (bloodDataExist != null) { bloodDataExist.WantedFrom = Common.CreatePoint(bloodModel.Latitude, bloodModel.Longitude); bloodDataExist.Description = bloodModel.Description; bloodDataExist.Name = bloodModel.Name; db.SaveChanges(); } else { var blood = new Blood(); blood.Id = Guid.NewGuid(); blood.IsActive = true; blood.CreatedDate = DateTime.UtcNow; blood.WantedFrom = Common.CreatePoint(bloodModel.Latitude, bloodModel.Longitude); blood.Description = bloodModel.Description; blood.Name = bloodModel.Name; blood.OrgUserId = Guid.Parse("b55f9060-2f96-4ff0-91c7-ecdbdc386056"); blood.Contact = bloodModel.Contact; blood.IsFulfilled = true; blood.BloodGroup = bloodModel.Name; db.Bloods.Add(blood); db.SaveChanges(); Common.Push(bloodModel.Longitude, bloodModel.Latitude, 10000, bloodModel.Name + " blood required urgently ", bloodModel.Id, 0); } db.SaveChanges(); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public List <Blood> GetAll() { string query = "SELECT Blood_Group, Quantity FROM blood_inventory"; MySqlDataReader reader = DataAccess.GetData(query); Blood blood = null; List <Blood> bloodList = new List <Blood>(); while (reader.Read()) { blood = new Blood(); blood.BloodGroup = reader["Blood_Group"].ToString(); blood.Quantity = Convert.ToInt32(reader["Quantity"]); bloodList.Add(blood); } return(bloodList); }
public override bool OnBeforeDeath() { Effects.PlaySound(Location, Map, Utility.RandomList(0x5D9, 0x5DB)); int corpseItems = Utility.RandomMinMax(2, 3); for (int a = 0; a < corpseItems; a++) { Point3D point = new Point3D(Location.X + Utility.RandomMinMax(-1, 1), Location.Y + Utility.RandomMinMax(-1, 1), Location.Z); Item corpsePart = new Blood(); corpsePart.ItemID = Utility.RandomList(7389, 7397, 7395, 7402, 7408, 7407, 7393, 7405, 7394, 7406, 7586, 7600); corpsePart.MoveToWorld(point, Map); new Blood().MoveToWorld(point, Map); } return(base.OnBeforeDeath()); }
public ActionResult SaveBlood(Donation don) { var donation = unitOfWork.DonationRepository.Get(x => x.Id == don.Id).First(); donation.Succesfull = Common.Enums.Stage.SendAnalyse; unitOfWork.DonationRepository.Update(donation); var blood = new Blood() { Rh = donation.RhType, Type = donation.BloodType, BloodBankId = donation.BloodBank_Id, Amount = (float)don.Amount }; unitOfWork.BloodRepository.Insert(blood); unitOfWork.Save(); return(RedirectToAction("Donations")); }
public override void OnThink() { base.OnThink(); if (Utility.RandomDouble() < 0.01 && !Hidden && DateTime.UtcNow > m_NextSpeechAllowed) { if (Combatant == null) { Say(idleSpeech[Utility.Random(idleSpeech.Length - 1)]); } else { Say(combatSpeech[Utility.Random(combatSpeech.Length - 1)]); } m_NextSpeechAllowed = DateTime.UtcNow + NextSpeechDelay; } if (Utility.RandomDouble() < 1 && DateTime.UtcNow > m_NextDigAllowed && Combatant == null) { Effects.PlaySound(this.Location, this.Map, Utility.RandomList(0x125, 0x126)); Animate(Utility.RandomList(11, 12), 5, 1, true, false, 0); AIObject.NextMove = DateTime.UtcNow + TimeSpan.FromSeconds(2); LastSwingTime = LastSwingTime + TimeSpan.FromSeconds(2); //Dirt for (int a = 0; a < 2; a++) { Blood dirt = new Blood(); dirt.Name = "dirt"; dirt.ItemID = Utility.RandomList(7681, 7682); Point3D dirtLocation = new Point3D(X + Utility.RandomMinMax(-1, 1), Y + Utility.RandomMinMax(-1, 1), Z); dirt.MoveToWorld(dirtLocation, Map); } m_NextDigAllowed = DateTime.UtcNow + NextDigDelay; } }
private static void FinishBlood3Launch(object state) { object[] states = (object[])state; Mobile from = (Mobile)states[0]; Point3D endBlood3Loc = (Point3D)states[1]; Map map = (Map)states[2]; Mobile killed = (Mobile)states[3]; if (map == null || map == Map.Internal) { return; } Effects.PlaySound(endBlood3Loc, map, 458); Item blood = new Blood(0x122D); blood.Movable = false; blood.MoveToWorld(endBlood3Loc, map); }
public Blood SetBloodFlow(Blood incoming) { Blood outgoing; if (incoming.Water > 0 || incoming.BigWasteProducts > 0) { outgoing = incoming; outgoing.Temperature = IncomingFluidTemperature; // First step: Filtrate Blood if (IncomingQuantityOfDialyzingFluid >= outgoing.SmallWasteProducts) { outgoing.SmallWasteProducts = 0; } else { outgoing.SmallWasteProducts -= IncomingQuantityOfDialyzingFluid; } // Second step: Ultra Filtration // To satisfy the incoming suction rate we must take the fluid from the blood. // The ultrafiltrationRate is the amount of fluid we take from the blood-side. var ultrafiltrationRate = IncomingSuctionRateOnDialyzingFluidSide - IncomingQuantityOfDialyzingFluid; if (ultrafiltrationRate < outgoing.BigWasteProducts) { outgoing.BigWasteProducts -= ultrafiltrationRate; } else { // Remove water instead of BigWasteProducts // Assume Water >= (ultrafiltrationRate - outgoing.BigWasteProducts) outgoing.Water -= (ultrafiltrationRate - outgoing.BigWasteProducts); outgoing.BigWasteProducts = 0; } } else { outgoing = incoming; } return(outgoing); }
public override void OnGaveMeleeAttack(Mobile defender) { base.OnGaveMeleeAttack(defender); double effectChance = .25; if (Controlled && ControlMaster != null) { if (ControlMaster is PlayerMobile) { if (defender is PlayerMobile) { effectChance = .20; } } } if (Utility.RandomDouble() <= effectChance) { int healingAmount = (int)((double)HitsMax * .25); Hits += healingAmount; this.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist); Blood blood = new Blood(); blood.MoveToWorld(new Point3D(defender.X + Utility.RandomMinMax(-1, 1), defender.Y + Utility.RandomMinMax(-1, 1), defender.Z + 1), Map); if (defender is PlayerMobile) { SpecialAbilities.BleedSpecialAbility(1.0, this, defender, DamageMax, 8.0, 0x44D, true, "", "The creature sinks its fangs into you, causing you to bleed!", "-1"); } else { SpecialAbilities.DisorientSpecialAbility(1.0, this, defender, .15, 10, -1, false, "", "", "-1"); SpecialAbilities.BleedSpecialAbility(1.0, this, defender, DamageMax, 8.0, 0x44D, true, "", "The creature sinks its fangs into you, stunning you and causing you to bleed!", "-1"); } } }
public Blood SetBloodFlow(Blood incoming) { Blood outgoing; if (incoming.Water > 0 || incoming.BigWasteProducts > 0) { outgoing=incoming; outgoing.Temperature = IncomingFluidTemperature; // First step: Filtrate Blood if (IncomingQuantityOfDialyzingFluid >= outgoing.SmallWasteProducts) { outgoing.SmallWasteProducts = 0; } else { outgoing.SmallWasteProducts -= IncomingQuantityOfDialyzingFluid; } // Second step: Ultra Filtration // To satisfy the incoming suction rate we must take the fluid from the blood. // The ultrafiltrationRate is the amount of fluid we take from the blood-side. var ultrafiltrationRate = IncomingSuctionRateOnDialyzingFluidSide - IncomingQuantityOfDialyzingFluid; if (ultrafiltrationRate < outgoing.BigWasteProducts) { outgoing.BigWasteProducts -= ultrafiltrationRate; } else { // Remove water instead of BigWasteProducts // Assume Water >= (ultrafiltrationRate - outgoing.BigWasteProducts) outgoing.Water -= (ultrafiltrationRate - outgoing.BigWasteProducts); outgoing.BigWasteProducts = 0; } } else { outgoing=incoming; } return outgoing; }
public void IncreaseTimeInSeconds_ShouldIncreaseAllCounters() { var game = new Game(0, 0, 0, 5, 5); game.Sperm.IsMagnetActivated = true; game.Sperm.IsShieldActivated = true; game.Sperm.Core.Shot(0); game.IncreaseGameTimeInSeconds(1); Assert.AreEqual(1, game.GameTimeInSeconds); Assert.AreEqual(1, game.EmptyFieldTime); Assert.AreEqual(1, game.MagnetTimeInSeconds); Assert.AreEqual(1, game.ShieldTimeInSeconds); Assert.AreEqual(1, game.Sperm.Core.flightTimeInSeconds); Assert.AreEqual(1, game.Sperm.Core.timeAfterShotInSeconds); var blood = new Blood(0, 0); game.GameObjects.Add(blood); game.Sperm.Core.Stop(0); game.IncreaseGameTimeInSeconds(1); Assert.AreEqual(1, blood.TimeAliveInSeconds); Assert.AreEqual(2, game.Sperm.Core.timeAfterShotInSeconds); }
public Blood SetMainFlow(Blood fromPredecessor) { if (ValveState == ValveState.Open) { Blood toSuccessor = DelayedBlood; DelayedBlood=fromPredecessor; return toSuccessor; } else { Blood toSuccessor = DelayedBlood; toSuccessor.HasHeparin = true; toSuccessor.Water = 0; toSuccessor.SmallWasteProducts = 0; toSuccessor.BigWasteProducts = 0; toSuccessor.ChemicalCompositionOk = true; toSuccessor.GasFree = true; toSuccessor.Pressure = QualitativePressure.NoPressure; toSuccessor.Temperature = QualitativeTemperature.BodyHeat; return toSuccessor; } }
public Blood SetMainFlow(Blood fromPredecessor) { if (ValveState == ValveState.Open) { Blood toSuccessor = DelayedBlood; DelayedBlood = fromPredecessor; return(toSuccessor); } else { Blood toSuccessor = DelayedBlood; toSuccessor.HasHeparin = true; toSuccessor.Water = 0; toSuccessor.SmallWasteProducts = 0; toSuccessor.BigWasteProducts = 0; toSuccessor.ChemicalCompositionOk = true; toSuccessor.GasFree = true; toSuccessor.Pressure = QualitativePressure.NoPressure; toSuccessor.Temperature = QualitativeTemperature.BodyHeat; return(toSuccessor); } }
void GenerateDirectionalBlast() { Vector2 mainProjPosition = spawnPositionOffset.Rotate(shootAngle) + owner.position; Projectile mainProj = new Blood(mainProjPosition, mainProjRadius, shootAngle, projSpeed); mainProj.body.IgnoreCollisionWith(owner.body); Bloodbender.ptr.listGraphicObj.Add(mainProj); int projNbr = rnd.Next(5, 10); for (int i = 0; i < projNbr; i++) { int bloodTexRand = rnd.Next(0, 3); int spawnPositionInLineRand = rnd.Next(-20, 21); Vector2 decorationProjPositionOffset = new Vector2(0 + spawnPositionOffset.X - mainProjRadius + rnd.Next(-15, 6), spawnPositionInLineRand + spawnPositionOffset.Y); Vector2 decorationProjPosition = decorationProjPositionOffset.Rotate(shootAngle) + owner.position; Projectile decorationProj = new Blood(decorationProjPosition, decorationProjRadius, shootAngle, projSpeed); if (bloodTexRand == 0) { decorationProj.addAnimation(new Animation(Bloodbender.ptr.blood1)); } else if (bloodTexRand == 1) { decorationProj.addAnimation(new Animation(Bloodbender.ptr.blood2)); } else { decorationProj.addAnimation(new Animation(Bloodbender.ptr.blood3)); } decorationProj.setRotation(shootAngle + (float)Math.PI / 2.0f); decorationProj.body.IgnoreCollisionWith(owner.body); Bloodbender.ptr.listGraphicObj.Add(decorationProj); } }
public void BloodReceived(Blood incomingBlood) { Water += incomingBlood.Water; SmallWasteProducts += incomingBlood.SmallWasteProducts; BigWasteProducts += incomingBlood.BigWasteProducts; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); //Boden boden = Content.Load<Texture2D>("Texturen\\Ground\\Ground"); //PlayerHUD playerHUD = new HUD(this, spriteBatch, Content.Load<SpriteFont>("Font")); Components.Add(playerHUD); //Menu menu = new Menu(this, spriteBatch); Components.Add(menu); //Blut blood = new Blood(this, spriteBatch); Components.Add(blood); //player hinzufügen player = new Player(this, spriteBatch); Components.Add(player); //Crosshair hinzufügen Crosshair = new crosshair(this, spriteBatch); Components.Add(Crosshair); }
public Blood SetMainFlow(Blood fromPredecessor) { return fromPredecessor; }
public void ReceivedBlood(Blood incomingElement) { SensedPressure = incomingElement.Pressure; }
public Blood SetMainFlow(Blood fromPredecessor) { var toSuccessor=fromPredecessor; toSuccessor.GasFree = true; return toSuccessor; }
public override Blood SetMainFlow(Blood fromPredecessor) { DetectedGasOrContaminatedBlood = false; return fromPredecessor; }
public void BloodReceived(Blood incomingBlood) { Water += incomingBlood.Water; SmallWasteProducts += incomingBlood.SmallWasteProducts; BigWasteProducts += incomingBlood.BigWasteProducts; var receivedSomething = incomingBlood.BigWasteProducts > 0 || incomingBlood.Water > 0; var compositionOk = incomingBlood.ChemicalCompositionOk && incomingBlood.GasFree && (incomingBlood.Temperature == QualitativeTemperature.BodyHeat); IncomingBloodWasNotOk |= receivedSomething && !compositionOk; }