Ejemplo n.º 1
0
    // Token: 0x06000ABF RID: 2751 RVA: 0x000E6B5C File Offset: 0x000E4D5C
    public void MoveUnitToEndPoint(EMarchEventType type)
    {
        LineNode lineNode = this.workingLine;

        if (lineNode == null)
        {
            return;
        }
        float x = lineNode.distance - lineNode.distance * 0.5f;

        lineNode.movingNode.localPosition = new Vector3(x, 0f, 0f);
        lineNode.sheetUnit.RecoverUnit();
        lineNode.sheetUnit.setupAnimUnit(lineNode.side, (byte)type, lineNode.angle, 0);
        if (type == EMarchEventType.EMET_HitMonsterRetreat)
        {
            NewbieManager.SetupFakeMonster(1, lineNode);
        }
    }
Ejemplo n.º 2
0
 // Token: 0x06000ABE RID: 2750 RVA: 0x000E6B14 File Offset: 0x000E4D14
 public EMarchEventType RetreatToReturn(EMarchEventType type)
 {
     if (type == EMarchEventType.EMET_AttackRetreat)
     {
         return(EMarchEventType.EMET_AttackReturn);
     }
     if (type == EMarchEventType.EMET_CampRetreat)
     {
         return(EMarchEventType.EMET_CampReturn);
     }
     if (type == EMarchEventType.EMET_GatherRetreat)
     {
         return(EMarchEventType.EMET_GatherReturn);
     }
     if (type == EMarchEventType.EMET_RallyRetreat)
     {
         return(EMarchEventType.EMET_RallyReturn);
     }
     if (type == EMarchEventType.EMET_HitMonsterRetreat)
     {
         return(EMarchEventType.EMET_HitMonsterReturn);
     }
     return(type);
 }
