예제 #1
0
    public static bool ZombieCrazy()
    {
        BattleUIEvent bue = new BattleUIEvent(BattleUIEvent.BATTLE_UI_ZOMBIE_CRAZY);

        EventSystem.Instance.PushEvent(bue);
        return(true);
    }
예제 #2
0
    protected override void onDamage(DamageInfo damage, AttackerAttr attackerAttr)
    {
        if (!mMainPlayer)
        {
            int curHp = GetHP() < 0 ? 0 : GetHP();
            BossBloodUIManager.Instance.ChangeHp(mGhostData.name, "touxiang:head" + mGhostData.resId.ToString(), GetLevel(), curHp, GetMaxHP(),
                                                 GetMaxHP(), IsFury());
        }

        Vector3 headPos = this.GetBonePositionByName("head");

        if (headPos != Vector3.zero)
        {
            headPos   = CameraController.Instance.WorldToScreenPoint(headPos);
            headPos.z = 0.0f;

            BattleUIEvent evt = new BattleUIEvent(BattleUIEvent.BATTLE_UI_GHOST_DAMAGE);
            evt.pos    = headPos;
            evt.damage = damage;
            evt.dead   = IsDead();

            EventSystem.Instance.PushEvent(evt);
        }

        base.onDamage(damage, attackerAttr);
    }
예제 #3
0
    public override void OnPick(ObjectBase pick, ObjectBase picker)
    {
        base.OnPick(pick, picker);

        if (pick == null || picker == null)
        {
            return;
        }

        Pick obj = pick as Pick;

        if (obj == null)
        {
            return;
        }

        PickTableItem pti = obj.GetCurPickTableItem();

        if (pti == null)
        {
            return;
        }

        if (pick.GetAlias() == "pick_buff")
        {
            ModuleManager.Instance.FindModule <MonsterFloodModule>().TempMoney -= 50;
            GameDebug.Log("拾取pick_buff:" + pti.resID);
            RemoveObjsByAlias <Pick>(MonsterFloodModule.Pick_Buff);
            BattleUIEvent bu4 = new BattleUIEvent(BattleUIEvent.BATTLE_UI_PICK_TEMPMONEY);
            bu4.msg = pick.GetPosition();
            EventSystem.Instance.PushEvent(bu4);
        }
    }
예제 #4
0
    protected override void onDamage(DamageInfo damage, AttackerAttr attackerAttr)
    {
        if (mRes.bossHpUnit > 0)
        {
            int curHp = GetHP() < 0 ? 0 : GetHP();
            BossBloodUIManager.Instance.ChangeHp(mRes.name, mRes.headicon, GetLevel(), curHp, GetMaxHP(),
                                                 mRes.bossHpUnit, IsFury());
        }

        if (mBloodNode != null && !IsDead() && damage.Value < 0)
        {
            mBloodNode.Show();
        }

        Vector3 headPos = this.GetBonePositionByName("head");

        if (headPos != Vector3.zero)
        {
            headPos   = CameraController.Instance.WorldToScreenPoint(headPos);
            headPos.z = 0.0f;

            BattleUIEvent evt = new BattleUIEvent(BattleUIEvent.BATTLE_UI_DAMAGE);
            evt.pos    = headPos;
            evt.damage = damage;
            evt.dead   = IsDead();

            EventSystem.Instance.PushEvent(evt);
        }

        base.onDamage(damage, attackerAttr);
    }
예제 #5
0
    protected override void OnKillOther(AttackerAttr attr, BattleUnit theDead)
    {
        base.OnKillOther(attr, theDead);

        BattleUIEvent evt = new BattleUIEvent(BattleUIEvent.BATTLE_UI_KILL_OTHER);

        EventSystem.Instance.PushEvent(evt);
    }
예제 #6
0
    private void UpdateUI()
    {
        BattleUIEvent eUpdate = new BattleUIEvent(BattleUIEvent.BATTLE_UI_PROGRESS_UPDATE);

        eUpdate.msg  = mCurProgNum;
        eUpdate.msg1 = mTotalProgNum;
        EventSystem.Instance.PushEvent(eUpdate);
    }
예제 #7
0
    public override void OnKillEnemy(ObjectBase sprite, uint killId)
    {
        base.OnKillEnemy(sprite, killId);

        ModuleManager.Instance.FindModule <MonsterFloodModule>().TempMoney += 50;
        BattleUIEvent bu3 = new BattleUIEvent(BattleUIEvent.BATTLE_UI_PICK_TEMPMONEY);

        EventSystem.Instance.PushEvent(bu3);
    }
