몹과 자신을 "비교"
2007.04.12 13:05
/* 무한대전 *비교*
*
* 현재운영중인 무한대전 또는 "무한대전 소스를 수정한 머드"들 중에서
* 상업적으로 사용되는 곳을 제외하면, 누구나 이소스를 사용할수 있습니다.
*
* 설명: 몹과 사용자간의 데이타를 비교하여...
* > , < , = 으로 표시를 함...
* 설명을 제대로 못드리겠네여... 그냥 추가하시면 알게됨..
* 추가방법: mextern.h 에서 아무곳에나
* int bi_go(); 라고 써주시궁...
* 밑에 써져있는 본문을 아무곳에나 추가...
* global.c 화일에서 명령어를 추가해주시면 됩니다.
* 나머지는 각 무한대전에 알맞게 수정하셔서 쓰시면 됩니다.
*
* 1999년 10월 18일 By Muhan.
*/
/***********************************************************************/
/* 비교 By 천마신군 */
/************************************************************************/
int bi_go(ply_ptr, cmnd)
creature *ply_ptr;
cmd *cmnd;
{
creature *crt_ptr = NULL;
room *rom_ptr = NULL;
ctag *cp = NULL;
int fd, i = 0;
float st = 0;
char c = '?';
int a, b;
char str[64], strs[64];
long ndi = 0, sdi = 0, pdi = 0, smtot = 0, latot = 0;
long atotal = 0, btotal = 0;
fd = ply_ptr->fd;
rom_ptr = ply_ptr->parent_rom;
if(F_ISSET(ply_ptr, PBLIND)) {
print(fd, "아무것도 보이지 않습니다!\n");
return;
}
if(crt_ptr==NULL) {
if(cmnd->num < 2) {
print(fd, "누구의 상태를 보시겠습니까?\n");
return;
}
crt_ptr = find_crt(ply_ptr, rom_ptr->first_mon, cmnd->str[1], cmnd->val[1]);
}
if(crt_ptr==NULL) {
print(fd, "그런것은 여기에 없습니다.\n");
return;
}
print(fd, "\r\n");
print(fd, "이름: %-15s %s\r\n", ply_ptr->name, crt_ptr->name);
a = ply_ptr->level;
b = crt_ptr->level;
if (a > b)
c = '>';
if (a < b)
c = '<';
if (a == b)
c = '=';
print(fd, "레벨: %-15d %c %d\r\n", a, c, b);
a = ply_ptr->hpmax;
b = crt_ptr->hpmax;
if (a > b)
c = '>';
if (a < b)
c = '<';
if (a == b)
c = '=';
sprintf(str, "%d/%d", ply_ptr->hpcur, ply_ptr->hpmax);
sprintf(strs, "%d/%d", crt_ptr->hpcur, crt_ptr->hpmax);
print(fd, "체력: %-15s %c %s\r\n", str, c, strs);
a = ply_ptr->mpmax;
b = crt_ptr->mpmax;
if (a > b)
c = '>';
if (a < b)
c = '<';
if (a == b)
c = '=';
sprintf(str, "%d/%d", ply_ptr->mpcur, ply_ptr->mpmax);
sprintf(strs, "%d/%d", crt_ptr->mpcur, crt_ptr->mpmax);
print(fd, "마력: %-15s %c %s\r\n", str, c, strs);
/*
여기부터는 이동력입니다.
이동력을 추가하신분들은 구냥 변수를 수정하시구...
이동력 추가안한 곳에서는 삭제하시면 됩니다.
*/
/* 시작 */
a = ply_ptr->mvmax;
b = crt_ptr->mvmax;
if (a > b)
c = '>';
if (a < b)
c = '<';
if (a == b)
c = '=';
sprintf(str, "%d/%d", ply_ptr->mvcur, ply_ptr->mvmax);
sprintf(strs, "%d/%d", crt_ptr->mvcur, crt_ptr->mvmax);
print(fd, "이동: %-15s %c %s\r\n", str, c, strs);
/* 종료 */
ndi = ply_ptr->ndice;
sdi = ply_ptr->sdice;
pdi = ply_ptr->pdice;
smtot = ndi + pdi;
latot = ndi * sdi + pdi;
atotal = latot - smtot;
a = atotal;
sprintf(str, "%d ~ %d", smtot, latot);
ndi = crt_ptr->ndice;
sdi = crt_ptr->sdice;
pdi = crt_ptr->pdice;
smtot = ndi + pdi;
latot = ndi * sdi + pdi;
btotal = latot - smtot;
b = btotal;
sprintf(strs, "%d ~ %d", smtot, latot);
if (a > b)
c = '>';
if (a < b)
c = '<';
if (a == b)
c = '=';
print(fd, "타격: %-15s %c %s\r\n", str, c, strs);
a = ply_ptr->armor;
b = crt_ptr->armor;
if (a > b)
c = '>';
if (a < b)
c = '<';
if (a == b)
c = '=';
print(fd, "방어: %-15d %c %d",
(100-ply_ptr->armor), c, (100-crt_ptr->armor));
return(0);
}
소스가 조금 단조롭지만, 약간만 다듬으면 좋은 소스가 될것
같습니다.
홈지기 "그륨"
*
* 현재운영중인 무한대전 또는 "무한대전 소스를 수정한 머드"들 중에서
* 상업적으로 사용되는 곳을 제외하면, 누구나 이소스를 사용할수 있습니다.
*
* 설명: 몹과 사용자간의 데이타를 비교하여...
* > , < , = 으로 표시를 함...
* 설명을 제대로 못드리겠네여... 그냥 추가하시면 알게됨..
* 추가방법: mextern.h 에서 아무곳에나
* int bi_go(); 라고 써주시궁...
* 밑에 써져있는 본문을 아무곳에나 추가...
* global.c 화일에서 명령어를 추가해주시면 됩니다.
* 나머지는 각 무한대전에 알맞게 수정하셔서 쓰시면 됩니다.
*
* 1999년 10월 18일 By Muhan.
*/
/***********************************************************************/
/* 비교 By 천마신군 */
/************************************************************************/
int bi_go(ply_ptr, cmnd)
creature *ply_ptr;
cmd *cmnd;
{
creature *crt_ptr = NULL;
room *rom_ptr = NULL;
ctag *cp = NULL;
int fd, i = 0;
float st = 0;
char c = '?';
int a, b;
char str[64], strs[64];
long ndi = 0, sdi = 0, pdi = 0, smtot = 0, latot = 0;
long atotal = 0, btotal = 0;
fd = ply_ptr->fd;
rom_ptr = ply_ptr->parent_rom;
if(F_ISSET(ply_ptr, PBLIND)) {
print(fd, "아무것도 보이지 않습니다!\n");
return;
}
if(crt_ptr==NULL) {
if(cmnd->num < 2) {
print(fd, "누구의 상태를 보시겠습니까?\n");
return;
}
crt_ptr = find_crt(ply_ptr, rom_ptr->first_mon, cmnd->str[1], cmnd->val[1]);
}
if(crt_ptr==NULL) {
print(fd, "그런것은 여기에 없습니다.\n");
return;
}
print(fd, "\r\n");
print(fd, "이름: %-15s %s\r\n", ply_ptr->name, crt_ptr->name);
a = ply_ptr->level;
b = crt_ptr->level;
if (a > b)
c = '>';
if (a < b)
c = '<';
if (a == b)
c = '=';
print(fd, "레벨: %-15d %c %d\r\n", a, c, b);
a = ply_ptr->hpmax;
b = crt_ptr->hpmax;
if (a > b)
c = '>';
if (a < b)
c = '<';
if (a == b)
c = '=';
sprintf(str, "%d/%d", ply_ptr->hpcur, ply_ptr->hpmax);
sprintf(strs, "%d/%d", crt_ptr->hpcur, crt_ptr->hpmax);
print(fd, "체력: %-15s %c %s\r\n", str, c, strs);
a = ply_ptr->mpmax;
b = crt_ptr->mpmax;
if (a > b)
c = '>';
if (a < b)
c = '<';
if (a == b)
c = '=';
sprintf(str, "%d/%d", ply_ptr->mpcur, ply_ptr->mpmax);
sprintf(strs, "%d/%d", crt_ptr->mpcur, crt_ptr->mpmax);
print(fd, "마력: %-15s %c %s\r\n", str, c, strs);
/*
여기부터는 이동력입니다.
이동력을 추가하신분들은 구냥 변수를 수정하시구...
이동력 추가안한 곳에서는 삭제하시면 됩니다.
*/
/* 시작 */
a = ply_ptr->mvmax;
b = crt_ptr->mvmax;
if (a > b)
c = '>';
if (a < b)
c = '<';
if (a == b)
c = '=';
sprintf(str, "%d/%d", ply_ptr->mvcur, ply_ptr->mvmax);
sprintf(strs, "%d/%d", crt_ptr->mvcur, crt_ptr->mvmax);
print(fd, "이동: %-15s %c %s\r\n", str, c, strs);
/* 종료 */
ndi = ply_ptr->ndice;
sdi = ply_ptr->sdice;
pdi = ply_ptr->pdice;
smtot = ndi + pdi;
latot = ndi * sdi + pdi;
atotal = latot - smtot;
a = atotal;
sprintf(str, "%d ~ %d", smtot, latot);
ndi = crt_ptr->ndice;
sdi = crt_ptr->sdice;
pdi = crt_ptr->pdice;
smtot = ndi + pdi;
latot = ndi * sdi + pdi;
btotal = latot - smtot;
b = btotal;
sprintf(strs, "%d ~ %d", smtot, latot);
if (a > b)
c = '>';
if (a < b)
c = '<';
if (a == b)
c = '=';
print(fd, "타격: %-15s %c %s\r\n", str, c, strs);
a = ply_ptr->armor;
b = crt_ptr->armor;
if (a > b)
c = '>';
if (a < b)
c = '<';
if (a == b)
c = '=';
print(fd, "방어: %-15d %c %d",
(100-ply_ptr->armor), c, (100-crt_ptr->armor));
return(0);
}
소스가 조금 단조롭지만, 약간만 다듬으면 좋은 소스가 될것
같습니다.
홈지기 "그륨"
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
57 | 특수 아이템 만들기 | 그리움 | 2007.04.12 | 253 |
» | 몹과 자신을 "비교" | 그리움 | 2007.04.12 | 219 |
55 | 패거리 전쟁시 적과 아군 구분 | 그리움 | 2007.04.12 | 216 |
54 | 순위 소스 | 그리움 | 2007.04.12 | 215 |
53 | 개량형 우체국 | 그리움 | 2007.04.12 | 228 |
52 | 명성치 도입 | 그리움 | 2007.04.12 | 229 |
51 | 자기 아파트 방설명은 자기가 #2 | 그리움 | 2007.04.12 | 222 |
50 | 이동력 추가하기 | 그리움 | 2007.04.12 | 225 |
49 | 경매 소스 | 그리움 | 2007.04.12 | 217 |
48 | 글자색, 배경색 15색 사용하기 | 그리움 | 2007.04.12 | 213 |
47 | Ctrl+Enter 패치하기 | 그리움 | 2007.04.12 | 198 |
46 | 패거리 상점 만들기 | 그리움 | 2007.04.12 | 199 |
45 | 귀환장소 설정 | 그리움 | 2007.04.12 | 228 |
44 | 출구 정렬 | 그리움 | 2007.04.12 | 222 |
43 | 게시판 검색 기능 추가하기 | 그리움 | 2007.04.12 | 207 |
42 | 암호 *****로 보이게 하기 | 그리움 | 2007.04.12 | 215 |
41 | 레벨을 32767까지 가능하게 | 그리움 | 2007.04.12 | 236 |
40 | 잡담 안시 사용하기 | 그리움 | 2007.04.12 | 236 |
39 | 지도 소스 #2 | 그리움 | 2007.04.12 | 230 |
38 | 베팅소스 | 그리움 | 2007.04.12 | 242 |