Ejemplo n.º 1
0
        private void _init()
        {
            _setUpSFML();

            m_DeltaTime    = 0.0;
            m_StepTime     = 1.0 / 60.0;
            m_MaxDeltaTime = 0.25; //0.25f
            m_Accumulator  = 0.0;
            m_Time         = 0.0;
            m_FPS          = 0.0;

            m_Timer = new cTimer();
            //ChangeGameState( new cGameScene(this) );

            fpsUpdater = new cRegulator();
            fpsUpdater.resetByPeriodTime(1.0f);


            //Idő szöveg
            timeText               = new Text("", cAssetManager.GetFont("pf_tempesta_seven"));
            timeText.Position      = new Vector2f(this.defaultView.Size.X - 500, 30);
            timeText.CharacterSize = 28; // in pixels, not points!
            timeText.Color         = Color.White;
            timeText.Style         = Text.Styles.Bold;

            cGlobalClock.Start();

            m_CurrentState = new cGameScene(this);
            m_CurrentState.Enter();

            m_AppRunning = true;
        }
Ejemplo n.º 2
0
        public override void Stop(IDataInput input)
        {
            if (_Timers != null)
            {
                _Timers.Stop();
                _Timers.Dispose();
                _Timers = null;
            }

            base.Stop(input);
        }
Ejemplo n.º 3
0
        public override void Start(IDataInput input)
        {
            if (_Timers != null)
            {
                return;
            }

            // Creación del timer
            _Timers          = new cTimer();
            _Timers.Parent   = input;
            _Timers.Interval = IntervalInMilliseconds;
            _Timers.Elapsed += Timer_Elapsed;

            _Timers.Start();

            base.Start(input);
        }
Ejemplo n.º 4
0
        public cMonster(cGameScene scene, Vector2f pos) : base(scene, pos)
        {
            p_followLight                 = new cLight();
            p_followLight.Radius          = 80.0f;
            p_followLight.LinearizeFactor = 0.9f;
            p_followLight.Bleed           = 2.0f;
            p_followLight.Color           = new Color(20, 184, 87);
            //this.Scene.LightMap.AddStaticLight(p_followLight);


            eye                 = new cLight();
            eye.Radius          = 10.0f;
            eye.LinearizeFactor = 0.98f;
            eye.Bleed           = 5.0f;
            eye.OriginalColor   = new Color(255, 39, 13);
            eye.Color           = new Color(255, 39, 13);

            this.Scene.LightMap.AddStaticLight(eye);

            locateTime = new cTimer();
        }
Ejemplo n.º 5
0
        public override void Run()
        {
            if (Calls.MovementIsOnly(0x0))
            {
                if (!locationSaved)
                {
                    curPoint      = new Objects.Location(ObjectManager.PlayerObject.Pos.x, ObjectManager.PlayerObject.Pos.y, ObjectManager.PlayerObject.Pos.z);
                    locationSaved = true;
                    IsVendoring   = true;
                    failCounter   = 0;
                    failCounter2  = 0;
                }
                else
                {
                    if (Data.VendorLocation.differenceToPlayer() > 2)
                    {
                        if (ObjectManager.playerClass == (uint)Constants.Offsets.classIds.Warlock || ObjectManager.playerClass == (uint)Constants.Offsets.classIds.Hunter)
                        {
                            if (Ingame.GotPet())
                            {
                                Ingame.DismissPet();
                            }
                            else
                            {
                                Ingame.Tele(Data.VendorLocation, 60, false);
                            }
                        }
                        else
                        {
                            Ingame.Tele(Data.VendorLocation, 60, false);
                        }
                    }
                    else
                    {
                        if (ObjectManager.playerClass == (byte)Constants.Offsets.classIds.Druid)
                        {
                            SpellManager.CheckSpells();
                            if (Ingame.druidIsBear())
                            {
                                Ingame.Cast("Bear Form", false);
                            }
                            if (Ingame.druidIsCat())
                            {
                                Ingame.Cast("Cat Form", false);
                            }
                            Ingame.CastFinal();
                        }

                        if (Ingame.IsVendorFrameOpen())
                        {
                            Ingame.SellAllBut(Data.ProtectedItems);

                            cTimer waitTimer = new cTimer(1000);
                            while (!waitTimer.IsReady())
                            {
                                Thread.CurrentThread.Join(100);
                            }
                            failCounter2 = failCounter2 + 1;

                            if (Data.gotVendor && ObjectManager.FreeBagSlots <= Data.LeaveFreeSlots)
                            {
                                if (failCounter2 >= 20)
                                {
                                    GoBack();
                                }
                            }
                            else
                            {
                                GoBack();
                            }
                        }
                        else
                        {
                            Objects.UnitObject tmpObj = ObjectManager.GetUnitByName(Data.VendorName);
                            if (tmpObj.baseAdd != 0)
                            {
                                Calls.OnRightClickUnit(tmpObj.baseAdd, 1);
                            }
                            else
                            {
                                failCounter = failCounter + 1;
                            }

                            cTimer waitTimer = new cTimer(1000);
                            while (!waitTimer.IsReady())
                            {
                                Thread.CurrentThread.Join(100);
                            }

                            if (failCounter >= 6)
                            {
                                GoBack();
                            }
                        }
                    }
                }
            }
            else
            {
                Calls.StopRunning();
            }
        }
