Beispiel #1
0
 //复活
 public void toLive()
 {
     isDead = false;
     banBattleRole.attribute            = banBattleRole.initAttri;
     sprite_Attribute.spriteName        = BanTools.GetAttributeName(banBattleRole.initAttri);
     sprite_Attribute_Border.spriteName = BanTools.GetAttributeBorderName(banBattleRole.initAttri);
 }
    public bool Set(BanBattleRole.Attribute attackAttribute, BanBattleRole.Attribute defenseAttribute)
    {
        int state = BanTools.GetAttributeState(attackAttribute, defenseAttribute);

        StartCoroutine(ShowKezhi(state, attackAttribute, defenseAttribute));
        return(state != 0);
    }
Beispiel #3
0
    /// <summary>
    /// 返回值表示是否有属性克制, True代表确定有属性克制
    /// </summary>

    public bool Set(BanBattleRole.Attribute attackAttribute, BanBattleRole.Attribute defenseAttribute)
    {
        Core.Data.soundManager.SoundFxPlay(SoundFx.FX_Explosion);

        sprite_Attack.spriteName  = BanTools.GetAttributeName(attackAttribute);
        sprite_Defense.spriteName = BanTools.GetAttributeName(defenseAttribute);

        sprite_Attack.MakePixelPerfect();
        sprite_Defense.MakePixelPerfect();

        transform.localScale = new Vector3(15f, 15f, 15f);

        state = BanTools.GetAttributeState(attackAttribute, defenseAttribute);
        if (state == 1)
        {
            sprite_Attack.transform.localPosition = new Vector3(sprite_Attack.transform.localPosition.x - 10f, sprite_Attack.transform.localPosition.y, sprite_Attack.transform.localPosition.z);
            sprite_Attack.transform.localScale    = new Vector3(EnlargeFactor, EnlargeFactor, EnlargeFactor);
            sprite_Defense.transform.localScale   = new Vector3(1.0f, 1.0f, 1.0f);
        }
        else if (state == -1)
        {
            sprite_Defense.transform.localPosition = new Vector3(sprite_Defense.transform.localPosition.x + 10f, sprite_Defense.transform.localPosition.y, sprite_Defense.transform.localPosition.z);
            sprite_Attack.transform.localScale     = new Vector3(1.0f, 1.0f, 1.0f);
            sprite_Defense.transform.localScale    = new Vector3(EnlargeFactor, EnlargeFactor, EnlargeFactor);
        }

        MiniItween itween = MiniItween.ScaleTo(gameObject, new Vector3(1.0f, 1.0f, 1.0f), ScaleTime, ScaleType);

        itween.myDelegateFunc += shake;

        return(state != 0);
    }
Beispiel #4
0
    IEnumerator showAngryPoint()
    {
        yield return(new WaitForSeconds(BanTimeCenter.AddOneAngry));

        while (fullObjects.Count < _curSlot)
        {
            fullObjects.Add(BanTools.CreateObject(prefab_Full, GetPos(fullObjects.Count) + Vector3.back * 0.01f));
        }
    }
Beispiel #5
0
    void AsyncInitial()
    {
        fullObjects  = new List <GameObject>();
        emptyObjects = new List <GameObject>();

        for (int i = 0; i < maxSlot; i++)
        {
            emptyObjects.Add(BanTools.CreateNGUIOject(prefab_Empty, GetPos(i), Quaternion.identity, this.transform));
        }
    }
        private static async Task Discord_GuildMemberAdded(DSharpPlus.EventArgs.GuildMemberAddEventArgs e)
        {
            //Check if this user has any outstanding bans or mutes
            DiscordUserData data = BotTools.GetUserDataById(e.Member.Id);

            if (data.temp_banned.CheckIfActive())
            {
                await BanTools.OnBannedMemberJoined(data, e.Guild, e.Member);

                return;
            }
        }
