i'm curious what methods people have used to implement item (or card) trading between players.

I need to develop a system where players can trade uneven quantities, and make counteroffers if they don't like the original offer.

A player cannot see what cards other players have, so they would have to blindly ask for something (they wouldn't be able to just click on a particular card in the other player's inventory for instance).
<code>mob Stat() if(Trading) statpanel("Offering:",Offer) statpanel("Offered:",Offered) var/list/Offer = list() var/list/Offered = list() var/mob/Trading var/Accepted verb Trade(mob/M in oview(1)) if(usr.Trading || M.Trading) return usr.Trading = M switch(alert(M,"Do you wish to trade with [usr]?") in list("Yes","No") if("No") alert("[M] has declined the trading offer.","Bah!") sleep(20) usr.Trading = null else alert("[M] has accepted your training offer.","Yipee!") M.Trading = usr Accept() if(!usr.Trading) return usr.Accepted = 1-usr.Accepted //Simple boolean toggle, pretty useful if(usr.Trading.Accepted) usr.Trading << "The deal was accepted!" usr << "The deal was accepted!" for(var/obj/O in usr.Offered) new O(usr) del(O) for(var/obj/A in usr.Trading.Offered) new A(usr.Trading) del(A) for(var/obj/B in usr.Offer) del(B) for(var/obj/C in usr.Trading.Offer) del(C) usr.Trading.Trading = null usr.Trading = null Cancel_Deal() for(var/obj/O in usr.Offer) O.UNOFFER for(var/obj/A in usr.Trading.Offer) A.UNOFFER usr.Trading.Trading = null usr.Trading = null obj proc UNOFFER(mob/M) new src(M) M.Trading.Offered -= src del(src) verb Offer() if(!usr.Trading) return new src(usr.Offer) new src(usr.Trading.Offered) del(src) Unoffer() set src in usr.Offer src.UNOFFER(M)</code>

Totally untested of course, but meh.