Ejemplo n.º 3
0
    // Token: 0x06002B20 RID: 11040 RVA: 0x00471494 File Offset: 0x0046F694
    public void CheckMessage(ushort ItemID)
    {
        DataManager instance      = DataManager.Instance;
        GUIManager  instance2     = GUIManager.Instance;
        uint        num           = 0u;
        uint        num2          = 0u;
        bool        flag          = false;
        bool        flag2         = false;
        bool        flag3         = false;
        Equip       recordByKey   = instance.EquipTable.GetRecordByKey(ItemID);
        ushort      equipKind     = (ushort)recordByKey.EquipKind;
        ushort      propertieskey = recordByKey.PropertiesInfo[0].Propertieskey;

        for (int i = 0; i < instance.MaxBuffTableCount; i++)
        {
            ItemBuff recordByKey2 = instance.ItemBuffTable.GetRecordByKey(instance.m_RecvItemBuffData[i].ID);
            recordByKey = instance.EquipTable.GetRecordByKey(recordByKey2.BuffItemID);
            if ((byte)(equipKind - 1) == 13 && propertieskey == 1)
            {
                if (DataManager.Instance.bHaveWarBuff)
                {
                    GUIManager.Instance.AddHUDMessage(instance.mStringTable.GetStringByID(9943u), 255, true);
                    return;
                }
                for (int j = 0; j < (int)instance.MaxMarchEventNum; j++)
                {
                    EMarchEventType type = instance.MarchEventData[j].Type;
                    if ((instance.MarchEventData[j].IsAmbushCamp() || instance.MarchEventData[j].IsAmbushCampMarching() || instance.MarchEventData[j].IsAmbushCampReturn() || type == EMarchEventType.EMET_AttackMarching || type == EMarchEventType.EMET_ScoutMarching || type == EMarchEventType.EMET_InforceStanby || type == EMarchEventType.EMET_RallyStanby || (type >= EMarchEventType.EMET_InforceMarching && type <= EMarchEventType.EMET_RallyAttack) || (type == EMarchEventType.EMET_AttackReturn || type == EMarchEventType.EMET_RallyReturn || type == EMarchEventType.EMET_ScoutReturn || type == EMarchEventType.EMET_InfroceReturn || type == EMarchEventType.EMET_AttackRetreat || type == EMarchEventType.EMET_RallyRetreat) || ((type == EMarchEventType.EMET_Camp || type == EMarchEventType.EMET_CampMarching || type == EMarchEventType.EMET_CampReturn) && DataManager.MapDataController.getYolkIDbyPointCode(instance.MarchEventData[j].Point.zoneID, instance.MarchEventData[j].Point.pointID, 0) < 40)) && instance.MarchEventData[j].bRallyHost != 3 && instance.MarchEventData[j].bRallyHost != 4)
                    {
                        GUIManager.Instance.OpenMessageBox(instance.mStringTable.GetStringByID(614u), instance.mStringTable.GetStringByID(7647u), null, null, 0, 0, false, false, false, false, false);
                        return;
                    }
                }
                if (instance.TotalSoldier_Embassy > 0u || instance.PrisonerNum > 0 || AmbushManager.Instance.GetMaxTroop() > 0u)
                {
                    instance2.OpenOKCancelBox(instance2.FindMenu(EGUIWindow.UI_BagFilter), instance.mStringTable.GetStringByID(614u), instance.mStringTable.GetStringByID(8240u), (int)ItemID, 0, instance.mStringTable.GetStringByID(3u), instance.mStringTable.GetStringByID(617u));
                    return;
                }
            }
            if (instance.m_RecvItemBuffData[i].bEnable && recordByKey2.BuffKind == 3)
            {
                num = (uint)recordByKey2.BuffID;
            }
            if (!flag2 && (ushort)recordByKey.EquipKind == equipKind && recordByKey.PropertiesInfo[0].Propertieskey == propertieskey)
            {
                flag = (recordByKey2.BuffKind == 3);
                switch ((byte)(equipKind - 1))
                {
                case 9:
                {
                    ECaseByCaseType ecaseByCaseType = (ECaseByCaseType)propertieskey;
                    if (ecaseByCaseType == ECaseByCaseType.ECBCT_ExpPercent || ecaseByCaseType == ECaseByCaseType.ECBCT_Monster)
                    {
                        num2 = (uint)recordByKey2.BuffNameID;
                    }
                    break;
                }

                case 11:
                {
                    ESpeedUpPercent espeedUpPercent = (ESpeedUpPercent)propertieskey;
                    if (espeedUpPercent == ESpeedUpPercent.EUP_MARCH_SPEED || espeedUpPercent == ESpeedUpPercent.EUP_BUILD_SPEED || espeedUpPercent == ESpeedUpPercent.EUP_RESEARCH_SPEED || espeedUpPercent == ESpeedUpPercent.EUP_TRAINING_SPEED || espeedUpPercent == ESpeedUpPercent.EUP_RESOURCE_SPEED || espeedUpPercent == ESpeedUpPercent.EUP_TRAP_SPEED || espeedUpPercent == ESpeedUpPercent.EUP_PET_FUSION_SPEED)
                    {
                        num2 = (uint)recordByKey2.BuffNameID;
                    }
                    break;
                }

                case 13:
                {
                    EShieldType eshieldType = (EShieldType)propertieskey;
                    if ((eshieldType == EShieldType.EST_Shield && ShieldLogManager.Instance.HasShieldState()) || eshieldType == EShieldType.EST_Investigate)
                    {
                        num2 = (uint)recordByKey2.BuffNameID;
                    }
                    break;
                }

                case 14:
                {
                    EDefenseType edefenseType = (EDefenseType)propertieskey;
                    if (edefenseType == EDefenseType.EDT_Crafty || edefenseType == EDefenseType.EDT_Salaries || edefenseType == EDefenseType.EDT_TroopScale || edefenseType == EDefenseType.EDT_TroopAtk || edefenseType == EDefenseType.EDT_TorrpDef || edefenseType == EDefenseType.EDT_TroopAtk_Reduce || edefenseType == EDefenseType.EDT_TroopDef_Reduce)
                    {
                        num2 = (uint)recordByKey2.BuffNameID;
                    }
                    break;
                }

                case 15:
                    num2 = (uint)recordByKey2.BuffNameID;
                    break;
                }
                flag3 = instance.m_RecvItemBuffData[i].bEnable;
                flag2 = true;
            }
        }
        if (num2 > 0u)
        {
            this.MessageStr.ClearString();
            if (flag && num > 0u)
            {
                ItemBuff recordByKey2 = instance.ItemBuffTable.GetRecordByKey((ushort)num);
                recordByKey = instance.EquipTable.GetRecordByKey(recordByKey2.BuffItemID);
                num         = (uint)recordByKey2.BuffNameID;
                this.MessageStr.StringToFormat(instance.mStringTable.GetStringByID(num2));
                this.MessageStr.StringToFormat(instance.mStringTable.GetStringByID(num));
                this.MessageStr.AppendFormat(instance.mStringTable.GetStringByID(7247u));
            }
            else
            {
                if (!flag3)
                {
                    this.OnOKCancelBoxClick(true, (int)ItemID, 0);
                    return;
                }
                this.MessageStr.StringToFormat(instance.mStringTable.GetStringByID(num2));
                this.MessageStr.StringToFormat(instance.mStringTable.GetStringByID(num2));
                this.MessageStr.AppendFormat(instance.mStringTable.GetStringByID(7247u));
            }
            instance2.OpenOKCancelBox(instance2.FindMenu(EGUIWindow.UI_BagFilter), instance.mStringTable.GetStringByID(614u), this.MessageStr.ToString(), (int)ItemID, 0, instance.mStringTable.GetStringByID(3u), instance.mStringTable.GetStringByID(617u));
        }
        else
        {
            this.OnOKCancelBoxClick(true, (int)ItemID, 0);
        }
    }
