public void PushEvent(ProgramEvent e) { lock (Events) { Events.Enqueue(e); } }
public override void HandleEvent(ProgramEvent e) { if (e.Type == ProgramEventType.WorldMapControlMoved) { Completed = true; } }
public override void HandleEvent(ProgramEvent e) { if (e is ProgramEvents.StartPlayingMap) { Enabled = false; } if (e is ProgramEvents.StopPlayingMap) { Enabled = false; } var p = e as ProgramEvents.PistolAmmoChanged; if (p != null && p.Unit is Game.Map.Units.MainCharacter) { Enabled = p.Unit.PistolAmmo > 0; } var d = e as ProgramEvents.ScriptStartPerform; if (d != null && d.Script is Game.Map.Units.GhostBullet) { Completed = true; } if (e.Type == ProgramEventType.MainCharacterSwitchWeapon) { Enabled = ((ProgramEvents.MainCharacterSwitchWeapon)e).Weapon == 1; } }
public override void HandleEvent(ProgramEvent e) { if (e is ProgramEvents.StartPlayingMap) { Enabled = false; } if (e is ProgramEvents.StopPlayingMap) { Enabled = false; } var p = e as ProgramEvents.PistolAmmoChanged; if (p != null && p.Unit is Game.Map.Units.MainCharacter) { Enabled = p.Unit.PistolAmmo > 0; } var d = e as ProgramEvents.ScriptStartPerform; if (d != null && d.Script is Game.Map.Units.Blast) { Completed = true; } }
public override void HandleEvent(ProgramEvent e) { var s = e as ProgramEvents.StartPlayingMap; if (s != null && s.MapName != null && s.MapName.Contains(mapName)) { if (CountCondition(s)) { nTriesLeft--; } if (nTriesLeft < 0) { Enabled = true; } } var st = e as ProgramEvents.StopPlayingMap; if (st != null) { Enabled = false; } var c = e as ProgramEvents.CompletedMap; if (c != null && c.MapName.Contains(mapName)) { Completed = true; } }
public ActionResult DeleteConfirmed(int id) { ProgramEvent programEvent = db.ProgramEvents.Find(id); if (programEvent != null && programEvent.ResidentID > 0) { db.ProgramEvents.Remove(programEvent); db.SaveChanges(); var events = db.Residents.FirstOrDefault(i => i.ResidentID == programEvent.ResidentID).ProgramEvents; foreach (var item in events) { if (item != null && item.ProgramType != null) { if (item.ProgramType.EventType == EnumEventType.ADMISSION) { item.Resident.IsCurrent = true; } if (item.ProgramType.EventType == EnumEventType.DISCHARGE) { item.Resident.IsCurrent = false; } } } db.SaveChanges(); } return(RedirectToAction("Index")); }
public override void HandleEvent(ProgramEvent e) { if (e is ProgramEvents.UserInput && ((ProgramEvents.UserInput)e).InputType == ProgramEvents.UserInputType.WASD) { Completed = true; } }
public override void HandleEvent(ProgramEvent e) { if (e is ProgramEvents.UnitJumps && ((ProgramEvents.UnitJumps)e).Unit is Game.Map.Units.MainCharacter) { Completed = true; } }
public override void HandleEvent(ProgramEvent e) { var d = e as ProgramEvents.UnitHit; if (d != null && d.DamageEventArgs.Performer is Game.Map.Units.MainCharacter) { Completed = true; } }
public static void TriggerEvent(EventType eventName, object param) { ProgramEvent thisEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.Invoke(param); } }
public override void RegistEvent() { var programEvent = new ProgramEvent( (handler) => ClipBoardChanged += handler, (handler) => ClipBoardChanged -= handler ); Event.RegistEvent(CLIPBOARD_CHANGED_EVENT_NAME, programEvent); }
public override void HandleEvent(ProgramEvent e) { if (e.Type == ProgramEventType.ProfileSaved) { Enabled = Program.Instance.Profile.SilverCoins > 1000; } if (e.Type == ProgramEventType.PurchasedWeapon) { Completed = true; } }
void Instance_ProgramEvent(ProgramEvent e) { if (e.Type == ProgramEventType.UnitHit && ((ProgramEvents.UnitHit)e).DamageEventArgs.Performer is Map.Units.MainCharacter) { damageAcc += ((ProgramEvents.UnitHit)e).DamageEventArgs.AdjustedDamage; } if (e.Type == ProgramEventType.RageLevelProgressChanged && ((ProgramEvents.RageLevelProgressChanged)e).Unit is Map.Units.MainCharacter) { rageAcc += ((ProgramEvents.RageLevelProgressChanged)e).Diff; } }
public override void HandleEvent(ProgramEvent e) { base.HandleEvent(e); if (e.Type == ProgramEventType.StageCompleted) { var o = e as ProgramEvents.StageCompleted; if (o.Stage.Stage >= 2) { Completed = true; } } }
public override void HandleEvent(ProgramEvent e) { base.HandleEvent(e); if (e.Type == ProgramEventType.RageLevelChanged) { var o = e as ProgramEvents.RageLevelChanged; if (o.Unit.RageLevel >= 5) { Completed = true; } } }
public override void HandleEvent(ProgramEvent e) { base.HandleEvent(e); if (e.Type == ProgramEventType.DestructibleKilled) { var o = e as ProgramEvents.DestructibleKilled; if (o.Destructible is Game.Map.Units.Bull && o.Script is Game.Map.PirahnaHit) { Completed = true; } } }
public static void StopListening(EventType eventName, UnityAction <object> listener) { if (eventManager == null) { return; } ProgramEvent thisEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.RemoveListener(listener); } }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ProgramEvent programEvent = db.ProgramEvents.Find(id); if (programEvent == null) { return(HttpNotFound()); } return(View(programEvent)); }
public static void StartListening(EventType eventName, UnityAction <object> listener) { ProgramEvent thisEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.AddListener(listener); } else { thisEvent = new ProgramEvent(); thisEvent.AddListener(listener); instance.eventDictionary.Add(eventName, thisEvent); } }
public override void RegistEvent() { var pullStartedEvent = new ProgramEvent( (handler) => PullStarted += handler, (handler) => PullStarted -= handler ); Event.RegistEvent(SyncService.PULL_START_ENENT_NAME, pullStartedEvent); var pullStoppedEvent = new ProgramEvent( (handler) => PullStopped += handler, (handler) => PullStopped -= handler ); Event.RegistEvent(SyncService.PULL_STOP_ENENT_NAME, pullStoppedEvent); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ProgramEvent programEvent = db.ProgramEvents.Find(id); if (programEvent == null) { return(HttpNotFound()); } ViewBag.AdmissionType = programEvent.ProgramType.EventType.ToString(); ViewBag.ProgramTypeID = new SelectList(db.ProgramTypes.Where(i => i.EventType == programEvent.ProgramType.EventType), "ProgramTypeID", "ProgramDescription", programEvent.ProgramTypeID); ViewBag.ResidentID = new SelectList(db.Residents, "ResidentID", "ClearLastName", programEvent.ResidentID); return(View(programEvent)); }
public ActionResult Readmit(int id, string ReadmitDate) { var date = DateTime.Parse(ReadmitDate, CultureInfo.InvariantCulture); try { Resident residentToReadmit = db.Residents .Include(p => p.ProgramEvents) .Where(r => r.ResidentID == id) .Single(); // To close discharge events var ev = residentToReadmit.ProgramEvents .Where(i => i.ProgramType?.EventType == EnumEventType.DISCHARGE) .LastOrDefault(); if (ev != null) { ev.ClearEndDate = DateTime.Parse(ReadmitDate, CultureInfo.InvariantCulture); db.Entry(ev).State = EntityState.Modified; } var admitEvent = new ProgramEvent { ProgramTypeID = 3, ClearStartDate = date }; residentToReadmit.ProgramEvents.Add(admitEvent); residentToReadmit.AgeAtRelease = 0; // resident is readmitted, reset Age At Release. residentToReadmit.IsCurrent = true; db.SaveChanges(); TempData["UserMessage"] = residentToReadmit.ClearLastName + " has been readmitted from your center. "; } catch (DataException /* dex */) { TempData["UserMessage"] = "Failed to readmit the resident to the center."; return(RedirectToAction("Readmit", new { id = id, saveChangesError = true })); } return(RedirectToAction("Index")); }
public override void HandleEvent(ProgramEvent e) { var d = e as ProgramEvents.ScriptStartPerform; if (d != null && d.Script is Game.Map.Units.Slam) { Completed = true; } if (e.Type == ProgramEventType.MainCharacterSwitchWeapon) { Enabled = ((ProgramEvents.MainCharacterSwitchWeapon)e).Weapon == 0; } if (e.Type == ProgramEventType.StartPlayingMap) { Enabled = true; } }
void Instance_ProgramEvent(ProgramEvent obj) { if (obj.Type == ProgramEventType.CompletedMap) { GoldYield = ((ProgramEvents.CompletedMap)obj).GoldEarned; } else if (obj.Type == ProgramEventType.AchievementEarned) { AchievementsEarned.Add(((ProgramEvents.AchievementEarned)obj).Achievement); } else if (obj.Type == ProgramEventType.DestructibleKilled && Map.Settings.MapType == Client.Game.Map.MapType.Normal) { var u = obj as ProgramEvents.DestructibleKilled; if (u.Perpetrator == Game.Instance.Map.MainCharacter && u.Destructible is Map.NPC && Program.Settings.SilverEnabled) { SilverYield += u.Destructible.SilverYield; } } else if (obj.Type == ProgramEventType.PistolAmmoChanged) { var p = obj as ProgramEvents.PistolAmmoChanged; int diff = p.OldPistolAmmo - p.Unit.PistolAmmo; if (diff == 1) { Statistics.CharacterActions.TotalShots++; } } else if (obj.Type == ProgramEventType.ScriptStartPerform) { var s = obj as ProgramEvents.ScriptStartPerform; var slam = s.Script as Client.Game.Map.Units.Slam; if (slam != null) { Statistics.CharacterActions.Slams++; } } }
public override void HandleEvent(ProgramEvent e) { if (e.Type == ProgramEventType.StartPlayingMap) { var ranged = ((ProgramEvents.StartPlayingMap)e).RangedWeapon; var melee = ((ProgramEvents.StartPlayingMap)e).MeleeWeapon; var map = ((ProgramEvents.StartPlayingMap)e).MapName; if (ranged == lastRanged && melee == lastMelee && map == lastMap && Program.Instance.Profile != null && (Program.Instance.Profile.AvailableMeleeWeapons != MeleeWeapons.Sword || Program.Instance.Profile.AvailableRangedWeapons != RangedWeapons.Rifle)) { count++; } else { count = 0; } lastRanged = ranged; lastMelee = melee; lastMap = map; Enabled = count >= 6; } }
public override void NormalMapHandleEvent(ProgramEvent e) { if (e.Type == ProgramEventType.StartPlayingMap) { var p = e as ProgramEvents.StartPlayingMap; if (p.MapName != null) { if (p.MapName.Contains(previousMapName)) { count++; if (count == 50) Completed = true; } else count = 1; previousMapName = p.MapName; } } }
public override void NormalMapHandleEvent(ProgramEvent e) { if (e.Type == ProgramEventType.CustomMapEvent) { var p = e as ProgramEvents.CustomMapEvent; if (p.EventName == "TomsDog") Completed = true; } }
public override void HandleEvent(ProgramEvent e) { if (e.Type == ProgramEventType.StartPlayingMap) { var p = e as ProgramEvents.StartPlayingMap; if (p.Map != null) enabled = p.Map.Settings.MapType == Client.Game.Map.MapType.Normal; } else if (e.Type == ProgramEventType.StopPlayingMap) enabled = true; if (enabled) NormalMapHandleEvent(e); }
public abstract void NormalMapHandleEvent(ProgramEvent e);
public override void NormalMapHandleEvent(ProgramEvent e) { if(e.Type == ProgramEventType.StartPlayingMap) damageTaken = 0; if (e.Type == ProgramEventType.MainCharacterTakesDamage) { var p = e as ProgramEvents.MainCharacterTakesDamage; if (p.Perpetrator is Game.Map.NPC) { damageTaken += p.DamageTaken; if (damageTaken >= 3000) Completed = true; } } }
public override void NormalMapHandleEvent(ProgramEvent e) { if (e.Type == ProgramEventType.MainCharacterRageLevel) { var p = e as ProgramEvents.MainCharacterRageLevel; if (p.RageLevel == 11) Completed = true; } }
public override void NormalMapHandleEvent(ProgramEvent e) { if (e.Type == ProgramEventType.CompletedMap) { var p = e as ProgramEvents.CompletedMap; if (p.MapName.Contains("LevelL")) Completed = true; } }
public override void NormalMapHandleEvent(ProgramEvent e) { if (e.Type == ProgramEventType.StartPlayingMap) { boxesDestroyed = 0; dateTime = DateTime.Now; } if (e.Type == ProgramEventType.DestructibleKilled) { var p = e as ProgramEvents.DestructibleKilled; if(p.Destructible is Client.Game.Map.Props.DestructibleChest) { boxesDestroyed++; if (boxesDestroyed == 51 && (DateTime.Now - dateTime).TotalSeconds <= 120) Completed = true; } } }
public override void NormalMapHandleEvent(ProgramEvent e) { if (e.Type == ProgramEventType.StartPlayingMap) { ammoUsed = false; ammo = 0; } if (e.Type == ProgramEventType.PistolAmmoChanged) { var p = e as ProgramEvents.PistolAmmoChanged; if (p.Unit.PistolAmmo != ammo) { if (p.Unit.PistolAmmo < ammo) ammoUsed = true; ammo = p.Unit.PistolAmmo; } } if(e.Type == ProgramEventType.StopPlayingMap) { var p = e as ProgramEvents.StopPlayingMap; if (p.MapFileName.Contains("LevelE") && !ammoUsed && p.GameState == Client.Game.GameState.Won) Completed = true; } }
public ActionResult Create(ResidentIncomeModel residentIncomeModel, string[] selectedCampaigns, int AdmissionType) { if (residentIncomeModel == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ViewBag.AdmissionType = new SelectList(db.ProgramTypes .Where(t => t.EventType == EnumEventType.ADMISSION), "ProgramTypeID", "ProgramDescription", AdmissionType); ViewBag.StateTerritoryID = new SelectList(db.States, "StateTerritoryID", "State", residentIncomeModel.StateTerritoryID); ViewBag.ReferralID = new SelectList(db.Referrals, "ReferralID", "ReferralName", residentIncomeModel.ReferralID); var allMilitaryCampaigns = db.MilitaryCampaigns; var viewModel = new List <AssignedCampaignData>(); foreach (var militaryCampaign in allMilitaryCampaigns) { viewModel.Add(new AssignedCampaignData { MilitaryCampaignID = militaryCampaign.MilitaryCampaignID, MilitaryCampaign = militaryCampaign.CampaignName, Assigned = false }); } ViewBag.Campaigns = viewModel.OrderBy(i => i.MilitaryCampaign).ToList(); Resident resident = new Resident { ClearFirstMidName = residentIncomeModel.FirstMidName, ClearLastName = residentIncomeModel.LastName, IsCurrent = AdmissionType != 1, Gender = residentIncomeModel.Gender, Ethnicity = residentIncomeModel.Ethnicity, Religion = residentIncomeModel.Religion, ClearBirthdate = residentIncomeModel.Birthdate, ServiceBranch = residentIncomeModel.ServiceBranch, NGReserve = residentIncomeModel.NGReserve, MilitaryDischarge = residentIncomeModel.DischargeStatus, InVetCourt = residentIncomeModel.InVetCourt, IsNoncombat = residentIncomeModel.IsNoncombat, StateTerritoryID = residentIncomeModel.StateTerritoryID, ReferralID = residentIncomeModel.ReferralID, Note = residentIncomeModel.Note, MilitaryCampaigns = new List <MilitaryCampaign>(), ProgramEvents = new List <ProgramEvent>(), Benefit = new Benefit(), }; if (!string.IsNullOrEmpty(residentIncomeModel.ReferralOther)) { resident.OptionalReferralDescription = residentIncomeModel.ReferralOther; } if (!string.IsNullOrEmpty(residentIncomeModel.StateTerritoryOther)) { resident.StateTerritoryOther = residentIncomeModel.StateTerritoryOther; } Benefit benefit = new Benefit { DisabilityPercentage = residentIncomeModel.DisabilityPercentage, DisabilityAmount = residentIncomeModel.DisabilityAmount, SSI = residentIncomeModel.SSI, SSDI = residentIncomeModel.SSDI, FoodStamp = residentIncomeModel.FoodStamp, OtherDescription = residentIncomeModel.OtherDescription, Other = residentIncomeModel.Other, TotalBenefitAmount = residentIncomeModel.TotalBenefitAmount }; try { if (ModelState.IsValid) { if (!IsDuplicateResident(residentIncomeModel)) { db.Residents.Add(resident); var admitEvent = new ProgramEvent { ProgramTypeID = AdmissionType, ClearStartDate = residentIncomeModel.AdmitDate, }; resident.ProgramEvents.Add(admitEvent); db.Benefits.Add(benefit); resident.Benefit = benefit; db.SaveChanges(); } else { ModelState.AddModelError("", "This resident may already exist in the system. Please check their full name, birthdate, and service branch. Try to add another resident to continue."); return(View(residentIncomeModel)); } } } catch (DataException dex) { //Log the error (uncomment dex variable name and add a line here to write a log. ModelState.AddModelError(dex.Message, "Unable to save changes. Try again, and if the problem persists, see your system administrator."); } finally { resident.Dispose(); } if (TryUpdateModel(residentIncomeModel, "", new string[] { "LastName", "FirstMidName", "Ethnicity", "StateTerritoryID", "ReferralID", "Gender", "Religion", "ClearBirthdate", "ServiceBranch", "NGReserve", "Note", "IsNoncombat", "InVetCourt", "Benefit", "MilitaryCampaigns", "TotalBenefitAmount" })) { try { UpdateResidentCampaigns(selectedCampaigns, resident); db.SaveChanges(); TempData["UserMessage"] = residentIncomeModel.LastName + " has been admitted into your center. "; return(RedirectToAction("Manage", new RouteValueDictionary( new { controller = "ProgramEvents", action = "Manage", Id = resident.ResidentID, FromPage = 1 }))); } catch (DataException /* dex */) { //Log the error (uncomment dex variable name and add a line here to write a log. ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists, see your system administrator."); } finally { resident.Dispose(); } } resident.Dispose(); return(View(residentIncomeModel)); }
void Instance_ProgramEvent(ProgramEvent obj) { if (obj.Type == ProgramEventType.CompletedMap) GoldYield = ((ProgramEvents.CompletedMap)obj).GoldEarned; else if (obj.Type == ProgramEventType.AchievementEarned) { AchievementsEarned.Add(((ProgramEvents.AchievementEarned)obj).Achievement); } else if (obj.Type == ProgramEventType.DestructibleKilled && Map.Settings.MapType == Client.Game.Map.MapType.Normal) { var u = obj as ProgramEvents.DestructibleKilled; if (u.Perpetrator == Game.Instance.Map.MainCharacter && u.Destructible is Map.NPC && Program.Settings.SilverEnabled) { SilverYield += u.Destructible.SilverYield; } } else if (obj.Type == ProgramEventType.PistolAmmoChanged) { var p = obj as ProgramEvents.PistolAmmoChanged; int diff = p.OldPistolAmmo - p.Unit.PistolAmmo; if (diff == 1) Statistics.CharacterActions.TotalShots++; } else if (obj.Type == ProgramEventType.ScriptStartPerform) { var s = obj as ProgramEvents.ScriptStartPerform; var slam = s.Script as Client.Game.Map.Units.Slam; if (slam != null) Statistics.CharacterActions.Slams++; } }
public override void NormalMapHandleEvent(ProgramEvent e) { if (e.Type == ProgramEventType.DestructibleKilled) { var p = e as ProgramEvents.DestructibleKilled; if (p.Destructible is Client.Game.Map.NPC && p.Perpetrator is Client.Game.Map.Units.MainCharacter) { count++; if (count == 20000) Completed = true; } } }
public override void NormalMapHandleEvent(ProgramEvent e) { if (e.Type == ProgramEventType.StartPlayingMap) caught = false; if(e.Type == ProgramEventType.MainCharacterCaughtInNet) caught = true; if (e.Type == ProgramEventType.StopPlayingMap) { var p = e as ProgramEvents.StopPlayingMap; if (!caught && p.GameState == Client.Game.GameState.Won && p.MapFileName.Contains("LevelQ")) Completed = true; } }
public ActionResult EditPost(int?id, int?fromPage, string[] selectedCampaigns, bool?Readmit, string readmitDate, bool?AdmitEmergencyShelter, string updatedAdmitDate) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Resident residentToUpdate = db.Residents .Include(c => c.MilitaryCampaigns) .Include(b => b.Benefit) .Include(r => r.Referral) .Where(c => c.ResidentID == id) .Single(); ViewBag.DischargeInfo = residentToUpdate.ProgramEvents .Where(i => i.ProgramType.EventType == EnumEventType.DISCHARGE) .OrderByDescending(i => i.ProgramEventID).FirstOrDefault(); var lastEmergencyShelter = residentToUpdate.ProgramEvents.LastOrDefault(i => i.ProgramType.EventType == EnumEventType.ADMISSION && i.ProgramTypeID == 1); var lastAdmission = residentToUpdate.ProgramEvents.Any(i => i.ProgramType.EventType == EnumEventType.ADMISSION && i.ProgramTypeID == 2); ViewBag.EmergencyShelterTrack = lastEmergencyShelter != null && !lastAdmission; ViewBag.StateTerritoryID = new SelectList(db.States, "StateTerritoryID", "StateTerritoryID", residentToUpdate.StateTerritoryID); ViewBag.ReferralID = new SelectList(db.Referrals, "ReferralID", "ReferralName", residentToUpdate.ReferralID); ViewBag.Campaigns = residentService.PopulateAssignedCampaignData(residentToUpdate, db).OrderBy(i => i.MilitaryCampaign).ToList(); if (TryUpdateModel(residentToUpdate, "", new string[] { "ClearLastName", "ClearFirstMidName", "Gender", "Religion", "Ethnicity", "StateTerritoryID", "ReferralID", "AgeAtRelease", "OptionalReferralDescription", "StateTerritoryOther", "ClearBirthdate", "ServiceBranch", "NGReserve", "Note", "InVetCourt", "IsNoncombat", "Benefit", "MilitaryCampaigns", "TotalBenefitAmount" })) { try { UpdateResidentCampaigns(selectedCampaigns, residentToUpdate); /** for admitting a resident that had been previously an emergency shelter admittance */ if (lastEmergencyShelter != null && AdmitEmergencyShelter == true) { if (!string.IsNullOrEmpty(updatedAdmitDate)) { var newAdmitDate = DateTime.Parse(updatedAdmitDate, CultureInfo.InvariantCulture); lastEmergencyShelter.ClearEndDate = newAdmitDate; residentToUpdate.ProgramEvents.Add(new ProgramEvent { ProgramTypeID = 2, ClearStartDate = newAdmitDate }); residentToUpdate.IsCurrent = true; } } if (Readmit.HasValue) { if (Readmit == true) { if (string.IsNullOrEmpty(readmitDate)) { ModelState.AddModelError("", "Readmission Date is required if you are readmitting this resident."); return(View(residentToUpdate)); } var date = DateTime.Parse(readmitDate, CultureInfo.InvariantCulture); var ev = residentToUpdate.ProgramEvents .LastOrDefault(i => i.ProgramType.EventType == EnumEventType.DISCHARGE); // Emergency Discharge to be readmited. if (date < ev.ClearStartDate) { ModelState.AddModelError("", "Readmission date cannot be prior to last discharge date, " + ev.ClearStartDate.ToShortDateString()); return(View(residentToUpdate)); } ev.ClearEndDate = date; residentToUpdate.AgeAtRelease = 0; // reset the age at release for the readmitted resident. db.Entry(ev).State = EntityState.Modified; var readmitEvent = new ProgramEvent { ProgramTypeID = 3, ClearStartDate = date }; residentToUpdate.IsCurrent = true; residentToUpdate.ProgramEvents.Add(readmitEvent); } } db.SaveChanges(); TempData["UserMessage"] = residentToUpdate.ClearLastName + " has been updated. "; return(RedirectToAction("Index", new { page = fromPage })); } catch (DataException dex) { //Log the error (uncomment dex variable name and add a line here to write a log. ModelState.AddModelError(dex.Message, "Unable to save changes. Try again, and if the problem persists, see your system administrator."); } } residentToUpdate.FromPage = fromPage; return(View(residentToUpdate)); }
public override void NormalMapHandleEvent(ProgramEvent e) { if (e.Type == ProgramEventType.StartPlayingMap) doorsClosed = 0; if (e.Type == ProgramEventType.CustomMapEvent) { var p = e as ProgramEvents.CustomMapEvent; if(p.EventName == "DoorClosed") doorsClosed++; if (doorsClosed == 7) Completed = true; } }
public override void NormalMapHandleEvent(ProgramEvent e) { if (e.Type == ProgramEventType.DestructibleKilled) { var p = e as ProgramEvents.DestructibleKilled; if (p.Destructible is Client.Game.Map.NPC && p.Perpetrator is Game.Map.Units.MainCharacter) { killTimes.Add(DateTime.Now); if (killCount >= (requiredZombies - 1)) { if ((killTimes[killCount] - killTimes[killCount - (requiredZombies - 1)]).TotalSeconds <= allowedTime) Completed = true; killTimes.RemoveAt(0); } else killCount++; } } }
public override void NormalMapHandleEvent(ProgramEvent e) { if(e.Type == ProgramEventType.StartPlayingMap) boxDestroyed = false; if (e.Type == ProgramEventType.DestructibleKilled) { var p = e as ProgramEvents.DestructibleKilled; if (p.Destructible is Client.Game.Map.Props.DestructibleChest) { if (!((Client.Game.Map.Props.DestructibleChest)p.Destructible).Golden) boxDestroyed = true; } } if (e.Type == ProgramEventType.StopPlayingMap) { var p = e as ProgramEvents.StopPlayingMap; if (p.MapFileName.Contains("LevelN") && p.GameState == Client.Game.GameState.Won && !boxDestroyed) Completed = true; } }
public override void NormalMapHandleEvent(ProgramEvent e) { if (e.Type == ProgramEventType.StartPlayingMap) { var p = e as ProgramEvents.StartPlayingMap; bullsEaten = 0; mapName = p.MapName ?? ""; } if (e.Type == ProgramEventType.DestructibleKilled && mapName.Contains("LevelJ")) { var p = e as ProgramEvents.DestructibleKilled; if (p.Script is Client.Game.Map.PirahnaHit && p.Destructible is Client.Game.Map.Units.Bull) bullsEaten++; if (bullsEaten == 3) Completed = true; } }
public override void NormalMapHandleEvent(ProgramEvent e) { if (e.Type == ProgramEventType.StopPlayingMap) { var p = e as ProgramEvents.StopPlayingMap; if (p.MapFileName.Contains("LevelL") && p.GameState == Client.Game.GameState.Won) Completed = true; } }
public override void HandleEvent(ProgramEvent e) { if (e.Type == ProgramEventType.StartPlayingMap) count = 0; if (e.Type == ProgramEventType.DestructibleKilled) { var p = e as ProgramEvents.DestructibleKilled; if (p.Destructible is Client.Game.Map.NPC && p.Script is Client.Game.Map.PirahnaHit) { count++; if(count == 10) Completed = true; } } }
public override void NormalMapHandleEvent(ProgramEvent e) { if (e.Type == ProgramEventType.DestructibleKilled) { var p = e as ProgramEvents.DestructibleKilled; if (p.Destructible is Client.Game.Map.Units.Cleric && p.Perpetrator is Game.Map.Units.Cleric) Completed = true; } }