Advertisement
recollectine

Untitled

May 20th, 2024
724
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 5.56 KB | None | 0 0
  1. subroutine curio_table(ply,target,type)
  2. {
  3.     local replica;
  4.     local count;
  5.     local mother;
  6.     local set;
  7.     local type$;
  8.     local filter;
  9.     local filter$;
  10.     local title$;
  11.     local collection$;
  12.     local sort;
  13.     local sort$;
  14.     local temp$;
  15.     local curiobox;
  16.     local boxyes$;
  17.     local part;
  18.     local rub$;
  19.  
  20.     curiobox = is_item_in_room(node[ply].persona+invadd, ARTI_CURIOBOX, 1);
  21.  
  22.     filter$=lower$(words$(game.input$, 4, 0));
  23.  
  24.     if type=5 then
  25.     {
  26.         if filter$="" then
  27.         {
  28.             unimsg(ply,"You need to provide the name of the curio set you want to list.\n");
  29.             return;
  30.         }
  31.         else
  32.         {
  33.             filter=get_curioset_set_type(filter$);
  34.             if !filter then
  35.             {
  36.                 unimsg(ply,"That is not a valid curio set.\n");
  37.                 return;
  38.             }
  39.         }
  40.         title$=CURIOSET_NAME$(filter)+" Set";
  41.     }
  42.  
  43.     if type=6 then
  44.     {
  45.         if filter$="" then
  46.         {
  47.             unimsg(ply,"You need to provide the name of the collection you want to list.\n");
  48.             return;
  49.         }
  50.         else
  51.         {
  52.             filter=get_curiocollection_type(filter$);
  53.             if !filter then
  54.             {
  55.                 unimsg(ply,"That is not a valid collection.\n");
  56.                 return;
  57.             }
  58.         }
  59.         title$=CURIOCOLLECTION_NAME$(filter)+" Collection";
  60.     }
  61.  
  62.     if type=1 or type=2 or type=3 or type=4 then
  63.     {
  64.         sort$=lower$(words$(game.input$, 4, 0));
  65.         if sort$!="" and node[ply].persona=target then
  66.         {
  67.             sort$="*"+sort$+"*";
  68.             sort=1;
  69.             if type=1 then title$="All Curios ("+upper$(sort$)+")";
  70.             if type=2 then title$="Completed Curios ("+upper$(sort$)+")";
  71.             if type=3 then title$="Partial Curios ("+upper$(sort$)+")";
  72.             if type=4 then title$="Curio Pieces ("+upper$(sort$)+")";
  73.         }
  74.         else if type=1 then title$="All Curios";
  75.         else if type=2 then title$="Completed Curios";
  76.         else if type=3 then title$="Partial Curios";
  77.         else if type=4 then title$="Curio Pieces";
  78.     }
  79.     table_new(title$);
  80.     table_column("Id", 7);
  81.     if curiobox and type=2 then table_column("", 1);
  82.     table_column("Type", 8);
  83.     table_column("Set", 20);
  84.     table_column("Collection", 12);
  85.     if type = 2 then
  86.         table_column("Location", 0);
  87.     else
  88.     {
  89.         table_column("Description", 23);
  90.         table_column("Rub", 0);
  91.     }
  92.  
  93.     replica=replica.data[2].search(target, 0);
  94.     while replica do
  95.     {
  96.         mother=replica[replica].mother;
  97.         type$="";
  98.         set=0;
  99.  
  100.         set=is_curioset_replica(mother);
  101.         if set then
  102.         {
  103.  
  104.             temp$=lower$(objname2$(replica));
  105.             if CURIOSET_COLLECTION(set) then collection$=CURIOCOLLECTION_NAME$(CURIOSET_COLLECTION(set)); else collection$="None";
  106.  
  107.             if type=2 then
  108.             {
  109.                 if curiobox then
  110.                 {
  111.                     if REP_INV(curiobox)=replica[replica].room then boxyes$="*"; else boxyes$="";
  112.                     temp$=string$(replica)+"\n"+boxyes$+"\n"+"Completed"+"\n"+CURIOSET_NAME$(set)+"\n"+collection$+"\n"+get_room_name$(replica[replica].room, amigod(ply));
  113.                 }
  114.                 else
  115.                 {
  116.                     temp$=string$(replica)+"\n"+"Completed"+"\n"+CURIOSET_NAME$(set)+"\n"+collection$+"\n"+get_room_name$(replica[replica].room, amigod(ply));
  117.                 }
  118.             }
  119.             else  temp$=string$(replica)+"\n"+"Completed"+"\n"+CURIOSET_NAME$(set)+"\n"+collection$+"\n"+"Complete "+CURIOSET_NAME$(set)+"\nN/A";
  120.  
  121.             if type=1 or type=2 or (type=5 and filter=set) or (type=6 and filter=CURIOSET_COLLECTION(set)) then
  122.             {
  123.                 if (sort and lower$(temp$)~=sort$) or !sort then
  124.                 {
  125.                     table_row(temp$);
  126.                     count+=1;
  127.                 }
  128.             }
  129.         }
  130.         replica=replica.data[2].search(target,replica);
  131.     }
  132.  
  133.     if type!=2 then
  134.     {
  135.         part=1;
  136.         while part<=curioParts.maxrecord do
  137.         {
  138.             if CURIOPART_OWNER(part)=target and !curioParts[part].curioPartsMarket then
  139.             {
  140.                 set=CURIOPART_SET(part);
  141.                 if !set then DEBUG(string$(part));
  142.                 if set and CURIOSET_COLLECTION(set) then collection$=CURIOCOLLECTION_NAME$(CURIOSET_COLLECTION(set)); else collection$="None";
  143.                 if CURIOPART_PART(part)=CURIOPART_PARTIAL then rub$ = "N/A"; else if CURIOPART_RUB(part) then rub$ = "No"; else rub$ = "Yes";
  144.                 temp$=string$(part)+"\n"+curiopart_type_name$(CURIOPART_PART(part))+"\n"+CURIOSET_NAME$(set)+"\n"+collection$+"\n"+capitalise_words$(get_curiopart_desc$(part))+"\n"+rub$;
  145.                 if type=1 or (type=3 and CURIOPART_PART(part)=CURIOPART_PARTIAL) or (type=4 and CURIOPART_PART(part)!=CURIOPART_PARTIAL) or (type=5 and set=filter) or (type=6 and CURIOSET_COLLECTION(set)=filter) then
  146.                 {
  147.                     if (sort and lower$(temp$)~=sort$) or !sort then
  148.                     {
  149.                         table_row(temp$);
  150.                         count+=1;
  151.                     }
  152.                 }
  153.             }
  154.             part+=1;
  155.         }
  156.     }
  157.  
  158.     more_on(ply);
  159.     if !count then unimsg(ply,"You have no matching curios.\n");
  160.     else {table_render(ply); unimsg(ply,"Total Curios: "+string$(count)+"\n");}
  161.     if curiobox and type=2 then unimsg(ply,"*Inside curiobox.\n");
  162.     more_off(ply);
  163. }
Tags: lusternia
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement