private HeraldEyeModule(int ledCount, GameState gameState, int itemID, int itemSlot, LightingMode preferredLightMode, AbilityCastPreference preferredCastMode)
            : base(itemID, itemSlot, gameState, preferredLightMode)
        {
            // Initialization for the item module occurs here.

            PreferredCastMode = preferredCastMode;

            ItemCast         += OnItemActivated;
            GameStateUpdated += OnGameStateUpdated;

            ItemCastMode = AbilityCastMode.Instant();

            ItemCooldownController.SetCooldown(ITEM_ID, 240000);

            // Preload all the animations you'll want to use. MAKE SURE that each animation file
            // has its Build Action set to "Content" and "Copy to Output Directory" is set to "Always".

            animator = AnimationModule.Create(ledCount);
            animator.NewFrameReady += (_, ls, mode) => DispatchNewFrame(ls, mode);

            animator.PreloadAnimation(ITEM_ANIMATION_PATH + "HeraldEye/anim_1.txt");
            animator.PreloadAnimation(ITEM_ANIMATION_PATH + "HeraldEye/anim_2.txt");
            animator.PreloadAnimation(ITEM_ANIMATION_PATH + "HeraldEye/anim_3.txt");
            animator.PreloadAnimation(ITEM_ANIMATION_PATH + "HeraldEye/anim_4.txt");
        }
        private RedemptionModule(int ledCount, GameState gameState, int itemID, int itemSlot, LightingMode preferredLightMode, AbilityCastPreference preferredCastMode)
                            : base(itemID, itemSlot, gameState, preferredLightMode)
        {
            // Initialization for the item module occurs here.

            // Set preferred cast mode. It's a player choice (Quick cast, Quick cast with indicator, or Normal cast)
            this.PreferredCastMode = preferredCastMode;

            ItemCast += OnItemActivated;
            GameStateUpdated += OnGameStateUpdated;

            // Set item cast mode.
            // For Oracle Lens, for example:
            // It's Instant Cast (press it, and the trinket activates)
            // For a ward, it's normal cast (press & click)
            ItemCastMode = AbilityCastMode.Normal();

            ItemCooldownController.SetCooldown(ITEM_ID, 0);
            WaitForItemInfo();

            // Preload all the animations you'll want to use. MAKE SURE that each animation file
            // has its Build Action set to "Content" and "Copy to Output Directory" is set to "Always".

            animator = AnimationModule.Create(ledCount);
            animator.NewFrameReady += (_, ls, mode) => DispatchNewFrame(ls, mode);

            animator.PreloadAnimation(ITEM_ANIMATION_PATH + "Redemption/start.txt");
            animator.PreloadAnimation(ITEM_ANIMATION_PATH + "Redemption/impact.txt");

        }
Exemple #3
0
        private void MakeAnimation <T>(AnimationModule module)
            where T : AnimationModule
        {
            var controller = MakeController <AnimationController, AnimationModule>(module);

            CampaignController.GetAnimation <T>().Returns(controller);
        }
Exemple #4
0
        private LeagueOfLegendsModule(int ledCount, LightingMode mode, AbilityCastPreference castMode)
        {
            // League of Legends integration Initialization

            // Init Item Attributes
            ItemUtils.Init();
            ItemCooldownController.Init();

            this.preferredCastMode = castMode;

            // LED Initialization
            lightingMode = mode;
            this.leds    = new Led[ledCount];
            for (int i = 0; i < ledCount; i++)
            {
                leds[i] = new Led();
            }

            // Load animation module
            animationModule = AnimationModule.Create(this.leds.Length);
            animationModule.NewFrameReady += OnNewFrameReceived;
            CurrentLEDSource = animationModule;

            PlayLoadingAnimation();
            WaitForGameInitialization();
        }
        private WardingTotemModule(int ledCount, GameState gameState, int itemID, int itemSlot, LightingMode preferredLightMode, AbilityCastPreference preferredCastMode)
            : base(itemID, itemSlot, gameState, preferredLightMode)
        {
            // Initialization for the item module occurs here.

            // Set preferred cast mode. It's a player choice (Quick cast, Quick cast with indicator, or Normal cast)
            PreferredCastMode = preferredCastMode;

            ItemCast += OnItemActivated;

            /*GameStateUpdated += OnGameStateUpdated;
             * OnGameStateUpdated(gameState);*/

            // Set item cast mode.
            // For Oracle Lens, for example:
            // It's Instant Cast (press it, and the trinket activates)
            // For a ward, it's normal cast (press & click)
            ItemCastMode = AbilityCastMode.Normal();

            // TODO: This is because of a game bug, IT WILL GET FIXED and this will have to be changed
            ItemCooldownController.SetCooldown(this.ItemID, GetCooldownPerCharge(gameState));

            // Preload all the animations you'll want to use. MAKE SURE that each animation file
            // has its Build Action set to "Content" and "Copy to Output Directory" is set to "Always".

            animator = AnimationModule.Create(ledCount);
            animator.NewFrameReady += (_, ls, mode) => DispatchNewFrame(ls, mode);
        }
