Example #1
0
 public ReunObjectAdd(int newStep, ObjectAsset newObjectAsset, ItemAsset newItemAsset, Vector3 newPosition, Quaternion newRotation, Vector3 newScale)
 {
     this.step        = newStep;
     this.model       = null;
     this.objectAsset = newObjectAsset;
     this.itemAsset   = newItemAsset;
     this.position    = newPosition;
     this.rotation    = newRotation;
     this.scale       = newScale;
 }
Example #2
0
 public ReunObjectRemove(int newStep, Transform newModel, ObjectAsset newObjectAsset, ItemAsset newItemAsset, Vector3 newPosition, Quaternion newRotation, Vector3 newScale)
 {
     this.step        = newStep;
     this.model       = newModel;
     this.objectAsset = newObjectAsset;
     this.itemAsset   = newItemAsset;
     this.position    = newPosition;
     this.rotation    = newRotation;
     this.scale       = newScale;
 }
Example #3
0
		private static void findChartHit(Vector3 pos, out EObjectChart chart, out RaycastHit hit)
		{
			Physics.Raycast(pos, Vector3.down, ref hit, Level.HEIGHT, RayMasks.CHART);
			chart = EObjectChart.NONE;
			ObjectAsset asset = LevelObjects.getAsset(hit.transform);
			if (asset != null)
			{
				chart = asset.chart;
			}
			if (chart == EObjectChart.IGNORE)
			{
				Level.findChartHit(hit.point + Vector3.down * 0.1f, out chart, out hit);
				return;
			}
		}
Example #4
0
        public static void getAssetEditor(Transform select, out ObjectAsset objectAsset, out ItemAsset itemAsset)
        {
            objectAsset = null;
            itemAsset   = null;
            if (select == null)
            {
                return;
            }
            byte b;
            byte b2;

            if (Regions.tryGetCoordinate(select.position, out b, out b2))
            {
                if (select.CompareTag("Barricade") || select.CompareTag("Structure"))
                {
                    for (int i = 0; i < LevelObjects.buildables[(int)b, (int)b2].Count; i++)
                    {
                        if (LevelObjects.buildables[(int)b, (int)b2][i].transform == select)
                        {
                            itemAsset = LevelObjects.buildables[(int)b, (int)b2][i].asset;
                            return;
                        }
                    }
                }
                else
                {
                    for (int j = 0; j < LevelObjects.objects[(int)b, (int)b2].Count; j++)
                    {
                        if (LevelObjects.objects[(int)b, (int)b2][j].transform == select)
                        {
                            objectAsset = LevelObjects.objects[(int)b, (int)b2][j].asset;
                            return;
                        }
                    }
                }
            }
        }