예제 #8
0
    //public static bool SaySomething(string str)
    //{
    //    //BattleUIEvent bue = new BattleUIEvent(BattleUIEvent.BATTLE_UI_SAY_SOMETHING);
    //    //bue.msg = str;
    //    //EventSystem.Instance.PushEvent(bue);

    //    PromptUIManager.Instance.AddNewPrompt(str);

    //    return true;
    //}

    public static bool ZombieTenSecond(int fontSize, int resId)
    {
        BattleUIEvent bue = new BattleUIEvent(BattleUIEvent.BATTLE_UI_TEN_SECOND);

        bue.msg  = fontSize;
        bue.msg1 = resId;
        EventSystem.Instance.PushEvent(bue);
        return(true);
    }
예제 #9
0
    public void ShowTimer(bool b)
    {
        mShowTimer = b;

        BattleUIEvent e = new BattleUIEvent(BattleUIEvent.BATTLE_UI_SHOW_TIMER);

        e.msg = b;
        EventSystem.Instance.PushEvent(e);
    }
예제 #10
0
    public void SetShootType(int type)
    {
        if (mShootType != type)
        {
            mShootType = type;
            PlayerPrefs.SetInt(mPlayerName + "_shoot_type", mShootType);

            BattleUIEvent ev = new BattleUIEvent(BattleUIEvent.BATTLE_UI_SHOOT_TYPE_CHANGE);
            EventSystem.Instance.PushEvent(ev);
        }
    }
예제 #11
0
    public static bool SetChallengeNum(List <string> paramList)
    {
        if (paramList == null || paramList.Count != 1)
        {
            return(false);
        }
        ModuleManager.Instance.FindModule <MonsterFloodModule>().mCurNum = Convert.ToInt32(paramList[0]);
        BattleUIEvent evt = new BattleUIEvent(BattleUIEvent.BATTLE_UI_UPDATE_MONSTER_FlOOD);

        GameDebug.Log("设置波数" + ModuleManager.Instance.FindModule <MonsterFloodModule>().mCurNum);
        EventSystem.Instance.PushEvent(evt);
        return(true);
    }
예제 #12
0
    public static bool SetTotalEnermyNum(uint num)
    {
        mLastEnermyNum = mTotalEnermyNum = num;

        BattleUIEvent ev = new BattleUIEvent(BattleUIEvent.BATTLE_UI_ZOMBIE_ENERMY_NUM);

        ev.msg  = mLastEnermyNum;
        ev.msg1 = mTotalEnermyNum;

        EventSystem.Instance.PushEvent(ev);

        return(true);
    }
예제 #13
0
    public void ShowProgress(int total, string alias, float angle)
    {
        mTotalProgNum = total;
        mCurProgNum   = total;
        mAngle        = angle;

        mAlias = alias.Split(',');

        BattleUIEvent e = new BattleUIEvent(BattleUIEvent.BATTLE_UI_PROGRESS_SHOW);

        e.msg  = mCurProgNum;
        e.msg1 = mTotalProgNum;
        EventSystem.Instance.PushEvent(e);
    }
예제 #14
0
    private void StepStop(int index)
    {
        FunctionTriggerStep step = steps[index] as FunctionTriggerStep;

        if (step == null || (step.functions.Count < 1 && step.times.Count < 1))
        {
            return;
        }

        if (step.times.Count > 0)
        {
            BattleUIEvent ev = new BattleUIEvent(BattleUIEvent.BATTLE_UI_SHOW_TIMER);
            ev.msg = 0;
            EventSystem.Instance.PushEvent(ev);
        }
    }
예제 #15
0
    protected virtual void onSkillBuffAdded(uint resID)
    {
        SkillBuffTableItem buffRes = DataManager.BuffTable[resID] as SkillBuffTableItem;
        Vector3            headPos = Vector3.zero;

        if (!string.IsNullOrEmpty(buffRes.icon) && (headPos = this.GetBonePositionByName("head")) != Vector3.zero)
        {
            headPos   = CameraController.Instance.WorldToScreenPoint(headPos);
            headPos.z = 0.0f;

            BattleUIEvent evt = new BattleUIEvent(BattleUIEvent.BATTLE_UI_BUFF_ADDED);
            evt.bmpPath = buffRes.icon;
            evt.pos     = headPos;
            EventSystem.Instance.PushEvent(evt);
        }
    }
