示例#1
0
 public BCMVector4(BCMVector3 v, int _w)
 {
     x = v.x;
     y = v.y;
     z = v.z;
     w = _w;
 }
示例#2
0
        public BCMSleeperVolume(int index, [NotNull] SleeperVolume volume, [NotNull] World world)
        {
            Index = index;
            var volumeGroup = typeof(SleeperVolume).GetField(VolumeGroupFieldName, BindingFlags.NonPublic | BindingFlags.Instance);

            if (volumeGroup != null)
            {
                if (!(volumeGroup.GetValue(volume) is string name))
                {
                    return;
                }
                Group = name;
            }

            Position = new BCMVector3(volume.mins);
            Extent   = new BCMVector3(volume.maxs);
            Size     = new BCMVector3(volume.maxs - volume.mins + Vector3i.one);

            var timer = typeof(SleeperVolume).GetField(TimerFieldName, BindingFlags.NonPublic | BindingFlags.Instance);

            if (timer == null)
            {
                return;
            }

            if (!(timer.GetValue(volume) is ulong timerValue))
            {
                return;
            }

            if (timerValue > world.worldTime)
            {
                RespawnTimer = Math.Round((timerValue - world.worldTime) / 24000f, 2);
            }
        }
示例#3
0
 //use PCP for online players
 private void GetMarker(PlayerInfo pInfo)
 {
     if (pInfo.PDF != null)
     {
         Bin.Add("Marker", Marker = new BCMVector3(pInfo.EP != null ? pInfo.PCP.DataCache.markerPosition : pInfo.PDF.markerPosition));
     }
 }
示例#4
0
 public BCMVector4(BCMVector3 v, int w)
 {
     x      = v.x;
     y      = v.y;
     z      = v.z;
     this.w = w;
 }
示例#5
0
 public BCMSpawnPoint(SleeperVolume.SpawnPoint spawn)
 {
     Pos     = new BCMVector3(spawn.pos);
     Look    = new BCMVector3(spawn.look);
     Rot     = spawn.rot;
     Pose    = spawn.pose;
     BlockId = spawn.blockID;
 }
示例#6
0
 public BCMPrefabSleeperVolume(Prefab prefab, int x)
 {
     Used   = prefab.SleeperVolumeUsed[x];
     Start  = new BCMVector3(prefab.SleeperVolumesStart[x]);
     Size   = new BCMVector3(prefab.SleeperVolumesSize[x]);
     Group  = prefab.SleeperVolumesGroup[x];
     Adjust = prefab.SleeperVolumeGameStageAdjust[x];
     IsLoot = prefab.SleeperIsLootVolume[x];
 }
示例#7
0
 public BCMLot([NotNull] RWG2.HubCell.Lot lot, BCMLotType type)
 {
     Prefab     = lot.PrefabName;
     Township   = lot.Township.ToString();
     Type       = lot.Type.ToString();
     InstanceId = lot.PrefabInstance.id;
     Position   = new BCMVector3(lot.PrefabSpawnPos);
     Rotation   = lot.RoadDirection;
     LotType    = type.ToString();
 }
示例#8
0
 public BCMLot([NotNull] BCMLot lot)
 {
     Prefab     = lot.Prefab;
     Township   = lot.Township;
     Type       = lot.Type;
     InstanceId = lot.InstanceId;
     Position   = lot.Position;
     Rotation   = lot.Rotation;
     LotType    = lot.LotType;
 }
示例#9
0
 private object GetVectorObj(BCMVector3 p)
 {
     if (Options.ContainsKey("strpos"))
     {
         return(p.x + " " + p.y + " " + p.z);
     }
     if (Options.ContainsKey("worldpos"))
     {
         return(GameUtils.WorldPosToStr(new Vector3(p.x, p.y, p.z), " "));
     }
     if (Options.ContainsKey("csvpos"))
     {
         return(new[] { p.x, p.y, p.z });
     }
     return(p);//vectors
 }