Beispiel #7
0
 /// <summary>
 /// /生成一个属性克制效果
 /// </summary>
 /// <param name="attackAttribute">攻击方的属性.</param>
 /// <param name="defenseAttribute">防御方的属性.</param>
 public bool GenerateAttributeConflict(BanBattleRole.Attribute attackAttribute, BanBattleRole.Attribute defenseAttribute)
 {
             #if VS
     AttributeConflictEx temp = BanTools.CreateNGUIOject(BanBattleManager.Instance.prefab_AttributeConflict, go_AttributeConflictPos.transform.position,
                                                         Quaternion.identity, go_AttributeConflictPos.transform).GetComponent <AttributeConflictEx>();
     return(temp.Set(attackAttribute, defenseAttribute));
             #else
     BanAttributeConflict temp = BanTools.CreateNGUIOject(BanBattleManager.Instance.prefab_AttributeConflict, go_AttributeConflictPos.transform.position,
                                                          Quaternion.identity, go_AttributeConflictPos.transform).GetComponent <BanAttributeConflict>();
     return(temp.Set(attackAttribute, defenseAttribute));
             #endif
 }
Beispiel #8
0
    public void SetData(BanBattleRole roleInfo, bool showAttack)
    {
        AtlasMgr.mInstance.SetHeadSprite(_head, roleInfo.number.ToString());
        _head.MakePixelPerfect();
        _level.text = "Lv" + roleInfo.level;

        att.spriteName    = BanTools.GetAttributeName(roleInfo.initAttri);
        border.spriteName = BanTools.GetAttributeBorderName(roleInfo.initAttri);
        _power.text       = "" + (roleInfo.group == BanBattleRole.Group.Attack ? roleInfo.attackBP : roleInfo.defenseBP);
        _name.text        = Core.Data.monManager.getMonsterByNum(roleInfo.number).name;

        if (showAttack)
        {
            _part.spriteName = "common-0008";
        }
        else
        {
            _part.spriteName = "common-0010";
        }
    }
Beispiel #9
0
    public void ReadData(BanBattleRole aBanBattleRole, bool isCurrent = false)
    {
        AtlasMgr.mInstance.SetHeadSprite(sprite_Role, aBanBattleRole.number.ToString());
        sprite_Attribute_Border.spriteName = BanTools.GetAttributeBorderName(aBanBattleRole.attribute);
        if (!isDie)
        {
            sprite_Attribute.spriteName = BanTools.GetAttributeName(aBanBattleRole.attribute);
        }
        else
        {
            sprite_Attribute.spriteName = BanTools.GetAttributeName(BanBattleRole.Attribute.Unknown);
        }
        text_Level.text = "Lv" + aBanBattleRole.level;

        if (Core.Data.monManager != null)
        {
            RoleName.text = Core.Data.monManager.getMonsterByNum(aBanBattleRole.number).name;
        }

        banBattleRole = aBanBattleRole;
    }