Example #5
0
 private void OnTriggerEnter(Collider other)
 {
     if (Provider.isServer)
     {
         if (other.isTrigger)
         {
             return;
         }
         if (other.CompareTag("Debris"))
         {
             return;
         }
         float num = Mathf.Clamp(this.vehicle.speed * this.vehicle.asset.bumperMultiplier, 0f, 10f);
         if (num < 3f)
         {
             return;
         }
         if (other.transform.parent.CompareTag("Vehicle"))
         {
             return;
         }
         if (other.transform.CompareTag("Player"))
         {
             if (Provider.isPvP && this.vehicle.isDriven)
             {
                 Player player = DamageTool.getPlayer(other.transform);
                 if (player != null && player.movement.getVehicle() == null && !this.vehicle.passengers[0].player.player.quests.isMemberOfSameGroupAs(player))
                 {
                     EPlayerKill eplayerKill;
                     DamageTool.damage(player, EDeathCause.ROADKILL, ELimb.SPINE, this.vehicle.passengers[0].player.playerID.steamID, base.transform.forward, Bumper.DAMAGE_PLAYER, num, out eplayerKill);
                     EffectManager.sendEffect(5, EffectManager.SMALL, other.transform.position + other.transform.up, -base.transform.forward);
                     this.vehicle.askDamage(2, true);
                 }
             }
         }
         else if (other.transform.CompareTag("Agent"))
         {
             Zombie zombie = DamageTool.getZombie(other.transform);
             if (zombie != null)
             {
                 EPlayerKill eplayerKill2;
                 uint        num2;
                 DamageTool.damage(zombie, base.transform.forward, Bumper.DAMAGE_ZOMBIE, num, out eplayerKill2, out num2);
                 EffectManager.sendEffect((!zombie.isRadioactive) ? 5 : 95, EffectManager.SMALL, other.transform.position + other.transform.up, -base.transform.forward);
                 this.vehicle.askDamage(2, true);
             }
             else
             {
                 Animal animal = DamageTool.getAnimal(other.transform);
                 if (animal != null)
                 {
                     EPlayerKill eplayerKill3;
                     uint        num3;
                     DamageTool.damage(animal, base.transform.forward, Bumper.DAMAGE_ANIMAL, num, out eplayerKill3, out num3);
                     EffectManager.sendEffect(5, EffectManager.SMALL, other.transform.position + other.transform.up, -base.transform.forward);
                     this.vehicle.askDamage(2, true);
                 }
             }
         }
         else
         {
             if (!other.transform.CompareTag("Barricade"))
             {
                 if (!other.transform.CompareTag("Structure"))
                 {
                     if (other.transform.CompareTag("Resource"))
                     {
                         DamageTool.impact(base.transform.position + base.transform.forward * ((BoxCollider)base.transform.GetComponent <Collider>()).size.z / 2f, -base.transform.forward, DamageTool.getMaterial(base.transform.position, other.transform, other.GetComponent <Collider>()), true);
                         EPlayerKill eplayerKill4;
                         uint        num4;
                         ResourceManager.damage(other.transform, base.transform.forward, Bumper.DAMAGE_RESOURCE, num, 1f, out eplayerKill4, out num4);
                         this.vehicle.askDamage((ushort)(Bumper.DAMAGE_VEHICLE * num), true);
                     }
                     else
                     {
                         InteractableObjectRubble componentInParent = other.transform.GetComponentInParent <InteractableObjectRubble>();
                         if (componentInParent != null)
                         {
                             EPlayerKill eplayerKill5;
                             uint        num5;
                             DamageTool.damage(componentInParent.transform, base.transform.forward, componentInParent.getSection(other.transform), Bumper.DAMAGE_OBJECT, num, out eplayerKill5, out num5);
                             if (Time.realtimeSinceStartup - this.lastDamageImpact > 0.2f)
                             {
                                 this.lastDamageImpact = Time.realtimeSinceStartup;
                                 DamageTool.impact(base.transform.position + base.transform.forward * ((BoxCollider)base.transform.GetComponent <Collider>()).size.z / 2f, -base.transform.forward, DamageTool.getMaterial(base.transform.position, other.transform, other.GetComponent <Collider>()), true);
                                 this.vehicle.askDamage((ushort)(Bumper.DAMAGE_VEHICLE * num), true);
                             }
                         }
                         else if (Time.realtimeSinceStartup - this.lastDamageImpact > 0.2f)
                         {
                             ObjectAsset asset = LevelObjects.getAsset(other.transform);
                             if (asset != null && !asset.isSoft)
                             {
                                 this.lastDamageImpact = Time.realtimeSinceStartup;
                                 DamageTool.impact(base.transform.position + base.transform.forward * ((BoxCollider)base.transform.GetComponent <Collider>()).size.z / 2f, -base.transform.forward, DamageTool.getMaterial(base.transform.position, other.transform, other.GetComponent <Collider>()), true);
                                 this.vehicle.askDamage((ushort)(Bumper.DAMAGE_VEHICLE * num), true);
                             }
                         }
                     }
                 }
             }
             if (!this.vehicle.isDead && !other.transform.CompareTag("Border") && ((this.vehicle.asset.engine == EEngine.PLANE && this.vehicle.speed > 20f) || (this.vehicle.asset.engine == EEngine.HELICOPTER && this.vehicle.speed > 10f)))
             {
                 this.vehicle.askDamage(20000, false);
             }
         }
     }
 }
        private static void updateSelection(string search, bool large, bool medium, bool small, bool barricades, bool structures, bool npcs)
        {
            if (EditorLevelObjectsUI.assets == null)
            {
                return;
            }
            EditorLevelObjectsUI.assets.Clear();
            if (large || medium || small || npcs)
            {
                Asset[] array = Assets.find(EAssetType.OBJECT);
                for (int i = 0; i < array.Length; i++)
                {
                    ObjectAsset objectAsset = array[i] as ObjectAsset;
                    if (large || objectAsset.type != EObjectType.LARGE)
                    {
                        if (medium || objectAsset.type != EObjectType.MEDIUM)
                        {
                            if (small || objectAsset.type != EObjectType.SMALL)
                            {
                                if (npcs || objectAsset.type != EObjectType.NPC)
                                {
                                    if (search == null || search.Length <= 0 || objectAsset.objectName.IndexOf(search, StringComparison.OrdinalIgnoreCase) != -1)
                                    {
                                        EditorLevelObjectsUI.assets.Add(objectAsset);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if (barricades || structures)
            {
                Asset[] array2 = Assets.find(EAssetType.ITEM);
                int     j      = 0;
                while (j < array2.Length)
                {
                    ItemAsset itemAsset = array2[j] as ItemAsset;
                    if (itemAsset.type == EItemType.BARRICADE)
                    {
                        if (barricades)
                        {
                            goto IL_14E;
                        }
                    }
                    else if (itemAsset.type == EItemType.STRUCTURE)
                    {
                        if (structures)
                        {
                            goto IL_14E;
                        }
                    }
IL_185:
                    j++;
                    continue;
IL_14E:
                    if (search != null && search.Length > 0 && itemAsset.itemName.IndexOf(search, StringComparison.OrdinalIgnoreCase) == -1)
                    {
                        goto IL_185;
                    }
                    EditorLevelObjectsUI.assets.Add(itemAsset);
                    goto IL_185;
                }
            }
            EditorLevelObjectsUI.assets.Sort(EditorLevelObjectsUI.comparator);
            EditorLevelObjectsUI.assetsScrollBox.remove();
            EditorLevelObjectsUI.assetsScrollBox.area = new Rect(0f, 0f, 5f, (float)(EditorLevelObjectsUI.assets.Count * 40 - 10));
            for (int k = 0; k < EditorLevelObjectsUI.assets.Count; k++)
            {
                string      text         = string.Empty;
                ObjectAsset objectAsset2 = EditorLevelObjectsUI.assets[k] as ObjectAsset;
                ItemAsset   itemAsset2   = EditorLevelObjectsUI.assets[k] as ItemAsset;
                if (objectAsset2 != null)
                {
                    text = objectAsset2.objectName;
                }
                else if (itemAsset2 != null)
                {
                    text = itemAsset2.itemName;
                }
                SleekButton sleekButton = new SleekButton();
                sleekButton.positionOffset_Y = k * 40;
                sleekButton.sizeOffset_X     = 200;
                sleekButton.sizeOffset_Y     = 30;
                sleekButton.text             = text;
                SleekButton sleekButton2 = sleekButton;
                if (EditorLevelObjectsUI.< > f__mg$cache0 == null)
                {
                    EditorLevelObjectsUI.< > f__mg$cache0 = new ClickedButton(EditorLevelObjectsUI.onClickedAssetButton);
                }
                sleekButton2.onClickedButton = EditorLevelObjectsUI.< > f__mg$cache0;
                EditorLevelObjectsUI.assetsScrollBox.add(sleekButton);
            }
        }
        public void updateState(Asset asset, byte[] state)
        {
            this.asset = (asset as ObjectAsset);
            Transform transform = base.transform.FindChild("Sections");

            if (transform != null)
            {
                this.rubbleInfos = new RubbleInfo[transform.childCount];
                for (int i = 0; i < this.rubbleInfos.Length; i++)
                {
                    Transform  section    = transform.FindChild("Section_" + i);
                    RubbleInfo rubbleInfo = new RubbleInfo();
                    rubbleInfo.section  = section;
                    this.rubbleInfos[i] = rubbleInfo;
                }
                Transform transform2 = base.transform.FindChild("Alive");
                if (transform2 != null)
                {
                    this.aliveGameObject = transform2.gameObject;
                }
                Transform transform3 = base.transform.FindChild("Dead");
                if (transform3 != null)
                {
                    this.deadGameObject = transform3.gameObject;
                }
                this.finaleTransform = base.transform.FindChild("Finale");
            }
            else
            {
                this.rubbleInfos = new RubbleInfo[1];
                RubbleInfo rubbleInfo2 = new RubbleInfo();
                rubbleInfo2.section = base.transform;
                this.rubbleInfos[0] = rubbleInfo2;
            }
            byte b = 0;

            while ((int)b < this.rubbleInfos.Length)
            {
                RubbleInfo rubbleInfo3 = this.rubbleInfos[(int)b];
                Transform  section2    = rubbleInfo3.section;
                Transform  transform4  = section2.FindChild("Alive");
                if (transform4 != null)
                {
                    rubbleInfo3.aliveGameObject = transform4.gameObject;
                }
                Transform transform5 = section2.FindChild("Dead");
                if (transform5 != null)
                {
                    rubbleInfo3.deadGameObject = transform5.gameObject;
                }
                Transform transform6 = section2.FindChild("Ragdolls");
                if (transform6 != null)
                {
                    rubbleInfo3.ragdolls = new RubbleRagdollInfo[transform6.childCount];
                    for (int j = 0; j < rubbleInfo3.ragdolls.Length; j++)
                    {
                        Transform transform7 = transform6.FindChild("Ragdoll_" + j);
                        Transform transform8 = transform7.FindChild("Ragdoll");
                        if (transform8 != null)
                        {
                            rubbleInfo3.ragdolls[j] = new RubbleRagdollInfo();
                            rubbleInfo3.ragdolls[j].ragdollGameObject = transform8.gameObject;
                            rubbleInfo3.ragdolls[j].forceTransform    = transform7.FindChild("Force");
                        }
                    }
                }
                else
                {
                    Transform transform9 = section2.FindChild("Ragdoll");
                    if (transform9 != null)
                    {
                        rubbleInfo3.ragdolls    = new RubbleRagdollInfo[1];
                        rubbleInfo3.ragdolls[0] = new RubbleRagdollInfo();
                        rubbleInfo3.ragdolls[0].ragdollGameObject = transform9.gameObject;
                        rubbleInfo3.ragdolls[0].forceTransform    = section2.FindChild("Force");
                    }
                }
                rubbleInfo3.effectTransform = section2.FindChild("Effect");
                b += 1;
            }
            byte b2 = 0;

            while ((int)b2 < this.rubbleInfos.Length)
            {
                bool isAlive = (state[state.Length - 1] & Types.SHIFTS[(int)b2]) == Types.SHIFTS[(int)b2];
                this.updateRubble(b2, isAlive, false, Vector3.zero);
                b2 += 1;
            }
        }
 // Token: 0x06001EA9 RID: 7849 RVA: 0x000A7BB6 File Offset: 0x000A5FB6
 public EditorCopy(Vector3 newPosition, Quaternion newRotation, Vector3 newScale, ObjectAsset newObjectAsset, ItemAsset newItemAsset)
 {
     this._position    = newPosition;
     this._rotation    = newRotation;
     this._scale       = newScale;
     this._objectAsset = newObjectAsset;
     this._itemAsset   = newItemAsset;
 }
Example #9
0
 public static Transform registerAddObject(Vector3 position, Quaternion rotation, Vector3 scale, ObjectAsset objectAsset, ItemAsset itemAsset)
 {
     return(LevelObjects.register(new ReunObjectAdd(LevelObjects.step, objectAsset, itemAsset, position, rotation, scale)));
 }