コード例 #1
0
        public override void Start(EntityEffectManager manager, DaggerfallEntityBehaviour caster = null)
        {
            base.Start(manager, caster);

            // Create compound lycanthrope race from birth race
            CreateCompoundRace();

            // Get infection type from stage one disease
            // Note: Classic save import will start this effect and set correct type after load
            LycanthropyInfection infection = (LycanthropyInfection)GameManager.Instance.PlayerEffectManager.FindIncumbentEffect <LycanthropyInfection>();

            if (infection != null)
            {
                infectionType = infection.InfectionType;
            }

            // Considered sated on first start
            UpdateSatiation();

            // Our transformation is complete - cure everything on player (including stage one disease)
            GameManager.Instance.PlayerEffectManager.CureAll();

            // Refresh head texture after effect starts
            DaggerfallUI.RefreshLargeHUDHeadTexture();
        }
コード例 #2
0
        Races StripTransformedRace(out Races classicTransformedRace, LycanthropyTypes stripLycanthropyType = LycanthropyTypes.None)
        {
            // Restore original character race if vampire or lycanthrope
            // Racial overrides are handled by the effect system in DFU rather than entirely hardcoded, but still need to handle importing from classic
            Races liveRace = parsedData.race + 1;

            classicTransformedRace = Races.None;
            if (liveRace == Races.Vampire || liveRace == Races.Werewolf || liveRace == Races.Wereboar)
            {
                classicTransformedRace = liveRace;
                liveRace = parsedData.race2 + 1;
            }

            // Remove vampire bonuses to stats and skills
            if (classicTransformedRace == Races.Vampire)
            {
                // Remove +20 bonus to stats
                parsedData.currentStats.SetPermanentStatValue(DFCareer.Stats.Strength, parsedData.currentStats.PermanentStrength - 20);
                parsedData.currentStats.SetPermanentStatValue(DFCareer.Stats.Willpower, parsedData.currentStats.PermanentWillpower - 20);
                parsedData.currentStats.SetPermanentStatValue(DFCareer.Stats.Agility, parsedData.currentStats.PermanentAgility - 20);
                parsedData.currentStats.SetPermanentStatValue(DFCareer.Stats.Endurance, parsedData.currentStats.PermanentEndurance - 20);
                parsedData.currentStats.SetPermanentStatValue(DFCareer.Stats.Personality, parsedData.currentStats.PermanentPersonality - 20);
                parsedData.currentStats.SetPermanentStatValue(DFCareer.Stats.Speed, parsedData.currentStats.PermanentSpeed - 20);
                parsedData.currentStats.SetPermanentStatValue(DFCareer.Stats.Luck, parsedData.currentStats.PermanentLuck - 20);
                if ((VampireClans)parsedData.vampireClan == VampireClans.Anthotis)
                {
                    parsedData.currentStats.SetPermanentStatValue(DFCareer.Stats.Intelligence, parsedData.currentStats.PermanentIntelligence - 20);
                }

                // Remove +30 bonus to vampire skills
                parsedData.skills.SetPermanentSkillValue(DFCareer.Skills.Jumping, (short)(parsedData.skills.GetPermanentSkillValue(DFCareer.Skills.Jumping) - 30));
                parsedData.skills.SetPermanentSkillValue(DFCareer.Skills.Running, (short)(parsedData.skills.GetPermanentSkillValue(DFCareer.Skills.Running) - 30));
                parsedData.skills.SetPermanentSkillValue(DFCareer.Skills.Stealth, (short)(parsedData.skills.GetPermanentSkillValue(DFCareer.Skills.Stealth) - 30));
                parsedData.skills.SetPermanentSkillValue(DFCareer.Skills.CriticalStrike, (short)(parsedData.skills.GetPermanentSkillValue(DFCareer.Skills.CriticalStrike) - 30));
                parsedData.skills.SetPermanentSkillValue(DFCareer.Skills.Climbing, (short)(parsedData.skills.GetPermanentSkillValue(DFCareer.Skills.Climbing) - 30));
                parsedData.skills.SetPermanentSkillValue(DFCareer.Skills.HandToHand, (short)(parsedData.skills.GetPermanentSkillValue(DFCareer.Skills.HandToHand) - 30));
            }

            // Remove werewolf/wereboar bonuses to stats and skills
            if (classicTransformedRace == Races.Werewolf || classicTransformedRace == Races.Wereboar || stripLycanthropyType != LycanthropyTypes.None)
            {
                // Remove +40 bonus to selected stats
                parsedData.currentStats.SetPermanentStatValue(DFCareer.Stats.Strength, parsedData.currentStats.PermanentStrength - 40);
                parsedData.currentStats.SetPermanentStatValue(DFCareer.Stats.Speed, parsedData.currentStats.PermanentSpeed - 40);
                parsedData.currentStats.SetPermanentStatValue(DFCareer.Stats.Agility, parsedData.currentStats.PermanentAgility - 40);
                parsedData.currentStats.SetPermanentStatValue(DFCareer.Stats.Endurance, parsedData.currentStats.PermanentEndurance - 40);

                // Remove +30 bonus to lycanthrope skills
                parsedData.skills.SetPermanentSkillValue(DFCareer.Skills.Swimming, (short)(parsedData.skills.GetPermanentSkillValue(DFCareer.Skills.Swimming) - 30));
                parsedData.skills.SetPermanentSkillValue(DFCareer.Skills.Running, (short)(parsedData.skills.GetPermanentSkillValue(DFCareer.Skills.Running) - 30));
                parsedData.skills.SetPermanentSkillValue(DFCareer.Skills.Stealth, (short)(parsedData.skills.GetPermanentSkillValue(DFCareer.Skills.Stealth) - 30));
                parsedData.skills.SetPermanentSkillValue(DFCareer.Skills.CriticalStrike, (short)(parsedData.skills.GetPermanentSkillValue(DFCareer.Skills.CriticalStrike) - 30));
                parsedData.skills.SetPermanentSkillValue(DFCareer.Skills.Climbing, (short)(parsedData.skills.GetPermanentSkillValue(DFCareer.Skills.Climbing) - 30));
                parsedData.skills.SetPermanentSkillValue(DFCareer.Skills.HandToHand, (short)(parsedData.skills.GetPermanentSkillValue(DFCareer.Skills.HandToHand) - 30));
                parsedData.skills.SetPermanentSkillValue(DFCareer.Skills.Jumping, (short)(parsedData.skills.GetPermanentSkillValue(DFCareer.Skills.Jumping) - 30));
            }

            return(liveRace);
        }