Beispiel #10
0
    IEnumerator Start()
    {
        ReadFromHttp();
        //跳过战斗的播放动画
        BanBattleProcess.Instance.skip = false;
        //攻击方读取数据
        attackSideInfo.ReadData(list_Attack, BanTools.GetAttackPlayerName());
        //防御方读取数据
        defenseSideInfo.ReadData(list_Defense, BanTools.GetDefensePlayerName());

        //攻击方奥义的数据
        DragonAoYiAnim.dragonMgrLeft.ReadData(list_AttAoYi);
        //防御方奥义的数据
        DragonAoYiAnim.dragonMgrRight.ReadData(list_DefAoYi);
        //初始化奥义,血条的状态
        AoyiMgr.init();
        //设定战斗速度
        SetBattleStatus();

        yield return(new WaitForSeconds(1f));

        if (War != null && War.LocalMode && War.StepMode)
        {
            if (Core.Data.temper.hasLiquidate)
            {
                //开始处理信息
                BanBattleProcess.Instance.HandleItem();
            }
            else
            {
                War.StartWarStep();
            }
        }
        else
        {
            //开始处理信息
            BanBattleProcess.Instance.HandleItem();
        }
    }
    //Left = true,代表左边克制右边。否则,右边克制左边
    IEnumerator ShowKezhi(int state, BanBattleRole.Attribute attackAttribute, BanBattleRole.Attribute defenseAttribute)
    {
        LeftAttri.spriteName  = BanTools.GetAttributeName(attackAttribute);
        RightAttri.spriteName = BanTools.GetAttributeName(defenseAttribute);

        Core.Data.soundManager.SoundFxPlay(SoundFx.FX_Explosion);
        bool Left = state == 1;

        init();

        LeftAttri.transform.localScale  = Left ? 1.5f * Vector3.one : Vector3.one;
        RightAttri.transform.localScale = Left ? Vector3.one : 1.5f * Vector3.one;

        Vector3 leftPos  = Vector3.zero;
        Vector3 rightPos = Vector3.zero;

        if (Left)
        {
            leftPos  = new Vector3(-BigPoint, 0f, 0f);
            rightPos = new Vector3(SmallPoint, 0f, 0f);
        }
        else
        {
            leftPos  = new Vector3(-SmallPoint, 0f, 0f);
            rightPos = new Vector3(BigPoint, 0f, 0f);
        }

        //start move
        MiniItween.MoveTo(LeftAttri.gameObject, leftPos, Closed);
        MiniItween.MoveTo(RightAttri.gameObject, rightPos, Closed);

        MiniItween.ColorTo(LeftAttri.gameObject, new V4(Color.white), Closed, MiniItween.Type.ColorWidget);
        MiniItween.ColorTo(RightAttri.gameObject, new V4(Color.white), Closed, MiniItween.Type.ColorWidget);

        yield return(new WaitForSeconds(Closed));

        //分离
        MiniItween.MoveTo(LeftAttri.gameObject, new Vector3(leftPos.x - ApartDis, 0f, 0f), Apart);
        MiniItween.MoveTo(RightAttri.gameObject, new Vector3(rightPos.x + ApartDis, 0f, 0f), Apart);

        MiniItween.ScaleTo(KeZhi.gameObject, 1.1f * Vector3.one, Apart);
        MiniItween.ColorTo(KeZhi.gameObject, new V4(Color.white), Apart, MiniItween.Type.ColorWidget);

        yield return(new WaitForSeconds(Apart));

        yield return(new WaitForEndOfFrame());

        KeZhi.transform.localScale = Vector3.one;

        //闪电出现
        GameObject go = Instantiate(Ray) as GameObject;

        if (Left)
        {
            RED.AddChild(go, LeftAttri.gameObject);
        }
        else
        {
            RED.AddChild(go, RightAttri.gameObject);
        }

        yield return(new WaitForSeconds(Thunder));

        Destroy(go);

        //消失
        MiniItween.MoveTo(LeftAttri.gameObject, new Vector3(-700f, 0f, 0f), Disappear);
        MiniItween.MoveTo(RightAttri.gameObject, new Vector3(700f, 0f, 0f), Disappear);
        MiniItween.ScaleTo(KeZhi.gameObject, Vector3.zero, Disappear);

        MiniItween.ColorTo(LeftAttri.gameObject, new V4(new Color(1f, 1f, 1f, 0f)), Disappear, MiniItween.Type.ColorWidget);
        MiniItween.ColorTo(RightAttri.gameObject, new V4(new Color(1f, 1f, 1f, 0f)), Disappear, MiniItween.Type.ColorWidget);
        MiniItween.ColorTo(KeZhi.gameObject, new V4(new Color(1f, 1f, 1f, 0f)), Disappear, MiniItween.Type.ColorWidget);

        yield return(new WaitForSeconds(Disappear));
    }
