Exemplo n.º 1
0
        public RiftRenderer(ICoreClientAPI capi, List <Rift> rifts)
        {
            this.capi  = capi;
            this.rifts = rifts;

            capi.Event.RegisterRenderer(this, EnumRenderStage.AfterBlit, "rendertest");
            MeshData mesh = QuadMeshUtil.GetQuad();

            meshref = capi.Render.UploadMesh(mesh);
            matrixf = new Matrixf();

            capi.Event.ReloadShader += LoadShader;
            LoadShader();

            modsys = capi.ModLoader.GetModSystem <ModSystemRifts>();
        }
        public override void Start(ICoreAPI api)
        {
            base.Start(api);
            this.api = api;

            riftSys = api.ModLoader.GetModSystem <ModSystemRifts>();


            texts = new Dictionary <EnumTempStormStrength, TemporalStormText>()
            {
                { EnumTempStormStrength.Light, new TemporalStormText()
                  {
                      Approaching = Lang.Get("A light temporal storm is approaching"), Imminent = Lang.Get("A light temporal storm is imminent"), Waning = Lang.Get("The temporal storm seems to be waning")
                  } },
                { EnumTempStormStrength.Medium, new TemporalStormText()
                  {
                      Approaching = Lang.Get("A medium temporal storm is approaching"), Imminent = Lang.Get("A medium temporal storm is imminent"), Waning = Lang.Get("The temporal storm seems to be waning")
                  } },
                { EnumTempStormStrength.Heavy, new TemporalStormText()
                  {
                      Approaching = Lang.Get("A heavy temporal storm is approaching"), Imminent = Lang.Get("A heavy temporal storm is imminent"), Waning = Lang.Get("The temporal storm seems to be waning")
                  } },
            };

            configs = new Dictionary <string, TemporalStormConfig>()
            {
                { "veryrare", new TemporalStormConfig()
                  {
                      Frequency           = NatFloat.create(EnumDistribution.UNIFORM, 30, 5),
                      StrengthIncrease    = 2.5f / 100,
                      StrengthIncreaseCap = 25f / 100
                  } },

                { "rare", new TemporalStormConfig()
                  {
                      Frequency           = NatFloat.create(EnumDistribution.UNIFORM, 25, 5),
                      StrengthIncrease    = 5f / 100,
                      StrengthIncreaseCap = 50f / 100
                  } },

                { "sometimes", new TemporalStormConfig()
                  {
                      Frequency           = NatFloat.create(EnumDistribution.UNIFORM, 15, 5),
                      StrengthIncrease    = 10f / 100,
                      StrengthIncreaseCap = 100f / 100
                  } },

                { "often", new TemporalStormConfig()
                  {
                      Frequency           = NatFloat.create(EnumDistribution.UNIFORM, 7.5f, 2.5f),
                      StrengthIncrease    = 15f / 100,
                      StrengthIncreaseCap = 150f / 100
                  } },

                { "veryoften", new TemporalStormConfig()
                  {
                      Frequency           = NatFloat.create(EnumDistribution.UNIFORM, 4.5f, 1.5f),
                      StrengthIncrease    = 20f / 100,
                      StrengthIncreaseCap = 200f / 100
                  } }
            };
        }