Structure for saving data about a Hero.
Esempio n. 1
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);
        }
Esempio n. 2
0
 /// <summary>
 /// Used for loading purposes
 /// </summary>
 /// <param name="data">The save data for the Hero</param>
 public void loadSaveStructure(HeroSave data)
 {
     this.setX(data.x);
     this.setY(data.y);
     this.setDirection(data.dir);
     this.setName(data.name);
     this.inventory.loadSaveStructure(data.inventorySave);
     this.monologue.loadSaveStructure(data.monologueSave);
     if (data.reputationSave.Length >= 5)
     {
         this.nerdRep = data.reputationSave[0];
         this.jockRep = data.reputationSave[1];
         this.prepRep = data.reputationSave[2];
         this.bullyRep = data.reputationSave[3];
         this.slackerRep = data.reputationSave[4];
     }
     this.setFollower(data.followerID);
     this.resetAnimation();
 }