public override void Load(ValuesDictionary valuesDictionary)
 {
     m_subsystemAudio              = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
     m_subsystemSoundMaterials     = base.Project.FindSubsystem <SubsystemSoundMaterials>(throwOnError: true);
     m_subsystemParticles          = base.Project.FindSubsystem <SubsystemParticles>(throwOnError: true);
     m_subsystemPickables          = base.Project.FindSubsystem <SubsystemPickables>(throwOnError: true);
     m_subsystemBodies             = base.Project.FindSubsystem <SubsystemBodies>(throwOnError: true);
     m_subsystemTerrain            = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
     m_subsystemSky                = base.Project.FindSubsystem <SubsystemSky>(throwOnError: true);
     m_subsystemTime               = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
     m_subsystemNoise              = base.Project.FindSubsystem <SubsystemNoise>(throwOnError: true);
     m_subsystemExplosions         = base.Project.FindSubsystem <SubsystemExplosions>(throwOnError: true);
     m_subsystemGameInfo           = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
     m_subsystemBlockBehaviors     = base.Project.FindSubsystem <SubsystemBlockBehaviors>(throwOnError: true);
     m_subsystemFluidBlockBehavior = base.Project.FindSubsystem <SubsystemFluidBlockBehavior>(throwOnError: true);
     m_subsystemFireBlockBehavior  = base.Project.FindSubsystem <SubsystemFireBlockBehavior>(throwOnError: true);
     foreach (ValuesDictionary item in valuesDictionary.GetValue <ValuesDictionary>("Projectiles").Values.Where((object v) => v is ValuesDictionary))
     {
         Projectile projectile = new Projectile();
         projectile.Value        = item.GetValue <int>("Value");
         projectile.Position     = item.GetValue <Vector3>("Position");
         projectile.Velocity     = item.GetValue <Vector3>("Velocity");
         projectile.CreationTime = item.GetValue <double>("CreationTime");
         m_projectiles.Add(projectile);
     }
 }
 public override void Load(ValuesDictionary valuesDictionary)
 {
     base.Load(valuesDictionary);
     m_subsystemGameInfo                          = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
     m_subsystemSoundMaterials                    = base.Project.FindSubsystem <SubsystemSoundMaterials>(throwOnError: true);
     m_subsystemMovingBlocks                      = base.Project.FindSubsystem <SubsystemMovingBlocks>(throwOnError: true);
     m_subsystemMovingBlocks.Stopped             += MovingBlocksStopped;
     m_subsystemMovingBlocks.CollidedWithTerrain += MovingBlocksCollidedWithTerrain;
 }
 public override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
 {
     base.Load(valuesDictionary, idToEntityMap);
     m_subsystemAudio          = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
     m_subsystemSoundMaterials = base.Project.FindSubsystem <SubsystemSoundMaterials>(throwOnError: true);
     m_walkAnimationSpeed      = valuesDictionary.GetValue <float>("WalkAnimationSpeed");
     m_walkFrontLegsAngle      = valuesDictionary.GetValue <float>("WalkFrontLegsAngle");
     m_walkHindLegsAngle       = valuesDictionary.GetValue <float>("WalkHindLegsAngle");
     m_canterLegsAngleFactor   = valuesDictionary.GetValue <float>("CanterLegsAngleFactor");
     m_walkBobHeight           = valuesDictionary.GetValue <float>("WalkBobHeight");
     m_moveLegWhenFeeding      = valuesDictionary.GetValue <bool>("MoveLegWhenFeeding");
     m_canCanter      = valuesDictionary.GetValue <bool>("CanCanter");
     m_canTrot        = valuesDictionary.GetValue <bool>("CanTrot");
     m_useCanterSound = valuesDictionary.GetValue <bool>("UseCanterSound");
 }
