Пример #1
0
 public void init()
 {
     this.findController    = new FindController(this);
     this.assessController  = new AssessController(this);
     this.tacticsController = new TacticsController(this);
     this.moodController    = new MoodController(this, "mood000");
     //this.resetIQ (this._map.AI_IQ);
 }
 public GraficoMood(User user)
 {
     InitializeComponent();
     this.user      = user;
     moodcontroller = new MoodController();
     themood        = new List <Mood>();
     cn             = new MoodDAO();
 }
Пример #3
0
 public static MoodController GetMoodController()
 {
     if (MoodController == null)
     {
         // This is a VERY slow call, that can add 30-40ms just to execute. Cache it!
         ModState.MoodController = UnityEngine.Object.FindObjectOfType <MoodController>();
     }
     return(ModState.MoodController);
 }
Пример #4
0
 public AddEvents(User user)
 {
     InitializeComponent();
     eventController      = new EventController();
     moodController       = new MoodController();
     categoriesController = new CategoriesController();
     categories           = new List <Categories>();
     loadComboBox();
     loadMoodComboBox();
     this.user = user;
 }
Пример #5
0
        public static void EnableNightVisionEffect(AbstractActor source)
        {
            // Skip if the green effect is disabled
            if (!Mod.Config.Toggles.ShowNightVision)
            {
                return;
            }

            ModState.IsNightVisionMode = true;

            MoodController mc = ModState.GetMoodController();

            Traverse uppT = Traverse.Create(mc).Field("unityPostProcess");
            PostProcessingBehaviour ppb = uppT.GetValue <PostProcessingBehaviour>();

            // Enable grain and set the intensity
            Traverse       grainT = Traverse.Create(ppb).Field("m_Grain");
            GrainComponent gc     = grainT.GetValue <GrainComponent>();

            GrainModel.Settings gms = gc.model.settings;
            gms.intensity     = 0.8f;
            gms.size          = 1.0f;
            gc.model.settings = gms;

            Traverse   sunlightBTT = Traverse.Create(mc).Field("sunlightBT");
            BTSunlight sunlightBT  = sunlightBTT.GetValue <BTSunlight>();

            // Disable shadows from sunlight
            //BTSunlight.SunlightSettings sunlightS = sunlightBT.sunSettings;
            //sunlightS.castShadows = false;
            //sunlightBT.sunSettings = sunlightS;
            Traverse sunlightT = Traverse.Create(sunlightBT).Field("sunLight");
            Light    sunlight  = sunlightT.GetValue <Light>();

            sunlight.shadows = LightShadows.None;

            // Set the sunlight color
            Color lightVision = Color.green;

            lightVision.a = 0.8f;
            Shader.SetGlobalColor(Shader.PropertyToID("_BT_SunlightColor"), lightVision);

            // Disable opacity from the clouds
            Shader.SetGlobalFloat(Shader.PropertyToID("_BT_CloudOpacity"), 0f);

            // Make the sunlight point straight down
            Shader.SetGlobalVector(Shader.PropertyToID("_BT_SunlightDirection"), sunlightBT.transform.up);
        }
    // Use this for initialization
    void Start()
    {
        wrapPoints        = new List <WrapPoint>(GetComponentsInChildren <WrapPoint>());
        originalMaterials = new List <Material>(GetComponent <Renderer>().materials);
        List <Material> blehMaterials = new List <Material>();

        for (int i = 0; i < originalMaterials.Count; i++)
        {
            blehMaterials.Add(blehMaterial);
        }
        GetComponent <Renderer>().materials = blehMaterials.ToArray();

        //Assigning dopey head
        dopeyHead = GameObject.Find("HeadSegment").GetComponent <HeadController>();

        //Assigning mood controller
        mood = GameObject.Find("AngryTrigger").GetComponent <MoodController>();
    }
Пример #7
0
        public static void Reset()
        {
            Mod.Log.Info?.Write($"RESETTING STATE!");
            // Reinitialize state
            MapConfig                = null;
            MoodController           = null;
            LastPlayerActorActivated = null;
            TurnDirectorStarted      = false;
            IsNightVisionMode        = false;

            CheckResults   = new double[ResultsToPrecalcuate];
            CheckResultIdx = 0;

            // Combat state
            Combat = null;
            MarkContainerRefs.Clear();

            EWState.ResetCache();
        }
