コード例 #1
0
        public override void OnDeath(Mobile m)
        {
            if (Guardians != null)
            {
                if (m is DarkGuardian && Guardians.Contains((DarkGuardian)m))
                {
                    Guardians.Remove((DarkGuardian)m);
                }

                if (Guardians.Count == 0)
                {
                    Reset();
                    Guardians.Clear();
                    Guardians.TrimExcess();
                }
            }

            if (m is PlayerMobile)
            {
                Timer.DelayCall(TimeSpan.FromSeconds(1), () =>
                {
                    BaseCreature.TeleportPets(m, KickLoc, Map.Malas);
                    m.MoveToWorld(KickLoc, Map.Malas);

                    if (m.Corpse != null)
                    {
                        m.Corpse.MoveToWorld(KickLoc, Map.Malas);
                    }
                });
            }
        }
コード例 #2
0
        public async Task<ActionResult<Guardians>> PostGuardians(Guardians guardians)
        {
            _context.Guardian.Add(guardians);
            await _context.SaveChangesAsync();

            return CreatedAtAction("GetGuardians", new { id = guardians.GuardianId }, guardians);
        }
コード例 #3
0
        public override bool CheckLocked(Mobile from)
        {
            if (from.AccessLevel > AccessLevel.Player)
            {
                return(false);
            }

            if (!TreasureMapInfo.NewSystem && Level == 0)
            {
                if (Guardians.Any(g => g.Alive))
                {
                    from.SendLocalizedMessage(1046448); // You must first kill the guardians before you may open this chest.
                    return(true);
                }

                LockPick(from);
                return(false);
            }
            else if (CanOpen(from))
            {
                return(base.CheckLocked(from));
            }

            return(true);
        }
コード例 #4
0
        public async Task<IActionResult> PutGuardians(int id, Guardians guardians)
        {
            if (id != guardians.GuardianId)
            {
                return BadRequest();
            }

            _context.Entry(guardians).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!GuardiansExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return NoContent();
        }
コード例 #5
0
        public void Activate(Mobile m)
        {
            CheckDoors();

            DoorOne.Open   = false;
            DoorTwo.Open   = false;
            DoorOne.Locked = true;
            DoorTwo.Locked = true;

            Effects.PlaySound(DoorOne.Location, DoorOne.Map, 0x241);
            Effects.PlaySound(DoorTwo.Location, DoorTwo.Map, 0x241);

            if (Guardians == null)
            {
                Guardians = new List <DarkGuardian>();
            }

            int count = 0;

            foreach (var mob in this.GetEnumeratedMobiles().Where(mob => mob is PlayerMobile || (mob is BaseCreature && ((BaseCreature)mob).GetMaster() != null && !mob.IsDeadBondedPet)))
            {
                if (mob.NetState != null)
                {
                    mob.SendLocalizedMessage(1050000, "", 365); // The locks on the door click loudly and you begin to hear a faint hissing near the walls.
                }
                if (mob.Alive)
                {
                    count++;
                }
            }

            count = Math.Max(1, count * 2);

            for (int i = 0; i < count; i++)
            {
                DarkGuardian guardian = new DarkGuardian();

                int x = Utility.RandomMinMax(PentagramBounds.X, PentagramBounds.X + PentagramBounds.Width);
                int y = Utility.RandomMinMax(PentagramBounds.Y, PentagramBounds.Y + PentagramBounds.Height);
                int z = Map.Malas.GetAverageZ(x, y);

                guardian.MoveToWorld(new Point3D(x, y, z), Map.Malas);
                Guardians.Add(guardian);

                guardian.Combatant = m;
            }

            if (m_Timer != null)
            {
                m_Timer.Stop();
                m_Timer = null;
            }

            m_Timer = new InternalTimer(this);
            m_Timer.Start();
        }
コード例 #6
0
        public override void OnDeath(Mobile m)
        {
            if (Guardians != null && m is DarkGuardian guardian && Guardians.Contains(guardian))
            {
                Guardians.Remove(guardian);
            }

            if (m is PlayerMobile mobile && Active)
            {
                Timer.DelayCall(TimeSpan.FromSeconds(3), MoveDeadPlayer, mobile);
            }
        }
コード例 #7
0
ファイル: FormGuardianEdit.cs プロジェクト: nampn/ODental
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (GuardianCur.IsNew)
     {
         DialogResult = DialogResult.Cancel;
     }
     else
     {
         Guardians.Delete(GuardianCur.GuardianNum);
         DialogResult = DialogResult.OK;
     }
 }
コード例 #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         GuardianID = Convert.ToInt32(Session["GuardianID"].ToString());
         string OldKey = Session["KEY"].ToString();
         lblUsername.Text = Guardians.ReturnUserName(GuardianID);
     }
     catch
     {
     }
 }
コード例 #9
0
        public override void OnAfterDelete()
        {
            if (m_Timer != null)
            {
                m_Timer.Stop();
                m_Timer = null;
            }

            Guardians.Each(g => g.Delete());

            base.OnAfterDelete();
        }
