Example #1
0
 public void SetReservedBullet(EWeaponSlotType slot, int count)
 {
     if (slot.IsSlotWithBullet())
     {
         ModeController.SetReservedBullet(this, slot, count);
     }
 }
Example #2
0
        public void StartMonitorModeUI()
        {
            // dispose
            data = null;

            // init control properties
            autoToolStripMenuItem.Checked         = Properties.Settings.Default.autoImageToFileEnabled;
            startMonitorToolStripMenuItem.Visible = false;
            stopMonitorToolStripMenuItem.Visible  = true;

            // hide main window and display system tray icon
            dialogue.WindowState   = FormWindowState.Minimized;
            dialogue.ShowInTaskbar = false;
            dialogue.Hide();
            dialogue.notifyIcon.Visible = true;

            try
            {
                ModeController.RegisterHotKey(Properties.Settings.Default.pasteHotkey);
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message,
                                Resources.Strings.TitleError, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            ModeController.StartMonitorMode();
        }
    private void Start() {

        currentAction = null;
        modeController = world.modeController;
        moneyController = world.money;

    }
Example #4
0
        private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (sender.IsMe && ModeController.Activemode(Orbwalker.ActiveModes.Combo) && ModeController.Mode == 1)
            {
                var target = TargetSelector.GetTarget(1000, DamageType.Physical);

                // E Cancels
                if (args.SData.Name == Spells.E.Name && Spells.R1.IsReady() && R1Activated == false)
                {
                    Logic.CastR(target);
                }

                if (args.SData.Name == Spells.E.Name && Items.Tiamat.IsReady() || Items.Hydra.IsReady())
                {
                    Logic.CastTiaHydra(target);
                }

                if (args.SData.Name == Spells.E.Name && Spells.W.IsReady())
                {
                    Logic.CastW(target);
                }

                if (args.SData.Name == Spells.E.Name && R1Activated && target.Health <= Spells.R2Damage(target, target.Health))
                {
                    var prediction = Spells.R2.GetPrediction(target);
                    Spells.R2.Cast(prediction.CastPosition);
                }

                // R1 Cancels

                if (args.SData.Name == Spells.R1.Name && Spells.W.IsReady())
                {
                    Logic.CastW(target);
                }

                if (args.SData.Name == Spells.R1.Name && Spells.Q.IsReady())
                {
                    Logic.CastQ(target);
                }

                // W Cancels

                if (args.SData.Name == Spells.W.Name && Spells.Q.IsReady())
                {
                    Logic.CastQ(target);
                }

                // R2 Cancels

                if (args.SData.Name == Spells.R2.Name && Spells.W.IsReady())
                {
                    Logic.CastW(target);
                }

                if (args.SData.Name == Spells.R2.Name && Spells.Q.IsReady())
                {
                    Logic.CastQ(target);
                }
            }
        }
Example #5
0
        private static void OnLoadingComplete(EventArgs args)
        {
            if (Player.Instance.Hero != Champion.Riven)
            {
                return;
            }

            Spells.Initialize();
            ModeController.Initialize();
            MenuDesigner.Initialize();
            Variables.Initialize();
            Logic.IniInitialize();
            AutoLevel.Initialize();

            Obj_AI_Base.OnPlayAnimation      += OnPlayAnimation;
            Orbwalker.OnPostAttack           += OnPostAttack;
            Obj_AI_Base.OnProcessSpellCast   += OnProcessSpellCast;
            Obj_AI_Base.OnBuffGain           += OnBuffGain;
            Obj_AI_Base.OnBuffLose           += OnBuffLose;
            Interrupter.OnInterruptableSpell += OnInterruptableSpell;
            Gapcloser.OnGapcloser            += OnGapcloser;
            Drawing.OnDraw += OnDraw;

            Chat.Print("Ex1L Riven made by Enelx !");
        }
Example #6
0
    public void StartGame(string mode)
    {
        Debug.Log("Stating game mode " + mode);

        this.gameMode = mode;

        switch (this.gameMode)
        {
        case MODE_CLASSIC:
            // TODO: create the appropriate mode controller logic
            this.modeController = classicGame.GetComponent <ClassicModeController>();
            break;

        default:
            Debug.LogError("Invalid game mode " + mode);
            this.modeController = null;
            this.gameMode       = null;
            throw new System.NullReferenceException();
        }

        this.modeController.StartGame();
        SetScoreText("0");

        GetUserInputController().SlideIntoView();
        GetGameMenuController().SlideOutOfView();
        GetSettingsMenuController().SlideOutOfView();
    }