Exemple #6
0
        // TODO: Handle champions with cooldown resets?

        protected ChampionModule(int ledCount, string champName, GameState gameState, LightingMode preferredLightingMode) // TODO: Pass gamestate instead of active player
        {
            Name         = champName;
            GameState    = gameState;
            LightingMode = preferredLightingMode;
            animator     = AnimationModule.Create(ledCount);

            LoadChampionInformation(champName);
        }
Exemple #7
0
        protected BaseGameModule(GameState gameState, AbilityCastPreference castMode)
        {
            PreferredCastMode = castMode;

            GameState = gameState;
            // Load animation module
            Animator         = AnimationModule.Create();
            CurrentLEDSource = Animator;
        }
Exemple #8
0
    public void SwitchAnimState(AnimationModule module)
    {
        var animatorInfo = module.Animator.GetCurrentAnimatorClipInfo(0);

        _currentState = animatorInfo[0].clip.name;

        if (_currentState == module.STATE)
        {
            return;
        }

        module.Animator.Play(module.STATE);
    }
Exemple #9
0
    public void Awake()
    {
        m_audioSource = this.GetComponent <AudioSource>();
        m_target      = new GameObject();
        m_target.transform.position = Vector3.zero;

        // Initialize self parameters
        m_droneRigitBody = this.GetComponentInChildren <Rigidbody>();
        m_droneRigitBody.Sleep();

        m_animationModule = new AnimationModule(this.GetComponentInChildren <Animator>());
        m_movmentModule   = new MovmentModule(m_target, this.gameObject.transform);
    }
        private LeagueOfLegendsModule(int ledCount)
        {
            // League of Legends integration Initialization
            Process[] pname = Process.GetProcessesByName("League of Legends");
            if (pname.Length == 0)
            {
                throw new InvalidOperationException("Game client is not open.");
            }

            // Queries the game information
            QueryPlayerInfo();

            // LED Initialization
            //reverseOrder = reverse;
            this.leds = new Led[ledCount];
            for (int i = 0; i < ledCount; i++)
            {
                leds[i] = new Led();
            }

            // Load animation module
            animationModule = AnimationModule.Create(ledCount);
            animationModule.NewFrameReady += OnNewFrameReceived;

            // Load champion module. Different modules will be loaded depending on the champion.
            // If there is no suitable module for the selected champion, just the health bar will be displayed.

            // TODO: Make this easily extendable when there are many champion modules
            if (playerChampion.RawChampionName.ToLower().Contains("velkoz"))
            {
                championModule = VelKozModule.Create(ledCount, activePlayer);
                championModule.NewFrameReady        += OnNewFrameReceived;
                championModule.TriedToCastOutOfMana += OnAbilityCastNoMana;
            }
            CurrentLEDSource = championModule;

            // Sets up a task to always check for updated player info
            Task.Run(async() =>
            {
                while (true)
                {
                    QueryPlayerInfo();
                    await Task.Delay(150);
                }
            });

            // start frame timer
            Task.Run(FrameTimer);
        }