Пример #8
0
 public InfoEvents(int id_event, String name, String description, String city, String direction, String date, String time,
                   String duration, int n_participants, int n_maxParticipants, String type, String mood, int id_user, User user)
 {
     InitializeComponent();
     this.id_event          = id_event;
     this.name              = name;
     this.description       = description;
     this.city              = city;
     this.direction         = direction;
     this.date              = date;
     this.time              = time;
     this.duration          = duration;
     this.n_participants    = n_participants;
     this.n_maxParticipants = n_maxParticipants;
     this.type              = type;
     this.mood              = mood;
     this.id_user           = id_user;
     this.user              = user;
     eventController        = new EventController();
     moodController         = new MoodController();
     categoriesController   = new CategoriesController();
     categories             = new List <Categories>();
 }
Пример #9
0
        public static void DisableNightVisionEffect()
        {
            // Skip if the green effect is disabled
            if (!Mod.Config.Toggles.ShowNightVision)
            {
                return;
            }

            ModState.IsNightVisionMode = false;

            MoodController mc = ModState.GetMoodController();

            // Grain will disable automatically

            // Re-enable shadows
            Traverse   sunlightBTT = Traverse.Create(mc).Field("sunlightBT");
            BTSunlight sunlightBT  = sunlightBTT.GetValue <BTSunlight>();

            // Re-enable shadows from sunlight
            BTSunlight.SunlightSettings sunlightS = sunlightBT.sunSettings;
            //sunlightS.castShadows = false;
            //sunlightBT.sunSettings = sunlightS;
            Traverse sunlightT = Traverse.Create(sunlightBT).Field("sunLight");
            Light    sunlight  = sunlightT.GetValue <Light>();

            sunlight.shadows = (sunlightS.castShadows) ? LightShadows.None : LightShadows.Soft;

            // Reset the sunlight color
            Shader.SetGlobalColor(Shader.PropertyToID("_BT_SunlightColor"), mc.currentMood.sunlight.sunColor);

            // Re-enable opacity from the clouds
            Shader.SetGlobalFloat(Shader.PropertyToID("_BT_CloudOpacity"), mc.currentMood.sunlight.cloudOpacity);

            // Point sunlight forward
            Shader.SetGlobalVector(Shader.PropertyToID("_BT_SunlightDirection"), sunlightBT.transform.forward);
        }
