示例#1
0
    void Start()
    {
        StreamReader reader = new StreamReader(@"X:\TLRPGdata\Enemies\Enemies.txt");
        string       s      = reader.ReadLine();

        string[] data;
        while (s != null)        //Load enemies
        {
            data = s.Split('~');
            Enemy e = new Enemy();
            e.name = data[0];
            e.id   = data[1];
            e.hp   = CommandsLoadSave.IntParseFast(data[2]);
            e.atk  = CommandsLoadSave.IntParseFast(data [3]);
            e.atk  = CommandsLoadSave.IntParseFast(data [4]);

            s    = reader.ReadLine();
            data = s.Split('~');

            var i = 0;
            while (i != data.Length)
            {
                e.loot.Add(data [i]);
                i++;
            }
            EnemyStructs.Add(e);
            EnemyIds.Add(e.id);
            s = reader.ReadLine();
            s = reader.ReadLine();
        }
    }
示例#2
0
    void Awake()
    {
        var loader = GameObject.Find("Commander");

        loaderScript = loader.GetComponent <CommandsLoadSave> ();
        AddToList();
    }
示例#3
0
    void Start()
    {
        Application.runInBackground              = true;
        TwitchChatClient.singleton.userName      = "******";
        TwitchChatClient.singleton.oAuthPassword = "******";
        TwitchChatClient.singleton.JoinChannel("twitchlandrpg");
        TwitchChatClient.singleton.AddChatListener(OnChatMessage);
        TwitchChatClient.singleton.EnableWhispers();

        commandsTutorial    = Commander.GetComponent <CommandsTutorial> ();
        commandsTravel      = Commander.GetComponent <CommandsTravel> ();
        commandsLoadSave    = Commander.GetComponent <CommandsLoadSave> ();
        commandsManageStats = Commander.GetComponent <CommandsManageStats> ();
        //commandsEquip = Commander.GetComponent<CommandsEquip> ();
        commandsMisc = Commander.GetComponent <CommandsMisc> ();

        playerCreator = PlayerCreator.GetComponent <PlayerCreator> ();
    }
示例#4
0
    void Start()
    {
        StreamReader reader = new StreamReader(@"X:\TLRPGdata\Items\EquipsHats.txt");
        string       s      = reader.ReadLine();

        string[] data;
        while (s != null)
        {
            data = s.Split('~');
            Equip e = new Equip();
            e.name      = data[0];
            e.id        = data[1];
            e.sellPrice = CommandsLoadSave.IntParseFast(data[2]);
            e.slot      = 0;

            s          = reader.ReadLine();
            data       = s.Split('~');
            e.stats[0] = CommandsLoadSave.IntParseFast(data[0]);
            e.stats[1] = CommandsLoadSave.IntParseFast(data[1]);
            e.stats[2] = CommandsLoadSave.IntParseFast(data[2]);
            e.stats[3] = CommandsLoadSave.IntParseFast(data[3]);
            e.stats[4] = CommandsLoadSave.IntParseFast(data[4]);

            EquipStructs.Add(e);
            EquipIds.Add(e.id);

            s = reader.ReadLine();
            s = reader.ReadLine();
        }

        reader = new StreamReader(@"X:\TLRPGdata\Items\EquipsBods.txt");
        s      = reader.ReadLine();
        while (s != null)
        {
            data = s.Split('~');
            Equip e = new Equip();
            e.name      = data[0];
            e.id        = data[1];
            e.sellPrice = CommandsLoadSave.IntParseFast(data[2]);
            e.slot      = 1;

            s          = reader.ReadLine();
            data       = s.Split('~');
            e.stats[0] = CommandsLoadSave.IntParseFast(data[0]);
            e.stats[1] = CommandsLoadSave.IntParseFast(data[1]);
            e.stats[2] = CommandsLoadSave.IntParseFast(data[2]);
            e.stats[3] = CommandsLoadSave.IntParseFast(data[3]);
            e.stats[4] = CommandsLoadSave.IntParseFast(data[4]);

            EquipStructs.Add(e);
            EquipIds.Add(e.id);

            s = reader.ReadLine();
            s = reader.ReadLine();
        }

        reader = new StreamReader(@"X:\TLRPGdata\Items\EquipsWeps.txt");
        s      = reader.ReadLine();
        while (s != null)
        {
            data = s.Split('~');
            Equip e = new Equip();
            e.name      = data[0];
            e.id        = data[1];
            e.sellPrice = CommandsLoadSave.IntParseFast(data[2]);
            e.slot      = 2;

            s          = reader.ReadLine();
            data       = s.Split('~');
            e.stats[0] = CommandsLoadSave.IntParseFast(data[0]);
            e.stats[1] = CommandsLoadSave.IntParseFast(data[1]);
            e.stats[2] = CommandsLoadSave.IntParseFast(data[2]);
            e.stats[3] = CommandsLoadSave.IntParseFast(data[3]);
            e.stats[4] = CommandsLoadSave.IntParseFast(data[4]);

            EquipStructs.Add(e);
            EquipIds.Add(e.id);

            s = reader.ReadLine();
            s = reader.ReadLine();
        }

        reader = new StreamReader(@"X:\TLRPGdata\Items\EquipsAccs.txt");
        s      = reader.ReadLine();
        while (s != null)
        {
            data = s.Split('~');
            Equip e = new Equip();
            e.name      = data[0];
            e.id        = data[1];
            e.sellPrice = CommandsLoadSave.IntParseFast(data[2]);
            e.slot      = 3;

            s          = reader.ReadLine();
            data       = s.Split('~');
            e.stats[0] = CommandsLoadSave.IntParseFast(data[0]);
            e.stats[1] = CommandsLoadSave.IntParseFast(data[1]);
            e.stats[2] = CommandsLoadSave.IntParseFast(data[2]);
            e.stats[3] = CommandsLoadSave.IntParseFast(data[3]);
            e.stats[4] = CommandsLoadSave.IntParseFast(data[4]);

            EquipStructs.Add(e);
            EquipIds.Add(e.id);

            s = reader.ReadLine();
            s = reader.ReadLine();
        }

        reader = new StreamReader(@"X:\TLRPGdata\Items\Resources.txt");
        s      = reader.ReadLine();
        while (s != null)
        {
            data = s.Split('~');
            Resource r = new Resource();
            r.name      = data[0];
            r.id        = data[1];
            r.type      = data[2];
            r.sellPrice = CommandsLoadSave.IntParseFast(data[3]);

            ResourceStructs.Add(r);
            ResourceIds.Add(r.id);

            s = reader.ReadLine();
        }
        reader.Close();
    }