var gotDoll = 0;

sub manpa () {
   setSceneDimensions (800, 600);
   stopSound ('inoffice/lounging.mp3');
   loopSound ('ma-n-pa/greasy.mp3');
   addOverlay ('ma-n-pa/room.tga', 0, 0);
   setFloor ('ma-n-pa/room.flo');
   setScale (0, 550);
   setZBuffer ('ma-n-pa/room.zbu');
 if (gotDoll == 0) {
   addCharacter (dollOnShelf, 390, 400, costume (
        anim ('iface/act1-1.duc', 51), NULL, NULL));
 }
   setCharacterExtra (dollOnShelf, NOZBUFFER + FIXEDSIZE);
   addCharacter (sam, 25, 459, makeEgoAnim ());
   addCharacter (max, 63, 457, makeMaxAnim ());
   moveCharacter (sam, 137, 466);
   addScreenRegion (outOfManPa, 1, 155, 48, 495, 40, 467, WEST);
   addScreenRegion (otherDoll, 307, 385, 335, 416, 318, 529, NORTH);
}

objectType outOfManPa ("leave Ma & Pa") {
  event oneCursor = arrowEast;
  event onlyAction {
     gotoRoom (outoffice);
  }
}

objectType dollOnShelf ("doll") {
  event lookAt {
      moveCharacter (sam, 387, 524);
      turnCharacter (sam, NORTH);
     Say (sam, "It's a sickeningly-cute doll.");
     if (dollDescription == 1) {
        Say (sam, "It matches the little girl's description perfectly, except this one has blonde hair.");
     }
  }
  event pickUp {
    if (dollDescription == 1) { Say (sam, "This doll is the closest to the girl's description."); }
     Say (sam, "Since Ma and Pa aren't here yet, I'll just take this.");
     moveCharacter (sam, 392, 523);
     turnCharacter (sam, NORTH);
     removeCharacter (dollOnShelf);
     pushToStack (inventory, doll);
     Say (max, "Sam, you just put an unholy piece of shameless marketing into your inventory!");
     Say (sam, "True, but it's all in the name of justice and liberty.");
     Say (max, "Yeah right.");
     gotDoll = 1;
  }
}

objectType otherDoll ("doll") {
  event lookAt {
     Say (sam, "It's a sickeningly-cute doll.");
     if (dollDescription == 1) {
        Say (sam, "It matches the little girl's description perfectly, except this one has differently-colored clothes.");
     }
  }
  event pickUp {
     if (dollDescription == 1) {
        Say (sam, "No, this one doesn't match her description closely enough.");
     }
     else {
        Say (sam, "It's not my style.");
     }
  }
}