Beispiel #12
0
    //处理运涛数据
    public void ReadFromHttp()
    {
        localCached = new ConvertData();

        //清除之前的一条条信息
        BanBattleProcess.Instance.list_Item.Clear();
        list_BattleRole.Clear();
        list_AttAoYi.Clear();
        list_DefAoYi.Clear();

                #if DEBUG
        ConsoleEx.DebugLog(JsonFx.Json.JsonWriter.Serialize(Core.Data.temper.warBattle));
                #endif

        int headerIndex = 0;
        List <CMsgHeader> battleInfo = Core.Data.temper.warBattle.battleData.info;

        foreach (CMsgHeader aHeader in battleInfo)
        {
            headerIndex++;
            switch (aHeader.status)
            {
            case CMsgHeader.STATUS_WAR_BEGIN:
                WarBegin(aHeader);

                //战斗开始,读取队伍信息,怒气槽等信息
                CMsgWarBegin aWarBegin = aHeader as CMsgWarBegin;
                localCached.attAPCount = aWarBegin.attTeam.angryCnt;
                localCached.defAPCount = aWarBegin.defTeam.angryCnt;

                break;

            case CMsgHeader.STATUS_ROUND_BEGIN:
                //回合开始
                RoundBegin(aHeader);
                break;

            case CMsgHeader.STATUS_PROPERTY_KILL:
                //属性相克
                Property_Kill(aHeader);
                break;

            case CMsgHeader.STATUS_ATTACK:
                NormalAttack(aHeader);
                break;

            case CMsgHeader.STATUS_WAR_END:
                WarEnd(aHeader);
                break;

            case CMsgHeader.STATUS_NSK_401:
            case CMsgHeader.STATUS_NSK_402:
            case CMsgHeader.STATUS_NSK_403:
            case CMsgHeader.STATUS_NSK_404:
            case CMsgHeader.STATUS_NSK_405:
            case CMsgHeader.STATUS_NSK_406:
            case CMsgHeader.STATUS_NSK_408:
            case CMsgHeader.STATUS_NSK_409:
            case CMsgHeader.STATUS_NSK_410:
            case CMsgHeader.STATUS_NSK_411:
            case CMsgHeader.STATUS_NSK_412:
            case CMsgHeader.STATUS_NSK_413:
            case CMsgHeader.STATUS_NSK_414:
            case CMsgHeader.STATUS_NSK_415:
            case CMsgHeader.STATUS_NSK_417:
            case CMsgHeader.STATUS_NSK_419:
            case CMsgHeader.STATUS_NSK_420:
                CastSkill(aHeader.status, aHeader);
                break;

            case CMsgHeader.STATUS_NSK_407:
            case CMsgHeader.STATUS_NSK_418:
                CastSkill(aHeader.status, aHeader, battleInfo, headerIndex);
                break;

            default:
                #if DEBUG
                BanTools.LogWarning(BanTools.Serialize(aHeader));
                #endif
                break;
            }
        }
    }
Beispiel #13
0
 //改变为全属性
 public void changeToAllAttribute()
 {
     sprite_Attribute_Border.spriteName = BanTools.GetAttributeBorderName(BanBattleRole.Attribute.Quan);
     sprite_Attribute.spriteName        = BanTools.GetAttributeName(BanBattleRole.Attribute.Quan);
 }
Beispiel #14
0
 //死亡
 public void toDie()
 {
     isDead = true;
     sprite_Attribute.spriteName = BanTools.GetAttributeName(BanBattleRole.Attribute.Unknown);
 }
Beispiel #15
0
    private void WarBegin(CMsgHeader aHeader)
    {
        //战斗开始,读取队伍信息,怒气槽等信息
        CMsgWarBegin aWarBegin = aHeader as CMsgWarBegin;

        foreach (AW.Battle.Monster aMonster in aWarBegin.attTeam.team)
        {
            BanBattleRole role = new BanBattleRole(aMonster.pveIndex, aMonster.num, BanTools.TransAttributeType(aMonster.myAttribute), aMonster.level, aMonster.curAtt, 0, BanBattleRole.Group.Attack, aMonster.curAtt, aMonster.AllFated);
            role.angSkObj = aMonster.aSkill;
            role.norSkObj = aMonster.nSkill;
            role.isBoss   = aMonster.isBoss;

            list_BattleRole.Add(role);
        }

        foreach (AW.Battle.Monster aMonster in aWarBegin.defTeam.team)
        {
            BanBattleRole role = new BanBattleRole(aMonster.pveIndex, aMonster.num, BanTools.TransAttributeType(aMonster.myAttribute), aMonster.level, 0, aMonster.curAtt, BanBattleRole.Group.Defense, aMonster.curAtt, aMonster.AllFated);
            role.angSkObj = aMonster.aSkill;
            role.norSkObj = aMonster.nSkill;
            role.isBoss   = aMonster.isBoss;

            list_BattleRole.Add(role);
        }

        //added by zq for atk and def icon
        attackSideInfo.IsAttack  = (0 == aWarBegin.attTeam.type);
        defenseSideInfo.IsAttack = !attackSideInfo.IsAttack;
        //end

        if (aWarBegin.attAoYi != null)
        {
            foreach (int aoyi in aWarBegin.attAoYi)
            {
                list_AttAoYi.Add(aoyi);
            }
        }

        if (aWarBegin.defAoYi != null)
        {
            foreach (int aoyi in aWarBegin.defAoYi)
            {
                list_DefAoYi.Add(aoyi);
            }
        }

        if (Core.Data.guideManger.isGuiding)
        {
            side = 0;
        }
        else
        {
            if (attackSideInfo.IsAttack)
            {
                side = 0;
            }
            else
            {
                side = 1;
            }
        }
    }
