diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-02-17 21:33:54 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-02-17 21:33:54 +0000 |
commit | f06d3b26ad08bb054b6593fac39042cb20649c36 (patch) | |
tree | 53861eeb70d343a9d429f35d1cf29b1139c828b1 /src/map/party.c | |
parent | ff4c178309e0e18939d4077283a689e356311ce8 (diff) | |
download | hercules-f06d3b26ad08bb054b6593fac39042cb20649c36.tar.gz hercules-f06d3b26ad08bb054b6593fac39042cb20649c36.tar.bz2 hercules-f06d3b26ad08bb054b6593fac39042cb20649c36.tar.xz hercules-f06d3b26ad08bb054b6593fac39042cb20649c36.zip |
- Added NK value 3: No damage + area of effect skill (NK_SPLASH_NO_DAMAGE)
- Removed the double-cast specific code and made it use skill_addtimerskill instead.
- Modified party_foreachsamemap so that it returns to addition of the return value of the functions invoked. Type has been changed for "range", when 0, it scans all party members in the map.
- Updated most skill/battle code to use map_foreachinrange rather than map_foreachinarea.
- map_foreachinrange does not performs an exact range check anymore. However the relevant code is commented and anyone can enable it.
- Updated most skills to use skill_get_splash instead of hardcoded ranges.
- Added function skill_get_casttype which returns the type of function that should be invoked for that skill: skill_castend_pos, skill_castend_nodamage_id or skill_castend_damage_id.
- self skills are sent to skill_castend_nodamage_id regardless of nk (nk should signal if the skill causes damage above everything, it is used on autospell/effects).
- Due to the previous change, self skills where the target and src are different, and don't have an nk of no damage, they are sent to castend_damage_id (assumed target auto-selected skills)
- Applied the relevant updates to db/skill_db.txt, db/skill_unit_db also got updated, as trap ranges should all be 1, the splash damage range is defined now in skill_db
- Cleaned up the implementation of the code related to Gangster's paradise and TK_HP/SPtime
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5313 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/party.c')
-rw-r--r-- | src/map/party.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/map/party.c b/src/map/party.c index be8520d8f..31d4f0479 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -694,16 +694,13 @@ int party_send_dot_remove(struct map_session_data *sd) // party_foreachsamemap(party_sub_count, sd, 0, &c);
int party_sub_count(struct block_list *bl, va_list ap)
{
- int *c = va_arg(ap, int*);
-
- (*c)++;
return 1;
}
// 同じマップのパーティメンバー全体に処理をかける
// type==0 同じマップ
// !=0 画面内
-void party_foreachsamemap(int (*func)(struct block_list*,va_list),struct map_session_data *sd,int type,...)
+int party_foreachsamemap(int (*func)(struct block_list*,va_list),struct map_session_data *sd,int range,...)
{
struct party *p;
va_list ap;
@@ -711,25 +708,26 @@ void party_foreachsamemap(int (*func)(struct block_list*,va_list),struct map_ses int x0,y0,x1,y1;
struct block_list *list[MAX_PARTY];
int blockcount=0;
+ int total = 0; //Return value.
- nullpo_retv(sd);
+ nullpo_retr(0,sd);
if((p=party_search(sd->status.party_id))==NULL)
- return;
+ return 0;
- x0=sd->bl.x-AREA_SIZE;
- y0=sd->bl.y-AREA_SIZE;
- x1=sd->bl.x+AREA_SIZE;
- y1=sd->bl.y+AREA_SIZE;
+ x0=sd->bl.x-range;
+ y0=sd->bl.y-range;
+ x1=sd->bl.x+range;
+ y1=sd->bl.y+range;
- va_start(ap,type);
+ va_start(ap,range);
for(i=0;i<MAX_PARTY;i++){
struct party_member *m=&p->member[i];
if(m->sd!=NULL){
if(sd->bl.m!=m->sd->bl.m)
continue;
- if(type!=0 &&
+ if(range &&
(m->sd->bl.x<x0 || m->sd->bl.y<y0 ||
m->sd->bl.x>x1 || m->sd->bl.y>y1 ) )
continue;
@@ -741,9 +739,10 @@ void party_foreachsamemap(int (*func)(struct block_list*,va_list),struct map_ses for(i=0;i<blockcount;i++)
if(list[i]->prev) // 有効かどうかチェック
- func(list[i],ap);
+ total += func(list[i],ap);
map_freeblock_unlock(); // 解放を許可する
va_end(ap);
+ return total;
}
|