Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- subroutine curio_table(ply,target,type)
- {
- local replica;
- local count;
- local mother;
- local set;
- local type$;
- local filter;
- local filter$;
- local title$;
- local collection$;
- local sort;
- local sort$;
- local temp$;
- local curiobox;
- local boxyes$;
- local part;
- local rub$;
- curiobox = is_item_in_room(node[ply].persona+invadd, ARTI_CURIOBOX, 1);
- filter$=lower$(words$(game.input$, 4, 0));
- if type=5 then
- {
- if filter$="" then
- {
- unimsg(ply,"You need to provide the name of the curio set you want to list.\n");
- return;
- }
- else
- {
- filter=get_curioset_set_type(filter$);
- if !filter then
- {
- unimsg(ply,"That is not a valid curio set.\n");
- return;
- }
- }
- title$=CURIOSET_NAME$(filter)+" Set";
- }
- if type=6 then
- {
- if filter$="" then
- {
- unimsg(ply,"You need to provide the name of the collection you want to list.\n");
- return;
- }
- else
- {
- filter=get_curiocollection_type(filter$);
- if !filter then
- {
- unimsg(ply,"That is not a valid collection.\n");
- return;
- }
- }
- title$=CURIOCOLLECTION_NAME$(filter)+" Collection";
- }
- if type=1 or type=2 or type=3 or type=4 then
- {
- sort$=lower$(words$(game.input$, 4, 0));
- if sort$!="" and node[ply].persona=target then
- {
- sort$="*"+sort$+"*";
- sort=1;
- if type=1 then title$="All Curios ("+upper$(sort$)+")";
- if type=2 then title$="Completed Curios ("+upper$(sort$)+")";
- if type=3 then title$="Partial Curios ("+upper$(sort$)+")";
- if type=4 then title$="Curio Pieces ("+upper$(sort$)+")";
- }
- else if type=1 then title$="All Curios";
- else if type=2 then title$="Completed Curios";
- else if type=3 then title$="Partial Curios";
- else if type=4 then title$="Curio Pieces";
- }
- table_new(title$);
- table_column("Id", 7);
- if curiobox and type=2 then table_column("", 1);
- table_column("Type", 8);
- table_column("Set", 20);
- table_column("Collection", 12);
- if type = 2 then
- table_column("Location", 0);
- else
- {
- table_column("Description", 23);
- table_column("Rub", 0);
- }
- replica=replica.data[2].search(target, 0);
- while replica do
- {
- mother=replica[replica].mother;
- type$="";
- set=0;
- set=is_curioset_replica(mother);
- if set then
- {
- temp$=lower$(objname2$(replica));
- if CURIOSET_COLLECTION(set) then collection$=CURIOCOLLECTION_NAME$(CURIOSET_COLLECTION(set)); else collection$="None";
- if type=2 then
- {
- if curiobox then
- {
- if REP_INV(curiobox)=replica[replica].room then boxyes$="*"; else boxyes$="";
- temp$=string$(replica)+"\n"+boxyes$+"\n"+"Completed"+"\n"+CURIOSET_NAME$(set)+"\n"+collection$+"\n"+get_room_name$(replica[replica].room, amigod(ply));
- }
- else
- {
- temp$=string$(replica)+"\n"+"Completed"+"\n"+CURIOSET_NAME$(set)+"\n"+collection$+"\n"+get_room_name$(replica[replica].room, amigod(ply));
- }
- }
- else temp$=string$(replica)+"\n"+"Completed"+"\n"+CURIOSET_NAME$(set)+"\n"+collection$+"\n"+"Complete "+CURIOSET_NAME$(set)+"\nN/A";
- if type=1 or type=2 or (type=5 and filter=set) or (type=6 and filter=CURIOSET_COLLECTION(set)) then
- {
- if (sort and lower$(temp$)~=sort$) or !sort then
- {
- table_row(temp$);
- count+=1;
- }
- }
- }
- replica=replica.data[2].search(target,replica);
- }
- if type!=2 then
- {
- part=1;
- while part<=curioParts.maxrecord do
- {
- if CURIOPART_OWNER(part)=target and !curioParts[part].curioPartsMarket then
- {
- set=CURIOPART_SET(part);
- if !set then DEBUG(string$(part));
- if set and CURIOSET_COLLECTION(set) then collection$=CURIOCOLLECTION_NAME$(CURIOSET_COLLECTION(set)); else collection$="None";
- if CURIOPART_PART(part)=CURIOPART_PARTIAL then rub$ = "N/A"; else if CURIOPART_RUB(part) then rub$ = "No"; else rub$ = "Yes";
- 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$;
- 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
- {
- if (sort and lower$(temp$)~=sort$) or !sort then
- {
- table_row(temp$);
- count+=1;
- }
- }
- }
- part+=1;
- }
- }
- more_on(ply);
- if !count then unimsg(ply,"You have no matching curios.\n");
- else {table_render(ply); unimsg(ply,"Total Curios: "+string$(count)+"\n");}
- if curiobox and type=2 then unimsg(ply,"*Inside curiobox.\n");
- more_off(ply);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement