Changeset 59

Show
Ignore:
Timestamp:
04/22/07 11:24:42 (2 years ago)
Author:
pmac
Message:
  • Added ego lite support
  • Added 'selections' to store menus
  • Fixed stupid bogus selection on '=' and '?' in birth.c
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/birth.c

    r54 r59  
    589589        object_prep(i_ptr, lookup_kind(TV_LITE, SV_LITE_TORCH)); 
    590590        i_ptr->number = (byte)rand_range(3, 7); 
    591         i_ptr->pval = rand_range(3, 7) * 500; 
     591        i_ptr->timeout = rand_range(3, 7) * 500; 
    592592        object_aware(i_ptr); 
    593593        object_known(i_ptr); 
     
    829829                } 
    830830 
    831                 else i++; 
     831                /* Selection! */ 
     832                else if(cx.key == '\r' || cx.key == '\n' || cx.key == '\xff') 
     833                        i++; 
    832834        } 
    833835 
  • trunk/src/cmd3.c

    r48 r59  
    786786        if ((o_ptr->tval == TV_LITE) && 
    787787            (o_ptr->sval == SV_LITE_LANTERN) && 
    788             (o_ptr->pval > 0)) 
     788            (o_ptr->timeout > 0)) 
    789789        { 
    790790                return (TRUE); 
     
    837837 
    838838        /* Refuel */ 
    839         j_ptr->pval += o_ptr->pval; 
     839        j_ptr->timeout += o_ptr->timeout ? o_ptr->timeout : o_ptr->pval; 
    840840 
    841841        /* Message */ 
     
    843843 
    844844        /* Comment */ 
    845         if (j_ptr->pval >= FUEL_LAMP) 
    846         { 
    847                 j_ptr->pval = FUEL_LAMP; 
     845        if (j_ptr->timeout >= FUEL_LAMP) 
     846        { 
     847                j_ptr->timeout = FUEL_LAMP; 
    848848                msg_print("Your lamp is full."); 
    849849        } 
    850850 
    851         /* Refilled from a latern */ 
     851        /* Refilled from a lantern */ 
    852852        if (o_ptr->sval == SV_LITE_LANTERN) 
    853853        { 
     
    868868 
    869869                        /* Remove fuel */ 
    870                         i_ptr->pval = 0; 
     870                        i_ptr->timeout = 0; 
    871871 
    872872                        /* Unstack the used item */ 
     
    881881                } 
    882882 
    883                 /* Empty a single latern */ 
     883                /* Empty a single lantern */ 
    884884                else 
    885885                { 
    886886                        /* No more fuel */ 
    887                         o_ptr->pval = 0; 
     887                        o_ptr->timeout = 0; 
    888888                } 
    889889 
     
    979979 
    980980        /* Refuel */ 
    981         j_ptr->pval += o_ptr->pval + 5; 
     981        j_ptr->timeout += o_ptr->timeout + 5; 
    982982 
    983983        /* Message */ 
     
    985985 
    986986        /* Over-fuel message */ 
    987         if (j_ptr->pval >= FUEL_TORCH) 
    988         { 
    989                 j_ptr->pval = FUEL_TORCH; 
     987        if (j_ptr->timeout >= FUEL_TORCH) 
     988        { 
     989                j_ptr->timeout = FUEL_TORCH; 
    990990                msg_print("Your torch is fully fueled."); 
    991991        } 
  • trunk/src/dungeon.c

    r50 r59  
    456456 
    457457                /* Recharge activatable objects */ 
    458                 if (o_ptr->timeout > 0
     458                if (o_ptr->timeout > 0 && !(o_ptr->tval == TV_LITE && !artifact_p(o_ptr))
    459459                { 
    460460                        /* Recharge */ 
     
    10261026        { 
    10271027                /* Hack -- Use some fuel (except on artifacts) */ 
    1028                 if (!artifact_p(o_ptr) && (o_ptr->pval > 0)) 
     1028                if (!artifact_p(o_ptr) && (o_ptr->timeout > 0)) 
    10291029                { 
    10301030                        /* Decrease life-span */ 
    1031                         o_ptr->pval--; 
     1031                        o_ptr->timeout--; 
    10321032 
    10331033                        /* Hack -- notice interesting fuel steps */ 
    1034                         if ((o_ptr->pval < 100) || (!(o_ptr->pval % 100))) 
     1034                        if ((o_ptr->timeout < 100) || (!(o_ptr->timeout % 100))) 
    10351035                        { 
    10361036                                /* Window stuff */ 
     
    10421042                        { 
    10431043                                /* Hack -- save some light for later */ 
    1044                                 if (o_ptr->pval == 0) o_ptr->pval++; 
     1044                                if (o_ptr->timeout == 0) o_ptr->timeout++; 
    10451045                        } 
    10461046 
    10471047                        /* The light is now out */ 
    1048                         else if (o_ptr->pval == 0) 
     1048                        else if (o_ptr->timeout == 0) 
    10491049                        { 
    10501050                                disturb(0, 0); 
     
    10531053 
    10541054                        /* The light is getting dim */ 
    1055                         else if ((o_ptr->pval < 100) && (!(o_ptr->pval % 10))) 
     1055                        else if ((o_ptr->timeout < 100) && (!(o_ptr->timeout % 10))) 
    10561056                        { 
    10571057                                if (disturb_minor) disturb(0, 0); 
  • trunk/src/load.c

    r52 r59  
    478478                } 
    479479        } 
     480 
     481        if(older_than(3, 0, 9) && o_ptr->tval == TV_LITE && !artifact_p(o_ptr) && !ego_item_p(o_ptr) && o_ptr->pval) 
     482        { 
     483                o_ptr->timeout = o_ptr->pval; 
     484                o_ptr->pval = 0; 
     485        } 
     486 
    480487 
    481488        /* Success */ 
  • trunk/src/object1.c

    r48 r59  
    13181318                /* Hack -- Turns of light for normal lites */ 
    13191319                object_desc_str_macro(t, " (with "); 
    1320                 object_desc_num_macro(t, o_ptr->pval); 
     1320                object_desc_num_macro(t, o_ptr->timeout); 
    13211321                object_desc_str_macro(t, " turns of light)"); 
    13221322        } 
     
    14671467 
    14681468        /* Indicate "charging" artifacts */ 
    1469         else if (known && o_ptr->timeout
     1469        else if (known && o_ptr->timeout && !(o_ptr->tval == TV_LITE && !artifact_p(o_ptr))
    14701470        { 
    14711471                /* Hack -- Dump " (charging)" if relevant */ 
  • trunk/src/object2.c

    r48 r59  
    24502450                case TV_LITE: 
    24512451                { 
    2452                         /* Hack -- Torches -- random fuel */ 
     2452                        /* Hack -- Torches & lanterns -- random fuel at 1/2 max */ 
    24532453                        if (o_ptr->sval == SV_LITE_TORCH) 
    24542454                        { 
    2455                                 if (o_ptr->pval > 0) o_ptr->pval = randint(o_ptr->pval); 
     2455                                o_ptr->timeout = randint(FUEL_TORCH/2); 
    24562456                        } 
    24572457 
    2458                         /* Hack -- Lanterns -- random fuel */ 
    24592458                        else if (o_ptr->sval == SV_LITE_LANTERN) 
    24602459                        { 
    2461                                 if (o_ptr->pval > 0) o_ptr->pval = randint(o_ptr->pval); 
     2460                                o_ptr->timeout = randint(FUEL_LAMP/2); 
    24622461                        } 
    24632462 
  • trunk/src/store.c

    r57 r59  
    11691169        if (object.tval == TV_LITE) 
    11701170        { 
    1171                 if (object.sval == SV_LITE_TORCH)        object.pval = FUEL_TORCH / 2; 
    1172                 else if (object.sval == SV_LITE_LANTERN) object.pval = FUEL_LAMP / 2; 
     1171                if (object.sval == SV_LITE_TORCH)        object.timeout = FUEL_TORCH / 2; 
     1172                else if (object.sval == SV_LITE_LANTERN) object.timeout = FUEL_LAMP / 2; 
    11731173        } 
    11741174 
     
    13021302                if (i_ptr->tval == TV_LITE) 
    13031303                { 
    1304                         if (i_ptr->sval == SV_LITE_TORCH) i_ptr->pval = FUEL_TORCH / 2; 
    1305                         if (i_ptr->sval == SV_LITE_LANTERN) i_ptr->pval = FUEL_LAMP / 2; 
     1304                        if (i_ptr->sval == SV_LITE_TORCH) i_ptr->timeout = FUEL_TORCH / 2; 
     1305                        if (i_ptr->sval == SV_LITE_LANTERN) i_ptr->timeout = FUEL_LAMP / 2; 
    13061306                } 
    13071307 
     
    26332633                { 
    26342634                        store_sell(oid); 
    2635  
    26362635                        break; 
    26372636                } 
     
    28732872 
    28742873                        /* These two can't intersect! */ 
    2875                         menu.cmd_keys = "\n\r\t?=CeEiIls"; 
     2874                        menu.cmd_keys = "\n\p\r\t?=CdeEiIls"; 
    28762875                        menu.selections = "abcfghjkmnopqrtuvxyz"; 
    28772876                } 
     
    28822881 
    28832882                        /* These two can't intersect! */ 
    2884                         menu.cmd_keys = "\t\n\r{}Idepw"; 
    2885                         menu.selections = "abcfghijklmnoqrstuvxyz1234567890"; 
     2883                        menu.cmd_keys = "\t\n\p\r{}gIepw"; 
     2884                        menu.selections = "abcfhijklmnoqrstuvxyz1234567890"; 
    28862885                } 
    28872886                if(cursor >= menu.count) cursor = menu.count -1; 
  • trunk/src/ui.c

    r33 r59  
    4242 
    4343const char lower_case[] = "abcdefghijklmnopqrstuvwxyz"; 
     44const char upper_case[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 
    4445 
    4546int jumpscroll = 0; 
  • trunk/src/ui.h

    r33 r59  
    3030extern const char default_choice[];             /* 1234567890A-Za-z */ 
    3131extern const char lower_case[];                 /* abc..z */ 
     32extern const char upper_case[];                 /* ABC..Z */ 
    3233 
    3334 
  • trunk/src/xtra1.c

    r48 r59  
    17931793                         
    17941794                        /* Lanterns (with fuel) provide more lite */ 
    1795                         if ((o_ptr->sval == SV_LITE_LANTERN) && (o_ptr->pval > 0)) 
     1795                        if ((o_ptr->sval == SV_LITE_LANTERN) && (o_ptr->timeout > 0)) 
    17961796                        { 
    17971797                                p_ptr->cur_lite += 2; 
     
    18001800                         
    18011801                        /* Torches (with fuel) provide some lite */ 
    1802                         if ((o_ptr->sval == SV_LITE_TORCH) && (o_ptr->pval > 0)) 
     1802                        if ((o_ptr->sval == SV_LITE_TORCH) && (o_ptr->timeout > 0)) 
    18031803                        { 
    18041804                                p_ptr->cur_lite += 1;