team.tar.gz

snippets · 7.7 KB · 2010-03-30

Team object by Zeus (16/01/1993): team commands (_join, _go, _members and so on).

Download   « Back to the snippets list

./README

TEAM OBJECT.	by Zeus (16/01/1993)

FILES:
team.c		-	main file providing team fucntions.
_team.c		-	command to start a new team.
_members.c	-	lists all the current members of the team.
_disband.c	-	command to disband a member of a team or
			disband the whole team.
_join.c		-	command to join a player to an existing team.

The team.c file is inherited by user.c. In my case I just included
inherit "/std/team.c" in user.h. This file provides all the team
functions as below:

init_team	-	called by _team.c. All team variables are
			initialised. The property "leader" is set
			to the current player's cap_name. This will
			serve as a kind of team id. All player who
			join the team will have their "leader"
			property set to the current player's cap_name.

check_team	-	called by functions quit(), net_dead() and
			die() in user.c. When a player quits, goes
			net_dead or dies, this fucntion will check to
			see if he/she is either leader of a team or
			member of a team. If leader then the whole team
			is disbanded and if member then he/she is
			disbanded from the team.

add_member	-	just add a new member to the members array. The
			"leader" property of the new member is set to
			the cap_name of the leader of the team.

move_team	-	move the team

disband_team	-	disband the whole team. All "leader" properties
			set to 0.

disband_member	-	disband a single member and set his/her "leader"
			property  to 0.

The "leader" property is vital as it is a kind of id for a team. It is
used in _go.c command to check if a player is leader of a team and if
so then move the whole team.

Please add a call to check_team() to functions quit(), net_dead()
and die() in user.c.

This is inspired by Lars's team object for MudLib 2.4.5 but with
several modifications for MudOS.

It is far from perfect and I would welcome all modifications,
improvements, comments.....

Well thanks.... mail me if you have any problems with this
at all.

--Zeus

Archive contents (9 files)

FileSize
./README1.9 KB
./_disband.c1.7 KB
./_go.c3.0 KB
./_join.c1020 B
./_members.c670 B
./_team.c499 B
./team.c2.7 KB
./user.c10.5 KB
./ftp.kyndig.com935 B

Site Stats

Snippets: 1791
Codebases: 571