ID:164716
 
Ok I have gotten pretty far with my RPG game so far and just recently I was test hosting it for bug and one of the big bugs I found and need to fix is an Entering turf command. The problem is that I have it set up so you need a boat in your inventory to enter the sea. the coding for that is like this

Enter(atom/movable/A)
if(istype(A,/mob/PC) && (locate(/obj/Key_Item/boat) in A.contents))
return..()
return 0

Now the problem is that when people are in parties only leaders need to have the item and the rest get a free ride. I would like to make it so that everyone need the item. How can I do this?
Not to sound like a pest or anything but no one knows how I would have to go about coding this so that everyone in the party needs an item in order to enter certain turf?
In response to GraveRobber
How are your parties set up? We need more information, it could be as simple as making a list of the entire party's inventory or just everyones boats and then checking the amount of boats to the amount of party members, or it could of course be more complicated...

-KirbyAllStar
In response to KirbyAllStar
Below is the games party coding line for line

var/const/max_ppl_party = 3
mob/PC
var/tmp/list/party
var/tmp
formation
inparty
pstatus
pmoves
proc
move_party(var/atom/location)
for(var/mob/PC/p in party)
p.density = 0
p.pmoves = null
p.loc = location
if(p.inparty == 1) p.density = 1
lock_party()
set category="Party"
set desc="Lock the party so nobody can join"
pstatus=0
verbs+=/mob/PC/proc/unlock_party
verbs-=/mob/PC/proc/lock_party
unlock_party()
set category="Party"
set desc="Unlock the party so anyone can join"
pstatus=1
verbs+=/mob/PC/proc/lock_party
verbs-=/mob/PC/proc/unlock_party
kick_member()
set category="Party"
set desc="Kick a member from the party"
if(party.len==1){info(,list(src),"No one to kick out.");return}
else if(src!=party[1]){info(,list(src),"Only the party leader may do this.");return}
var/mob/PC/pkick = input(src,"Kick who from party?","Kick") as null|anything in party
if(pkick==src){info(,list(src),"You cannot kick yourself from party");return}
else if(pkick&&party.Find(pkick)) pkick.leave_party()
setup_party()
density=1
party=list(src)
inparty=1
pstatus=0
pmoves=null
verbs+=/mob/PC/proc/join_party
verbs+=/mob/PC/proc/unlock_party
verbs-=/mob/PC/proc/leave_party
verbs-=/mob/PC/proc/lock_party
verbs-=/mob/PC/proc/kick_member
update_party()
var/party_slots
for(var/mob/PC/p in party)
party_slots++
p.inparty=party_slots
if(party_slots>1)
p.density=0
p.verbs-=/mob/PC/proc/join_party
p.verbs-=/mob/PC/proc/unlock_party
p.verbs+=/mob/PC/proc/leave_party
p.verbs-=/mob/PC/proc/lock_party
p.verbs-=/mob/PC/proc/kick_member
else
p.density=1
if(length(party)>1){p.verbs-=/mob/PC/proc/ join_party;p.verbs+=/mob/PC/proc/leave_party;p.verbs+=/mob/ PC/proc/kick_member}
else {p.verbs+=/mob/PC/proc/join_party;p.verbs-=/mob/PC/proc/ leave_party;p.verbs-=/mob/PC/proc/kick_member}
if(p.pstatus){p.verbs-=/mob/PC/proc/unlock_party;p.verbs+=/ mob/PC/proc/lock_party}
else {p.verbs-=/mob/PC/proc/lock_party;p.verbs+=/mob/PC/proc/ unlock_party}
join_party()
set category="Party"
set desc="Join someone's party"
if(party.len>1){info(null,list(src),"Your already in a party.");return}
for(var/mob/PC/M in get_step(src,dir))
if(M&&M.inparty==1)
if(!M.inmenu)
if(M.pstatus)
if(length(M.party)<max_ppl_party)
M.party+=src
party = M.party
for(var/mob/PC/p in M.party)
if(p!=src) info(null,list(p),"[src] has joined the party.")
else info(null,list(p),"You joined with [M] to fight against the evils!")
M.update_party()
M.party_gt()
return
else info(null,list(src),"Cannot join party (full).")
else info(null,list(src),"Cannot join party (locked).")
else info(null,list(src),"Cannot join party (leader seems busy).")
leave_party()
set category="Party"
set desc="Leave the current party"
if(length(party) == 1)
if(inbattle) EndBattle(list(src))
return
party-=src
var/mob/PC/M = party[1] // setting new leader
for(var/mob/PC/p in M.party)
if(!p) continue
if(!inbattle) p.close_allscreen()
p.party-=src
info(null,list(p),"[src] has left the party.")
if(length(M.party)>1) M.update_party()
else M.setup_party()
setup_party()
info(,list(src),"You left the party.")

if(inbattle) EndBattle(list(src))
else
M.party_gt()
close_allscreen()
party_gt()
if(!inmenu) inmenu="party_gt"
for(var/mob/PC/p in party)
walk_to(p,src,0)
while("[p.x] [p.y] [p.z]"!="[src.x] [src.y] [src.z]") sleep(1)
walk_to(p,0)
p.dir = dir
p.pmoves = null
if(inmenu == "party_gt") inmenu=null

mob/PC/Move()
if(party&&src==party[1]&&!inbattle)
for(var/mob/PC/p in party)
if(p.inparty!=1)
var/mob/PC/m=party[p.inparty-1]
if(get_dist(m,p)==1){p.pmoves=m.dir}
else if(get_dist(m,p)>=2){p.pmoves="OUTOFSIGHT"}
else p.pmoves = null
..()
if(party&&src==party[1]&&!inbattle)
for(var/mob/PC/p in party)
if(p.inparty!=1)
var/mob/PC/m=party[p.inparty-1]
if(p.pmoves=="OUTOFSIGHT") p.loc = locate(m.x,m.y,m.z)
else if(p.pmoves) step(p,p.pmoves)