Example #7
0
        public static void StrategyDemo()
        {
            ModeController GameController = new ModeController();

            GameController.CreateGame(new ClassicMode());
            GameController.CreateGame(new DeathmatchMode());
            GameController.CreateGame(new ClanWarMode());
        }
Example #8
0
 public int GetReservedBullet(EWeaponSlotType slot)
 {
     if (slot.IsSlotWithBullet())
     {
         return(ModeController.GetReservedBullet(this, slot));
     }
     return(0);
 }
 public void SetGameTextType(TextType textType)
 {
     if (gameMode == null)
     {
         gameMode = ModeController.GetModeValues(Level.Normal);
     }
     gameMode.TextType = textType;
 }
Example #10
0
 public void SwitchBag()
 {
     if (CanSwitchWeaponBag)
     {
         int length = ModeController.GetUsableWeapnBagLength(RelatedPlayerInfo);
         SwitchBag((HeldBagPointer + 1) % length);
     }
 }
Example #11
0
        public void SetReservedBullet(int count)
        {
            var currSlot = HeldSlotType;

            if (currSlot.IsSlotWithBullet())
            {
                ModeController.SetReservedBullet(this, HeldSlotType, count);
            }
        }
Example #12
0
 private void GetComponents()
 {
     playUi          = GetComponent <PlayUI>();
     modeController  = GetComponent <ModeController>();
     leftForce       = leftPusher.GetComponentInChildren <ApplyForce>();
     rightForce      = rightPusher.GetComponentInChildren <ApplyForce>();
     leftPushHelper  = playUi.leftPushButton.GetComponent <ButtonHelper>();
     rightPushHelper = playUi.rightPushButton.GetComponent <ButtonHelper>();
 }
Example #13
0
        internal static void Initialize()
        {
            MenuDesigner.Initialize();
            ModeController.Initialize();

            Drawing.OnDraw                   += OnDraw;
            Orbwalker.OnPreAttack            += OnPreAttack;
            Interrupter.OnInterruptableSpell += OnInterruptableSpell;
            Gapcloser.OnGapcloser            += OnGapcloser;
        }
        internal static void Initialize()
        {
            MenuDesigner.Initialize();
            ModeController.Initialize();

            Drawing.OnDraw += OnDraw;
            Obj_AI_Base.OnProcessSpellCast   += OnProcessSpellCast;
            Obj_AI_Base.OnBuffLose           += OnBuffLose;
            Gapcloser.OnGapcloser            += OnGapcloser;
            Interrupter.OnInterruptableSpell += OnInterruptableSpell;
        }
Example #15
0
 private static void OnPostAttack(AttackableUnit target, EventArgs args)
 {
     if (PerformQaa &&
         ModeController.Activemode(Orbwalker.ActiveModes.Flee) ||
         ModeController.Activemode(Orbwalker.ActiveModes.Harass) ||
         ModeController.Activemode(Orbwalker.ActiveModes.Combo) ||
         ModeController.Activemode(Orbwalker.ActiveModes.LaneClear))
     {
         Spells.Q.Cast(target.Position);
         Logic.ResetAa();
     }
 }
Example #16
0
        public Asimov(ICreateController create, KinectSensor kinect)
        {
            this.create = create;
            this.kinect = kinect;

            this.modeController = new ModeController(this.create);
            this.gestures = this.InitGestures();
            this.lastActionTime = DateTime.MinValue;

            // Beep to indicate Asimov has started
            create.Beep();

            // Disable all safety features of the Create
            create.SetMode(CreateMode.Full);
        }
Example #17
0
    public void Init(UIManager ui, ModeController mode, NetworkController network, ILog log, IScene scene, IEvent events)
    {
        _ui      = ui;
        _mode    = mode;
        _network = network;
        _log     = log;
        _scene   = scene;
        _event   = events;

        _event.Subscribe <Network_ConnectComplete>(this, OnNetworkConnectComplete);
        _event.Subscribe <Network_Error>          (this, OnNetworkError);
        _event.Subscribe <Network_StateUpdated>   (this, OnNetworkStateUpdated);


        LocalPlayButton.onClick.AddListener(OnLocalPlayButton);
        NetworkPlayButton.onClick.AddListener(OnNetworkPlayButton);
    }