コード例 #3
0
        protected override void RestoreCustomDiseaseSaveData(object dataIn)
        {
            if (dataIn == null)
            {
                return;
            }

            CustomSaveData_v1 data = (CustomSaveData_v1)dataIn;

            InfectionType           = data.infectionType;
            warningDreamVideoPlayed = data.warningDreamVideoPlayed;
            startingDay             = data.startingDay;
        }
コード例 #4
0
        /// <summary>
        /// Converts a CharacterRecord to a prototypical CharacterDocument for character import.
        /// </summary>
        /// <param name="stripLycanthropyType">Lycanthropy type to remove, if previously read.</param>
        /// <returns>CharacterDocument derived from CharacterRecord data.</returns>
        public CharacterDocument ToCharacterDocument(LycanthropyTypes stripLycanthropyType = LycanthropyTypes.None)
        {
            CharacterDocument doc = new CharacterDocument();
            Dictionary <int, RaceTemplate> raceDict = RaceTemplate.GetRaceDictionary();

            // Strip back classic changes for vampire or lycanthrope as this is handled by effect system in DFU
            // If player is not transformed then this will simply return parsedData.race + 1
            Races classicTransformedRace;
            Races liveRace = StripTransformedRace(out classicTransformedRace, stripLycanthropyType);

            doc.raceTemplate                      = raceDict[(int)liveRace];
            doc.gender                            = parsedData.gender;
            doc.career                            = parsedData.career;
            doc.name                              = parsedData.characterName;
            doc.faceIndex                         = parsedData.faceIndex;
            doc.workingStats                      = parsedData.currentStats;
            doc.workingSkills                     = parsedData.skills;
            doc.reflexes                          = parsedData.reflexes;
            doc.currentHealth                     = parsedData.currentHealth;
            doc.maxHealth                         = parsedData.baseHealth;
            doc.currentSpellPoints                = parsedData.currentSpellPoints;
            doc.reputationCommoners               = parsedData.reputationCommoners;
            doc.reputationMerchants               = parsedData.reputationMerchants;
            doc.reputationNobility                = parsedData.reputationNobility;
            doc.reputationScholars                = parsedData.reputationScholars;
            doc.reputationUnderworld              = parsedData.reputationUnderworld;
            doc.currentFatigue                    = parsedData.currentFatigue;
            doc.skillUses                         = parsedData.skillUses;
            doc.skillsRaisedThisLevel1            = parsedData.skillsRaisedThisLevel1;
            doc.skillsRaisedThisLevel2            = parsedData.skillsRaisedThisLevel2;
            doc.startingLevelUpSkillSum           = parsedData.startingLevelUpSkillSum;
            doc.minMetalToHit                     = parsedData.minMetalToHit;
            doc.armorValues                       = parsedData.armorValues;
            doc.timeToBecomeVampireOrWerebeast    = parsedData.timeToBecomeVampireOrWerebeast;
            doc.hasStartedInitialVampireQuest     = parsedData.hasStartedInitialVampireQuest;
            doc.lastTimeVampireNeedToKillSatiated = parsedData.lastTimeVampireNeedToKillSatiated;
            doc.lastTimePlayerAteOrDrankAtTavern  = parsedData.lastTimePlayerAteOrDrankAtTavern;
            doc.lastTimePlayerBoughtTraining      = parsedData.lastTimePlayerBoughtTraining;
            doc.timeForThievesGuildLetter         = parsedData.timeForThievesGuildLetter;
            doc.timeForDarkBrotherhoodLetter      = parsedData.timeForDarkBrotherhoodLetter;
            doc.vampireClan                       = parsedData.vampireClan;
            doc.darkBrotherhoodRequirementTally   = parsedData.darkBrotherhoodRequirementTally;
            doc.thievesGuildRequirementTally      = parsedData.thievesGuildRequirementTally;
            doc.biographyReactionMod              = parsedData.biographyReactionMod;
            doc.classicTransformedRace            = classicTransformedRace;

            return(doc);
        }
