summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-02 15:54:27 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-02 15:54:27 +0000
commitd918805022383bbf9c63f82c700f88e443ff7cd2 (patch)
tree41ac155389f08738d15bf786cd36bacce3b7cc56 /src
parent64d039f074c942a4265345e7ff832b4938d6381a (diff)
downloadhercules-d918805022383bbf9c63f82c700f88e443ff7cd2.tar.gz
hercules-d918805022383bbf9c63f82c700f88e443ff7cd2.tar.bz2
hercules-d918805022383bbf9c63f82c700f88e443ff7cd2.tar.xz
hercules-d918805022383bbf9c63f82c700f88e443ff7cd2.zip
Removed some long-unneccessary debug messages (from r1105).
Removed function skill_count_target() because it's a duplicate (see topic:169337). Renamed skill_get_pl to skill_get_ele (because it retrieves element ids). The block_list structure now uses the BL_ enums instead of 'unsigned char'. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11640 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c9
-rw-r--r--src/map/map.h6
-rw-r--r--src/map/skill.c41
-rw-r--r--src/map/skill.h4
-rw-r--r--src/map/status.c2
-rw-r--r--src/map/unit.c4
6 files changed, 22 insertions, 44 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 66348ba6e..3a865a4a4 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -833,8 +833,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
/*==========================================
* battle_calc_weapon_attack (by Skotlex)
*------------------------------------------*/
-static struct Damage battle_calc_weapon_attack(
- struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int wflag)
+static struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int wflag)
{
unsigned int skillratio = 100; //Skill dmg modifiers.
short skill=0;
@@ -966,7 +965,7 @@ static struct Damage battle_calc_weapon_attack(
}
t_class = status_get_class(target);
- s_ele = s_ele_ = skill_get_pl(skill_num, skill_lv);
+ s_ele = s_ele_ = skill_get_ele(skill_num, skill_lv);
if (!skill_num || s_ele == -1) { //Take weapon's element
s_ele = sstatus->rhw.ele;
s_ele_ = sstatus->lhw?sstatus->lhw->ele:0;
@@ -2135,7 +2134,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
BL_CAST(BL_PC, target, tsd);
//Initialize variables that will be used afterwards
- s_ele = skill_get_pl(skill_num, skill_lv);
+ s_ele = skill_get_ele(skill_num, skill_lv);
if (s_ele == -1) // pl=-1 : the skill takes the weapon's element
s_ele = sstatus->rhw.ele;
@@ -2468,7 +2467,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
md.blewcount += battle_blewcount_bonus(sd, skill_num);
}
- s_ele = skill_get_pl(skill_num, skill_lv);
+ s_ele = skill_get_ele(skill_num, skill_lv);
if (s_ele < 0) //Attack that takes weapon's element for misc attacks? Make it neutral [Skotlex]
s_ele = ELE_NEUTRAL;
diff --git a/src/map/map.h b/src/map/map.h
index cc2b54b0c..c4526bcb6 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -232,8 +232,8 @@ struct block_list {
struct block_list *next,*prev;
int id;
short m,x,y;
- unsigned char type;
- unsigned char subtype;
+ enum bl_type type;
+ enum bl_subtype subtype;
};
struct walkpath_data {
@@ -253,7 +253,7 @@ struct skill_timerskill {
int map;
short x,y;
short skill_id,skill_lv;
- int type;
+ int type; // a BF_ type (NOTE: some places use this as general-purpose storage...)
int flag;
};
diff --git a/src/map/skill.c b/src/map/skill.c
index 362a7ca2e..88e45a5d8 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -692,7 +692,7 @@ int icewall_unit_pos;
// Skill DB
int skill_get_hit( int id ){ skill_get (skill_db[id].hit, id, 1); }
int skill_get_inf( int id ){ skill_get (skill_db[id].inf, id, 1); }
-int skill_get_pl( int id , int lv ){ skill_get (skill_db[id].pl[lv-1], id, lv); }
+int skill_get_ele( int id , int lv ){ skill_get (skill_db[id].element[lv-1], id, lv); }
int skill_get_nk( int id ){ skill_get (skill_db[id].nk, id, 1); }
int skill_get_max( int id ){ skill_get (skill_db[id].max, id, 1); }
int skill_get_range( int id , int lv ){ skill_get(skill_db[id].range[lv-1], id, lv); }
@@ -774,7 +774,6 @@ int skill_greed(struct block_list *bl, va_list ap);
int skill_cell_overlap(struct block_list *bl, va_list ap);
int skill_ganbatein(struct block_list *bl, va_list ap);
int skill_trap_splash(struct block_list *bl, va_list ap);
-int skill_count_target(struct block_list *bl, va_list ap);
struct skill_unit_group_tickset *skill_unitgrouptickset_search(struct block_list *bl,struct skill_unit_group *sg,int tick);
static int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int tick);
static int skill_unit_onleft(int skill_id, struct block_list *bl,unsigned int tick);
@@ -1036,11 +1035,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
nullpo_retr(0, src);
nullpo_retr(0, bl);
- if(skillid < 0)
- { // remove the debug print when this case is finished
- ShowDebug("skill_additional_effect: skillid=%i\ncall: %p %p %i %i %i %i",skillid,src,bl,skillid,skilllv,attack_type,tick);
- return 0;
- }
+ if(skillid < 0) return 0;
if(skillid > 0 && skilllv <= 0) return 0; // don't forget auto attacks! - celest
BL_CAST(BL_PC, src, sd);
@@ -1568,12 +1563,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
nullpo_retr(0, src);
nullpo_retr(0, bl);
- if(skillid < 0)
- { // remove the debug print when this case is finished
- ShowDebug("skill_counter_additional_effect: skillid=%i\ncall: %p %p %i %i %i %i",skillid,
- src, bl,skillid,skilllv,attack_type,tick);
- return 0;
- }
+ if(skillid < 0) return 0;
if(skillid > 0 && skilllv <= 0) return 0; // don't forget auto attacks! - celest
tsc = status_get_sc(bl);
@@ -2005,7 +1995,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
struct pet_data *pd = (TBL_PET*)src;
if (pd->a_skill && pd->a_skill->div_ && pd->a_skill->id == skillid)
{
- int element = skill_get_pl(skillid, skilllv);
+ int element = skill_get_ele(skillid, skilllv);
if (skillid == -1)
element = sstatus->rhw.ele;
if (element != ELE_NEUTRAL || !(battle_config.attack_attr_none&BL_PET))
@@ -3312,8 +3302,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
}
cnt--;
if (cnt > 0)
- skill_addtimerskill(src,tick+125,bl->id,0,0,
- skillid,skilllv,cnt,flag);
+ skill_addtimerskill(src,tick+125,bl->id,0,0,skillid,skilllv,cnt,flag);
} else if (sd) //Eat up deluge tiles.
skill_count_water(src,0);
@@ -3508,7 +3497,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
tsc = status_get_sc(bl);
if (src!=bl && type > -1 &&
- (i = skill_get_pl(skillid, skilllv)) > ELE_NEUTRAL &&
+ (i = skill_get_ele(skillid, skilllv)) > ELE_NEUTRAL &&
skill_get_inf(skillid) != INF_SUPPORT_SKILL &&
battle_attr_fix(NULL, NULL, 100, i, tstatus->def_ele, tstatus->ele_lv) <= 0)
return 1; //Skills that cause an status should be blocked if the target element blocks its element.
@@ -3871,11 +3860,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case ITEM_ENCHANTARMS:
clif_skill_nodamage(src,bl,skillid,skilllv,
sc_start2(bl,type,100,skilllv,
- skill_get_pl(skillid,skilllv), skill_get_time(skillid,skilllv)));
+ skill_get_ele(skillid,skilllv), skill_get_time(skillid,skilllv)));
break;
case TK_SEVENWIND:
- switch(skill_get_pl(skillid,skilllv)) {
+ switch(skill_get_ele(skillid,skilllv)) {
case ELE_EARTH : type = SC_EARTHWEAPON; break;
case ELE_WIND : type = SC_WINDWEAPON; break;
case ELE_WATER : type = SC_WATERWEAPON; break;
@@ -5004,7 +4993,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case NPC_CHANGETELEKINESIS:
case NPC_CHANGEUNDEAD:
clif_skill_nodamage(src,bl,skillid,skilllv,
- sc_start2(bl, type, 100, skilllv, skill_get_pl(skillid,skilllv),
+ sc_start2(bl, type, 100, skilllv, skill_get_ele(skillid,skilllv),
skill_get_time(skillid, skilllv)));
break;
@@ -9687,16 +9676,6 @@ int skill_chastle_mob_changetarget(struct block_list *bl,va_list ap)
}
/*==========================================
- * 指定範囲内でsrcに対して有効なターゲットのblの数を数える(foreachinarea)
- *------------------------------------------*/
-int skill_count_target (struct block_list *bl, va_list ap)
-{
- struct block_list *src = va_arg(ap,struct block_list *);
- if (battle_check_target(src,bl,BCT_ENEMY) > 0)
- return 1;
- return 0;
-}
-/*==========================================
*
*------------------------------------------*/
int skill_trap_splash (struct block_list *bl, va_list ap)
@@ -11409,7 +11388,7 @@ int skill_readdb (void)
skill_split_atoi(split[1],skill_db[i].range);
skill_db[i].hit=atoi(split[2]);
skill_db[i].inf=atoi(split[3]);
- skill_split_atoi(split[4],skill_db[i].pl);
+ skill_split_atoi(split[4],skill_db[i].element);
skill_db[i].nk=(int)strtol(split[5], NULL, 0);
skill_split_atoi(split[6],skill_db[i].splash);
skill_db[i].max=atoi(split[7]);
diff --git a/src/map/skill.h b/src/map/skill.h
index efb6cd086..61f4d1c88 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -63,7 +63,7 @@
struct s_skill_db {
char *name;
char *desc;
- int range[MAX_SKILL_LEVEL],hit,inf,pl[MAX_SKILL_LEVEL],nk,splash[MAX_SKILL_LEVEL],max;
+ int range[MAX_SKILL_LEVEL],hit,inf,element[MAX_SKILL_LEVEL],nk,splash[MAX_SKILL_LEVEL],max;
int num[MAX_SKILL_LEVEL];
int cast[MAX_SKILL_LEVEL],walkdelay[MAX_SKILL_LEVEL],delay[MAX_SKILL_LEVEL];
int upkeep_time[MAX_SKILL_LEVEL],upkeep_time2[MAX_SKILL_LEVEL];
@@ -155,7 +155,7 @@ int skill_get_casttype(int id); //[Skotlex]
int skill_get_type( int id );
int skill_get_hit( int id );
int skill_get_inf( int id );
-int skill_get_pl( int id , int lv );
+int skill_get_ele( int id , int lv );
int skill_get_nk( int id );
int skill_get_max( int id );
int skill_get_range( int id , int lv );
diff --git a/src/map/status.c b/src/map/status.c
index 6919a47bb..4ae211098 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1112,7 +1112,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, int
hide_flag = flag?OPTION_HIDE:(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK);
//You cannot hide from ground skills.
- if(skill_get_pl(skill_num,1) == ELE_EARTH) //TODO: Need Skill Lv here :/
+ if(skill_get_ele(skill_num,1) == ELE_EARTH) //TODO: Need Skill Lv here :/
hide_flag &= ~OPTION_HIDE;
switch (target->type)
diff --git a/src/map/unit.c b/src/map/unit.c
index 3f5d1673a..6fd7ce871 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -995,7 +995,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, sh
if( casttime>0 || temp){
- clif_skillcasting(src, src->id, target_id, 0,0, skill_num, skill_get_pl(skill_num, skill_lv), casttime);
+ clif_skillcasting(src, src->id, target_id, 0,0, skill_num, skill_get_ele(skill_num, skill_lv), casttime);
if (sd && target->type == BL_MOB)
{
@@ -1131,7 +1131,7 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, sh
if( casttime>0 ) {
unit_stop_walking( src, 1);
- clif_skillcasting(src, src->id, 0, skill_x, skill_y, skill_num, skill_get_pl(skill_num, skill_lv), casttime);
+ clif_skillcasting(src, src->id, 0, skill_x, skill_y, skill_num, skill_get_ele(skill_num, skill_lv), casttime);
} else
ud->state.skillcastcancel=0;