Ejemplo n.º 1
0
 public static CharacterBankSave getSaveStructure()
 {
     CharacterBankSave data = new CharacterBankSave();
     data.char_x = new int[NUM_PERSON_IDS];
     data.char_y = new int[NUM_PERSON_IDS];
     data.char_room = new PlaceID[NUM_PERSON_IDS];
     for (int i = 0; i < NUM_PERSON_IDS; i++)
     {
         Character c1 = mCharMap[(PersonID)i];
         data.char_x[i] = c1.getX();
         data.char_y[i] = c1.getY();
         data.char_room[i] = mRoomMap[(PersonID)i];
     }
     return data;
 }
Ejemplo n.º 2
0
        public static void unpackDefaultData()
        {
            HeroSave hSave = new HeroSave();
            hSave.x = 25 * 32;
            hSave.y = 4 * 32;
            hSave.dir = Direction.North;
            hSave.inventorySave = new Inventory().getSaveStructure();
            hSave.monologueSave = new InnerMonologue().getSaveStructure();
            hSave.name = "No name";
            hSave.reputationSave = new int[] { 0, 0, 0, 0, 0 };
            hSave.followerID = PersonID.None;
            Hero.instance.loadSaveStructure(hSave);

            KeyboardManager.loadDefaultKeys();

            QuestState[] defQuests = new QuestState[Quest.NUM_QUEST_IDS];   //should all be 0 when initialized
            defQuests[(int)QuestID.FoodFight] = QuestState.Available;
            Quest.loadQuestStateSave(defQuests);

            WorldManager.clearMaps();
            WorldManager.setRoomNoTransition(PlaceID.StudentLounge);

            GameClock.renewClock();

            CharacterBankSave characterSave = new CharacterBankSave();
            characterSave.char_x = new int[CharacterManager.NUM_PERSON_IDS];
            characterSave.char_y = new int[CharacterManager.NUM_PERSON_IDS];
            characterSave.char_room = new PlaceID[CharacterManager.NUM_PERSON_IDS];

            characterSave.char_x[(int)PersonID.Phil] = 23 * 32;
            characterSave.char_y[(int)PersonID.Phil] = 7 * 32;
            characterSave.char_room[(int)PersonID.Phil] = PlaceID.Cafeteria;

            characterSave.char_x[(int)PersonID.Librarian] = 4 * 32;
            characterSave.char_y[(int)PersonID.Librarian] = 4 * 32;
            characterSave.char_room[(int)PersonID.Librarian] = PlaceID.Library;

            characterSave.char_x[(int)PersonID.Artie] = 12 * 32;
            characterSave.char_y[(int)PersonID.Artie] = 8 * 32;
            characterSave.char_room[(int)PersonID.Artie] = PlaceID.Cafeteria;

            characterSave.char_x[(int)PersonID.Bill] = 16 * 32;
            characterSave.char_y[(int)PersonID.Bill] = 14 * 32;
            characterSave.char_room[(int)PersonID.Bill] = PlaceID.Cafeteria;

            characterSave.char_x[(int)PersonID.Claude] = 25 * 32;
            characterSave.char_y[(int)PersonID.Claude] = 18 * 32;
            characterSave.char_room[(int)PersonID.Claude] = PlaceID.Cafeteria;

            characterSave.char_x[(int)PersonID.Jay1] = 4 * 32;
            characterSave.char_y[(int)PersonID.Jay1] = 18 * 32;
            characterSave.char_room[(int)PersonID.Jay1] = PlaceID.Cafeteria;

            characterSave.char_x[(int)PersonID.Jay2] = 10 * 32;
            characterSave.char_y[(int)PersonID.Jay2] = 2 * 32;
            characterSave.char_room[(int)PersonID.Jay2] = PlaceID.Cafeteria;

            characterSave.char_x[(int)PersonID.Jay3] = 14 * 32;
            characterSave.char_y[(int)PersonID.Jay3] = 18 * 32;
            characterSave.char_room[(int)PersonID.Jay3] = PlaceID.Cafeteria;

            characterSave.char_x[(int)PersonID.Jay4] = 20 * 32;
            characterSave.char_y[(int)PersonID.Jay4] = 2 * 32;
            characterSave.char_room[(int)PersonID.Jay4] = PlaceID.Cafeteria;

            characterSave.char_x[(int)PersonID.BraceFace] = 10 * 32;
            characterSave.char_y[(int)PersonID.BraceFace] = 10 * 32;
            characterSave.char_room[(int)PersonID.BraceFace] = PlaceID.Math;

            characterSave.char_x[(int)PersonID.Fitz] = 19 * 32;
            characterSave.char_y[(int)PersonID.Fitz] = 13 * 32;
            characterSave.char_room[(int)PersonID.Fitz] = PlaceID.ComputerLab;

            characterSave.char_x[(int)PersonID.ROB] = 8 * 32;
            characterSave.char_y[(int)PersonID.ROB] = 11 * 32;
            characterSave.char_room[(int)PersonID.ROB] = PlaceID.Science;

            characterSave.char_x[(int)PersonID.Enforcer] = 11 * 32;
            characterSave.char_y[(int)PersonID.Enforcer] = 49 * 32;
            characterSave.char_room[(int)PersonID.Enforcer] = PlaceID.HallwayWest;

            characterSave.char_x[(int)PersonID.Tyke] = 11 * 32;
            characterSave.char_y[(int)PersonID.Tyke] = 6 * 32;
            characterSave.char_room[(int)PersonID.Tyke] = PlaceID.Entrance;

            characterSave.char_x[(int)PersonID.Dyke] = 18 * 32;
            characterSave.char_y[(int)PersonID.Dyke] = 11 * 32;
            characterSave.char_room[(int)PersonID.Dyke] = PlaceID.StudentLounge;

            characterSave.char_x[(int)PersonID.Shaq] = 23 * 32;
            characterSave.char_y[(int)PersonID.Shaq] = 3 * 32;
            characterSave.char_room[(int)PersonID.Shaq] = PlaceID.HallwayEast;

            characterSave.char_x[(int)PersonID.Herbert] = 3 * 32;
            characterSave.char_y[(int)PersonID.Herbert] = 40 * 32;
            characterSave.char_room[(int)PersonID.Herbert] = PlaceID.HallwayWest;

            characterSave.char_x[(int)PersonID.Avery] = 8 * 32;
            characterSave.char_y[(int)PersonID.Avery] = 7 * 32;
            characterSave.char_room[(int)PersonID.Avery] = PlaceID.StudentLounge;

            characterSave.char_x[(int)PersonID.Boris] = 25 * 32;
            characterSave.char_y[(int)PersonID.Boris] = 5 * 32;
            characterSave.char_room[(int)PersonID.Boris] = PlaceID.Entrance;

            characterSave.char_x[(int)PersonID.Jarvis] = 17 * 32;
            characterSave.char_y[(int)PersonID.Jarvis] = 15 * 32;
            characterSave.char_room[(int)PersonID.Jarvis] = PlaceID.Entrance;

            characterSave.char_x[(int)PersonID.Zeke] = 10 * 32;
            characterSave.char_y[(int)PersonID.Zeke] = 4 * 32;
            characterSave.char_room[(int)PersonID.Zeke] = PlaceID.Bathroom;

            /*
            Fitz,
            ROB,
            Enforcer,
            Tyke,
            Dyke,
            Shaq,
            Herbert,
            Avery,
            Boris,
            Jarvis,
            Zeke
             */

            CharacterManager.loadSaveStructure(characterSave);
        }
Ejemplo n.º 3
0
 public static void loadSaveStructure(CharacterBankSave save)
 {
     for (int i = 0; i < NUM_PERSON_IDS && i < save.char_x.Length; i++)
     {
         Character c1 = mCharMap[(PersonID)i];
         c1.setX(save.char_x[i]);
         c1.setY(save.char_y[i]);
         c1.reset();
         if (mRoomMap.ContainsKey((PersonID)i))
             WorldManager.removeObjectFromRoom(c1, mRoomMap[(PersonID)i]);
         WorldManager.addObjectToRoom(c1, save.char_room[i]);
         mRoomMap[(PersonID)i] = save.char_room[i];
     }
 }