home *** CD-ROM | disk | FTP | other *** search
/ MegaDoom Adventures / PMWMEGADOOM.iso / doom / creators / deu521 / source / names.c < prev    next >
C/C++ Source or Header  |  1994-05-20  |  17KB  |  681 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.    case 4:
  92.       return "W1 Open door";
  93.    case 5:
  94.       return "W1 Raise floor?C"; /* highest floor ? */
  95.    case 6:
  96.       return "W1 Fast crushing";
  97.    case 7:
  98.       return "S1 Raise stairs";
  99.    case 8:
  100.       return "W1 Raise stairs";
  101.    case 9:
  102.       return "S1 Lower+neigh.T";
  103.    case 10:
  104.       return "W1 Lower lift";
  105.    case 11:
  106.       return "S- End level";
  107.    case 12:
  108.       return "W1 Lights max. N";
  109.    case 13:
  110.       return "W1 Lights on!";
  111.    case 14:
  112.       return "S1 Raise floor>N";
  113.    case 15:
  114.       return "S1 Raise flr32 T";
  115.    case 16:
  116.       return "W1 Close door 30";
  117.    case 17:
  118.       return "W? Blink light";
  119.    case 18:
  120.       return "S1 Raise floor N";
  121.    case 19:
  122.       return "W1 Lower floor N";
  123.    case 20:
  124.       return "S1 Raise floor T";
  125.    case 21:
  126.       return "S1 Lower floor<C";
  127.    case 22:
  128.       return "W1 Raise floor T";
  129.    case 23:
  130.       return "S1 Lower floor<?";
  131.    case 24:
  132.       return "G1 Raise floor C";
  133.    case 25:
  134.       return "W1 Crushing ceil";
  135.    case 26:
  136.       return "DR Blue door";
  137.    case 27:
  138.       return "DR Yellow door";
  139.    case 28:
  140.       return "DR Red door";
  141.    case 29:
  142.       return "S1 Open door";
  143.    case 30:
  144.       return "W1 Raise floor>?";
  145.    case 31:
  146.       return "D1 Door (stay O)";
  147.    case 32:
  148.       return "D1 Blue door O";
  149.    case 33:
  150.       return "D1 Red door O";
  151.    case 34:
  152.       return "D1 Yellow door O";
  153.    case 35:
  154.       return "W1 Lights out!";
  155.    case 36:
  156.       return "W1 Lower floor>N";
  157.    case 37:
  158.       return "W1 Lower floor T";
  159.    case 38:
  160.       return "W1 Lower floor";
  161.    case 39:
  162.       return "W1 Teleport";
  163.    case 40:
  164.       return "W1 Raise ceiling";
  165.    case 41:
  166.       return "S1 Lower ceiling";
  167.    case 42:
  168.       return "SR Close door";
  169.    case 43:
  170.       return "SR Lower ceiling";
  171.    case 44:
  172.       return "W1 Lower ceil. >";
  173.    case 45:
  174.       return "SR Raise floor N";
  175.    case 46:
  176.       return "G1 Shoot to open";
  177.    case 47:
  178.       return "G1 Raise floor T";
  179.    case 48:
  180.       return "-- Animated wall";
  181.    case 49:
  182.       return "S1 Lower ceil. >";
  183.    case 50:
  184.       return "S1 Open door (O)";
  185.    case 51:
  186.       return "S- Secret level";
  187.    case 52:
  188.       return "W- End level";
  189.    case 53:
  190.       return "W1 Moving floor";
  191.    case 54:
  192.       return "W1 Stop Moving f";
  193.    case 55:
  194.       return "S1 Raise floor<C";
  195.    case 56:
  196.       return "W1 Raise floor<C";
  197.    case 57:
  198.       return "W1 Stop crushing";
  199.    case 58:
  200.       return "W1 Raise floor32";
  201.    case 59:
  202.       return "W1 Raise floor>T";
  203.    case 60:
  204.       return "SR Lower floor N";
  205.    case 61:
  206.       return "SR Open door (O)";
  207.    case 62:
  208.       return "SR Lower lift";
  209.    case 63:
  210.       return "SR Open door";
  211.    case 64:
  212.       return "SR Raise floor C";
  213.    case 65:
  214.       return "SR Raise floor<C";
  215.    case 66:
  216.       return "SR Raise flr16 T";
  217.    case 67:
  218.       return "SR Raise flr32 T";
  219.    case 68:
  220.       return "S? Lower floor T";
  221.    case 69:
  222.       return "SR Raise floor N";
  223.    case 70:
  224.       return "SR Lower floor>N";
  225.    case 71:
  226.       return "S1 Lower floor>N";
  227.    case 73:
  228.       return "WR Crushing ceil";
  229.    case 74:
  230.       return "WR Stop crushing";
  231.    case 75:
  232.       return "WR Close door";
  233.    case 76:
  234.       return "WR Close door 30";
  235.    case 77:
  236.       return "WR Fast crushing";
  237.    /* 78 */
  238.    case 79:
  239.       return "WR Lights out!";
  240.    case 80:
  241.       return "WR Lights max. N";
  242.    case 81:
  243.       return "WR Lights on!";
  244.    case 82:
  245.       return "WR Lower floor N";
  246.    case 83:
  247.       return "WR Lower fl.maxN";
  248.    case 84:
  249.       return "WR Lower fl.minN";
  250.    /* 85 */
  251.    case 86:
  252.       return "WR Open door (O)";
  253.    case 87:
  254.       return "WR Moving floor";
  255.    case 88:
  256.       return "WR Lower lift";
  257.    case 89:
  258.       return "WR Stop moving f";
  259.    case 90:
  260.       return "WR Open door";
  261.    case 91:
  262.       return "WR Raise floor C";
  263.    case 92:
  264.       return "WR Raise floor24";
  265.    case 93:
  266.       return "WR Raise flr.24T";
  267.    case 94:
  268.       return "WR Raise floor<C";
  269.    case 95:
  270.       return "W1 Raise floor T";
  271.    case 96:
  272.       return "WR Raise floor72";
  273.    case 97:
  274.       return "WR Teleport";
  275.    case 98:
  276.       return "WR Lower floor >";
  277.    /* 99 100 */
  278.    case 101:
  279.       return "S1 Raise floor C";
  280.    case 102:
  281.       return "S? Lower floor";
  282.    case 103:
  283.       return "S1 Open Door (O)";
  284.    case 104:
  285.       return "W1 Lights down N";
  286.    }
  287.    return "?? UNKNOWN";
  288. }
  289.  
  290.  
  291.  
  292. /*
  293.    get a long description of the type of a linedef
  294. */
  295.  
  296. char *GetLineDefTypeLongName( int type)
  297. {
  298.    switch (type)
  299.    {
  300.    case 0:
  301.       return "-- Normal";
  302.    case 1:
  303.       return "DR Open door (closes after 6 seconds)";
  304.    case 2:
  305.       return "W1 Open door (stays open)";
  306.    case 3:
  307.       return "W1 Close door";
  308.    case 4:
  309.       return "W1 Open door (closes after 6 seconds)";
  310.    case 5:
  311.       return "W1 Raise floor to match Ne. ceiling/highest floor ?";
  312.    case 6:
  313.       return "W1 Start crushing ceiling (Fast)";
  314.    case 7:
  315.       return "S1 Raise stairs (several sectors 0/999)";
  316.    case 8:
  317.       return "W1 Raise stairs (several sectors 0/999)";
  318.    case 9:
  319.       return "S1 Lower floor, raise Ne. floor & match outer texture";
  320.    case 10:
  321.       return "W1 Lower lift (rises after 3 seconds)";
  322.    case 11:
  323.       return "S- End level, go to next level";
  324.    case 12:
  325.       return "W1 Light level goes to maximum Ne. light level";
  326.    case 13:
  327.       return "W1 Light level goes to 255";
  328.    case 14:
  329.       return "S1 Raise floor to 64 above Ne. floor";
  330.    case 15:
  331.       return "S1 Raise floor up 32 and match Ne. texture and type";
  332.    case 16:
  333.       return "W1 Close door for 30 seconds";
  334.    case 17:
  335.       return "W? Start blinking lights";
  336.    case 18:
  337.       return "S1 Raise floor to match Ne. floor";
  338.    case 19:
  339.       return "W1 Lower floor to match Ne. floor";
  340.    case 20:
  341.       return "S1 Raise floor to match Ne. floor, texture and type";
  342.    case 21:
  343.       return "S1 Lower floor for 3 seconds, then raise up to Ne. ceiling";
  344.    case 22:
  345.       return "W1 Raise floor to match Ne. floor, texture and type";
  346.    case 23:
  347.       return "S1 Lower floor to match lowest Ne. floor ?";
  348.    case 24:
  349.       return "G1 Raise floor to match Ne. ceiling";
  350.    case 25:
  351.       return "W1 Start crushing ceiling (Slow)";
  352.    case 26:
  353.       return "DR Open door (closes after 6 seconds), Blue key";
  354.    case 27:
  355.       return "DR Open door (closes after 6 seconds), Yellow key";
  356.    case 28:
  357.       return "DR Open door (closes after 6 seconds), Red key";
  358.    case 29:
  359.       return "S1 Open door (closes after 6 seconds)";
  360.    case 30:
  361.       return "W1 Raise floor to 100-128 above Ne. floor ?";
  362.    case 31:
  363.       return "D1 Open door (stays open)";
  364.    case 32:
  365.       return "D1 Open door (stays open), Blue key";
  366.    case 33:
  367.       return "D1 Open door (stays open), Red key";
  368.    case 34:
  369.       return "D1 Open door (stays open), Yellow key";
  370.    case 35:
  371.       return "W1 Light level goes to 0";
  372.    case 36:
  373.       return "W1 Lower floor to 8 above Ne. floor";
  374.    case 37:
  375.       return "W1 Lower floor to match Ne. floor, texture and type";
  376.    case 38:
  377.       return "W1 Lower floor to match Ne. floor ?";
  378.    case 39:
  379.       return "W1 Teleport to another sector";
  380.    case 40:
  381.       return "W1 Raise ceiling to match Ne. ceiling";
  382.    case 41:
  383.       return "S1 Lower ceiling to floor";
  384.    case 42:
  385.       return "SR Close door";
  386.    case 43:
  387.       return "SR Lower ceiling to floor";
  388.    case 44:
  389.       return "W1 Lower ceiling to 8 above floor";
  390.    case 45:
  391.       return "SR Lower floor to match Ne. floor";
  392.    case 46:
  393.       return "G1 Open door (stays open), when shot";
  394.    case 47:
  395.       return "G1 Raise floor to match Ne. floor, texture and type ?";
  396.    case 48:
  397.       return "-- Animated wall (scrolls horizontally)";
  398.    case 49:
  399.       return "S1 Lower ceiling to 8 above floor";
  400.    case 50:
  401.       return "S1 Open door (stays open) ?";
  402.    case 51:
  403.       return "S- End level, go to secret level";
  404.    case 52:
  405.       return "W- End level, go to next level";
  406.    case 53:
  407.       return "W1 Start moving floor (up/down every 5 seconds)";
  408.    case 54:
  409.       return "W1 Stop moving floor";
  410.    case 55:
  411.       return "S1 Raise floor to 8 below Ne. ceiling";
  412.    case 56:
  413.       return "W1 Raise floor to 8 below Ne. ceiling";
  414.    case 57:
  415.       return "W1 Stop crushing ceiling";
  416.    case 58:
  417.       return "W1 Raise floor up 32";
  418.    case 59:
  419.       return "W1 Raise floor up 8 and match Ne. texture and type";
  420.    case 60:
  421.       return "SR Lower floor to match Ne. floor ?";
  422.    case 61:
  423.       return "SR Open door (stays open)";
  424.    case 62:
  425.       return "SR Lower lift (rises after 3 seconds)";
  426.    case 63:
  427.       return "SR Open door (closes after 6 seconds)";
  428.    case 64:
  429.       return "SR Raise floor to match Ne. ceiling";
  430.    case 65:
  431.       return "SR Raise floor to 8 below Ne. ceiling";
  432.    case 66:
  433.       return "SR Raise floor up 16 and match Ne. texture and type";
  434.    case 67:
  435.       return "SR Raise floor up 32 and match Ne. texture and type";
  436.    case 68:
  437.       return "S? Lower floor to match Ne. floor, texture and type";
  438.    case 69:
  439.       return "SR Raise floor to match Ne. floor";
  440.    case 70:
  441.       return "SR Lower floor to 8 above Ne. floor";
  442.    case 71:
  443.       return "S1 Lower floor to 8 above Ne. floor";
  444.    case 72:
  445.       return "WR Lower ceiling to 8 above floor";
  446.    case 73:
  447.       return "WR Start crushing ceiling (Slow)";
  448.    case 74:
  449.       return "WR Stop crushing ceiling";
  450.    case 75:
  451.       return "WR Close door";
  452.    case 76:
  453.       return "WR Close door for 30 seconds";
  454.    case 77:
  455.       return "WR Start crushing ceiling (Fast)";
  456.    /* 78 */
  457.    case 79:
  458.       return "WR Light level goes to 0";
  459.    case 80:
  460.       return "WR Light level goes to maximum Ne. light level";
  461.    case 81:
  462.       return "WR Light level goes to 255";
  463.    case 82:
  464.       return "WR Lower floor to match Ne. floor";
  465.    case 83:
  466.       return "WR Lower floor to match Ne. floor ?";
  467.    case 84:
  468.       return "WR Lower floor to match lowest Ne. floor ?";
  469.    /* 85 */
  470.    case 86:
  471.       return "WR Open door (stays open)";
  472.    case 87:
  473.       return "WR Start moving floor (up/down every 5 seconds)";
  474.    case 88:
  475.       return "WR Lower lift (rises after 3 seconds)";
  476.    case 89:
  477.       return "WR Stop moving floor";
  478.    case 90:
  479.       return "WR Open door (closes after 6 seconds)";
  480.    case 91:
  481.       return "WR Raise floor to match Ne. ceiling";
  482.    case 92:
  483.       return "WR Raise floor up 24";
  484.    case 93:
  485.       return "WR Raise floor up 24 and match Ne. texture and type";
  486.    case 94:
  487.       return "WR Raise floor to 8 below Ne. ceiling";
  488.    case 95:
  489.       return "W1 Raise floor to match Ne. floor, texture and type ?";
  490.    case 96:
  491.       return "WR Raise floor up 72";
  492.    case 97:
  493.       return "WR Teleport to another sector";
  494.    case 98:
  495.       return "WR Lower floor to 8 above Ne. floor";
  496.    /* 99 100 */
  497.    case 101:
  498.       return "S1 Raise floor to match Ne. ceiling";
  499.    case 102:
  500.       return "S? Lower floor to match Ne. floor";
  501.    case 103:
  502.       return "S1 Open door (stays open) ?";
  503.    case 104:
  504.       return "W1 Light level goes to minimum Ne. light level";
  505.    }
  506.    return "?? UNKNOWN ?";
  507. }
  508.  
  509.  
  510.  
  511. /*
  512.    get a short description of the flags of a linedef
  513. */
  514.  
  515. char *GetLineDefFlagsName( int flags)
  516. {
  517.    static char temp[ 20];
  518.  
  519.    if (flags & 0x0100)
  520.       strcpy( temp, "Ma"); /* Already on the map */
  521.    else
  522.       strcpy( temp, "-");
  523.    if (flags & 0x80)
  524.       strcat( temp, "In"); /* Invisible on the map */
  525.    else
  526.       strcat( temp, "-");
  527.    if (flags & 0x40)
  528.       strcat( temp, "So"); /* Blocks sound */
  529.    else
  530.       strcat( temp, "-");
  531.    if (flags & 0x20)
  532.       strcat( temp, "Se"); /* Secret (normal on the map) */
  533.    else
  534.       strcat( temp, "-");
  535.    if (flags & 0x10)
  536.       strcat( temp, "Lo"); /* Lower texture offset changed */
  537.    else
  538.       strcat( temp, "-");
  539.    if (flags & 0x08)
  540.       strcat( temp, "Up"); /* Upper texture offset changed */
  541.    else
  542.       strcat( temp, "-");
  543.    if (flags & 0x04)
  544.       strcat( temp, "2S"); /* Two-sided */
  545.    else
  546.       strcat( temp, "-");
  547.    if (flags & 0x02)
  548.       strcat( temp, "Mo"); /* Monsters can't cross this line */
  549.    else
  550.       strcat( temp, "-");
  551.    if (flags & 0x01)
  552.       strcat( temp, "Im"); /* Impassible */
  553.    else
  554.       strcat( temp, "-");
  555.    if (strlen( temp) > 13)
  556.    {
  557.       temp[13] = '|';
  558.       temp[14] = '\0';
  559.    }
  560.    return temp;
  561. }
  562.  
  563.  
  564.  
  565. /*
  566.    get a long description of one linedef flag
  567. */
  568.  
  569. char *GetLineDefFlagsLongName( int flags)
  570. {
  571.    if (flags & 0x0100)
  572.       return "Already on the map at startup";
  573.    if (flags & 0x80)
  574.       return "Invisible on the map";
  575.    if (flags & 0x40)
  576.       return "Blocks sound";
  577.    if (flags & 0x20)
  578.       return "Secret (shown as normal on the map)";
  579.    if (flags & 0x10)
  580.       return "Lower texture is \"unpegged\"";
  581.    if (flags & 0x08)
  582.       return "Upper texture is \"unpegged\"";
  583.    if (flags & 0x04)
  584.       return "Two-sided (may be transparent)";
  585.    if (flags & 0x02)
  586.       return "Monsters cannot cross this line";
  587.    if (flags & 0x01)
  588.       return "Impassible";
  589.    return "UNKNOWN";
  590. }
  591.  
  592.  
  593.  
  594. /*
  595.    get a short (13 char.) description of the type of a sector
  596. */
  597.  
  598. char *GetSectorTypeName( int type)
  599. {
  600.    switch (type)
  601.    {
  602.    case 0:
  603.       return "Normal";
  604.    case 1:
  605.       return "Blinks random.";
  606.    case 2:
  607.       return "Blinks 0.5 sec";
  608.    case 3:
  609.       return "Blinks 1.0 sec";
  610.    case 4:
  611.       return "-20% & blinks";
  612.    case 5:
  613.       return "-10% health";
  614.    case 7:
  615.       return "-5% health";
  616.    case 8:
  617.       return "Pulsates 2 sec";
  618.    case 9:
  619.       return "Secret";
  620.    case 10:
  621.       return "Unknown ???";
  622.    case 11:
  623.       return "-20% & end lev";
  624.    case 12:
  625.       return "Pulsates";
  626.    case 13:
  627.       return "Blinks .25 sec";
  628.    case 14:
  629.       return "Unknown ???";
  630.    case 16:
  631.       return "-20% health";
  632.    }
  633.    return "DO NOT USE!";
  634. }
  635.  
  636.  
  637.  
  638. /*
  639.    get a long description of the type of a sector
  640. */
  641.  
  642. char *GetSectorTypeLongName( int type)
  643. {
  644.    switch (type)
  645.    {
  646.    case 0:
  647.       return "Normal";
  648.    case 1:
  649.       return "Light blinks randomly";
  650.    case 2:
  651.       return "Light blinks every 0.5 second";
  652.    case 3:
  653.       return "Light blinks every second";
  654.    case 4:
  655.       return "-10/20% health and light blinks every 0.5 second";
  656.    case 5:
  657.       return "-5/10% health";
  658.    case 7:
  659.       return "-2/5% health (acid floor)";
  660.    case 8:
  661.       return "Light pulsates every 2 seconds";
  662.    case 9:
  663.       return "Secret (credit if discovered)";
  664.    case 10:
  665.       return "Unknown ??? (ceiling goes down)";
  666.    case 11:
  667.       return "-10/20% health and end level when health <= 10%";
  668.    case 12:
  669.       return "Light smoothly pulsates";
  670.    case 13:
  671.       return "Blinks every 0.25 seconds";
  672.    case 14:
  673.       return "Unknown ???";
  674.    case 16:
  675.       return "-10/20% health";
  676.    }
  677.    return "DO NOT USE!";
  678. }
  679.  
  680. /* end of file */
  681.