Exemplo n.º 1
0
    private static void WereBuffs_OnNewMagicRound()
    {
        if (!GameManager.IsGamePaused && playerEntity.CurrentHealth > 0 && !GameManager.Instance.EntityEffectBroker.SyntheticTimeIncrease)
        {
            ////Code to trigger werewolf infection for testing
            //if (!GameManager.Instance.PlayerEffectManager.HasLycanthropy())
            //{
            //    EntityEffectBundle bundle = GameManager.Instance.PlayerEffectManager.CreateLycanthropyDisease(LycanthropyTypes.Werewolf);
            //    GameManager.Instance.PlayerEffectManager.AssignBundle(bundle, AssignBundleFlags.SpecialInfection);
            //    Debug.Log("Adding Were");
            //}

            if (GameManager.Instance.PlayerEffectManager.HasLycanthropy())
            {
                LycanthropyEffect lycanthropyEffect = GameManager.Instance.PlayerEffectManager.GetRacialOverrideEffect() as LycanthropyEffect;
                LycanthropyTypes  lycanthropyTypes  = lycanthropyEffect.InfectionType;
                if (GameManager.Instance.AreEnemiesNearby())
                {
                    PacifyWere(playerEntity.IsInBeastForm);
                }

                if (lycanthropyTypes == LycanthropyTypes.Werewolf)
                {
                    if (playerEntity.IsInBeastForm)
                    {
                        strAtt = -20;
                        agiAtt = 0;
                        endAtt = -20;
                        spdAtt = 0;
                    }
                    else
                    {
                        strAtt = -40;
                        agiAtt = -30;
                        endAtt = -40;
                        spdAtt = -30;
                    }
                }
                else
                {
                    if (playerEntity.IsInBeastForm)
                    {
                        strAtt = 0;
                        agiAtt = -20;
                        endAtt = 0;
                        spdAtt = -20;
                    }
                    else
                    {
                        strAtt = -30;
                        agiAtt = -40;
                        endAtt = -30;
                        spdAtt = -40;
                    }
                }

                if (playerEntity.IsInBeastForm)
                {
                    skillModAmount = 0;
                    dodging        = 30;
                    centaurian     = playerEntity.Skills.GetLiveSkillValue(DFCareer.Skills.Centaurian);
                    daedric        = playerEntity.Skills.GetLiveSkillValue(DFCareer.Skills.Daedric);
                    dragonish      = playerEntity.Skills.GetLiveSkillValue(DFCareer.Skills.Dragonish);
                    etiquette      = playerEntity.Skills.GetLiveSkillValue(DFCareer.Skills.Etiquette);
                    giantish       = playerEntity.Skills.GetLiveSkillValue(DFCareer.Skills.Giantish);
                    harpy          = playerEntity.Skills.GetLiveSkillValue(DFCareer.Skills.Harpy);
                    impish         = playerEntity.Skills.GetLiveSkillValue(DFCareer.Skills.Impish);
                    lockpicking    = playerEntity.Skills.GetLiveSkillValue(DFCareer.Skills.Lockpicking);
                    nymph          = playerEntity.Skills.GetLiveSkillValue(DFCareer.Skills.Nymph);
                    orcish         = playerEntity.Skills.GetLiveSkillValue(DFCareer.Skills.Orcish);
                    pickpocket     = playerEntity.Skills.GetLiveSkillValue(DFCareer.Skills.Pickpocket);
                    spriggan       = playerEntity.Skills.GetLiveSkillValue(DFCareer.Skills.Spriggan);
                    streetwise     = playerEntity.Skills.GetLiveSkillValue(DFCareer.Skills.Streetwise);
                    playerEntity.CurrentMagicka = 0;
                    playerEntity.CurrentFatigue = playerEntity.MaxFatigue;
                    GameManager.Instance.TransportManager.TransportMode = TransportModes.Foot;
                    GameObject lightsNode = GameObject.Find("NightVision");
                    if (lightsNode == null)
                    {
                        Debug.Log("lightsNode == null");
                        nightVision = false;
                    }
                }
                else
                {
                    skillModAmount = -25;
                    dodging        = 0;
                    centaurian     = 0;
                    daedric        = 0;
                    dragonish      = 0;
                    etiquette      = 0;
                    giantish       = 0;
                    harpy          = 0;
                    impish         = 0;
                    lockpicking    = 0;
                    nymph          = 0;
                    orcish         = 0;
                    pickpocket     = 0;
                    spriggan       = 0;
                    streetwise     = 0;
                    GameObject lightsNode = GameObject.Find("NightVision");
                    if (lightsNode != null)
                    {
                        nightVision = false;
                        Destroy(lightsNode);
                    }
                }
            }
            else
            {
                strAtt         = 0;
                intAtt         = 0;
                wilAtt         = 0;
                agiAtt         = 0;
                endAtt         = 0;
                perAtt         = 0;
                spdAtt         = 0;
                skillModAmount = 0;
            }

            int[] statMods = new int[DaggerfallStats.Count];
            statMods[(int)DFCareer.Stats.Strength]     = +strAtt;
            statMods[(int)DFCareer.Stats.Intelligence] = +intAtt;
            statMods[(int)DFCareer.Stats.Willpower]    = +wilAtt;
            statMods[(int)DFCareer.Stats.Agility]      = +agiAtt;
            statMods[(int)DFCareer.Stats.Endurance]    = +endAtt;
            statMods[(int)DFCareer.Stats.Personality]  = +perAtt;
            statMods[(int)DFCareer.Stats.Speed]        = +spdAtt;
            playerEffectManager.MergeDirectStatMods(statMods);

            int[] skillMods = new int[DaggerfallSkills.Count];
            skillMods[(int)DFCareer.Skills.Dodging]        = +dodging;
            skillMods[(int)DFCareer.Skills.Swimming]       = +skillModAmount;
            skillMods[(int)DFCareer.Skills.Running]        = +skillModAmount;
            skillMods[(int)DFCareer.Skills.Stealth]        = +skillModAmount;
            skillMods[(int)DFCareer.Skills.CriticalStrike] = +skillModAmount;
            skillMods[(int)DFCareer.Skills.Climbing]       = +skillModAmount;
            skillMods[(int)DFCareer.Skills.HandToHand]     = +skillModAmount;
            skillMods[(int)DFCareer.Skills.Jumping]        = +skillModAmount;
            skillMods[(int)DFCareer.Skills.Centaurian]     = -centaurian;
            skillMods[(int)DFCareer.Skills.Daedric]        = -daedric;
            skillMods[(int)DFCareer.Skills.Dragonish]      = -dragonish;
            skillMods[(int)DFCareer.Skills.Etiquette]      = -etiquette;
            skillMods[(int)DFCareer.Skills.Giantish]       = -giantish;
            skillMods[(int)DFCareer.Skills.Harpy]          = -harpy;
            skillMods[(int)DFCareer.Skills.Impish]         = -impish;
            skillMods[(int)DFCareer.Skills.Lockpicking]    = -lockpicking;
            skillMods[(int)DFCareer.Skills.Nymph]          = -nymph;
            skillMods[(int)DFCareer.Skills.Orcish]         = -orcish;
            skillMods[(int)DFCareer.Skills.Pickpocket]     = -pickpocket;
            skillMods[(int)DFCareer.Skills.Spriggan]       = -spriggan;
            skillMods[(int)DFCareer.Skills.Streetwise]     = -streetwise;
            playerEffectManager.MergeDirectSkillMods(skillMods);
        }
    }
