dat opts solved

master
Henrique 13 years ago
parent 8a179ea585
commit c3deadf916

@ -42,6 +42,44 @@ namespace Otc
"6207862794310902180176810615217550567108238764764442605581471797" "6207862794310902180176810615217550567108238764764442605581471797"
"07119674283982419152118103759076030616683978566631413"; "07119674283982419152118103759076030616683978566631413";
enum DatFlag {
Bank = 0,
Clip,
Bottom,
Top,
Container,
Cumulative,
ForceUse,
MultiUse,
Write,
WriteOnce,
LiquidContainer,
LiquidPool,
Unpass,
Unmove,
Unsight,
Avout,
Take,
Hang,
HookSouth,
HookEast,
Rotate,
Light,
DontHide,
Translucent,
Shift,
Height,
LyingObject,
AnimateAlways,
Automap,
LensHelp,
FullBank,
IgnoreLook,
Clothes,
Animation,
LastDatFlag
};
enum ThingAttributesGroup { enum ThingAttributesGroup {
ThingNoGroup = 0, ThingNoGroup = 0,
ThingGroundGroup, ThingGroundGroup,

@ -111,115 +111,116 @@ void DatManager::parseThingAttributes(std::stringstream& fin, ThingAttributes& t
void DatManager::parseThingAttributesOpt(std::stringstream& fin, ThingAttributes& thingAttributes, uint8 opt) void DatManager::parseThingAttributesOpt(std::stringstream& fin, ThingAttributes& thingAttributes, uint8 opt)
{ {
switch(opt) { switch(opt) {
case 0x00: // Ground tile case Otc::Bank: // Ground tile
thingAttributes.speed = Fw::getU16(fin); thingAttributes.speed = Fw::getU16(fin);
thingAttributes.group = Otc::ThingGroundGroup; thingAttributes.group = Otc::ThingGroundGroup;
break; break;
case 0x01: // Must be drawn behind creatures foot, e.g.: ground, carpets, borders... case Otc::Clip: // Ground borders
thingAttributes.alwaysOnTop = true; thingAttributes.alwaysOnTop = true;
thingAttributes.alwaysOnTopOrder = 1; thingAttributes.alwaysOnTopOrder = 1;
break; break;
case 0x02: // Must be drawn over tile items, e.g.: trees, walls, stairs, rocks, statues... case Otc::Bottom: // Bottom items
thingAttributes.alwaysOnTop = true; thingAttributes.alwaysOnTop = true;
thingAttributes.alwaysOnTopOrder = 2; thingAttributes.alwaysOnTopOrder = 2;
break; break;
case 0x03: // Can walk trough and must be drawn over creatures, e.g: open doors, arces, bug pen fence case Otc::Top: // Top items
thingAttributes.alwaysOnTop = true; thingAttributes.alwaysOnTop = true;
thingAttributes.alwaysOnTopOrder = 3; thingAttributes.alwaysOnTopOrder = 3;
break; break;
case 0x04: // Container case Otc::Container: // Container
thingAttributes.group = Otc::ThingContainerGroup; thingAttributes.group = Otc::ThingContainerGroup;
break; break;
case 0x05: // Stackable case Otc::Cumulative: // Stackable
thingAttributes.stackable = true; thingAttributes.stackable = true;
break; break;
case 0x06: // Unknown, some corpses, stairs, even ground ???? case Otc::ForceUse: // Unknown, some corpses, stairs, even ground ????
break; break;
case 0x07: // Useable case Otc::MultiUse: // Useable
thingAttributes.useable = true; thingAttributes.useable = true;
break; break;
case 0x08: // Writtable case Otc::Write: // Writtable
thingAttributes.group = Otc::ThingWriteableGroup; thingAttributes.group = Otc::ThingWriteableGroup;
thingAttributes.readable = true; thingAttributes.readable = true;
thingAttributes.subParam08 = Fw::getU16(fin); thingAttributes.subParam08 = Fw::getU16(fin);
break; break;
case 0x09: // Writtable once case Otc::WriteOnce: // Writtable once. objects that can't be edited by players
// Writtable objects that can't be edited by players
thingAttributes.readable = true; thingAttributes.readable = true;
thingAttributes.subParam08 = Fw::getU16(fin); thingAttributes.subParam08 = Fw::getU16(fin);
break; break;
case 0x0A: // Fluid containers case Otc::LiquidContainer: // Fluid containers
thingAttributes.group = Otc::ThingFluidGroup; thingAttributes.group = Otc::ThingFluidGroup;
Fw::getU8(fin); Fw::getU8(fin);
break; break;
case 0x0B: // Splashes case Otc::LiquidPool: // Splashes
thingAttributes.group = Otc::ThingSplashGroup; thingAttributes.group = Otc::ThingSplashGroup;
break; break;
case 0x0C: // Blocks solid objects (creatures, walls etc) case Otc::Unpass: // Blocks solid objects (creatures, walls etc)
thingAttributes.blockSolid = true; thingAttributes.blockSolid = true;
break; break;
case 0x0D: // Not moveable case Otc::Unmove: // Not moveable
thingAttributes.moveable = false; thingAttributes.moveable = false;
break; break;
case 0x0E: // Blocks missiles (walls, magic wall etc) case Otc::Unsight: // Blocks missiles (walls, magic wall etc)
thingAttributes.blockProjectile = true; thingAttributes.blockProjectile = true;
break; break;
case 0x0F: // Blocks pathfind algorithms (monsters) case Otc::Avout: // Blocks pathfind algorithms (monsters)
thingAttributes.blockPathFind = true; thingAttributes.blockPathFind = true;
break; break;
case 0x10: // Pickupable case Otc::Take: // Pickupable
thingAttributes.pickupable = true; thingAttributes.pickupable = true;
break; break;
case 0x11: // Hangable objects (wallpaper etc) case Otc::Hang: // Hangable objects (wallpaper etc)
thingAttributes.isHangable = true; thingAttributes.isHangable = true;
break; break;
case 0x12: // Horizontal wall case Otc::HookSouth: // Horizontal wall??
thingAttributes.isHorizontal = true; thingAttributes.isHorizontal = true;
break; break;
case 0x13: // Vertical wall case Otc::HookEast: // Vertical wall??
thingAttributes.isVertical = true; thingAttributes.isVertical = true;
break; break;
case 0x14: // Rotable case Otc::Rotate: // Rotable
thingAttributes.rotable = true; thingAttributes.rotable = true;
break; break;
case 0x15: // Light info case Otc::Light: // Light info
thingAttributes.lightLevel = Fw::getU16(fin); thingAttributes.lightLevel = Fw::getU16(fin);
thingAttributes.lightColor = Fw::getU16(fin); thingAttributes.lightColor = Fw::getU16(fin);
break; break;
case 0x16: // Unknown, just a few monuments case Otc::DontHide: // Unknown, just a few monuments
break; break;
case 0x17: // Changes floor, e.g: holes case Otc::Translucent: // Unknown description
thingAttributes.changesFloor = true; thingAttributes.changesFloor = true;
break; break;
case 0x18: // Thing must be drawed with offset case Otc::Shift: // Thing must be drawed with offset
thingAttributes.hasHeight = true; thingAttributes.hasHeight = true;
thingAttributes.drawOffset = Fw::getU8(fin); thingAttributes.drawOffset = Fw::getU8(fin);
Fw::getU8(fin); Fw::getU8(fin);
Fw::getU16(fin); Fw::getU16(fin);
break; break;
case 0x19: // pixels characters height case Otc::Height: // pixels characters height
thingAttributes.drawNextOffset = Fw::getU8(fin); thingAttributes.drawNextOffset = Fw::getU8(fin);
Fw::getU8(fin); Fw::getU8(fin);
break; break;
case 0x1A: // Unknown, some corpses case Otc::LyingObject: // Unknown, some corpses
//thingAttributes.hasHeight = true; //thingAttributes.hasHeight = true;
break; break;
case 0x1B: case Otc::AnimateAlways: // Unknown, check if firesword is a kind of AnimateAlways.
break; break;
case 0x1C: // Minimap color case Otc::Automap: // Minimap color
thingAttributes.miniMapColor = Fw::getU16(fin); thingAttributes.miniMapColor = Fw::getU16(fin);
thingAttributes.hasMiniMapColor = true; thingAttributes.hasMiniMapColor = true;
break; break;
case 0x1D: // Unknown case Otc::LensHelp: // Unknown
if(Fw::getU16(fin) == 1112) if(Fw::getU16(fin) == 1112)
thingAttributes.readable = true; thingAttributes.readable = true;
break; break;
case 0x1E: // Unknown, only grounds case Otc::FullBank: // Ground has no transparent pixels.
break; break;
case 0x1F: // Unknown, borders that cant walk into? case Otc::IgnoreLook: // Ignore look, then looks at the item on the bottom of it.
thingAttributes.lookThrough = true; thingAttributes.lookThrough = true;
break; break;
case 0x20: // Unknown case Otc::Clothes: // Unknown
break;
case Otc::Animation: // Not used in 8.62
break; break;
default: default:
throw std::runtime_error(Fw::mkstr("unknown .dat byte code: 0x", std::hex, (int)opt)); throw std::runtime_error(Fw::mkstr("unknown .dat byte code: 0x", std::hex, (int)opt));

Loading…
Cancel
Save