Exemple #1
0
    public ComboAttack ProcessCombo()
    {
        ComboAttack currentComboStepAttack = GetComboAttack();

        OnAttack();
        return(currentComboStepAttack);
    }
Exemple #2
0
    public ComboAttack ExecuteCombo(Queue <byte> combo)
    {
        ComboAttack output = new ComboAttack();

        if (combos != null)
        {
            if (combos.TryGetValue(combo, out output))
            {
                String o = "Executing combo ";
                foreach (byte b in combo)
                {
                    o += b + ", ";
                }
                Debug.Log(o);
            }
        }
        return(output);
    }
Exemple #3
0
    protected void ComboUpdate()
    {
        if (Time.time > comboTimer && comboTimer != 0f)        // Clear the queue of combo inputs after the input timer expires
        {
            comboTimer = 0f;
            comboCounter.Clear();
            currentCombo = null;
            //	Debug.Log("Combo queue cleared");
            //	Debug.Log ("Combos: " + combos.Keys.Count);
            foreach (Queue <byte> q in combos.Keys)
            {
                string st = "{";
                foreach (byte b in q)
                {
                    st += b + ", ";
                }
                st += "}: ";
                ComboAttack c;
                combos.TryGetValue(q, out c);
                st += c;
                Debug.Log(st);
            }
        }
        if (Time.time < comboTimer)        // Input for combos is available
        {
            currentCombo = ExecuteCombo(comboCounter);
            string st = "Execute combo called with ";
            foreach (byte b in comboCounter)
            {
                st += b + ", ";
            }
//			Debug.Log (st);
            if (currentCombo != null)
            {
                if (currentCombo.initialized)
                {
                    currentCombo.AttackLayer = attackLayer;
                }
            }
        }
    }
Exemple #4
0
 public ActiveCombo(ComboAttack c)
 {
     this.Combo = c;
     this.PositionInSequence = 0;
 }
Exemple #5
0
        //
        // carry out the combo attacks
        //
        // If you add a new combo, you must add the code here to define what it actually does when it is activated
        //
        public void DoComboAttack(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven, ComboAttack combo)
        {
            if (attacker == null || defender == null || weapon == null || combo == null)
            {
                return;
            }

            attacker.SendMessage("You unleash the combo attack {0}!", combo.Name);

            // apply the combo attack
            switch (combo.AttackID)
            {
            case ComboAttacks.ThunderStrike:
            {
                defender.FixedEffect(0x376A, 9, 32);
                defender.PlaySound(0x28);
                // 5x damage
                defender.Damage(weapon.MaxDamage * 5, attacker);
                // mana and stam drain
                defender.Mana -= weapon.MaxDamage * 3;
                defender.Stam -= weapon.MaxDamage * 3;
                // full self heal
                attacker.FixedEffect(0x376A, 9, 32);
                attacker.Hits = attacker.HitsMax;
                break;
            }

            case ComboAttacks.LightningRain:
            {
                defender.Damage(weapon.MaxDamage * 3, attacker);
                defender.Mana -= weapon.MaxDamage * 7;
                defender.Stam -= weapon.MaxDamage * 4;
                break;
            }

            case ComboAttacks.SqueezingFist:
            {
                // 5 sec paralyze
                defender.FixedEffect(0x376A, 9, 32);
                defender.PlaySound(0x204);
                defender.Freeze(TimeSpan.FromSeconds(5));
                // 7x stam drain
                defender.Stam -= weapon.MaxDamage * 7;
                break;
            }
            }
        }
Exemple #6
0
 void Start()
 {
     rb   = GetComponent <Rigidbody2D>();
     anim = GetComponent <Animator>();
     ca   = GetComponent <ComboAttack>();
 }
