public PlayerContextData(Mobile m, CTFControl ctfc)
 {
     m_Mobile          = m;                                  // player that owns this context
     m_PreGameLocation = m.Location;                         // starting location of the player (pregame)
     m_PreGameMap      = m.Map;                              // starting map of the player (pregame)
     m_ctfc            = ctfc;                               // CTF Controller
 }
Exemplo n.º 2
0
        public override void OnAfterDeath(Mobile m)
        {
            CTFControl ctfc = this.m_Controller as CTFControl;

            if (ctfc == null)
            {
                return;
            }
            ctfc.OnRegionAfterDeath(m);
        }
Exemplo n.º 3
0
        public override void OnPlayerAdd(Mobile m)
        {               // player is logging into the region
            base.OnPlayerAdd(m);
            CTFControl ctfc = this.m_Controller as CTFControl;

            if (ctfc != null)
            {
                ctfc.OnPlayerAdd(m);
            }
        }
Exemplo n.º 4
0
        public override bool OnDeath(Mobile m)
        {
            CTFControl ctfc = this.m_Controller as CTFControl;

            if (ctfc == null)
            {
                return(base.OnDeath(m));
            }
            ctfc.OnDeath(m);
            return(base.OnDeath(m));
        }
Exemplo n.º 5
0
        public override bool EquipItem(Mobile m, Item item)
        {
            bool       result = true;
            CTFControl ctfc   = this.m_Controller as CTFControl;

            if (ctfc != null)
            {
                result = ctfc.OnRegionEquipItem(m, item);
            }
            return(base.EquipItem(m, item) && result);
        }
Exemplo n.º 6
0
        // process CTF commands
        public override void OnSpeech(SpeechEventArgs e)
        {
            CTFControl ctfc = this.m_Controller as CTFControl;

            if (ctfc != null)
            {
                if (ctfc.OnRegionSpeech(e))
                {
                    e.Handled = true;
                }
            }
            base.OnSpeech(e);
        }
Exemplo n.º 7
0
        public override bool CheckAccessibility(Item i, Mobile m)
        {
            CTFControl ctfc = this.m_Controller as CTFControl;

            if (ctfc != null && m.AccessLevel == AccessLevel.Player)
            {
                return(ctfc.OnRegionCheckAccessibility(i, m));
            }
            else
            {
                return(base.CheckAccessibility(i, m));
            }
        }
            public void Deserialize(GenericReader reader)
            {
                int version = reader.ReadInt();

                switch (version)
                {
                case 3:
                {
                    m_PreGameMap = reader.ReadMap();
                    goto case 2;
                }

                case 2:
                {
                    m_Mobile = reader.ReadMobile();
                    m_ctfc   = (CTFControl)reader.ReadItem();
                    goto case 1;
                }

                case 1:
                {
                    // read the player's return location
                    m_PreGameLocation = reader.ReadPoint3D();

                    // read the int data
                    int count = reader.ReadInt();
                    for (int ix = 0; ix < count; ix++)
                    {
                        m_IntData[ix] = reader.ReadInt();
                    }
                    goto case 0;
                }

                case 0:
                {
                    goto default;
                }

                default:
                    break;
                }

                // do we need a res?
                if (RespawnSeconds > 0 && m_Mobile != null && m_Mobile.Deleted == false && !m_Mobile.Alive)
                {                       // use the remaining seconds - have a 10 second delay to accomodate for shard up
                    m_RespawnTimer = new RespawnTimer(TimeSpan.FromSeconds(10), this, TimeSpan.FromSeconds(1));
                    m_RespawnTimer.Start();
                }
            }
Exemplo n.º 9
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                m_ctrl = reader.ReadItem() as CTFControl;
                goto default;
            }

            default:
                break;
            }
        }
Exemplo n.º 10
0
 public void Setup(CTFControl ctrl)
 {
     m_ctrl = ctrl;
     Hue    = ctrl.FlagColor;
 }
Exemplo n.º 11
0
 public CTFRegion(CTFControl ctfcontrol, Map map)
     : base(ctfcontrol, map)
 {
     Setup();
 }
Exemplo n.º 12
0
 public void Setup(CTFControl ctrl, CTFControl.Team team)
 {
     m_ctrl = ctrl;
     m_team = team;
     Hue    = ctrl.TeamColor(team);
 }