Пример #4
0
 public override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
 {
     m_subsystemTime           = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
     m_subsystemAudio          = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
     m_subsystemSoundMaterials = base.Project.FindSubsystem <SubsystemSoundMaterials>(throwOnError: true);
     m_componentCreature       = base.Entity.FindComponent <ComponentCreature>(throwOnError: true);
     m_idleSound              = valuesDictionary.GetValue <string>("IdleSound");
     m_painSound              = valuesDictionary.GetValue <string>("PainSound");
     m_moanSound              = valuesDictionary.GetValue <string>("MoanSound");
     m_sneezeSound            = valuesDictionary.GetValue <string>("SneezeSound");
     m_coughSound             = valuesDictionary.GetValue <string>("CoughSound");
     m_pukeSound              = valuesDictionary.GetValue <string>("PukeSound");
     m_attackSound            = valuesDictionary.GetValue <string>("AttackSound");
     m_idleSoundMinDistance   = valuesDictionary.GetValue <float>("IdleSoundMinDistance");
     m_painSoundMinDistance   = valuesDictionary.GetValue <float>("PainSoundMinDistance");
     m_moanSoundMinDistance   = valuesDictionary.GetValue <float>("MoanSoundMinDistance");
     m_sneezeSoundMinDistance = valuesDictionary.GetValue <float>("SneezeSoundMinDistance");
     m_coughSoundMinDistance  = valuesDictionary.GetValue <float>("CoughSoundMinDistance");
     m_pukeSoundMinDistance   = valuesDictionary.GetValue <float>("PukeSoundMinDistance");
     m_attackSoundMinDistance = valuesDictionary.GetValue <float>("AttackSoundMinDistance");
 }
Пример #5
0
 public override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
 {
     m_subsystemTerrain        = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
     m_subsystemBodies         = base.Project.FindSubsystem <SubsystemBodies>(throwOnError: true);
     m_subsystemMovingBlocks   = base.Project.FindSubsystem <SubsystemMovingBlocks>(throwOnError: true);
     m_subsystemGameInfo       = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
     m_subsystemTime           = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
     m_subsystemAudio          = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
     m_subsystemSoundMaterials = base.Project.FindSubsystem <SubsystemSoundMaterials>(throwOnError: true);
     m_subsystemBlockBehaviors = base.Project.FindSubsystem <SubsystemBlockBehaviors>(throwOnError: true);
     ComponentCreature         = base.Entity.FindComponent <ComponentCreature>(throwOnError: true);
     ComponentPlayer           = base.Entity.FindComponent <ComponentPlayer>();
     if (m_subsystemGameInfo.WorldSettings.GameMode == GameMode.Creative && ComponentPlayer != null)
     {
         Inventory = base.Entity.FindComponent <ComponentCreativeInventory>();
     }
     else
     {
         Inventory = base.Entity.FindComponent <ComponentInventory>();
     }
     AttackPower = valuesDictionary.GetValue <float>("AttackPower");
 }
Пример #6
0
        public override void Load(ValuesDictionary valuesDictionary)
        {
            base.Load(valuesDictionary);
            m_subsystemAudio          = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
            m_subsystemSoundMaterials = base.Project.FindSubsystem <SubsystemSoundMaterials>(throwOnError: true);
            m_subsystemItemsScanner   = base.Project.FindSubsystem <SubsystemItemsScanner>(throwOnError: true);
            m_subsystemGameInfo       = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
            m_subsystemPickables      = base.Project.FindSubsystem <SubsystemPickables>(throwOnError: true);
            m_subsystemParticles      = base.Project.FindSubsystem <SubsystemParticles>(throwOnError: true);
            ValuesDictionary value = valuesDictionary.GetValue <ValuesDictionary>("FurnitureDesigns");

            foreach (FurnitureDesign item in LoadFurnitureDesigns(base.SubsystemTerrain, value))
            {
                m_furnitureDesigns[item.Index] = item;
            }
            foreach (ValuesDictionary item2 in valuesDictionary.GetValue <ValuesDictionary>("FurnitureSets").Values.Where((object v) => v is ValuesDictionary))
            {
                string       value2       = item2.GetValue <string>("Name");
                string       value3       = item2.GetValue <string>("ImportedFrom", null);
                string       value4       = item2.GetValue <string>("Indices");
                int[]        array        = HumanReadableConverter.ValuesListFromString <int>(';', value4);
                FurnitureSet furnitureSet = new FurnitureSet
                {
                    Name         = value2,
                    ImportedFrom = value3
                };
                m_furnitureSets.Add(furnitureSet);
                int[] array2 = array;
                foreach (int num in array2)
                {
                    if (num >= 0 && num < m_furnitureDesigns.Length && m_furnitureDesigns[num] != null)
                    {
                        m_furnitureDesigns[num].FurnitureSet = furnitureSet;
                    }
                }
            }
            m_subsystemItemsScanner.ItemsScanned += GarbageCollectDesigns;
        }