예제 #16
0
    public override void OnPick(ObjectBase pick, ObjectBase picker)
    {
        base.OnPick(pick, picker);

        if (pick == null || picker == null)
        {
            return;
        }

        Pick obj = pick as Pick;

        if (obj == null)
        {
            return;
        }

        PickTableItem pti = obj.GetCurPickTableItem();

        if (pti == null)
        {
            return;
        }

        //switch(pti.resID)
        //{
        //    case 5:             //齿轮碎片;
        //        BattleUIEvent bue1 = new BattleUIEvent(BattleUIEvent.BATTLE_UI_PICK_GEAR);
        //        bue1.msg = pick.GetPosition();
        //        EventSystem.Instance.PushEvent(bue1);
        //        break;
        //    case 3:             //捡到金币;
        //        BattleUIEvent bue2 = new BattleUIEvent(BattleUIEvent.BATTLE_UI_PICK_GOLD);
        //        bue2.msg = pick.GetPosition();
        //        EventSystem.Instance.PushEvent(bue2);
        //        break;
        //}
        int pickId = (int)ConfigManager.GetVal <int>(ConfigItemKey.ZOMBIE_PICK_ID);

        //Debug.LogError(pti.resID);
        if (pti.resID == pickId)
        {
            BattleUIEvent bue1 = new BattleUIEvent(BattleUIEvent.BATTLE_UI_ZOMBIE_PICK1);
            //bue1.msg = pick.GetPosition();
            EventSystem.Instance.PushEvent(bue1);
        }
    }
예제 #17
0
    private void Dec(int n)
    {
        mCurProgNum -= n;
        if (mCurProgNum < 0)
        {
            mCurProgNum = 0;
        }

        UpdateUI();

        if (mCurProgNum < 1)
        {
            BattleUIEvent eOver = new BattleUIEvent(BattleUIEvent.BATTLE_UI_PROGRESS_OVER);
            eOver.msg = mAngle;
            EventSystem.Instance.PushEvent(eOver);
        }
    }
예제 #18
0
    protected override void onManaChanged(int delta)
    {
        Vector3 headPos = this.GetBonePositionByName("head");

        if (headPos != Vector3.zero)
        {
            headPos   = CameraController.Instance.WorldToScreenPoint(headPos);
            headPos.z = 0.0f;

            BattleUIEvent evt = new BattleUIEvent(BattleUIEvent.BATTLE_UI_PLAYER_MANA_CHANGED);
            evt.pos       = headPos;
            evt.deltaMana = delta;
            EventSystem.Instance.PushEvent(evt);
        }

        base.onManaChanged(delta);
    }
예제 #19
0
    protected override void onDamage(DamageInfo damage, AttackerAttr attackerAttr)
    {
        Vector3 headPos = this.GetBonePositionByName("head");

        if (headPos != Vector3.zero)
        {
            headPos   = CameraController.Instance.WorldToScreenPoint(headPos);
            headPos.z = 0.0f;

            BattleUIEvent evt = new BattleUIEvent(BattleUIEvent.BATTLE_UI_PLAYER_DAMAGE);
            evt.pos    = headPos;
            evt.damage = damage;
            EventSystem.Instance.PushEvent(evt);
        }

        base.onDamage(damage, attackerAttr);
    }
예제 #20
0
    void onBattleDamage(EventBase e)
    {
        if (!mEnable)
        {
            return;
        }

        BattleUIEvent evt = (BattleUIEvent)e;

        if (!mBeginFlicker && evt.damage.Value < 0)
        {
            mSprite.alpha = 0.8f;
            TweenAlpha.Begin(mSprite.gameObject, 0.5f, 0.0f);

            //             mDamageTime = DamageTime;
            //             mDamageTimeBegin = true;
        }
    }
예제 #21
0
    public bool KillEnermy()
    {
        mLastEnermyNum--;

        if (mLastEnermyNum < 0)
        {
            return(false);
        }

        BattleUIEvent ev = new BattleUIEvent(BattleUIEvent.BATTLE_UI_ZOMBIE_ENERMY_NUM);

        ev.msg  = mLastEnermyNum;
        ev.msg1 = mTotalEnermyNum;

        EventSystem.Instance.PushEvent(ev);

        if (mLastEnermyNum == 0)
        {
            return(true);
        }

        return(false);
    }
예제 #22
0
    private void onPlayerManaChanged(EventBase e)
    {
        BattleUIEvent evt = (BattleUIEvent)e;

        AddNewDamage(evt.pos, evt.deltaMana, true, true, false, evt.dead);
    }
예제 #23
0
    private void onDamage(EventBase e)
    {
        BattleUIEvent evt = (BattleUIEvent)e;

        AddNewDamage(evt.pos, evt.damage.Value, false, false, evt.damage.Critical, evt.dead);
    }
예제 #24
0
    void onBuffAdded(EventBase e)
    {
        BattleUIEvent evt = (BattleUIEvent)e;

        AddNewBuff(evt.pos, evt.bmpPath);
    }