示例#10
0
        public override void GetData(object obj)
        {
            var ec = obj as EntityClass;

            if (ec == null)
            {
                return;
            }

            if (IsOption("filter"))
            {
                foreach (var f in StrFilter)
                {
                    switch (f)
                    {
                    case StrFilters.Id:
                        GetId(ec);
                        break;

                    case StrFilters.Name:
                        GetName(ec);
                        break;

                    default:
                        Log.Out($"{Config.ModPrefix} Unknown filter {f}");
                        break;
                    }
                }
            }
            else
            {
                GetId(ec);
                GetName(ec);

                Bin.Add("Class", Class                       = ec.classname?.ToString());
                Bin.Add("Skin", Skin                         = ec.skinTexture);
                Bin.Add("Parent", Parent                     = ec.parentGameObjectName);
                Bin.Add("UserInst", UserInst                 = ec.bAllowUserInstantiate);
                Bin.Add("IsEnemy", IsEnemy                   = ec.bIsEnemyEntity);
                Bin.Add("IsAnimal", IsAnimal                 = ec.bIsAnimalEntity);
                Bin.Add("Explosion", Explosion               = new BCMExplosionData(ec.explosionData));
                Bin.Add("Model", Model                       = ec.modelType);
                Bin.Add("ModelP1", ModelP1                   = ec.modelTypeParams1);
                Bin.Add("ModelP2", ModelP2                   = ec.modelTypeParams2);
                Bin.Add("RagdollChance", RagdollChance       = Math.Round(ec.RagdollOnDeathChance, 6));
                Bin.Add("HasRagdoll", HasRagdoll             = ec.HasRagdoll);
                Bin.Add("Colliders", Colliders               = ec.CollidersRagdollAsset);
                Bin.Add("CrouchY", CrouchY                   = Math.Round(ec.crouchYOffsetFP, 6));
                Bin.Add("CorpseId", CorpseId                 = ec.CorpseBlockId);
                Bin.Add("CorpseChance", CorpseChance         = Math.Round(ec.CorpseBlockChance, 6));
                Bin.Add("CorpseDen", CorpseDen               = ec.CorpseBlockDensity);
                Bin.Add("MaxTurn", MaxTurn                   = Math.Round(ec.MaxTurnSpeed, 6));
                Bin.Add("RootMotion", RootMotion             = ec.RootMotion);
                Bin.Add("HasDeathAnim", HasDeathAnim         = ec.HasDeathAnim);
                Bin.Add("IsMale", IsMale                     = ec.bIsMale);
                Bin.Add("IsObserver", IsObserver             = ec.bIsChunkObserver);
                Bin.Add("Experience", Experience             = ec.ExperienceValue);
                Bin.Add("Physics", Physics                   = ec.PhysicsBody?.Name);
                Bin.Add("DeadHP", DeadHP                     = ec.DeadBodyHitPoints);
                Bin.Add("LegCrippleTh", LegCrippleTh         = Math.Round(ec.LegCrippleThreshold, 6));
                Bin.Add("LegCrawlerTh", LegCrawlerTh         = Math.Round(ec.LegCrawlerThreshold, 6));
                Bin.Add("LowerLegDisTh", LowerLegDisTh       = Math.Round(ec.LowerLegDismemberThreshold, 6));
                Bin.Add("LowerLegDisBonus", LowerLegDisBonus = Math.Round(ec.LowerLegDismemberBonusChance, 6));
                Bin.Add("LowerLegDisBase", LowerLegDisBase   = Math.Round(ec.LowerLegDismemberBaseChance, 6));
                Bin.Add("UpperLegDisTh", UpperLegDisTh       = Math.Round(ec.UpperLegDismemberThreshold, 6));
                Bin.Add("UpperLegDisBonus", UpperLegDisBonus = Math.Round(ec.UpperLegDismemberBonusChance, 6));
                Bin.Add("UpperLegDisBase", UpperLegDisBase   = Math.Round(ec.UpperLegDismemberBaseChance, 6));
                Bin.Add("LowerArmDisTh", LowerArmDisTh       = Math.Round(ec.LowerArmDismemberThreshold, 6));
                Bin.Add("LowerArmDisBonus", LowerArmDisBonus = Math.Round(ec.LowerArmDismemberBonusChance, 6));
                Bin.Add("LowerArmDisBase", LowerArmDisBase   = Math.Round(ec.LowerArmDismemberBaseChance, 6));
                Bin.Add("UpperArmDisTh", UpperArmDisTh       = Math.Round(ec.UpperArmDismemberThreshold, 6));
                Bin.Add("UpperArmDisBonus", UpperArmDisBonus = Math.Round(ec.UpperArmDismemberBonusChance, 6));
                Bin.Add("UpperArmDisBase", UpperArmDisBase   = Math.Round(ec.UpperArmDismemberBaseChance, 6));
                Bin.Add("HeadDisTh", HeadDisTh               = Math.Round(ec.HeadDismemberThreshold, 6));
                Bin.Add("HeadDisBase", HeadDisBase           = Math.Round(ec.HeadDismemberBaseChance, 6));
                Bin.Add("HeadDisBonus", HeadDisBonus         = Math.Round(ec.HeadDismemberBonusChance, 6));
                Bin.Add("KDKneelDamTh", KDKneelDamTh         = Math.Round(ec.KnockdownKneelDamageThreshold, 6));
                Bin.Add("LegsExpMult", LegsExpMult           = Math.Round(ec.LegsExplosionDamageMultiplier, 6));
                Bin.Add("ArmsExpMult", ArmsExpMult           = Math.Round(ec.ArmsExplosionDamageMultiplier, 6));
                Bin.Add("ChestExpMult", ChestExpMult         = Math.Round(ec.ChestExplosionDamageMultiplier, 6));
                Bin.Add("HeadExpMult", HeadExpMult           = Math.Round(ec.HeadExplosionDamageMultiplier, 6));
                Bin.Add("SearchArea", SearchArea             = Math.Round(ec.SearchArea, 6));
                Bin.Add("SwimOffset", SwimOffset             = Math.Round(ec.SwimOffset, 6));
                Bin.Add("SightRange", SightRange             = Math.Round(ec.SightRange, 6));
                Bin.Add("GroanMin", GroanMin                 = new BCMVector2(ec.GroanMin));
                Bin.Add("GroanMax", GroanMax                 = new BCMVector2(ec.GroanMax));
                Bin.Add("WakeMin", WakeMin                   = new BCMVector2(ec.WakeMin));
                Bin.Add("WakeMax", WakeMax                   = new BCMVector2(ec.WakeMax));
                Bin.Add("SightScale", SightScale             = new BCMVector2(ec.SightScale));
                Bin.Add("SmellAlert", SmellAlert             = new BCMVector2(ec.SmellAlert));
                Bin.Add("NoiseAlert", NoiseAlert             = new BCMVector2(ec.NoiseAlert));
                Bin.Add("SmellWake", SmellWake               = new BCMVector2(ec.SmellWake));
                Bin.Add("SmellGroan", SmellGroan             = new BCMVector2(ec.SmellGroan));
                Bin.Add("NoiseWake", NoiseWake               = new BCMVector2(ec.NoiseWake));
                Bin.Add("NoiseGroan", NoiseGroan             = new BCMVector2(ec.NoiseGroan));
                Bin.Add("GroanChance", GroanChance           = Math.Round(ec.GroanChance, 6));
                Bin.Add("UMARace", UMARace                   = ec.UMARace);
                Bin.Add("UMAGenModel", UMAGenModel           = ec.UMAGeneratedModelName);
                Bin.Add("MatSwap", MatSwap                   = ec.MaterialSwap?.ToList());
                if (ec.tintColors != null)
                {
                    foreach (var tint in ec.tintColors.Values)
                    {
                        Tints.Add(new BCMVector3(tint));
                    }
                }
                Bin.Add("Tints", Tints);
                Bin.Add("SpawnParticle", SpawnParticle               = ec.particleOnSpawn);
                Bin.Add("KDKneelStunDur", KDKneelStunDur             = new BCMVector2(ec.KnockdownProneStunDuration));
                Bin.Add("KDProneDamTh", KDProneDamTh                 = Math.Round(ec.KnockdownProneDamageThreshold, 6));
                Bin.Add("KDProneStunDur", KDProneStunDur             = new BCMVector2(ec.KnockdownProneStunDuration));
                Bin.Add("KDProneRefillRate", KDProneRefillRate       = new BCMVector2(ec.KnockdownProneRefillRate));
                Bin.Add("KDKneelRefillRate", KDKneelRefillRate       = new BCMVector2(ec.KnockdownKneelRefillRate));
                Bin.Add("ModelTransformAdjust", ModelTransformAdjust = new BCMVector3(ec.ModelTransformAdjust));
                Bin.Add("Archetype", Archetype           = ec.ArchetypeName);
                Bin.Add("AIPackages", AIPackages         = ec.AIPackages?.ToList());
                Bin.Add("UseAIPackages", UseAIPackages   = ec.UseAIPackages);
                Bin.Add("PainStates", PainStates         = ec.MechanimPainStates);
                Bin.Add("PainTriggers", PainTriggers     = ec.MechanimPainTriggers);
                Bin.Add("Attacks", Attacks               = ec.MechanimAttacks);
                Bin.Add("AttackTriggers", AttackTriggers = ec.MechanimAttackTriggers);
                Bin.Add("SpecialAttacks", SpecialAttacks = ec.MechanimSpecialAttacks);
                Bin.Add("SpecialAttackTriggers", SpecialAttackTriggers = ec.MechanimSpecialAttackTriggers);
                Bin.Add("DeathStates", DeathStates = ec.MechanimDeathStates);
                Bin.Add("DeathStateTriggers", DeathStateTriggers = ec.MechanimDeathStateTriggers);
                Bin.Add("Buffs", Buffs = ec.Buffs);
            }
        }