Ejemplo n.º 6
0
 internal Spell(string name, int sleepTime)
 {
     wait = new cTimer(sleepTime);
     Name = name;
 }
Ejemplo n.º 7
0
 public cTimer(ARM7TDMI cpu, Scheduler.Scheduler scheduler, int index, cTimer Next) : this(cpu, scheduler, index)
 {
     this.Next = Next;
 }
Ejemplo n.º 8
0
        public override void Run()
        {
            if (firstBool)
            {
                tmpTimer = new cTimer(10000);
                while (!tmpTimer.IsReady() && ObjectManager.playerPtr == 0)
                {
                    Thread.CurrentThread.Join(100);
                }

                Ingame.BackToLogin();
                tmpTimer = new cTimer(10000);
                while (!tmpTimer.IsReady() && ObjectManager.playerPtr == 0)
                {
                    Thread.CurrentThread.Join(100);
                }
                firstBool = false;
                failTrys  = 0;
            }

            if (Ingame.IsDc())
            {
                if (ObjectManager.LoginState == "login")
                {
                    Calls.DoString("DefaultServerLogin('" + Data.AccName + "', '" + Data.AccPw + "');");

                    tmpTimer = new cTimer(600000);
                    while (!tmpTimer.IsReady() && ObjectManager.playerPtr == 0 && ObjectManager.LoginState == "login")
                    {
                        Thread.CurrentThread.Join(100);
                    }
                    failTrys = failTrys + 1;

                    if (failTrys >= 2)
                    {
                        firstBool = true;
                    }
                }

                if (ObjectManager.LoginState == "charselect")
                {
                    Calls.DoString("EnterWorld();");
                    EnterWorldTimer.Reset();
                    while (!EnterWorldTimer.IsReady() && ObjectManager.playerPtr == 0)
                    {
                        Thread.CurrentThread.Join(100);
                    }
                }
                gotDc = true;
            }
            else
            {
                if (ObjectManager.playerPtr != 0)
                {
                    Thread.CurrentThread.Join(3000);
                    Calls.SetMovementFlags(0);
                    gotDc     = false;
                    firstBool = true;
                    ObjectManager.ExecuteOnce = true;
                    ChatReader.ClearChat      = true;
                }
            }
        }
Ejemplo n.º 9
0
 public cGameScene(cSfmlApp controller) : base(controller)
 {
     levelTimer = new cTimer();
 }
Ejemplo n.º 10
0
 /*private cGlobalClock() { }*/
 static cGlobalClock()
 {
     timer = new cTimer();
 }
Ejemplo n.º 11
0
 internal Spell(string name, int sleepTime)
 {
     wait = new cTimer(sleepTime);
     Name = name;
 }