Beispiel #16
0
    //主功能
    void MainFunction()
    {
        go_Gobal = GameObject.FindGameObjectWithTag("Gobal");

        mainResult = ((float)Screen.height / Screen.width) / F_Standard_Height_Divide_Width;
        if (mainResult == 1)
        {
            //DoNothing
        }
        else
        {
            //generate plane up and down
            if (mainResult > 1)
            {
                if (layer >= 0)
                {
                    //down
                    if (b_ShowBelow)
                    {
                        Vector3 pos = this.camera.ScreenToWorldPoint(new Vector3(Screen.width / 2, 0, this.camera.nearClipPlane + F_Distance_To_Plane));

                        GameObject aBlack = BanTools.CreateObject(BanTools.prefab_Black);

                        aBlack.layer = layer;
                        aBlack.transform.localScale = new Vector3(F_Cull_Plane_Width, F_Cull_Plane_Width, F_Cull_Plane_Width / 10);
                        aBlack.transform.position   = pos + aBlack.renderer.bounds.extents.y * Vector3.down;
                        //if(go_Gobal != null) aBlack.transform.parent = go_Gobal.transform;
                        aBlack.gameObject.name = gameObject.transform.name + "Block";
                        aBlack.SetActive(b_ShowBlack);
                    }
                    //up
                    if (b_ShowUpper)
                    {
                        Vector3 pos = this.camera.ScreenToWorldPoint(new Vector3(Screen.width / 2, Screen.height, this.camera.nearClipPlane + F_Distance_To_Plane));

                        GameObject aBlack = BanTools.CreateObject(BanTools.prefab_Black);

                        aBlack.layer = layer;
                        aBlack.transform.localScale = new Vector3(F_Cull_Plane_Width, F_Cull_Plane_Width, F_Cull_Plane_Width / 10);
                        aBlack.transform.position   = pos + aBlack.renderer.bounds.extents.y * Vector3.up;
                        //if(go_Gobal != null) aBlack.transform.parent = go_Gobal.transform;
                        aBlack.gameObject.name = gameObject.transform.name + "Block";
                        aBlack.SetActive(b_ShowBlack);
                    }
                }
                //Change Camera Size
                if (this.camera.orthographic)
                {
                    this.camera.orthographicSize *= mainResult;
                }
            }
            else
            {
                if (layer >= 0)
                {
                    if (b_ShowLeft)
                    {
                        //Left
                        Vector3 pos = this.camera.ScreenToWorldPoint(new Vector3(Screen.width / 2 * (1 - mainResult), Screen.height / 2, this.camera.nearClipPlane + F_Distance_To_Plane));

                        GameObject aBlack = BanTools.CreateObject(BanTools.prefab_Black);

                        aBlack.layer = layer;
                        aBlack.transform.position   = pos;
                        aBlack.transform.localScale = new Vector3(F_Cull_Plane_Width, F_Cull_Plane_Width, F_Cull_Plane_Width / 10);
                        aBlack.transform.position   = pos + aBlack.renderer.bounds.extents.x * Vector3.left;
                        // if(go_Gobal != null) aBlack.transform.parent = go_Gobal.transform;aBlack.SetActive (b_ShowBlack);
                    }

                    if (b_ShowRight)
                    {
                        //Right
                        Vector3 pos = this.camera.ScreenToWorldPoint(new Vector3(Screen.width - Screen.width / 2 * (1 - mainResult), Screen.height / 2, this.camera.nearClipPlane + F_Distance_To_Plane));

                        GameObject aBlack = BanTools.CreateObject(BanTools.prefab_Black);

                        aBlack.layer = layer;
                        aBlack.transform.localScale = new Vector3(F_Cull_Plane_Width, F_Cull_Plane_Width, F_Cull_Plane_Width / 10);
                        aBlack.transform.position   = pos + aBlack.renderer.bounds.extents.x * Vector3.right;
                        //if(go_Gobal != null) aBlack.transform.parent = go_Gobal.transform;
                        aBlack.SetActive(b_ShowBlack);
                    }
                }
            }
        }
    }
Beispiel #17
0
 //生成一个角色图标(位置,父节点)
 public BanBattleRoleIcon GenerateRoleIcon(Vector3 pos, Transform parent)
 {
     return(BanTools.CreateNGUIOject(BanBattleManager.Instance.prefab_RoleIcon, pos, Quaternion.identity, parent).GetComponent <BanBattleRoleIcon>());
 }