示例#1
0
        void QuickLoad()
        {
            // Setup start behaviour
            StartGameBehaviour startGameBehaviour = FindStartGameBehaviour();

            startGameBehaviour.StartMethod = StartGameBehaviour.StartMethods.LoadDaggerfallUnityQuickSave;
        }
示例#2
0
 void Start()
 {
     startGameBehaviour = GameObject.FindObjectOfType <StartGameBehaviour>();
     if (!startGameBehaviour)
     {
         throw new Exception("Could not find StartGameBehaviour in scene.");
     }
 }
示例#3
0
        void OpenSelectedSaveGame()
        {
            Cursor.lockState = CursorLockMode.Locked;
            Cursor.visible   = false;

            // Setup start behaviour
            StartGameBehaviour startGameBehaviour = FindStartGameBehaviour();

            startGameBehaviour.ClassicSaveIndex = selectedSaveGame;
            startGameBehaviour.StartMethod      = StartGameBehaviour.StartMethods.LoadClassicSave;
        }
        protected override void Setup()
        {
            // Must have a start game object to transmit character sheet
            startGameBehaviour = GameObject.FindObjectOfType <StartGameBehaviour>();
            if (!startGameBehaviour)
            {
                throw new Exception("Could not find StartGameBehaviour in scene.");
            }

            // Wizard starts with race selection
            SetRaceSelectWindow();
        }
示例#5
0
        StartGameBehaviour FindStartGameBehaviour()
        {
            // Get StartGameBehaviour
            StartGameBehaviour startGameBehaviour = GameObject.FindObjectOfType <StartGameBehaviour>();

            if (!startGameBehaviour)
            {
                throw new Exception("Could not find StartGameBehaviour in scene.");
            }

            return(startGameBehaviour);
        }
示例#6
0
        private static void InitMod(bool lootRebalance, bool bandaging, bool conditionBasedPrices, bool enemyEquipment, bool skillStartEquip, bool skillStartSpells)
        {
            Debug.Log("Begin mod init: LootRealism");

            if (lootRebalance)
            {
                // Iterate over the new mob enemy data array and load into DFU enemies data.
                foreach (int mobDataId in MobLootKeys.Keys)
                {
                    // Log a message indicating the enemy mob being updated and update the loot key.
                    Debug.LogFormat("Updating enemy loot key for {0} to {1}.", EnemyBasics.Enemies[mobDataId].Name, MobLootKeys[mobDataId]);
                    EnemyBasics.Enemies[mobDataId].LootTableKey = (string)MobLootKeys[mobDataId];
                }
                // Replace the default loot matrix table with custom data.
                LootTables.DefaultLootTables = LootRealismTables;
            }

            if (bandaging)
            {
                if (DaggerfallUnity.Instance.ItemHelper.RegisterItemUseHander((int)UselessItems2.Bandage, UseBandage))
                {
                    FormulaHelper.RegisterOverride(mod, "IsItemStackable", (Func <DaggerfallUnityItem, bool>)IsItemStackable);
                }
                else
                {
                    Debug.LogWarning("LootRealism: Unable to register bandage use handler.");
                }
            }

            if (conditionBasedPrices)
            {
                FormulaHelper.RegisterOverride(mod, "ModifyFoundLootItems", (Func <DaggerfallUnityItem[], int>)RandomConditionFoundLootItems);
                FormulaHelper.RegisterOverride(mod, "CalculateCost", (Func <int, int, int, int>)CalculateConditionCost);
            }

            if (enemyEquipment)
            {
                EnemyEntity.AssignEnemyEquipment = AssignEnemyStartingEquipment;
            }

            StartGameBehaviour startGameBehaviour = GameManager.Instance.StartGameBehaviour;

            if (skillStartEquip)
            {
                startGameBehaviour.AssignStartingEquipment = AssignSkillEquipment;
            }
            if (skillStartSpells)
            {
                startGameBehaviour.AssignStartingSpells = AssignSkillSpellbook;
            }

            Debug.Log("Finished mod init: LootRealism");
        }
 void Awake()
 {
     alreadyStarted  = false;
     currentInstance = this;
     playerReference.SetActive(false);
 }