private static void EncumbranceEffects_OnNewMagicRound() { PlayerEntity playerEntity = GameManager.Instance.PlayerEntity; if (!GameManager.IsGamePaused && !playerEntity.IsResting && playerEntity.CurrentHealth > 0 && !GameManager.Instance.EntityEffectBroker.SyntheticTimeIncrease && !DaggerfallUI.Instance.FadeBehaviour.FadeInProgress) { float encPc = playerEntity.CarriedWeight / playerEntity.MaxEncumbrance; float encOver = Mathf.Max(encPc - 0.75f, 0f) * EncEffectScaleFactor; if (encOver > 0) { int speedEffect = Mathf.Min(playerEntity.Stats.PermanentSpeed - 2, (int)(playerEntity.Stats.PermanentSpeed * encOver)); int fatigueEffect = Mathf.Min(playerEntity.CurrentFatigue - 100, (int)(encOver * 100)); #if UNITY_EDITOR Debug.LogFormat("Encumbrance {0}, over {1} = effects: {2} speed, {3} fatigue", encPc, encOver, speedEffect, fatigueEffect); #endif playerEntity.DecreaseFatigue(fatigueEffect, false); EntityEffectManager playerEffectManager = playerEntity.EntityBehaviour.GetComponent <EntityEffectManager>(); int[] statMods = new int[DaggerfallStats.Count]; statMods[(int)DFCareer.Stats.Speed] = -speedEffect; playerEffectManager.MergeDirectStatMods(statMods); } } }
public static void Drunk() { if (drunk > 0) { drunkCounter++; if (drunkCounter > 10) { drunkCounter = 0; drunk--; } } if (drunk > playerEntity.Stats.LiveEndurance / 2) { EntityEffectManager playerEffectManager = GameManager.Instance.PlayerEntity.EntityBehaviour.GetComponent <EntityEffectManager>(); int alcEffect = (drunk - (playerEntity.Stats.LiveEndurance / 2)) / 10; int[] statMods = new int[DaggerfallStats.Count]; statMods[(int)DFCareer.Stats.Agility] = -Mathf.Min(alcEffect, playerEntity.Stats.PermanentAgility - 5); statMods[(int)DFCareer.Stats.Intelligence] = -Mathf.Min(alcEffect, playerEntity.Stats.PermanentIntelligence - 5); statMods[(int)DFCareer.Stats.Willpower] = -Mathf.Min(alcEffect, playerEntity.Stats.PermanentWillpower - 5); statMods[(int)DFCareer.Stats.Personality] = 20 - Mathf.Min(alcEffect, playerEntity.Stats.PermanentPersonality - 5); statMods[(int)DFCareer.Stats.Speed] = -Mathf.Min(alcEffect, playerEntity.Stats.PermanentSpeed - 5); playerEffectManager.MergeDirectStatMods(statMods); } }
public override void MagicRound() { base.MagicRound(); // Caster must still be in range or vampiric link ends if (!CheckCasterDistance()) { forcedRoundsRemaining = 0; ResignAsIncumbent(); return; } // Send stat mods to caster effect manager EntityEffectManager casterManager = caster.GetComponent <EntityEffectManager>(); casterManager.MergeDirectStatMods(casterStatMods); }
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); } }