Example #18
0
    public override void Init(ModeController modeController)
    {
        this.modeController = modeController;
        modeController.dataHolder.disappearTimer = disappearTimer;
        modeController.dataHolder.isDisappearing = loopsDisappearing;

        if (difficulty == Difficulty.Easy)
        {
            modeController.dataHolder.OnTimerPassed += NormalMode_OnTimerPassed;
            Debug.Log("Normal easy started.");
        }
        else
        {
            modeController.dataHolder.OnEntering += NormalMode_OnEntering;
            modeController.dataHolder.OnExiting  += NormalMode_OnExiting;
            Debug.Log("Normal hard started.");
        }
    }
Example #19
0
        private bool TxtPasteHotkeyValidate(string hotkeyStr)
        {
            if (string.IsNullOrEmpty(hotkeyStr))
            {
                return(false);
            }

            try
            {
                ModeController.RegisterHotKey(hotkeyStr);
                return(true);
            }
            catch (Exception ex)
            {
                CommandLine.Warning("[Hotkey] register failed" + Environment.NewLine + ex.ToString());
                return(false);
            }
        }
Example #20
0
        public static void Execute()
        {
            if (Variables.UseAutoW)
            {
                if (Player.Instance.CountEnemiesInRange(Spells.W.Range) >= Variables.MinEnemiesW && Spells.W.IsReady())
                {
                    Spells.W.Cast();
                }
            }

            // Killsteal
            var rtarget = TargetSelector.GetTarget(Spells.R2.Range, DamageType.Physical);
            var qtarget = TargetSelector.GetTarget(400, DamageType.Physical);
            var wtarget = TargetSelector.GetTarget(Spells.W.Range, DamageType.Physical);

            if (rtarget != null && !rtarget.IsZombie && !rtarget.IsInvulnerable)
            {
                if (Riven.R1Activated && rtarget.Health <= Spells.R2Damage(rtarget, rtarget.Health))
                {
                    if (Spells.R2.IsReady())
                    {
                        var prediction = Spells.R2.GetPrediction(rtarget);
                        Spells.R2.Cast(prediction.CastPosition);
                    }
                }
            }

            if (qtarget != null && !qtarget.IsZombie && !qtarget.IsInvulnerable && ModeController.Activemode(Orbwalker.ActiveModes.Combo))
            {
                if (Spells.Q.IsReady() && qtarget.Health <= Spells.QDamage(qtarget) * 1.5)
                {
                    Spells.Q.Cast(qtarget.ServerPosition);
                }
            }

            if (wtarget != null && !wtarget.IsZombie && !wtarget.IsInvulnerable)
            {
                if (Spells.W.IsReady() && wtarget.Health <= Spells.WDamage(wtarget))
                {
                    Spells.W.Cast();
                }
            }
        }
Example #21
0
    public override void Init(ModeController modeController)
    {
        this.modeController      = modeController;
        modeController.startTime = Time.time;
        modeController.endTime   = Time.time + timerMax;
        timer = timerMax;
        modeController.dataHolder.disappearTimer = disappearTimer;
        modeController.dataHolder.isDisappearing = loopsDisappearing;

        if (difficulty == Difficulty.Easy)
        {
            modeController.dataHolder.OnTimerPassed += WaterModeEasy_OnTimerPassed;
            Debug.Log("Water easy started.");
        }
        else
        {
            modeController.dataHolder.OnTimerPassed += WaterHardMode_OnTimerPassed;
            Debug.Log("Water hard started.");
        }
    }
Example #22
0
        public void Initialize(EntityKey owner, PlayerWeaponComponentsAgent agent, PlayerEntityWeaponInteract interact, GrenadeCacheHelper helper)
        {
            Owner             = owner;
            grenadeHelper     = helper;
            weaponInteract    = interact;
            playerWeaponAgent = agent;
            int modeBagLength = ModeController.GetUsableWeapnBagLength(RelatedPlayerInfo);

            slotWeaponAgents = new WeaponBaseAgent[GlobalConst.WeaponBagMaxCount, GlobalConst.WeaponSlotMaxLength];
            var throwWeaponAgent = CreateGetWeaponAgent(0, EWeaponSlotType.ThrowingWeapon);

            //多个背包共享一份投掷武器代理
            if (modeBagLength > 1)
            {
                for (int i = 1; i < modeBagLength; i++)
                {
                    slotWeaponAgents[i, (int)EWeaponSlotType.ThrowingWeapon] = throwWeaponAgent;
                }
            }
        }
