Beispiel #1
0
        // Token: 0x060036F6 RID: 14070 RVA: 0x000F4798 File Offset: 0x000F2998
        public void SetTerrain(GridPosition p, ConfigDataTerrainInfo terrainInfo)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetTerrainGridPositionConfigDataTerrainInfo_hotfix != null)
            {
                this.m_SetTerrainGridPositionConfigDataTerrainInfo_hotfix.call(new object[]
                {
                    this,
                    p,
                    terrainInfo
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            if (terrainInfo == null)
            {
                return;
            }
            BattleMapCell cell = this.GetCell(p);

            if (cell == null)
            {
                return;
            }
            cell.m_terrain = terrainInfo;
        }
Beispiel #2
0
    public static int GetTerrain(IntPtr l)
    {
        int result;

        try
        {
            BattleMap    battleMap = (BattleMap)LuaObject.checkSelf(l);
            GridPosition p;
            LuaObject.checkValueType <GridPosition>(l, 2, out p);
            ConfigDataTerrainInfo terrain = battleMap.GetTerrain(p);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, terrain);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
        // Token: 0x06009731 RID: 38705 RVA: 0x002B31F8 File Offset: 0x002B13F8
        private void CreateMapTerrainFx(ConfigDataBattlefieldInfo battlefieldInfo, GameObject parent)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_CreateMapTerrainFxConfigDataBattlefieldInfoGameObject_hotfix != null)
            {
                this.m_CreateMapTerrainFxConfigDataBattlefieldInfoGameObject_hotfix.call(new object[]
                {
                    this,
                    battlefieldInfo,
                    parent
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            this.ClearMapTerrainFx();
            IConfigDataLoader configDataLoader = GameManager.Instance.ConfigDataLoader as IConfigDataLoader;
            int num = 0;

            for (int i = 0; i < battlefieldInfo.Height; i++)
            {
                for (int j = 0; j < battlefieldInfo.Width; j++)
                {
                    int key = battlefieldInfo.Terrains[num++];
                    ConfigDataTerrainInfo configDataTerrainInfo = configDataLoader.GetConfigDataTerrainInfo(key);
                    if (configDataTerrainInfo != null && !string.IsNullOrEmpty(configDataTerrainInfo.Fx))
                    {
                        GameObject asset = AssetUtility.Instance.GetAsset <GameObject>(configDataTerrainInfo.Fx);
                        if (asset != null)
                        {
                            GridPosition gridPosition = new GridPosition(j, i);
                            GameObject   gameObject   = UnityEngine.Object.Instantiate <GameObject>(asset, parent.transform, false);
                            gameObject.transform.localPosition = this.GridPositionToWorldPosition(gridPosition);
                            this.m_mapTerrainFxs[gridPosition] = gameObject;
                        }
                    }
                }
            }
        }
Beispiel #4
0
        // Token: 0x060036FE RID: 14078 RVA: 0x000F4CA0 File Offset: 0x000F2EA0
        public static int GetMovePointCost(ConfigDataTerrainInfo terrain, MoveType moveType)
        {
            if (terrain == null)
            {
                return(0);
            }
            switch (moveType)
            {
            case MoveType.MoveType_Ride:
                return(terrain.MovePoint_Ride);

            case MoveType.MoveType_Walk:
                return(terrain.MovePoint_Walk);

            case MoveType.MoveType_Water:
                return(terrain.MovePoint_Water);

            case MoveType.MoveType_Fly:
                return(terrain.MovePoint_Fly);

            default:
                return(0);
            }
        }
        // Token: 0x060036CE RID: 14030 RVA: 0x000F37B0 File Offset: 0x000F19B0
        public static int ComputeSkillHpModifyValue(BattleProperty attackerProperty, BattleProperty targetProperty, ArmyRelationData armyRelation, ConfigDataSkillInfo skillInfo, bool isCritical, bool isBuffForceMagicDamage, bool isBanMeleePunish, ConfigDataTerrainInfo targetTerrain, int gridDistance, bool isSameTeam, RandomNumber randomNumber, IConfigDataLoader configDataLoader)
        {
            Fix64 value = Fix64.Zero;
            bool  flag  = false;

            if (skillInfo.SkillType == SkillType.SkillType_BF_DamageHeal)
            {
                if (isSameTeam)
                {
                    flag = true;
                }
            }
            else if (skillInfo.IsHealSkill() || skillInfo.IsBuffSkill())
            {
                flag = true;
            }
            if (flag)
            {
                value = BattleFormula.ComputeHealValue(attackerProperty, targetProperty, skillInfo);
            }
            else
            {
                int targetTerrainBonus = 0;
                if (targetTerrain != null)
                {
                    targetTerrainBonus = targetTerrain.BattleBonus;
                }
                int meleePunish = 0;
                if (gridDistance <= 1 && !isBanMeleePunish)
                {
                    meleePunish = configDataLoader.Const_MeleeATKPunish_Mult;
                }
                if (skillInfo.IsMagic)
                {
                    value = -BattleFormula.ComputeMagicDamageValue(attackerProperty, targetProperty, skillInfo, isCritical, targetTerrainBonus, armyRelation.Magic, armyRelation.MagicDefend, meleePunish, false);
                }
                else if (isBuffForceMagicDamage)
                {
                    value = -BattleFormula.ComputeMagicDamageValue(attackerProperty, targetProperty, skillInfo, isCritical, targetTerrainBonus, armyRelation.Attack, armyRelation.MagicDefend, meleePunish, true);
                }
                else
                {
                    value = -BattleFormula.ComputePhysicalDamageValue(attackerProperty, targetProperty, skillInfo, isCritical, targetTerrainBonus, armyRelation.Attack, armyRelation.Defend, meleePunish);
                }
            }
            return((int)((long)Fix64.Round(value)));
        }