Prev: C052 Up: Map Next: C11B
C063: Every object and every character, by number
A FIND_RECORD table of 61 objects, whose values are the objects' own records. The keys come in two runs: $00 to $2B without a gap, then $3C to $4C. The second run is the characters -- every one of the nine seen wandering in a single turn had its number here, and ACTING, which says who a sentence is about, holds numbers from that same run. So a character is an object with a number in the upper block, not a separate kind of thing.
Object 0 is the player: ACTING, which is zero when a sentence is about you, holds object numbers, and object 0's location is where the player is.
A record is a 16-byte head, then the locations the object is in -- byte 0 of the head says how many -- then its own action handlers (see FIND_OBJECT_HANDLER). Watched rather than inferred: over several turns the one byte that changes in any character's record is the first of those locations, as it wanders; and when the player walked east out of Bag End and back, object 0's location went 1, 4, 1, matching at every step the location whose picture DRAW_LOCATION_PICTURE looked up. Most things are in one place; the ones in several are fixtures between rooms. Object 5 is in locations 1 and 4 -- exactly the two rooms that walk went between, so it is the round green door.
The head, as far as it is known. Byte 1 is what holds the object or has it inside, $FF for nothing: see SHUT_IN. Byte 2 is its size and byte 3 its weight, and for a character byte 3 is the most it can carry: the routine at CAN_LIFT compares a thing's weight and load with the actor's byte 3 and fails with "is too heavy to lift", the one at GIVE_TOO_MUCH with "you are carrying too much", and the one at DO_CLIMB_INTO_1 compares the actor's size with the room in the thing at byte 2 and fails with "you are too big". Doors, walls and fixtures are $FF in both. Bytes 14 and 15, where not zero, are the object's own description: the map's says there seem to be symbols on it that you cannot read, printed through RUN_MESSAGE. Byte 4's low four bits say how things are placed with this object, as PLACED_WORD prints it: 0 in, 1 on, 2 behind (the curtain, which the wall is behind), 3 under (the trap door), 4 tied to (the rope). Its bits 4 to 6 are sides (see SAME_SIDE): 1 for the player, Gandalf, Thorin and Bard; 2 for Gollum and the goblins; 4 for the wood elf and the butler; 5 for Elrond, on two; bit 7 is on the window alone. Byte 5 is strength and byte 6 defence, what DO_ATTACK weighs, and both wear down with wounds -- and a fall in the dark halves the player's strength.
Byte 7, the flags. Bit 7: there, to be seen and reached -- IN_REACH wants it, and the only two objects without it are the mountains' side door, which is secret, and the butler. Bit 6: a character -- set on the player and the seventeen others, objects $3C to $4C, and on nothing else, and what FIND_NAMED_OBJECT's mode picks on. Bit 5: can be seen into, which SHUT_IN climbs through; the characters have it, and the goblins' cache and the wooden boat. Bit 1: a liquid -- exactly the wine and the four waters, and the rivers. Bit 2, on a container, is full: DRINK and EMPTY clear it, and FILL will not fill what has it. Bit 3 is dead, or broken: KILL sets it on a character, and a struck spider web has it until it is mended. Bit 4 gives light: it is on exactly the sword and the torch, and nothing else, as Wilderland also has it. Bits 2, 3 and 4 together are what TOO_DARK reads on the sword; the torch has the same flags. Bit 5 is also a door's being open: OPEN sets it and CLOSE clears it, and CAN_PASS will not let anyone through a way whose object has neither it nor bit 3. Bit 0 is locked: LOCK sets it and UNLOCK clears it, and it is on four doors to start with.
OBJECT_INDEX C063 DEFB $00 $00: you
C064 DEFW PLAYER
C066 DEFB $01 $01: heavy rock door
C067 DEFW HEAVY_ROCK_DOOR
C069 DEFB $02 $02: small curious key
C06A DEFW SMALL_CURIOUS_KEY
C06C DEFB $03 $03: curious map
C06D DEFW CURIOUS_MAP
C06F DEFB $04 $04: large key
C070 DEFW LARGE_KEY
C072 DEFB $05 $05: round green door
C073 DEFW ROUND_GREEN_DOOR
C075 DEFB $06 $06: small insignificant crack
C076 DEFW SMALL_INSIGNIFICANT_CRACK
C078 DEFB $07 $07: spider web
C079 DEFW SPIDER_WEB
C07B DEFB $08 $08: red door
C07C DEFW RED_DOOR
C07E DEFB $09 $09: fast black river
C07F DEFW FAST_BLACK_RIVER
C081 DEFB $0A $0A: goblins back door
C082 DEFW GOBLINS_BACK_DOOR
C084 DEFB $0B $0B: mountains side door
C085 DEFW MOUNTAINS_SIDE_DOOR
C087 DEFB $0C $0C: large trap door
C088 DEFW LARGE_TRAP_DOOR
C08A DEFB $0D $0D: magic door
C08B DEFW MAGIC_DOOR
C08D DEFB $0E $0E: short strong sword
C08E DEFW SHORT_STRONG_SWORD
C090 DEFB $0F $0F: red key
C091 DEFW RED_KEY
C093 DEFB $10 $10: valuable golden ring
C094 DEFW VALUABLE_GOLDEN_RING
C096 DEFB $11 $11: goblins door
C097 DEFW GOBLINS_DOOR
C099 DEFB $12 $12: rope
C09A DEFW ROPE
C09C DEFB $13 $13: barrel
C09D DEFW BARREL
C09F DEFB $14 $14: wine
C0A0 DEFW WINE
C0A2 DEFB $15 $15: water
C0A3 DEFW WATER
C0A5 DEFB $16 $16: black water
C0A6 DEFW BLACK_WATER
C0A8 DEFB $17 $17: water
C0A9 DEFW WATER_OBJ17
C0AB DEFB $18 $18: black water
C0AC DEFW BLACK_WATER_OBJ18
C0AE DEFB $19 $19: bow
C0AF DEFW BOW
C0B1 DEFB $1A $1A: strong arrow
C0B2 DEFW STRONG_ARROW
C0B4 DEFB $1B $1B: window
C0B5 DEFW WINDOW
C0B7 DEFB $1C $1C: torch
C0B8 DEFW TORCH
C0BA DEFB $1D $1D: sand
C0BB DEFW SAND
C0BD DEFB $1E $1E: trap door
C0BE DEFW TRAP_DOOR
C0C0 DEFB $1F $1F: goblins cache
C0C1 DEFW GOBLINS_CACHE
C0C3 DEFB $20 $20: heavy curtain
C0C4 DEFW HEAVY_CURTAIN
C0C6 DEFB $21 $21: large cupboard
C0C7 DEFW LARGE_CUPBOARD
C0C9 DEFB $22 $22: food
C0CA DEFW FOOD
C0CC DEFB $23 $23: valuable treasure
C0CD DEFW VALUABLE_TREASURE
C0CF DEFB $24 $24: wall
C0D0 DEFW WALL
C0D2 DEFB $25 $25: wooden chest
C0D3 DEFW WOODEN_CHEST
C0D5 DEFB $26 $26: lunch
C0D6 DEFW LUNCH
C0D8 DEFB $27 $27: strong portcullis
C0D9 DEFW STRONG_PORTCULLIS
C0DB DEFB $28 $28: stone
C0DC DEFW STONE
C0DE DEFB $29 $29: wooden boat
C0DF DEFW WOODEN_BOAT
C0E1 DEFB $2A $2A: fast river
C0E2 DEFW FAST_RIVER
C0E4 DEFB $2B $2B: golden key
C0E5 DEFW GOLDEN_KEY
C0E7 DEFB $3C $3C: red golden dragon
C0E8 DEFW RED_GOLDEN_DRAGON
C0EA DEFB $3D $3D: nasty goblin
C0EB DEFW NASTY_GOBLIN
C0ED DEFB $3E $3E: gandalf
C0EE DEFW GANDALF
C0F0 DEFB $3F $3F: thorin
C0F1 DEFW THORIN
C0F3 DEFB $40 $40: wood elf
C0F4 DEFW WOOD_ELF
C0F6 DEFB $41 $41: elrond
C0F7 DEFW ELROND
C0F9 DEFB $42 $42: butler
C0FA DEFW BUTLER
C0FC DEFB $43 $43: vicious warg
C0FD DEFW VICIOUS_WARG
C0FF DEFB $44 $44: gollum
C100 DEFW GOLLUM
C102 DEFB $45 $45: hideous goblin
C103 DEFW HIDEOUS_GOBLIN
C105 DEFB $46 $46: bard
C106 DEFW BARD
C108 DEFB $47 $47: hideous troll
C109 DEFW HIDEOUS_TROLL
C10B DEFB $48 $48: vicious troll
C10C DEFW VICIOUS_TROLL
C10E DEFB $49 $49: horrible goblin
C10F DEFW HORRIBLE_GOBLIN
C111 DEFB $4A $4A: mean goblin
C112 DEFW MEAN_GOBLIN
C114 DEFB $4B $4B: vicious goblin
C115 DEFW VICIOUS_GOBLIN
C117 DEFB $4C $4C: disgusting goblin
C118 DEFW DISGUSTING_GOBLIN
C11A DEFB $FF End of the index
Prev: C052 Up: Map Next: C11B