Example #23
0
        private PlayerWeaponBagData FindWeaponBagDataBySlot(int index)
        {
            int length = ModeController.GetUsableWeapnBagLength(RelatedPlayerInfo);

            if (index == HeldBagPointer)
            {
                return(null);
            }
            List <PlayerWeaponBagData> bagDatas = ModeController.FilterSortedWeaponBagDatas(RelatedPlayerInfo);

            if (bagDatas == null || bagDatas.Count <= index)
            {
                return(null);
            }
            PlayerWeaponBagData tarBag = bagDatas.Find(bag => bag.BagIndex == index);

            if (tarBag == null)
            {
                return(null);
            }
            HeldBagPointer = index;
            return(tarBag);
        }
        void Start()
        {
            armModels = GameObject.Find("ModesArmModel");
            Assert.IsNotNull(armModels);
            modeController = SceneHelpers.FindObjectOfType <ModeController>(true);
            Assert.IsNotNull(modeController);
            initialPointer = GvrPointerInputModule.Pointer;
            for (int i = 0; i < Camera.allCameras.Length; i++)
            {
                GvrPointerPhysicsRaycaster raycaster = Camera.allCameras[i].GetComponent <GvrPointerPhysicsRaycaster>();
                if (raycaster != null)
                {
                    physicsRaycasters.Add(raycaster);
                }
            }

            wasPhysicsRaycasterEnabledArray = new bool[physicsRaycasters.Count];

            GameObject customizeMenu = GameObject.Find("CustomizeArmModelUI");

            Assert.IsNotNull(customizeMenu);
            graphicRaycaster = customizeMenu.GetComponent <GvrPointerGraphicRaycaster>();
            Assert.IsNotNull(graphicRaycaster);
        }
Example #25
0
 public int SetReservedBullet(EBulletCaliber caliber, int count)
 {
     return(ModeController.SetReservedBullet(this, caliber, count));
 }
Example #26
0
 private void FormMain_FormClosing(object sender, FormClosingEventArgs e)
 {
     ModeController.UnregisterHotKey();
     ModeController.StopMonitorMode();
     CommandLine.CloseConsole();
 }
Example #27
0
 public void Init(ModeController mode)
 {
     _mode = mode.Mode;
 }
Example #28
0
 public abstract void Init(ModeController modeController);
Example #29
0
    /// <summary>
    /// Use Start() for initialization
    /// </summary>
    void Start()
    {
        //reset root structure rotation so we dont store it in the initial rotation
        Quaternion rotOriginal = transform.rotation;
        transform.rotation = Quaternion.identity;

        //iterate over all limbs and initialize them
        foreach(Limb l in limbArray)
        {
            l.StartTrackingLimb();//create a TrackBone script for each entry that has a transform attached to it
        }
        initialized=true;

        //set rotation of the root back to what it was
        transform.rotation = rotOriginal;

        hand = GameObject.Find("mixamorig:LeftHand");
        torso = GameObject.Find("mixamorig:LeftForeArm");

        gameObject.AddComponent<LineRenderer> ();

        if (Network.isServer) {
            lineRenderer = gameObject.GetComponent<LineRenderer> ();
            lineRenderer.SetWidth (0.01f, 0.01f);
            //lineRenderer.material = new Material (Shader.Find("Particles/Additive"));
            //lineRenderer.SetColors (myred, myred);

            modeController=GetComponent(typeof(ModeController)) as ModeController;
        }
    }
Example #30
0
 public int GetReservedBullet()
 {
     return(ModeController.GetReservedBullet(this, HeldSlotType));
 }
Example #31
0
 public int GetReservedBullet(EBulletCaliber caliber)
 {
     return(ModeController.GetReservedBullet(this, caliber));
 }