Пример #10
0
        public static MapConfig ParseCurrentMap()
        {
            Mod.Log.Info?.Write("MH:PCM Parsing current map.");

            MoodController moodController = ModState.GetMoodController();

            MoodSettings moodSettings = moodController?.CurrentMood;
            TagSet       moodTags     = moodSettings?.moodTags;

            if (moodTags == null || moodTags.IsEmpty)
            {
                return(new MapConfig {
                    spotterRange = Mod.Config.Vision.BaseRangeBright,
                    visualIDRange = Mod.Config.Vision.ScanRangeHexes
                });
            }

            Mod.Log.Debug?.Write($"  - Parsing current map for mod config");
            MapConfig mapConfig = new MapConfig();

            String allTags = String.Join(", ", moodTags.ToArray());

            Mod.Log.Debug?.Write($"  - All mood tags are: {allTags}");

            float baseVision  = Mod.Config.Vision.BaseRangeBright;
            float visionMulti = 1.0f;

            foreach (string tag in moodTags)
            {
                switch (tag)
                {
                case "mood_timeMorning":
                case "mood_timeNoon":
                case "mood_timeAfternoon":
                case "mood_timeDay":
                    Mod.Log.Debug?.Write($"  - {tag}");
                    mapConfig.isDay  = true;
                    mapConfig.isDim  = false;
                    mapConfig.isDark = false;
                    break;

                case "mood_timeSunrise":
                case "mood_timeSunset":
                case "mood_timeTwilight":
                    Mod.Log.Debug?.Write($"  - {tag}");
                    if (baseVision > Mod.Config.Vision.BaseRangeDim)
                    {
                        baseVision       = Mod.Config.Vision.BaseRangeDim;
                        mapConfig.isDay  = false;
                        mapConfig.isDim  = true;
                        mapConfig.isDark = false;
                    }
                    break;

                case "mood_timeNight":
                    Mod.Log.Debug?.Write($"  - {tag}");
                    if (baseVision > Mod.Config.Vision.BaseRangeDark)
                    {
                        baseVision       = Mod.Config.Vision.BaseRangeDark;
                        mapConfig.isDay  = false;
                        mapConfig.isDim  = false;
                        mapConfig.isDark = true;
                    }
                    break;

                case "mood_weatherRain":
                    Mod.Log.Debug?.Write($"  - {tag}");
                    if (visionMulti > Mod.Config.Vision.RangeMultiRainSnow)
                    {
                        visionMulti       = Mod.Config.Vision.RangeMultiRainSnow;
                        mapConfig.hasRain = true;
                    }
                    break;

                case "mood_weatherSnow":
                    Mod.Log.Debug?.Write($"  - {tag}");
                    if (visionMulti > Mod.Config.Vision.RangeMultiRainSnow)
                    {
                        visionMulti       = Mod.Config.Vision.RangeMultiRainSnow;
                        mapConfig.hasSnow = true;
                    }
                    break;

                case "mood_fogLight":
                    Mod.Log.Debug?.Write($"  - {tag}");
                    if (visionMulti > Mod.Config.Vision.RangeMultiLightFog)
                    {
                        visionMulti           = Mod.Config.Vision.RangeMultiLightFog;
                        mapConfig.hasLightFog = true;
                    }
                    break;

                case "mood_fogHeavy":
                    Mod.Log.Debug?.Write($"  - {tag}");
                    if (visionMulti > Mod.Config.Vision.RangeMultiHeavyFog)
                    {
                        visionMulti           = Mod.Config.Vision.RangeMultiHeavyFog;
                        mapConfig.hasHeavyFog = true;
                    }
                    break;

                default:
                    break;
                }
            }

            // Calculate normal vision range
            float visRange = (float)Math.Ceiling(baseVision * 30f * visionMulti);

            Mod.Log.Info?.Write($"  Calculating vision range as Math.Ceil(baseVision:{baseVision} * 30.0 * visionMulti:{visionMulti}) = visRange:{visRange}.");
            if (visRange < Mod.Config.Vision.MinimumVisionRange())
            {
                visRange = Mod.Config.Vision.MinimumVisionRange();
            }

            float roundedVisRange = HexUtils.CountHexes(visRange, false) * 30f;

            Mod.Log.Info?.Write($"MapHelper: Vision range for map will be ==> {roundedVisRange}m (normalized from {visRange}m)");
            mapConfig.spotterRange  = roundedVisRange;
            mapConfig.visualIDRange = Math.Min(roundedVisRange, Mod.Config.Vision.ScanRangeHexes * 30.0f);

            Mod.Log.Info?.Write($"Map vision range = visual:{roundedVisRange} / visualScan:{mapConfig.visualIDRange}");

            // Calculate night vision range
            if (mapConfig.isDark)
            {
                float nightVisRange = (float)Math.Ceiling(Mod.Config.Vision.BaseRangeBright * 30f * visionMulti);
                if (nightVisRange < Mod.Config.Vision.MinimumVisionRange())
                {
                    nightVisRange = Mod.Config.Vision.MinimumVisionRange();
                }

                float roundedNightVisRange = HexUtils.CountHexes(nightVisRange, false) * 30f;
                Mod.Log.Info?.Write($"MapHelper: Night vision range for map will be ==> {roundedNightVisRange}m (normalized from {nightVisRange}m)");
                mapConfig.nightVisionSpotterRange  = roundedNightVisRange;
                mapConfig.nightVisionVisualIDRange = Math.Min(roundedNightVisRange, Mod.Config.Vision.ScanRangeHexes * 30.0f);
            }

            return(mapConfig);
        }
Пример #11
0
 public AnswerMood(User user)
 {
     InitializeComponent();
     moodController = new MoodController();
     this.user      = user;
 }
Пример #12
0
 public Login()
 {
     InitializeComponent();
     userController = new UserController();
     moodController = new MoodController();
 }