Exemple #7
0
 public ActiveCombo(ComboAttack c)
 {
     Combo = c;
     PositionInSequence = 0;
 }
 public ActiveCombo(ComboAttack c)
 {
     Combo = c;
     PositionInSequence  = 0;
 }
        //
        // carry out the combo attacks
        //
        // If you add a new combo, you must add the code here to define what it actually does when it is activated
        //
        public void DoComboAttack(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven, ComboAttack combo)
        {
            if(attacker == null || defender == null || weapon == null || combo == null) return;

            attacker.SendMessage("You unleash the combo attack {0}!",combo.Name);

            // apply the combo attack
            switch(combo.AttackID)
            {
                case ComboAttacks.ThunderStrike:
                {
                    defender.FixedEffect( 0x376A, 9, 32 );
                    defender.PlaySound( 0x28 );
                    // 5x damage
                    defender.Damage( weapon.MaxDamage*5, attacker );
                    // mana and stam drain
                    defender.Mana -= weapon.MaxDamage*3;
                    defender.Stam -= weapon.MaxDamage*3;
                    // full self heal
                    attacker.FixedEffect( 0x376A, 9, 32 );
                    attacker.Hits = attacker.HitsMax;
                    break;
                }
                case ComboAttacks.LightningRain:
                {
                    defender.Damage( weapon.MaxDamage*3, attacker );
                    defender.Mana -= weapon.MaxDamage*7;
                    defender.Stam -= weapon.MaxDamage*4;
                    break;
                }
                case ComboAttacks.SqueezingFist:
                {
                    // 5 sec paralyze
                    defender.FixedEffect( 0x376A, 9, 32 );
                    defender.PlaySound( 0x204 );
                    defender.Freeze( TimeSpan.FromSeconds(5) );
                    // 7x stam drain
                    defender.Stam -= weapon.MaxDamage*7;
                    break;
                }
            }
        }