Example #32
0
        public void Execute()
        {
            if (action == CLIParams.REG)
            {
                RightMenu.ShiftSetting shift = HasThisParam(CLIParams.SHIFT) ? RightMenu.ShiftSetting.True : RightMenu.ShiftSetting.False;
                RightMenu.QuickSetting quick = HasThisParam(CLIParams.QUICK) ? RightMenu.QuickSetting.True : RightMenu.QuickSetting.False;
                RightMenu.Add(shift, quick);
            }
            else if (action == CLIParams.UNREG)
            {
                RightMenu.QuickSetting quick = HasThisParam(CLIParams.QUICK) ? RightMenu.QuickSetting.True : RightMenu.QuickSetting.False;
                RightMenu.Delete(quick);
            }
            else if (action == CLIParams.MONITOR)
            {
                if (ApplicationHelper.IsPasteExMonitorModeProcessExist())
                {
                    CommandLine.Error(Resources.Strings.TipMonitorProcessExisted);
                    MessageBox.Show(Resources.Strings.TipMonitorProcessExisted,
                                    Resources.Strings.TitleError, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                // Monitor mode
                Application.Run(new FormMain(null));
            }
            else if (action == CLIParams.PASTE)
            {
                if (HasThisParam(CLIParams.QUICK))
                {
                    // Quick paste mode
                    bool forceOverWrite = HasThisParam(CLIParams.FORCE);

                    if (File.Exists(path))
                    {
                        string directory = Path.GetDirectoryName(path);
                        if (string.IsNullOrEmpty(directory))
                        {
                            Console.WriteLine(Resources.Strings.TipTargetPathNotExist);
                            MessageBox.Show(Resources.Strings.TipTargetPathNotExist,
                                            Resources.Strings.Title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                        ModeController.QuickPasteEx(directory, Path.GetFileName(path), forceOverWrite);
                    }
                    else if (Directory.Exists(path))
                    {
                        ModeController.QuickPasteEx(path, null, forceOverWrite);
                    }
                    else
                    {
                        string directory = Path.GetDirectoryName(path);
                        if (string.IsNullOrEmpty(directory))
                        {
                            Console.WriteLine(Resources.Strings.TipTargetPathNotExist);
                            MessageBox.Show(Resources.Strings.TipTargetPathNotExist,
                                            Resources.Strings.Title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                        ModeController.QuickPasteEx(directory, Path.GetFileName(path), forceOverWrite);
                    }
                }
                else
                {
                    if (!string.IsNullOrEmpty(path))
                    {
                        // Start the main interface with path
                        Application.Run(new FormMain(path));
                    }
                    else
                    {
                        // Client.Start();
                        if (!RightMenu.Init())
                        {
                            return;
                        }
                        if (Properties.Settings.Default.DefaultStartupMonitorModeEnabled)
                        {
                            // Monitor Mode Entrance 2
                            ApplicationHelper.StartSelf(CLIParams.MONITOR, false);
                            return;
                        }
                        else
                        {
                            Application.Run(new FormMain());
                        }
                    }
                }
            }
            else
            {
                Application.Run(new FormMain());
            }
        }
Example #33
0
    void Update()
    {
        if (Network.isServer) {
            if(!modeController) {
                modeController = GameObject.Find ("draugr(Clone)").GetComponent(typeof(ModeController)) as ModeController;
            }

            if (modeController.getMode () == ModeController.Mode.None) {
                //DO NOTHING
                isFading = false;
                isActive = false;
                isSelectedNow (false);
                SetVolume (maxVolume);
                SetPitch (maxPitch);
                if (music.isPlaying) {
                    Pause ();
                }
            } else if (modeController.getMode () == ModeController.Mode.One) {
                updateOneInstrument ();
            } else if (modeController.getMode () == ModeController.Mode.All) {
                updateAllInstruments ();
            }
        }
    }
Example #34
0
    void Start()
    {
        initTime = Time.realtimeSinceStartup;
        coll = GetComponent<Collider> ();
        hand = GameObject.Find ("mixamorig:LeftHand");
        torso = GameObject.Find ("mixamorig:LeftForeArm");
        modeController=GameObject.Find ("draugr(Clone)").GetComponent(typeof(ModeController)) as ModeController;

        music = gameObject.AddComponent<AudioSource> ();
        music.clip = Resources.Load(clipname) as AudioClip;
    }
Example #35
0
    void OnGUI()
    {
        if(!modeController) {
            modeController = GameObject.Find ("draugr(Clone)").GetComponent(typeof(ModeController)) as ModeController;
        }

        if (modeController.getMode () == ModeController.Mode.One) {
            if (modeController.getInstrumentName ().Equals (this.name)) {
                string pla="";
                if(music.isPlaying)
                    pla="Playing";
                else
                    pla="Stopped";
                GUI.Box (new Rect (Screen.width / 3, 25, Screen.width / 3, 25), "Volume at " + (Mathf.Round(music.volume * 100f) / 100f)*100f + "% (" + pla + ")");
            }
        }
    }