Ejemplo n.º 4
0
    // Token: 0x06000ABA RID: 2746 RVA: 0x000E6004 File Offset: 0x000E4204
    public LineNode createLine(MapLine mapLine, Vector3 from, Vector3 to, ELineColor color, EUnitSide unitSide, bool bEase = true, bool NeedRenderLine = true, EMonsterFace MonsterFace = EMonsterFace.LEFT, byte bLoop = 0)
    {
        CHAOS chaos = GameManager.ActiveGameplay as CHAOS;

        if (chaos == null || chaos.realmController == null || chaos.realmController.mapLineController == null)
        {
            return(null);
        }
        if (chaos.realmController.mapLineController.m_Bundle == null)
        {
            chaos.realmController.mapLineController.m_Bundle = AssetManager.GetAssetBundle("Role/FlowLinePrefab", 0L);
        }
        uint num   = mapLine.during;
        long begin = (long)mapLine.begin;

        if (num <= 0u)
        {
            return(null);
        }
        int num2 = (int)(begin + (long)((ulong)num) - DataManager.Instance.ServerTime);

        if (num2 <= 0)
        {
            return(null);
        }
        byte side = (byte)unitSide;

        from   = this.m_Parent.transform.InverseTransformPoint(from);
        from.z = 0f;
        to     = this.m_Parent.transform.InverseTransformPoint(to);
        to.z   = 0f;
        long num3 = DataManager.Instance.ServerTime - begin;

        num3 = Math.Max(num3, 0L);
        num3 = Math.Min(num3, (long)((ulong)num));
        float           num4            = (float)num3;
        float           num5            = Vector3.Distance(from, to);
        float           num6            = num5 / num * 2f;
        EMarchEventType emarchEventType = EMarchEventType.EMET_Camp;
        byte            b = mapLine.lineFlag;

        if (b >= 23)
        {
            if (num4 >= 5f)
            {
                emarchEventType = (EMarchEventType)b;
                b = (byte)this.RetreatToReturn((EMarchEventType)b);
            }
            else if (b == 24 || b == 25)
            {
                side = ((color != ELineColor.DEEPBLUE) ? 0 : 1);
            }
        }
        LineNode   lineNode = null;
        GameObject gameObject;

        if (this.workingLine != null)
        {
            gameObject = this.workingLine.gameObject;
            gameObject.SetActive(true);
            this.setupLineNode(lineNode, num5, bEase, (byte)color);
        }
        else
        {
            if (this.m_Bundle == null)
            {
                this.m_Bundle = chaos.realmController.mapLineController.m_Bundle;
            }
            gameObject = (UnityEngine.Object.Instantiate(this.m_Bundle.mainAsset) as GameObject);
            gameObject.transform.parent = this.m_Parent.transform;
            MeshFilter   component  = gameObject.GetComponent <MeshFilter>();
            Mesh         mesh       = new Mesh();
            MeshRenderer component2 = gameObject.GetComponent <MeshRenderer>();
            component2.material.renderQueue = 3001;
            component.mesh         = mesh;
            lineNode               = new LineNode();
            lineNode.gameObject    = gameObject;
            lineNode.lineTransform = gameObject.transform;
            GameObject gameObject2 = new GameObject("movingNode");
            gameObject2.transform.parent = gameObject.transform;
            gameObject2.transform.Rotate(0f, 90f, 0f);
            lineNode.movingNode = gameObject2.transform;
            lineNode.meshFilter = component;
            lineNode.renderer   = component2;
            this.setupLineNode(lineNode, num5, bEase, (byte)color);
            this.workingLine = lineNode;
        }
        float num7 = num4;

        if (b >= 23 || emarchEventType >= EMarchEventType.EMET_AttackRetreat)
        {
            num  -= 5u;
            num7 -= 5f;
            num7  = ((num7 >= 0f) ? num7 : 0f);
        }
        lineNode.lineTableID    = (int)mapLine.lineID;
        lineNode.timeOffset     = num7;
        lineNode.inverseMaxTime = ((num <= 0u) ? 0f : (1f / num));
        float x = num5 * (lineNode.timeOffset * lineNode.inverseMaxTime) - num5 * 0.5f;

        lineNode.movingNode.localPosition = new Vector3(x, 0f, 0f);
        lineNode.speedRate     = num6 / 1.75f;
        lineNode.unitSpeedRate = 1f;
        lineNode.bFocus        = bLoop;
        Vector3 from2 = to - from;
        float   num8  = Vector3.Angle(from2, Vector3.right);

        if (from2.y < 0f)
        {
            num8 = 360f - num8;
        }
        gameObject.transform.rotation      = Quaternion.identity;
        gameObject.transform.localPosition = from + (to - from) * 0.5f;
        gameObject.transform.rotation      = Quaternion.AngleAxis(num8, Vector3.forward);
        gameObject.transform.localScale    = Vector3.one;
        this.recalculateSpeed(lineNode, mapLine, true);
        if (lineNode != null && lineNode.movingNode != null)
        {
            if (lineNode.sheetUnit == null)
            {
                lineNode.sheetUnit = new SheetAnimationUnitGroupNewbie();
            }
            SheetAnimationUnitGroupNewbie sheetAnimationUnitGroupNewbie = lineNode.sheetUnit as SheetAnimationUnitGroupNewbie;
            sheetAnimationUnitGroupNewbie.transform.parent        = null;
            sheetAnimationUnitGroupNewbie.transform.rotation      = Quaternion.identity;
            sheetAnimationUnitGroupNewbie.transform.parent        = lineNode.movingNode;
            sheetAnimationUnitGroupNewbie.transform.localPosition = Vector3.zero;
            byte b2 = 0;
            if (b == 27 && MonsterFace == EMonsterFace.RIGHT)
            {
                b2 |= 1;
            }
            sheetAnimationUnitGroupNewbie.setupAnimUnit(side, b, num8, b2);
            sheetAnimationUnitGroupNewbie.resetScale();
            lineNode.flag        = b;
            lineNode.angle       = num8;
            lineNode.side        = side;
            lineNode.MonsterFace = MonsterFace;
            if (b >= 23)
            {
                float timer = 5f - num4;
                lineNode.renderer.enabled = false;
                lineNode.action           = ELineAction.ACTION_BEFORE;
                lineNode.timer            = timer;
            }
        }
        if (lineNode != null && !NeedRenderLine)
        {
            if (lineNode.action == ELineAction.ACTION_BEFORE)
            {
                lineNode.action = ELineAction.ACTION_BEFORE_WITHOUT_LINE;
            }
            lineNode.renderer.enabled = false;
        }
        return(lineNode);
    }