示例#11
0
 public bool Equals(BCMVector3 obj) => obj != null && x == obj.x && y == obj.y && z == obj.z;
示例#12
0
 private void GetSize(Prefab prefab) => Bin.Add("Size", Size = new BCMVector3(prefab.size));
示例#13
0
 private void GetTraderProtect(Prefab prefab) => Bin.Add("TraderProtect", TraderProtect = new BCMVector3(prefab.TraderAreaProtect));
示例#14
0
 private void GetTraderTpSize(Prefab prefab) => Bin.Add("TraderTpSize", TraderTpSize = new BCMVector3(prefab.TraderAreaTeleportSize));
示例#15
0
 private void GetTraderTpCenter(Prefab prefab) => Bin.Add("TraderTpCenter", TraderTpCenter = new BCMVector3(prefab.TraderAreaTeleportCenter));
示例#16
0
 public bool Equals(BCMVector3 obj)
 {
     return(obj != null && x == obj.x && y == obj.y && z == obj.z);
 }
示例#17
0
 public BCMTileEntity(Vector3i pos, [NotNull] TileEntity te)
 {
     Type = te.GetTileEntityType().ToString();
     Pos  = new BCMVector3(pos);
 }
示例#18
0
 private void GetRotation(PlayerInfo pInfo) => Bin.Add("Rotation", GetVectorObj(Rotation = new BCMVector3(pInfo.EP != null ? pInfo.EP.rotation : pInfo.PDF.ecd.rot)));
示例#19
0
 private void GetPosition(PlayerInfo pInfo) => Bin.Add("Position", GetVectorObj(Position = new BCMVector3(pInfo.EP != null ? pInfo.EP.position : pInfo.PDF.ecd.pos)));
示例#20
0
 //todo:EP not updating
 private void GetRentedVendor(PlayerInfo pInfo) => Bin.Add("RentedVendor", GetVectorObj(RentedVendor = new BCMVector3(pInfo.EP != null ? pInfo.EP.RentedVMPosition : pInfo.PDF.rentedVMPosition)));
示例#21
0
 //todo: check this is updating while online
 private void GetDroppedPack(PlayerInfo pInfo) => Bin.Add("DroppedPack",
                                                          GetVectorObj(DroppedPack = new BCMVector3(pInfo.EP != null ? pInfo.EP.GetDroppedBackpackPosition()
 : pInfo.PDF.droppedBackpackPosition)));