Exemplo n.º 2
0
        static void ThiefEffects_OnNewMagicRound()
        {
            //Debug.Log("[ThiefOverhaul] Magic Round");
            if (playerEnterExit.IsPlayerInsideBuilding)
            {
                PlayerGPS.DiscoveredBuilding buildingData = GameManager.Instance.PlayerEnterExit.BuildingDiscoveryData;
                if (RMBLayout.IsShop(buildingData.buildingType) && !PlayerActivate.IsBuildingOpen(buildingData.buildingType))
                {
                    int stealthValue = playerEntity.Skills.GetLiveSkillValue(DFCareer.Skills.Stealth);
                    stealthValue -= buildingData.quality * 2;

                    if (Dice100.FailedRoll(StealthCalc(stealthValue, false)))
                    {
                        if (burglaryCounter >= 100)
                        {
                            DaggerfallUI.MessageBox("'Guards! Guards! We're being robbed!'");
                            if (Dice100.SuccessRoll(playerEntity.Stats.LiveLuck))
                            {
                                playerEntity.MagicalConcealmentFlags = MagicalConcealmentFlags.None;
                                DaggerfallUI.AddHUDText("Your magical concealment is broken");
                            }

                            playerEntity.CrimeCommitted = PlayerEntity.Crimes.Breaking_And_Entering;
                            playerEntity.SpawnCityGuards(true);
                        }
                        else if (burglaryCounter == 0)
                        {
                            DaggerfallUI.MessageBox(burglaryString1());
                            burglaryCounter += Mathf.Clamp(UnityEngine.Random.Range(100, 200) - playerEntity.Stats.LiveLuck, 10, 100);
                        }
                        else if (burglaryCounter < 50)
                        {
                            DaggerfallUI.MessageBox(burglaryString2());
                            burglaryCounter += Mathf.Clamp(UnityEngine.Random.Range(100, 200) - playerEntity.Stats.LiveLuck, 10, 100);
                        }
                        else
                        {
                            burglaryCounter += Mathf.Clamp(UnityEngine.Random.Range(100, 200) - playerEntity.Stats.LiveLuck, 10, 100);
                        }
                    }
                }
            }

            DaggerfallUnityItem ringSlot0     = playerEntity.ItemEquipTable.GetItem(EquipSlots.Ring0);
            DaggerfallUnityItem ringSlot1     = playerEntity.ItemEquipTable.GetItem(EquipSlots.Ring1);
            DaggerfallUnityItem markSlot0     = playerEntity.ItemEquipTable.GetItem(EquipSlots.Mark0);
            DaggerfallUnityItem markSlot1     = playerEntity.ItemEquipTable.GetItem(EquipSlots.Mark1);
            DaggerfallUnityItem braceletSlot0 = playerEntity.ItemEquipTable.GetItem(EquipSlots.Bracelet0);
            DaggerfallUnityItem braceletSlot1 = playerEntity.ItemEquipTable.GetItem(EquipSlots.Bracelet1);
            DaggerfallUnityItem bracerSlot0   = playerEntity.ItemEquipTable.GetItem(EquipSlots.Bracer0);
            DaggerfallUnityItem bracerSlot1   = playerEntity.ItemEquipTable.GetItem(EquipSlots.Bracer1);
            DaggerfallUnityItem crystalSlot0  = playerEntity.ItemEquipTable.GetItem(EquipSlots.Crystal0);
            DaggerfallUnityItem crystalSlot1  = playerEntity.ItemEquipTable.GetItem(EquipSlots.Crystal1);

            if (ringSlot0 != null && ringSlot0.TemplateIndex == templateIndex_Ring)
            {
                lockpickingBonus = 20;
            }
            else if (ringSlot1 != null && ringSlot1.TemplateIndex == templateIndex_Ring)
            {
                lockpickingBonus = 20;
            }
            else
            {
                lockpickingBonus = 0;
            }

            if (markSlot0 != null && markSlot0.TemplateIndex == templateIndex_Mark)
            {
                streetwiseBonus = 20;
            }
            else if (markSlot1 != null && markSlot1.TemplateIndex == templateIndex_Mark)
            {
                streetwiseBonus = 20;
            }
            else
            {
                streetwiseBonus = 0;
            }

            if (braceletSlot0 != null && braceletSlot0.TemplateIndex == templateIndex_Bracelet)
            {
                pickpocketBonus = 20;
            }
            else if (braceletSlot1 != null && braceletSlot1.TemplateIndex == templateIndex_Bracelet)
            {
                pickpocketBonus = 20;
            }
            else
            {
                pickpocketBonus = 0;
            }

            if (bracerSlot0 != null && bracerSlot0.TemplateIndex == templateIndex_Bracer)
            {
                climbingBonus = 20;
            }
            else if (bracerSlot1 != null && bracerSlot1.TemplateIndex == templateIndex_Bracer)
            {
                climbingBonus = 20;
            }
            else
            {
                climbingBonus = 0;
            }

            if (crystalSlot0 != null && crystalSlot0.TemplateIndex == templateIndex_Crystal)
            {
                stealthBonus = 20;
            }
            else if (crystalSlot1 != null && crystalSlot1.TemplateIndex == templateIndex_Crystal)
            {
                stealthBonus = 20;
            }
            else
            {
                stealthBonus = 0;
            }


            if (!GameManager.IsGamePaused && playerEntity.CurrentHealth > 0)
            {
                int[] skillMods = new int[DaggerfallSkills.Count];
                skillMods[(int)DFCareer.Skills.Lockpicking] = +lockpickingBonus;
                skillMods[(int)DFCareer.Skills.Streetwise]  = +streetwiseBonus;
                skillMods[(int)DFCareer.Skills.Pickpocket]  = +pickpocketBonus;
                skillMods[(int)DFCareer.Skills.Climbing]    = +climbingBonus;
                skillMods[(int)DFCareer.Skills.Stealth]     = +stealthBonus;
                playerEffectManager.MergeDirectSkillMods(skillMods);
            }
        }