home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / DOOM / EDITOR / DEU51 / SOURCE / NAMES.C < prev    next >
C/C++ Source or Header  |  1994-04-15  |  14KB  |  577 lines

  1. /*
  2.    Doom Editor Utility, by Brendon Wyber and Raphaël Quinet.
  3.  
  4.    If you use any part of this code in one of your programs,
  5.    please make it clear that you borrowed it from here...
  6.  
  7.    NAMES.C - Object name and type routines.
  8. */
  9.  
  10. /* the includes */
  11. #include "deu.h"
  12.  
  13.  
  14. /*
  15.    get the name of an object type
  16. */
  17. char *GetObjectTypeName( int objtype)
  18. {
  19.    switch (objtype)
  20.    {
  21.    case OBJ_THINGS:
  22.       return "Thing";
  23.    case OBJ_LINEDEFS:
  24.       return "LineDef";
  25.    case OBJ_SIDEDEFS:
  26.       return "SideDef";
  27.    case OBJ_VERTEXES:
  28.       return "Vertex";
  29.    case OBJ_SEGS:
  30.       return "Segment";
  31.    case OBJ_SSECTORS:
  32.       return "SSector";
  33.    case OBJ_NODES:
  34.       return "Node";
  35.    case OBJ_SECTORS:
  36.       return "Sector";
  37.    case OBJ_REJECT:
  38.       return "Reject";
  39.    case OBJ_BLOCKMAP:
  40.       return "Blockmap";
  41.    }
  42.    return "< Bug! >";
  43. }
  44.  
  45.  
  46.  
  47. /*
  48.    what are we editing?
  49. */
  50. char *GetEditModeName( int objtype)
  51. {
  52.    switch (objtype)
  53.    {
  54.    case OBJ_THINGS:
  55.       return "Things";
  56.    case OBJ_LINEDEFS:
  57.    case OBJ_SIDEDEFS:
  58.       return "LineDefs & SideDefs";
  59.    case OBJ_VERTEXES:
  60.       return "Vertices";
  61.    case OBJ_SEGS:
  62.       return "Segments";
  63.    case OBJ_SSECTORS:
  64.       return "Seg-Sectors";
  65.    case OBJ_NODES:
  66.       return "Nodes";
  67.    case OBJ_SECTORS:
  68.       return "Sectors";
  69.    }
  70.    return "< Bug! >";
  71. }
  72.  
  73.  
  74.  
  75. /*
  76.    get a short (2 + 13 char.) description of the type of a linedef
  77. */
  78.  
  79. char *GetLineDefTypeName( int type)
  80. {
  81.    switch (type)
  82.    {
  83.    case 0:
  84.       return "-- Normal";
  85.    case 1:
  86.       return "DR Door";
  87.    case 2:
  88.       return "W1 Open door (O)";
  89.    case 3:
  90.       return "W1 Close door";
  91.    /* 4 */
  92.    case 5:
  93.       return "W1 Raise floor?C"; /* highest floor ? */
  94.    /* 6 */
  95.    case 7:
  96.       return "S1 Raise stairs";
  97.    case 8:
  98.       return "W1 Raise stairs";
  99.    case 9:
  100.       return "S1 Lower+neigh.T";
  101.    case 10:
  102.       return "W1 Lower lift";
  103.    case 11:
  104.       return "S- End level";
  105.    /* 12 */
  106.    case 13:
  107.       return "W1 Lights on!";
  108.    case 14:
  109.       return "S1 Raise floor>N";
  110.    /* 15 */
  111.    case 16:
  112.       return "W1 Close door 30";
  113.    /* 17 */
  114.    case 18:
  115.       return "S1 Raise floor N";
  116.    case 19:
  117.       return "W1 Lower floor N";
  118.    case 20:
  119.       return "S1 Raise floor T";
  120.    case 21:
  121.       return "S1 Lower floor<C";
  122.    case 22:
  123.       return "W1 Raise floor T";
  124.    case 23:
  125.       return "S1 Lower floor<?";
  126.    /* 24 25 */
  127.    case 26:
  128.       return "DR Blue door";
  129.    case 27:
  130.       return "DR Yellow door";
  131.    case 28:
  132.       return "DR Red door";
  133.    case 29:
  134.       return "S1 Open door";
  135.    case 30:
  136.       return "W1 Raise floor>?";
  137.    case 31:
  138.       return "D1 Door (stay O)";
  139.    case 32:
  140.       return "D1 Blue door O";
  141.    case 33:
  142.       return "D1 Red door O";
  143.    case 34:
  144.       return "D1 Yellow door O";
  145.    case 35:
  146.       return "W1 Lights out!";
  147.    case 36:
  148.       return "W1 Lower floor>N";
  149.    case 37:
  150.       return "W1 Lower floor T";
  151.    case 38:
  152.       return "W1 Lower floor";
  153.    case 39:
  154.       return "W1 Teleport";
  155.    case 40:
  156.       return "W1 Raise ceiling";
  157.    case 41:
  158.       return "S1 Lower ceiling";
  159.    case 42:
  160.       return "SR Close door";
  161.    /* 43 */
  162.    case 44:
  163.       return "W1 Lower ceil. >";
  164.    /* 45 */
  165.    case 46:
  166.       return "G1 Shoot to open";
  167.    /* 47 */
  168.    case 48:
  169.       return "-- Animated wall";
  170.    /* 49 50 */
  171.    case 51:
  172.       return "S- Secret level";
  173.    case 52:
  174.       return "W- End level";
  175.    /* 53 54 55 */
  176.    case 56:
  177.       return "W1 Raise floor<C";
  178.    /* 57 */
  179.    case 58:
  180.       return "W1 Raise floor32";
  181.    case 59:
  182.       return "W1 Raise floor>T";
  183.    /* 60 */
  184.    case 61:
  185.       return "SR Open door (O)";
  186.    case 62:
  187.       return "WR Raise lift/SL";
  188.    case 63:
  189.       return "SR Open door";
  190.    /* 64 65 66 67 68 69 */
  191.    case 70:
  192.       return "SR Lower floor >";
  193.    /* 71 72 */
  194.    case 73:
  195.       return "WR Crushing ceil";
  196.    case 74:
  197.       return "WR Stop crushing";
  198.    case 75:
  199.       return "WR Close door";
  200.    case 76:
  201.       return "WR Close door 30";
  202.    case 77:
  203.       return "WR Fast crushing";
  204.    /* 78 79 */
  205.    case 80:
  206.       return "WR Lights up N";
  207.    /* 81 */
  208.    case 82:
  209.       return "WR Lower floor";
  210.    /* 83 84 85 */
  211.    case 86:
  212.       return "WR Open door (O)";
  213.    case 87:
  214.       return "WR Moving floor";
  215.    case 88:
  216.       return "WR Lower lift";
  217.    case 89:
  218.       return "WR Stop moving f";
  219.    case 90:
  220.       return "WR Open door";
  221.    case 91:
  222.       return "WR Raise floor C";
  223.    /* 92 93 94 95 96 */
  224.    case 97:
  225.       return "WR Teleport";
  226.    case 98:
  227.       return "WR Lower floor >";
  228.    /* 99 100 101 */
  229.    case 102:
  230.       return "S? Lower floor";
  231.    case 103:
  232.       return "S1 Open Door (O)";
  233.    case 104:
  234.       return "W1 Lights down N";
  235.    }
  236.    return "?? UNKNOWN ?";
  237. }
  238.  
  239.  
  240.  
  241. /*
  242.    get a long description of the type of a linedef
  243. */
  244.  
  245. char *GetLineDefTypeLongName( int type)
  246. {
  247.    switch (type)
  248.    {
  249.    case 0:
  250.       return "-- Normal";
  251.    case 1:
  252.       return "DR Open door (closes after 5 seconds)";
  253.    case 2:
  254.       return "W1 Open door (stays open)";
  255.    case 3:
  256.       return "W1 Close door";
  257.    case 5:
  258.       return "W1 Raise floor to match Ne. ceiling/highest floor ?";
  259.    /* 6 */
  260.    case 7:
  261.       return "S1 Raise stairs (several sectors 0/999)";
  262.    case 8:
  263.       return "W1 Raise stairs (several sectors 0/999)";
  264.    case 9:
  265.       return "S1 Lower floor, raise Ne. floor & match outer texture";
  266.    case 10:
  267.       return "W1 Lower lift (rises after 3 seconds)";
  268.    case 11:
  269.       return "S- End level, go to next level";
  270.    /* 12 */
  271.    case 13:
  272.       return "W1 Light level goes to 255";
  273.    case 14:
  274.       return "S1 Raise floor to 64 above Ne. floor";
  275.    /* 15 */
  276.    case 16:
  277.       return "W1 Close door for 30 seconds";
  278.    /* 17 */
  279.    case 18:
  280.       return "S1 Raise floor to match Ne. floor";
  281.    case 19:
  282.       return "W1 Lower floor to match Ne. floor";
  283.    case 20:
  284.       return "S1 Raise floor to match Ne. floor, texture and type";
  285.    case 21:
  286.       return "S1 Lower floor for 3 seconds, then raise up to Ne. ceiling";
  287.    case 22:
  288.       return "W1 Raise floor to match Ne. floor, texture and type";
  289.    case 23:
  290.       return "S1 Lower floor to match lowest Ne. floor ?";
  291.    /* 24 25 */
  292.    case 26:
  293.       return "DR Open door (closes after 5 seconds), Blue key";
  294.    case 27:
  295.       return "DR Open door (closes after 5 seconds), Yellow key";
  296.    case 28:
  297.       return "DR Open door (closes after 5 seconds), Red key";
  298.    case 29:
  299.       return "S1 Open door (closes after 5 seconds)";
  300.    case 30:
  301.       return "W1 Raise floor to 100-128 above Ne. floor ?";
  302.    case 31:
  303.       return "D1 Open door (stays open)";
  304.    case 32:
  305.       return "D1 Open door (stays open), Blue key";
  306.    case 33:
  307.       return "D1 Open door (stays open), Red key";
  308.    case 34:
  309.       return "D1 Open door (stays open), Yellow key";
  310.    case 35:
  311.       return "W1 Light level goes to 0";
  312.    case 36:
  313.       return "W1 Lower floor to 8 above Ne. floor";
  314.    case 37:
  315.       return "W1 Lower floor to match Ne. floor, texture and type";
  316.    case 38:
  317.       return "W1 Lower floor to match Ne. floor ?";
  318.    case 39:
  319.       return "W1 Teleport to another sector";
  320.    case 40:
  321.       return "W1 Raise ceiling to match Ne. ceiling";
  322.    case 41:
  323.       return "S1 Lower ceiling to floor";
  324.    case 42:
  325.       return "SR Close door";
  326.    /* 43 */
  327.    case 44:
  328.       return "W1 Lower ceiling to 8 above floor";
  329.    /* 45 */
  330.    case 46:
  331.       return "G1 Open door (stays open), when shot";
  332.    /* 47 */
  333.    case 48:
  334.       return "-- Animated wall (scrolls horizontally)";
  335.    /* 49 50 */
  336.    case 51:
  337.       return "S- End level, go to secret level";
  338.    case 52:
  339.       return "W- End level, go to next level";
  340.    /* 53 54 55 */
  341.    case 56:
  342.       return "W1 Raise floor to 8 below Ne. ceiling";
  343.    /* 57 */
  344.    case 58:
  345.       return "W1 Raise floor up 32";
  346.    case 59:
  347.       return "W1 Raise floor up 8 and match Ne. texture and type";
  348.    /* 60 */
  349.    case 61:
  350.       return "SR Open door (stays open)";
  351.    case 62:
  352.       return "WR Raise lift (also a Switch to Lower the lift)";
  353.    case 63:
  354.       return "SR Open door (closes after 5 seconds)";
  355.    /* 64 65 66 67 68 69 */
  356.    case 70:
  357.       return "SR Lower floor to 8 above Ne. floor";
  358.    /* 71 72 */
  359.    case 73:
  360.       return "WR Start crushing ceiling (Slow)";
  361.    case 74:
  362.       return "WR Stop crushing ceiling";
  363.    case 75:
  364.       return "WR Close door";
  365.    case 76:
  366.       return "WR Close door for 30 seconds";
  367.    case 77:
  368.       return "WR Start crushing ceiling (Fast)";
  369.    /* 78 79 */
  370.    case 80:
  371.       return "WR Light level goes to maximum Ne. light level";
  372.    /* 81 */
  373.    case 82:
  374.       return "WR Lower floor to match Ne. floor";
  375.    /* 83 84 85 */
  376.    case 86:
  377.       return "WR Open door (stays open)";
  378.    case 87:
  379.       return "WR Start moving floor (up/down every 5 seconds)";
  380.    case 88:
  381.       return "WR Lower lift (rises after 3 seconds)";
  382.    case 89:
  383.       return "WR Stop moving floor";
  384.    case 90:
  385.       return "WR Open door (closes after 5 seconds)";
  386.    case 91:
  387.       return "WR Raise floor to match Ne. ceiling";
  388.    /* 92 93 94 95 96 */
  389.    case 97:
  390.       return "WR Teleport to another sector";
  391.    case 98:
  392.       return "WR Lower floor to 8 above Ne. floor";
  393.    /* 99 100 101 */
  394.    case 102:
  395.       return "S? Lower floor to match Ne. floor";
  396.    case 103:
  397.       return "S1 Open Door (stays open)";
  398.    case 104:
  399.       return "W1 Light level goes to minimum Ne. light level";
  400.    }
  401.    return "?? UNKNOWN ?";
  402. }
  403.  
  404.  
  405.  
  406. /*
  407.    get a short description of the flags of a linedef
  408. */
  409.  
  410. char *GetLineDefFlagsName( int flags)
  411. {
  412.    int n;
  413.    static char temp[ 20];
  414.  
  415.    if (flags & 0x0100)
  416.       strcpy( temp, "Ma"); /* Already on the map */
  417.    else
  418.       strcpy( temp, "-");
  419.    if (flags & 0x80)
  420.       strcat( temp, "In"); /* Invisible on the map */
  421.    else
  422.       strcat( temp, "-");
  423.    if (flags & 0x40)
  424.       strcat( temp, "So"); /* Blocks sound */
  425.    else
  426.       strcat( temp, "-");
  427.    if (flags & 0x20)
  428.       strcat( temp, "Se"); /* Secret (normal on the map) */
  429.    else
  430.       strcat( temp, "-");
  431.    if (flags & 0x10)
  432.       strcat( temp, "Lo"); /* Lower texture offset changed */
  433.    else
  434.       strcat( temp, "-");
  435.    if (flags & 0x08)
  436.       strcat( temp, "Up"); /* Upper texture offset changed */
  437.    else
  438.       strcat( temp, "-");
  439.    if (flags & 0x04)
  440.       strcat( temp, "2S"); /* Two-sided */
  441.    else
  442.       strcat( temp, "-");
  443.    if (flags & 0x02)
  444.       strcat( temp, "Mo"); /* Monsters can't cross this line */
  445.    else
  446.       strcat( temp, "-");
  447.    if (flags & 0x01)
  448.       strcat( temp, "Im"); /* Impassible */
  449.    else
  450.       strcat( temp, "-");
  451.    if (strlen( temp) > 13)
  452.    {
  453.       temp[13] = '|';
  454.       temp[14] = '\0';
  455.    }
  456.    return temp;
  457. }
  458.  
  459.  
  460.  
  461. /*
  462.    get a long description of one linedef flag
  463. */
  464.  
  465. char *GetLineDefFlagsLongName( int flags)
  466. {
  467.    if (flags & 0x0100)
  468.       return "Already on the map at startup";
  469.    if (flags & 0x80)
  470.       return "Invisible on the map";
  471.    if (flags & 0x40)
  472.       return "Blocks sound";
  473.    if (flags & 0x20)
  474.       return "Secret (shown as normal on the map)";
  475.    if (flags & 0x10)
  476.       return "Lower texture is \"unpegged\"";
  477.    if (flags & 0x08)
  478.       return "Upper texture is \"unpegged\"";
  479.    if (flags & 0x04)
  480.       return "Two-sided (may be transparent)";
  481.    if (flags & 0x02)
  482.       return "Monsters cannot cross this line";
  483.    if (flags & 0x01)
  484.       return "Impassible";
  485.    return "UNKNOWN";
  486. }
  487.  
  488.  
  489.  
  490. /*
  491.    get a short (13 char.) description of the type of a sector
  492. */
  493.  
  494. char *GetSectorTypeName( int type)
  495. {
  496.    switch (type)
  497.    {
  498.    case 0:
  499.       return "Normal";
  500.    case 1:
  501.       return "Blinks random.";
  502.    case 2:
  503.       return "Blinks 0.5 sec";
  504.    case 3:
  505.       return "Blinks 1.0 sec";
  506.    case 4:
  507.       return "-20% & blinks";
  508.    case 5:
  509.       return "-10% health";
  510.    case 7:
  511.       return "-5% health";
  512.    case 8:
  513.       return "Pulsates 2 sec";
  514.    case 9:
  515.       return "Secret";
  516.    case 10:
  517.       return "Unknown ???";
  518.    case 11:
  519.       return "-20% & end lev";
  520.    case 12:
  521.       return "Pulsates";
  522.    case 13:
  523.       return "Blinks .25 sec";
  524.    case 14:
  525.       return "Unknown ???";
  526.    case 16:
  527.       return "-20% health";
  528.    }
  529.    return "DO NOT USE!";
  530. }
  531.  
  532.  
  533.  
  534. /*
  535.    get a long description of the type of a sector
  536. */
  537.  
  538. char *GetSectorTypeLongName( int type)
  539. {
  540.    switch (type)
  541.    {
  542.    case 0:
  543.       return "Normal";
  544.    case 1:
  545.       return "Light blinks randomly";
  546.    case 2:
  547.       return "Light blinks every 0.5 second";
  548.    case 3:
  549.       return "Light blinks every second";
  550.    case 4:
  551.       return "-10/20% health and light blinks every 0.5 second";
  552.    case 5:
  553.       return "-5/10% health";
  554.    case 7:
  555.       return "-2/5% health (acid floor)";
  556.    case 8:
  557.       return "Light pulsates every 2 seconds";
  558.    case 9:
  559.       return "Secret (credit if discovered)";
  560.    case 10:
  561.       return "Unknown ??? (ceiling goes down)";
  562.    case 11:
  563.       return "-10/20% health and end level when health <= 10%";
  564.    case 12:
  565.       return "Light smoothly pulsates";
  566.    case 13:
  567.       return "Blinks every 0.25 seconds";
  568.    case 14:
  569.       return "Unknown ???";
  570.    case 16:
  571.       return "-10/20% health";
  572.    }
  573.    return "DO NOT USE!";
  574. }
  575.  
  576. /* end of file */
  577.