Exemplo n.º 1
0
    void CreatePerkDatabase()
    {
        Debug.Log("Creating perk database...");

        perkDatabase = ScriptableObject.CreateInstance <PerkDatabase>();

        AssetDatabase.CreateAsset(perkDatabase, perkAssetPath);
        AssetDatabase.SaveAssets();
        EditorUtility.FocusProjectWindow();
        Selection.activeObject = perkDatabase;
    }
Exemplo n.º 2
0
    void LoadAuxillaryDatabases()
    {
        // CONDITION database
        _conditionDatabase = AssetDatabase.LoadAssetAtPath <AuraDatabase>(conditionPath);
        if (_conditionDatabase.Auras == null)
        {
            _conditionDatabase.ReloadDatabase();
        }

        // PERK database
        _perkDatabase = AssetDatabase.LoadAssetAtPath <PerkDatabase>(perkAssetPath);
        _perkDatabase.ReloadDatabase();
    }
Exemplo n.º 3
0
    void LoadPerkDatabase()
    {
        perkDatabase = AssetDatabase.LoadAssetAtPath <PerkDatabase>(perkAssetPath);
        perkDatabase.ReloadDatabase();

        if (perkDatabase == null)
        {
            CreatePerkDatabase();
        }
        else
        {
            AssetDatabase.SaveAssets();
            EditorUtility.FocusProjectWindow();
            Selection.activeObject = perkDatabase;
        }
    }
Exemplo n.º 4
0
    void LoadDatabase()
    {
        itemdb    = ScriptableObject.CreateInstance <ItemDatabase>();
        conddb    = ScriptableObject.CreateInstance <AuraDatabase>();
        perkdb    = ScriptableObject.CreateInstance <PerkDatabase>();
        skilldb   = ScriptableObject.CreateInstance <SkillDatabase>();
        npcdb     = ScriptableObject.CreateInstance <NPCDatabase>();
        factiondb = ScriptableObject.CreateInstance <FactionDatabase>();

        itemdb.ReloadDatabase();
        conddb.ReloadDatabase();
        perkdb.ReloadDatabase();
        skilldb.ReloadDatabase();
        npcdb.ReloadDatabase();
        factiondb.ReloadDatabase();
    }
Exemplo n.º 5
0
    public void UpdateInfo(Race race, PerkDatabase perks)
    {
        icon.sprite      = Resources.Load(race.RaceIconPath) as Sprite;
        header.text      = race.RaceName;
        description.text = File.ReadAllText(Application.dataPath + "/StreamingAssets" + race.RaceDescPath);

        // Show the race traits:
        traits.text = "Bonus Trait(s): \n";
        if (race.RacePerks == null || race.RacePerks.Count == 0)
        {
            return;
        }

        for (int i = 0; i < race.RacePerks.Count; i++)
        {
            if (perks.Contains(race.RacePerks[i]))
            {
                traits.text += perks.perk(race.RacePerks[i]).PerkName + "\n";
            }
        }
    }
Exemplo n.º 6
0
        public static void Initialize()
        {
            try
            {
                ModSettings.Version = ModAPI.Mods.LoadedMods["ChampionsOfForest"].Version;
                if (SteamDSConfig.isDedicated)
                {
                    ModAPI.Log.Write("isDedicated true");
                    ModSettings.IsDedicated = true;
                }

                if (ModSettings.IsDedicated)
                {
                    DedicatedServer.COTFDS.ReadDediServerConfig();
                    new GameObject("NetworkManagerObj").AddComponent <Network.NetworkManager>();
                    GameObject go = new GameObject("Playerobj");
                    go.AddComponent <ModReferences>();
                    ItemDataBase.Initialize();
                    EnemyManager.Initialize();
                    Network.NetworkManager.instance.onGetMessage += Network.CommandReader.OnCommand;
                    ExpEvents.Initialize();
                    return;
                }

                ModSettings.DifficultyChosen = false;
                if (SceneManager.GetActiveScene().name == "TitleScene")
                {
                    new GameObject("Resource Manager").AddComponent <ResourceLoader>();
                    ResourceLoader.InMainMenu = true;
                    MainMenuVisual.Create();
                }
                else
                {
                    ResourceLoader.InMainMenu = false;
                    NetworkPlayerStats.Reset();
                    COTFEvents.ClearEvents();

                    new GameObject("NetworkManagerObj").AddComponent <Network.NetworkManager>();
                    GameObject go           = new GameObject("__COTFPlayerobj__");
                    var        moddedPlayer = go.AddComponent <ModdedPlayer>();
                    moddedPlayer.SetStats();
                    go.AddComponent <Inventory>();
                    go.AddComponent <ModReferences>();
                    go.AddComponent <SpellCaster>();
                    go.AddComponent <ClientItemPicker>();
                    go.AddComponent <MeteorSpawner>();
                    go.AddComponent <BlackFlame>();
                    go.AddComponent <AsyncHit>();
                    go.AddComponent <GlobalSFX>();
                    go.AddComponent <TheFartCreator>();
                    go.AddComponent <RCoroutines>();
                    go.AddComponent <ActiveSpellManager>();
                    new GameObject("MainMenuObj").AddComponent <MainMenu>();


                    // go.AddComponent<Crafting>();
                    Network.CommandInitializer.Init();
                    CustomCrafting.Init();
                    BuffDB.FillBuffList();
                    ItemDataBase.Initialize();
                    SpellDataBase.Initialize();
                    EnemyManager.Initialize();
                    Network.NetworkManager.instance.onGetMessage += Network.CommandReader.OnCommand;
                    Buildings.InitBuildings();
                    PerkDatabase.FillPerkList();
                    ExpEvents.Initialize();
                    Portal.InitializePortals();
                    CoopCustomWeapons.Init();
                    BallLightning.InitPrefab();
                    ResourceInitializer.SetupMeshesFromOtherAssets();
                    Cataclysm.AssignPrefabs();
                    MarkEnemy.AssignTextures();
                }
            }
            catch (Exception ex)
            {
                ModAPI.Log.Write(ex.ToString());
            }
        }
Exemplo n.º 7
0
 void LoadAuxillaryDatabases()
 {
     // PERK database
     _perkDatabase = AssetDatabase.LoadAssetAtPath <PerkDatabase>(perkAssetPath);
     _perkDatabase.ReloadDatabase();
 }