Exemple #10
0
 public ActiveCombo(ComboAttack c)
 {
     this.Combo = c;
     this.PositionInSequence = 0;
 }
    public override void CallWhenLoadResources()
    {
        m_instance = this;
        ID = MFUIManager.MFUIID.BattleMainUI;
        MFUIManager.GetSingleton().RegisterUI(ID, m_myGameObject);
        FillFullNameData(m_myTransform);

        m_goMainUIBottom = m_myTransform.FindChild(m_widgetToFullName["Bottom"]).gameObject;
        m_goMainUIBottomLeft = m_myTransform.FindChild(m_widgetToFullName["BottomLeft"]).gameObject;
        m_goMainUIBottomRight = m_myTransform.FindChild(m_widgetToFullName["BottomRight"]).gameObject;
        m_goMainUITop = m_myTransform.FindChild("Top").gameObject;
        m_goMainUITopLeft = m_myTransform.FindChild(m_widgetToFullName["TopLeft"]).gameObject;
        m_goMainUITopRight = m_myTransform.FindChild(m_widgetToFullName["TopRight"]).gameObject;
        m_goController = m_myTransform.FindChild("BottomLeft/Controller").gameObject;
        m_goController.AddComponent<ControlStick>();

        // 设置各部分控件的Camera
        Camera camera = GameObject.Find("Camera").GetComponentsInChildren<Camera>(true)[0];
        m_goMainUIBottom.GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = camera;
        m_goMainUIBottomLeft.GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = camera;
        m_goMainUIBottomRight.GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = camera;
        m_goMainUITop.GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = camera;
        m_goMainUITopLeft.GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = camera;
        m_goMainUITopRight.GetComponentsInChildren<UIAnchor>(true)[0].uiCamera = camera;
        m_goController.GetComponentsInChildren<ControlStick>(true)[0].RelatedCamera = camera;

        m_myTransform.FindChild(m_widgetToFullName["MainUIBG"]).gameObject.AddComponent<TouchControll>();

        m_fsNormalAttackCD = m_myTransform.FindChild(m_widgetToFullName["NormalAttackCD"]).GetComponentsInChildren<UIFilledSprite>(true)[0];

        m_goSelfAttack = m_myTransform.FindChild(m_widgetToFullName["SelfAttack"]).gameObject;
        m_goCancelManaged = m_myTransform.FindChild(m_widgetToFullName["CancelManagedBtn"]).gameObject;

        m_lblPlayerBlood = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerBloodText"]).GetComponentsInChildren<UILabel>(true)[0];
        m_fsPlayerBloodFG = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerBloodFG"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite;
        m_ssPlayerHead = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerHead"]).GetComponentsInChildren<UISlicedSprite>(true)[0];
        m_fsPlayerAnger = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerAngerFG"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite;
        m_fsPlayerExp = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerExpFG"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite;
        m_fsAffectCD = m_myTransform.FindChild(m_widgetToFullName["AffectCD"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite;
        m_fsAffectCD.color = new Color(0.5f, 0.5f, 0.5f);
        m_fsOutputCD = m_myTransform.FindChild(m_widgetToFullName["OutputCD"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite;
        m_fsOutputCD.color = new Color(0.5f, 0.5f, 0.5f);
        m_fsMoveCD = m_myTransform.FindChild(m_widgetToFullName["MoveCD"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite;
        m_fsMoveCD.color = new Color(0.5f, 0.5f, 0.5f);
        m_fsSpriteSkillCD = FindTransform("MainUISpriteSkillBtnCD").GetComponentsInChildren<UIFilledSprite>(true)[0];
        m_fsSpriteSkillCD.color = new Color(0.5f, 0.5f, 0.5f);
        m_hpBottleCD = m_myTransform.FindChild(m_widgetToFullName["HpCD"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite;
        //m_hpBottleCD.atlas = MogoUIManager.Instance.GetSkillIconAtlas();
        m_fsSpecialCD = m_myTransform.FindChild(m_widgetToFullName["SpecialCD"]).GetComponentInChildren<UIFilledSprite>() as UIFilledSprite;
        m_fsNormalTargetBlood = m_myTransform.FindChild(m_widgetToFullName["NormalTargetBloodFG"]).GetComponentsInChildren<UIFilledSprite>(true)[0];
        //m_fsBossTargetBlood = m_myTransform.FindChild(m_widgetToFullName["BossTargetBloodFG"]).GetComponentsInChildren<UIFilledSprite>(true)[0];

        m_member1 = m_myTransform.FindChild(m_widgetToFullName["TeamMember1"]).gameObject;
        m_member2 = m_myTransform.FindChild(m_widgetToFullName["TeamMember2"]).gameObject;
        m_member3 = m_myTransform.FindChild(m_widgetToFullName["TeamMember3"]).gameObject;

        m_member1Image = m_myTransform.FindChild(m_widgetToFullName["TeamMember1LevelBG"]).GetComponentsInChildren<UISprite>(true)[0];
        m_member2Image = m_myTransform.FindChild(m_widgetToFullName["TeamMember2LevelBG"]).GetComponentsInChildren<UISprite>(true)[0];
        m_member3Image = m_myTransform.FindChild(m_widgetToFullName["TeamMember3LevelBG"]).GetComponentsInChildren<UISprite>(true)[0];

        m_fsMember1Blood = m_myTransform.FindChild(m_widgetToFullName["TeamMember1BloodFG"]).GetComponentsInChildren<UIFilledSprite>(true)[0];
        m_fsMember2Blood = m_myTransform.FindChild(m_widgetToFullName["TeamMember2BloodFG"]).GetComponentsInChildren<UIFilledSprite>(true)[0];
        m_fsMember3Blood = m_myTransform.FindChild(m_widgetToFullName["TeamMember3BloodFG"]).GetComponentsInChildren<UIFilledSprite>(true)[0];

        m_lblSelfAttack = m_myTransform.FindChild(m_widgetToFullName["SelfAttackText"]).GetComponentsInChildren<UILabel>(true)[0];
        m_spSelfAttack = m_myTransform.FindChild(m_widgetToFullName["SelfAttackSprite"]).GetComponentsInChildren<UISprite>(true)[0];

        //m_comboAttack = m_myTransform.FindChild(m_widgetToFullName["ComboAttack"]).GetComponentsInChildren<ComboAttack>(true)[0];
        m_comboAttack = m_myTransform.FindChild(m_widgetToFullName["ComboAttack"]).gameObject.AddComponent<ComboAttack>();


        m_bloodAnim = m_fsPlayerBloodFG.transform.parent.GetComponentsInChildren<MogoBloodAnim>(true)[0];
        m_bossBloodAnim0 = m_myTransform.FindChild(m_widgetToFullName["BossTargetBlood"]).GetComponentsInChildren<MogoBloodAnim>(true)[0];
        m_smallBossBloodAnim0 = m_myTransform.FindChild(m_widgetToFullName["SmallBossTargetBlood"]).GetComponentsInChildren<MogoBloodAnim>(true)[0];

        for (int i = 0; i < 5; ++i)
        {
            //////Mogo.Util.LoggerHelper.Debug(i + " !!!!!!!!!!!!!!!!!!!!!!!!!!!!");
            m_fsBossTargetBloodList[i] = m_myTransform.FindChild(m_widgetToFullName["BossTargetBloodFG" + i]).GetComponentsInChildren<UIFilledSprite>(true)[0];
            m_fsSmallBossTargetBloodList[i] = m_myTransform.FindChild(m_widgetToFullName["SmallBossTargetBloodFG" + i]).GetComponentsInChildren<UIFilledSprite>(true)[0];
        }

        // 左上角玩家信息Pos
        m_goMainUIPlayerInfo = FindTransform("MainUIPlayerInfo").gameObject;
        m_vecMainUIPlayerInfoPosDefault = FindTransform("MainUIPlayerInfoPosDefault").transform.localPosition;
        m_vecMainUIPlayerInfoPosPVP = FindTransform("MainUIPlayerInfoPosPVP").transform.localPosition;

        // 占塔贡献榜
        m_goOccupyTowerRank = FindTransform("OccupyTowerRank").gameObject;
        m_lblOccupyTowerRankTitle = FindTransform("OccupyTowerRankTitle").GetComponentsInChildren<UILabel>(true)[0];
        m_listOccupyTowerRank.Clear();
        for (int rank = 1; rank <= MAX_OCCUPY_TOWER_RANK; rank++)
        {
            UILabel rankLabel = FindTransform(string.Format("OccupyTowerRank{0}", rank)).GetComponentsInChildren<UILabel>(true)[0];
            m_listOccupyTowerRank.Add(rankLabel);
        }

        // 占塔战斗信息
        m_goOccupyTowerNotice = FindTransform("OccupyTowerNotice").gameObject;
        m_lblOccupyTowerNoticeCountDownNum = FindTransform("OccupyTowerNoticeCountDownNum").GetComponentsInChildren<UILabel>(true)[0];
        m_spOccupyTowerNoticeEnemyBloodFG = FindTransform("OccupyTowerNoticeEnemyBloodFG").GetComponentsInChildren<UISprite>(true)[0];
        m_spOccupyTowerNoticeOwnBloodFG = FindTransform("OccupyTowerNoticeOwnBloodFG").GetComponentsInChildren<UISprite>(true)[0];
        m_spOccupyTowerNoticeEnemyBloodAnim = FindTransform("OccupyTowerNoticeEnemyBloodAnim").GetComponentsInChildren<UISprite>(true)[0];
        m_spOccupyTowerNoticeOwnBloodAnim = FindTransform("OccupyTowerNoticeOwnBloodAnim").GetComponentsInChildren<UISprite>(true)[0];
        m_lblOccupyTowerNoticeEnemyBloodNum = FindTransform("OccupyTowerNoticeEnemyBloodNum").GetComponentsInChildren<UILabel>(true)[0];
        m_lblOccupyTowerNoticeOwnBloodNum = FindTransform("OccupyTowerNoticeOwnBloodNum").GetComponentsInChildren<UILabel>(true)[0];
        m_lblOccupyTowerNoticeEnemyScore = FindTransform("OccupyTowerNoticeEnemyScore").GetComponentsInChildren<UILabel>(true)[0];
        m_lblOccupyTowerNoticeOwnScore = FindTransform("OccupyTowerNoticeOwnScore").GetComponentsInChildren<UILabel>(true)[0];
        m_occupyTowerNoticeEnemyBloodAnim = FindTransform("OccupyTowerNoticeEnemyBlood").GetComponentsInChildren<MogoBloodAnim>(true)[0];
        m_occupyTowerNoticeOwnBloodAnim = FindTransform("OccupyTowerNoticeOwnBlood").GetComponentsInChildren<MogoBloodAnim>(true)[0];

        m_lblContributeRankText = m_myTransform.FindChild(m_widgetToFullName["CurrentRankText"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblFirstRank = m_myTransform.FindChild(m_widgetToFullName["FirstRank"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblSecRank = m_myTransform.FindChild(m_widgetToFullName["SecondRank"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblTriRank = m_myTransform.FindChild(m_widgetToFullName["TriRank"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblComboAttackNum = m_myTransform.FindChild(m_widgetToFullName["ComboAttackNum"]).GetComponentsInChildren<UILabel>(true)[0];
        m_lblDamageNum = m_myTransform.FindChild(m_widgetToFullName["DamageNum"]).GetComponentsInChildren<UILabel>(true)[0];

        m_lblInstanceCountDown = m_myTransform.FindChild(m_widgetToFullName["InstanceCountDown"]).GetComponentsInChildren<UILabel>(true)[0];

        m_goAutoFight = m_myTransform.FindChild(m_widgetToFullName["AutoFightBtn"]).gameObject;
        m_goAutoFightText = m_myTransform.FindChild(m_widgetToFullName["AutoFightBtnText"]).gameObject;

        m_goNormalAttackBtn = m_myTransform.FindChild(m_widgetToFullName["NormalAttack"]).gameObject;
        m_spNormalAttackFG = m_goNormalAttackBtn.transform.FindChild("NormalAttackBGUp").GetComponent<UISprite>();
        m_spNormalAttackBG = m_goNormalAttackBtn.transform.FindChild("NormalAttackBGDown").GetComponent<UISprite>();
        m_goSkill0Btn = m_myTransform.FindChild(m_widgetToFullName["Move"]).gameObject;
        m_goSkill1Btn = m_myTransform.FindChild(m_widgetToFullName["Affect"]).gameObject;
        m_goSkill2Btn = m_myTransform.FindChild(m_widgetToFullName["Output"]).gameObject;
        m_goSkill2Btn.AddComponent<MogoDebugWidget>();

        m_goBottle = m_myTransform.FindChild(m_widgetToFullName["MainUIItem"]).gameObject;
        m_goSpriteSkillBtn = FindTransform("MainUISpriteSkillBtn").gameObject;
        m_goCommunityBtn = m_myTransform.FindChild(m_widgetToFullName["Community"]).gameObject;

        UILabel lblText = m_goAutoFightText.transform.GetComponentsInChildren<UILabel>(true)[0];
        if (LanguageData.dataMap.ContainsKey(180000))
        {
            lblText.text = LanguageData.dataMap[180000].content;
        }

        m_goAutoFightStateText = m_myTransform.FindChild(m_widgetToFullName["AutoFightStateText"]).gameObject;
        m_goAutoFightStateText.SetActive(false);

        // 角色经验条(Bottom)
        m_goMainUIPlayerExpList = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerExpList"]).gameObject;
        m_goGOMainUIPlayerExpListFG = m_myTransform.FindChild(m_widgetToFullName["GOMainUIPlayerExpListFG"]).gameObject;
        m_lblMainUIPlayerExpListNum = m_myTransform.FindChild(m_widgetToFullName["MainUIPlayerExpListNum"]).GetComponentsInChildren<UILabel>(true)[0];
        m_goMainUIPlayerExpList.SetActive(true);
        AddPlayerExpFG();

        // 试炼之塔提示信息
        m_goGOClimbTowerCurrent = m_myTransform.FindChild(m_widgetToFullName["GOClimbTowerCurrent"]).gameObject;
        m_spClimbTowerCurrentNum1 = m_myTransform.FindChild(m_widgetToFullName["ClimbTowerCurrentNum1"]).GetComponentsInChildren<UISprite>(true)[0];
        m_spClimbTowerCurrentNum2 = m_myTransform.FindChild(m_widgetToFullName["ClimbTowerCurrentNum2"]).GetComponentsInChildren<UISprite>(true)[0];
        m_spClimbTowerCurrentNum3 = m_myTransform.FindChild(m_widgetToFullName["ClimbTowerCurrentNum3"]).GetComponentsInChildren<UISprite>(true)[0];

        // 左上角倒计时
        m_goTheCountDown1 = FindTransform("TheCountDown1").gameObject;
        m_goTheCountDown2 = FindTransform("TDCountDown").gameObject;

        m_lblTheCountDown1Num = FindTransform("TheCountDown1Num").GetComponentsInChildren<UILabel>(true)[0];
        m_lblTheCountDown2Num = FindTransform("TDCountDown").GetComponentsInChildren<UILabel>(true)[0];

        m_CDPosClimbTower = FindTransform("CDPosClimbTower").transform.localPosition;

        m_goDiamondProtectBtn = m_myTransform.FindChild(m_widgetToFullName["DiamondProtectBtn"]).gameObject;
        m_goBuildingProtectBtn = m_myTransform.FindChild(m_widgetToFullName["BuildingProtectBtn"]).gameObject;       

        // 精灵技能施放
        m_goMainUISpriteSkill = FindTransform("MainUISpriteSkill").gameObject;
        LoadFingerTailUI();

        Initialize();

        MFUIGameObjectPool.GetSingleton().NotRegisterGameObjectList(ID);
        m_myGameObject.SetActive(false);

        if (MogoWorld.thePlayer != null)
        {
            MogoWorld.thePlayer.UpdateSkillToManager();
        }

        #region 塔防血条

        go_tdNotice = m_myTransform.FindChild(m_widgetToFullName["TDNotice"]).gameObject;
        go_tdTip = m_myTransform.FindChild(m_widgetToFullName["TDTip"]).gameObject;
        sp_tdBlood = m_myTransform.FindChild(m_widgetToFullName["TDBloodFG"]).gameObject.GetComponentsInChildren<UISprite>(true)[0];
        lbl_tdWave = m_myTransform.FindChild(m_widgetToFullName["TDWaveText"]).gameObject.GetComponentsInChildren<UILabel>(true)[0];
        lbl_tdTip = m_myTransform.FindChild(m_widgetToFullName["TDTipText"]).gameObject.GetComponentsInChildren<UILabel>(true)[0];
    
        #endregion
    }
Exemple #12
0
 protected override BaseAttack GetAttack()
 {
     currentComboAttack = comboHandler.ProcessCombo();
     return(currentComboAttack.attackData);
 }