コード例 #5
0
        public override void RestoreSaveData(object dataIn)
        {
            if (dataIn == null)
            {
                return;
            }

            CustomSaveData_v1 data = (CustomSaveData_v1)dataIn;

            compoundRace       = data.compoundRace;
            infectionType      = data.infectionType;
            lastKilledInnocent = data.lastKilledInnocent;
            lastCastMorphSelf  = data.lastCastMorphSelf;
            wearingHircineRing = data.wearingHircineRing;
            isTransformed      = data.isTransformed;
        }
コード例 #6
0
        public override void RestoreSaveData(object dataIn)
        {
            if (dataIn == null)
            {
                return;
            }

            CustomSaveData_v1 data = (CustomSaveData_v1)dataIn;

            compoundRace       = data.compoundRace;
            infectionType      = data.infectionType;
            lastKilledInnocent = data.lastKilledInnocent;
            hasStartedInitialLycanthropyQuest = data.hasStartedInitialLycanthropyQuest;
            wearingHircineRing = data.wearingHircineRing;
            isTransformed      = data.isTransformed;
        }
コード例 #7
0
        void RestoreOldClassSpecials(SaveTree saveTree, Races classicTransformedRace, LycanthropyTypes lycanthropyType)
        {
            try
            {
                // Get old class record
                SaveTreeBaseRecord oldClassRecord = saveTree.FindRecord(RecordTypes.OldClass);
                if (oldClassRecord == null)
                {
                    return;
                }

                // Read old class data
                System.IO.MemoryStream stream = new System.IO.MemoryStream(oldClassRecord.RecordData);
                System.IO.BinaryReader reader = new System.IO.BinaryReader(stream);
                ClassFile classFile           = new ClassFile();
                classFile.Load(reader);
                reader.Close();

                // Restore any specials set by transformed race
                if (classicTransformedRace == Races.Vampire)
                {
                    // Restore pre-vampire specials
                    characterDocument.career.DamageFromSunlight   = classFile.Career.DamageFromSunlight;
                    characterDocument.career.DamageFromHolyPlaces = classFile.Career.DamageFromHolyPlaces;
                    characterDocument.career.Paralysis            = classFile.Career.Paralysis;
                    characterDocument.career.Disease = classFile.Career.Disease;
                }
                else if (lycanthropyType != LycanthropyTypes.None)
                {
                    // Restore pre-lycanthropy specials
                    characterDocument.career.Disease = classFile.Career.Disease;
                }
            }
            catch (Exception ex)
            {
                Debug.LogErrorFormat("Could not restore old class specials for vamp/were import. Error: '{0}'", ex.Message);
            }
        }
コード例 #8
0
ファイル: LousyLycans.cs プロジェクト: Ralzar81/LousyLycans
    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);
        }
    }