Exemple #11
0
        private VelKozModule(int ledCount, ActivePlayer playerInfo, string championName) : base(championName, playerInfo)
        {
            // Initialization for the champion module occurs here.
            // Preload all the animations you'll want to use. MAKE SURE that each animation file
            // has its Build Action set to "Content" and "Copy to Output Directory" is set to "Always".

            animator = AnimationModule.Create(ledCount);
            animator.PreloadAnimation(@"Animations/Vel'Koz/q_start.txt");
            animator.PreloadAnimation(@"Animations/Vel'Koz/q_recast.txt");
            animator.PreloadAnimation(@"Animations/Vel'Koz/w_cast.txt");
            animator.PreloadAnimation(@"Animations/Vel'Koz/w_close.txt");

            animator.NewFrameReady += (_, ls) => DispatchNewFrame(ls);

            KeyboardHookService.Instance.OnMouseClicked += OnMouseClick;
            KeyboardHookService.Instance.OnKeyPressed   += OnKeyPress;
        }
Exemple #12
0
        private WardingTotemModule(int ledCount, GameState gameState, int itemID, int itemSlot, LightingMode preferredLightMode, AbilityCastPreference preferredCastMode)
            : base(itemID, itemSlot, gameState, preferredLightMode)
        {
            // Initialization for the item module occurs here.

            // Set preferred cast mode. It's a player choice (Quick cast, Quick cast with indicator, or Normal cast)
            PreferredCastMode = preferredCastMode;

            ItemCast += OnItemActivated;

            /*GameStateUpdated += OnGameStateUpdated;
             * OnGameStateUpdated(gameState);*/

            // Set item cast mode.
            // For Oracle Lens, for example:
            // It's Instant Cast (press it, and the trinket activates)
            // For a ward, it's normal cast (press & click)
            ItemCastMode = AbilityCastMode.Normal();

            ItemCooldownController.SetCooldown(this.ItemID, GetCooldownPerCharge(gameState)); // Game bug? Set the cooldown to 0, because everytime

            // Since it's a ward trinket, setup ward recharging

            /*Task.Run(async () =>
             * {
             *  while (true)
             *  {
             *      if (wardCharges < 2)
             *      {
             *          await Task.Delay(cooldownPerCharge);
             *          wardCharges++;
             *      } else
             *      {
             *          await Task.Delay(300);
             *      }
             *  }
             *
             * });*/

            // Preload all the animations you'll want to use. MAKE SURE that each animation file
            // has its Build Action set to "Content" and "Copy to Output Directory" is set to "Always".

            animator = AnimationModule.Create(ledCount);
            animator.NewFrameReady += (_, ls, mode) => DispatchNewFrame(ls, mode);
        }
Exemple #13
0
    void InitModules()
    {
        Anim  = new AnimationModule(this);      //动作控制模块
        Move  = new MoveModule(this);           //移动模块
        Skill = new SkillModule(this);          //技能模块

        Hud         = new HUDModule(this);      //角色头顶信息模块
        Property    = new PropertyModule(this); //属性模块
        Buff        = new BuffModule(this);     //Buff 模块
        Render      = new RenderModule(this);   //渲染模块
        AI          = new AIModule(this);
        _moduleList = new List <ModuleBase>()
        {
            Anim,
            Move,
            Skill,
            Hud,
            Property,
            Buff,
            Render,
            AI
        };
    }
Exemple #14
0
 private void OnValidate()
 {
     if (_activeRagdoll == null)
     {
         _activeRagdoll = GetComponent <ActiveRagdoll.ActiveRagdoll>();
     }
     if (_physicsModule == null)
     {
         _physicsModule = GetComponent <PhysicsModule>();
     }
     if (_animationModule == null)
     {
         _animationModule = GetComponent <AnimationModule>();
     }
     if (_gripModule == null)
     {
         _gripModule = GetComponent <GripModule>();
     }
     if (_cameraModule == null)
     {
         _cameraModule = GetComponent <CameraModule>();
     }
 }
Exemple #15
0
 // Use this for initialization
 void Start()
 {
     mJoy = GameObject.Find("MovementJoy").GetComponent<JoystickScripts>();
     aJoy = GameObject.Find("AimingJoy").GetComponent<JoystickScripts>();
     am = GameObject.Find("GameController").GetComponent<AnimationModule>();
 }
 public GoalModule()
 {
     animator = AnimationModule.Create();
     animator.PreloadAnimation(GOAL_ANIM_PATH);
     animator.NewFrameReady += NewFrameReadyHandler;
 }
 protected BaseRLModule()
 {
     // Load animation module
     Animator         = AnimationModule.Create();
     CurrentLEDSource = Animator;
 }