コード例 #10
0
        private void butOK_Click(object sender, EventArgs e)
        {
            //PatNumChild already set
            //PatNumGuardian already set
            _guardianCur.IsGuardian = checkIsGuardian.Checked;
            string        relatName = comboRelationship.Items[comboRelationship.SelectedIndex].ToString();
            List <string> listRelationshipNamesRaw = new List <string>(Enum.GetNames(typeof(GuardianRelationship)));

            _guardianCur.Relationship = (GuardianRelationship)listRelationshipNamesRaw.IndexOf(relatName);
            if (_guardianCur.IsNew)
            {
                Guardians.Insert(_guardianCur);
            }
            else
            {
                Guardians.Update(_guardianCur);
            }
            DialogResult = DialogResult.OK;
        }
コード例 #11
0
ファイル: GuardianRoom.cs プロジェクト: UODOC/MyShard
        public void Activate(Mobile m)
        {
            CheckDoors();

            DoorOne.Open   = false;
            DoorTwo.Open   = false;
            DoorOne.Locked = true;
            DoorTwo.Locked = true;

            Effects.PlaySound(DoorOne.Location, DoorOne.Map, 0x241);
            Effects.PlaySound(DoorTwo.Location, DoorTwo.Map, 0x241);

            if (Guardians == null)
            {
                Guardians = new List <DarkGuardian>();
            }

            int count = MobileCount() * 2;

            for (int i = 0; i < count; i++)
            {
                DarkGuardian guardian = new DarkGuardian();

                int x = Utility.RandomMinMax(PentagramBounds.X, PentagramBounds.X + PentagramBounds.Width);
                int y = Utility.RandomMinMax(PentagramBounds.Y, PentagramBounds.Y + PentagramBounds.Height);
                int z = Map.Malas.GetAverageZ(x, y);

                guardian.MoveToWorld(new Point3D(x, y, z), Map.Malas);
                Guardians.Add(guardian);

                guardian.Combatant = m;
            }

            if (m_Timer != null)
            {
                m_Timer.Stop();
                m_Timer = null;
            }

            m_Timer = new InternalTimer(this);
            m_Timer.Start();
        }
コード例 #12
0
ファイル: FormGuardianEdit.cs プロジェクト: nampn/ODental
 private void butOK_Click(object sender, EventArgs e)
 {
     if (GuardianCur.PatNumGuardian == 0)
     {
         MsgBox.Show(this, "Please set a guardian first.");
         return;
     }
     //PatNumChild already set
     //PatNumGuardian already set
     GuardianCur.Relationship = (GuardianRelationship)listRelationship.SelectedIndex;
     if (GuardianCur.IsNew)
     {
         Guardians.Insert(GuardianCur);
     }
     else
     {
         Guardians.Update(GuardianCur);
     }
     DialogResult = DialogResult.OK;
 }
コード例 #13
0
    protected void btnLogIn_Click(object sender, EventArgs e)
    {
        // Checks if the credentials fit each table... there can only be one.
        int EmployeeID = Employees.CheckUser(txtUsername.Text, txtPassword.Text);
        int TenantID   = Tenants.CheckUser(txtUsername.Text, txtPassword.Text);
        int GuardianID = Guardians.CheckUser(txtUsername.Text, txtPassword.Text);


        if (EmployeeID + GuardianID + TenantID == 0)
        {
            lblAlert.Text = "Check your credentials!";
            Response.Write((EmployeeID + GuardianID + TenantID).ToString());
        }

        if (EmployeeID != 0)
        {
            Session.Add("EmployeeID", EmployeeID);
            Session.Add("AccessLevel", Employees.GetAccessLevel(EmployeeID));
            //Session.Add("KEY", Encryption.GenerateBCryptHash(txtPassword.Text));
            Response.Redirect("~/Admin/Default.aspx");
        }

        else if (TenantID != 0)
        {
            Session.Add("TenantID", TenantID);
            //Session.Add("KEY", Encryption.GenerateBCryptHash(txtPassword.Text));
            Response.Redirect("~/Tenant/Default.aspx");
        }

        else if (GuardianID != 0)
        {
            Session.Add("GuardianID", GuardianID);
            //Session.Add("KEY", Encryption.GenerateBCryptHash(txtPassword.Text));
            Response.Redirect("~/Guardian/Default.aspx");
        }
    }
コード例 #14
0
 private void OnDelete()
 {
     Guardians.Remove(SelectedGuardian);
 }
コード例 #15
0
        public static PID SpawnNamed(Props props, string name)
        {
            var parent = props.GuardianStrategy != null?Guardians.GetGuardianPID(props.GuardianStrategy) : null;

            return(props.Spawn(name, parent));
        }
コード例 #16
0
 private void CheckUser()
 {
     try
     {
             << << << < HEAD
             string Username = Guardians.ReturnUserName(int.Parse(Session["GuardianID"].ToString()));
コード例 #17
0
        public bool CheckReset()
        {
            if (GetPlayerCount() == 0 || Guardians == null || Guardians.Count == 0 || !Guardians.Any(x => !x.Deleted))
            {
                Reset();
                return(true);
            }

            return(false);
        }