Cleanup as follow up to a205287 (#6377)
Removes unused constants Cleans up some wrong usages of e_mode Cleans up a mistake introduced in 62a2813a Fixed a mismatching header
This commit is contained in:
parent
a7b4e5fd03
commit
081b5c86bd
@ -12,7 +12,7 @@
|
||||
# Hp Additional HP. Base HP depends on caster HP. (Default: 0)
|
||||
# Sp Additional SP. Base SP depends on caster SP. (Default: 1)
|
||||
# Attack Additional minimum attack. Base attack depends on caster attack. (Default: 0)
|
||||
# Attack2 Additional maximum attack. Base attack depend on caster attack. (Default: 0)
|
||||
# Attack2 Additional maximum attack. Base attack depends on caster attack. (Default: 0)
|
||||
# Defense Physical defense of the elemental, reduces melee and ranged physical attack/skill damage. Base defense depends on the caster defense. (Default: 0)
|
||||
# MagicDefense Magic defense of the elemental, reduces magical skill damage. Base magic defense depends on the caster magic defense. (Default: 0)
|
||||
# Str Strength which affects attack. (Default: 0)
|
||||
|
@ -167,10 +167,6 @@ const t_itemid WEDDING_RING_F = 2635;
|
||||
//Elemental System
|
||||
#define MAX_ELEMENTALSKILL 42
|
||||
#define EL_SKILLBASE 8401
|
||||
#define MAX_ELESKILLTREE 3
|
||||
#define MAX_ELEMENTAL_CLASS 12
|
||||
#define EL_CLASS_BASE 2114
|
||||
#define EL_CLASS_MAX (EL_CLASS_BASE+MAX_ELEMENTAL_CLASS-1)
|
||||
|
||||
//Achievement System
|
||||
#define MAX_ACHIEVEMENT_OBJECTIVES 10 /// Maximum different objectives in achievement_db.yml
|
||||
@ -488,7 +484,7 @@ struct s_elemental {
|
||||
int elemental_id;
|
||||
uint32 char_id;
|
||||
short class_;
|
||||
enum e_mode mode;
|
||||
int mode;
|
||||
int hp, sp, max_hp, max_sp, matk, atk, atk2;
|
||||
short hit, flee, amotion, def, mdef;
|
||||
t_tick life_time;
|
||||
|
@ -485,7 +485,7 @@ int elemental_change_mode_ack(s_elemental_data *ed, e_elemental_skillmode skill_
|
||||
/*===============================================================
|
||||
* Change elemental mode.
|
||||
*-------------------------------------------------------------*/
|
||||
int elemental_change_mode(s_elemental_data *ed, e_mode mode) {
|
||||
int elemental_change_mode(s_elemental_data *ed, int mode) {
|
||||
nullpo_ret(ed);
|
||||
|
||||
// Remove target
|
||||
@ -659,7 +659,7 @@ static int elemental_ai_sub_timer(s_elemental_data *ed, map_session_data *sd, t_
|
||||
else
|
||||
view_range = ed->db->range2;
|
||||
|
||||
e_mode mode = status_get_mode(&ed->bl);
|
||||
int mode = status_get_mode(&ed->bl);
|
||||
|
||||
master_dist = distance_bl(&sd->bl, &ed->bl);
|
||||
if( master_dist > AREA_SIZE ) { // Master out of vision range.
|
||||
|
@ -96,7 +96,7 @@ int elemental_data_received(s_elemental *ele, bool flag);
|
||||
int elemental_save(s_elemental_data *ed);
|
||||
|
||||
int elemental_change_mode_ack(s_elemental_data *ed, e_elemental_skillmode skill_mode);
|
||||
int elemental_change_mode(s_elemental_data *ed, e_mode mode);
|
||||
int elemental_change_mode(s_elemental_data *ed, int mode);
|
||||
|
||||
void elemental_heal(s_elemental_data *ed, int hp, int sp);
|
||||
int elemental_dead(s_elemental_data *ed);
|
||||
|
@ -1194,7 +1194,7 @@ int mob_spawn (struct mob_data *md)
|
||||
/*==========================================
|
||||
* Determines if the mob can change target. [Skotlex]
|
||||
*------------------------------------------*/
|
||||
static int mob_can_changetarget(struct mob_data* md, struct block_list* target, enum e_mode mode)
|
||||
static int mob_can_changetarget(struct mob_data* md, struct block_list* target, int mode)
|
||||
{
|
||||
// Special feature that makes monsters always attack the person that provoked them
|
||||
if(battle_config.mob_ai&0x800 && md->state.provoke_flag)
|
||||
@ -1683,7 +1683,7 @@ int mob_warpchase(struct mob_data *md, struct block_list *target)
|
||||
static bool mob_ai_sub_hard(struct mob_data *md, t_tick tick)
|
||||
{
|
||||
struct block_list *tbl = nullptr, *abl = nullptr;
|
||||
enum e_mode mode;
|
||||
int mode;
|
||||
int view_range, can_move;
|
||||
|
||||
if(md->bl.prev == nullptr || md->status.hp == 0)
|
||||
|
@ -18908,7 +18908,7 @@ BUILDIN_FUNC(setunitdata)
|
||||
ShowWarning("buildin_setunitdata: Error in finding target for BL_ELEM!\n");
|
||||
return SCRIPT_CMD_FAILURE;
|
||||
}
|
||||
elemental_change_mode(ed, static_cast<e_mode>(EL_MODE_AGGRESSIVE));
|
||||
elemental_change_mode(ed, EL_MODE_AGGRESSIVE);
|
||||
unit_attack(&ed->bl, target->id, 1);
|
||||
break;
|
||||
}
|
||||
|
@ -10966,7 +10966,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|
||||
|
||||
case SO_EL_CONTROL:
|
||||
if( sd ) {
|
||||
enum e_mode mode = EL_MODE_PASSIVE; // Standard mode.
|
||||
int mode;
|
||||
|
||||
if( !sd->ed ) break;
|
||||
|
||||
@ -10975,8 +10975,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|
||||
break;
|
||||
}
|
||||
switch( skill_lv ) {// Select mode bassed on skill level used.
|
||||
case 2: mode = static_cast<e_mode>(EL_MODE_ASSIST); break;
|
||||
case 3: mode = static_cast<e_mode>(EL_MODE_AGGRESSIVE); break;
|
||||
case 1: mode = EL_MODE_PASSIVE; // Standard mode.
|
||||
case 2: mode = EL_MODE_ASSIST; break;
|
||||
case 3: mode = EL_MODE_AGGRESSIVE; break;
|
||||
}
|
||||
if( !elemental_change_mode(sd->ed,mode) ) {
|
||||
clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
|
||||
|
@ -95,7 +95,7 @@ static unsigned int status_calc_maxhp(struct block_list *bl, uint64 maxhp);
|
||||
static unsigned int status_calc_maxsp(struct block_list *bl, uint64 maxsp);
|
||||
static unsigned char status_calc_element(struct block_list *bl, struct status_change *sc, int element);
|
||||
static unsigned char status_calc_element_lv(struct block_list *bl, struct status_change *sc, int lv);
|
||||
static enum e_mode status_calc_mode(struct block_list *bl, struct status_change *sc, enum e_mode mode);
|
||||
static int status_calc_mode(struct block_list *bl, struct status_change *sc, int mode);
|
||||
#ifdef RENEWAL
|
||||
static unsigned short status_calc_ematk(struct block_list *,struct status_change *,int);
|
||||
#endif
|
||||
@ -8397,19 +8397,19 @@ unsigned char status_calc_attack_element(struct block_list *bl, struct status_ch
|
||||
* @param mode: Original mode
|
||||
* @return mode with cap_value(mode, 0, INT_MAX)
|
||||
*/
|
||||
static enum e_mode status_calc_mode(struct block_list *bl, struct status_change *sc, enum e_mode mode)
|
||||
static int status_calc_mode(struct block_list *bl, struct status_change *sc, int mode)
|
||||
{
|
||||
if(!sc || !sc->count)
|
||||
return cap_value(mode, MD_NONE, static_cast<e_mode>(INT_MAX));
|
||||
return cap_value(mode, MD_NONE,INT_MAX);
|
||||
if(sc->data[SC_MODECHANGE]) {
|
||||
if (sc->data[SC_MODECHANGE]->val2)
|
||||
mode = static_cast<e_mode>((mode&~MD_MASK)|sc->data[SC_MODECHANGE]->val2); // Set mode
|
||||
mode = (mode&~MD_MASK)|sc->data[SC_MODECHANGE]->val2; // Set mode
|
||||
if (sc->data[SC_MODECHANGE]->val3)
|
||||
mode = static_cast<e_mode>(mode|sc->data[SC_MODECHANGE]->val3); // Add mode
|
||||
mode = mode|sc->data[SC_MODECHANGE]->val3; // Add mode
|
||||
if (sc->data[SC_MODECHANGE]->val4)
|
||||
mode = static_cast<e_mode>(mode&~sc->data[SC_MODECHANGE]->val4); // Del mode
|
||||
mode = mode&~sc->data[SC_MODECHANGE]->val4; // Del mode
|
||||
}
|
||||
return cap_value(mode, MD_NONE, static_cast<e_mode>(INT_MAX));
|
||||
return cap_value(mode, MD_NONE, INT_MAX);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -9778,7 +9778,7 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
|
||||
break;
|
||||
case SC_MODECHANGE:
|
||||
{
|
||||
enum e_mode mode;
|
||||
int mode;
|
||||
struct status_data *bstatus = status_get_base_status(bl);
|
||||
if (!bstatus) return 0;
|
||||
if (sc->data[type]) { // Pile up with previous values.
|
||||
@ -9786,9 +9786,9 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
|
||||
val3 |= sc->data[type]->val3;
|
||||
val4 |= sc->data[type]->val4;
|
||||
}
|
||||
mode = val2 ? static_cast<e_mode>((val2&~MD_MASK)|val2) : bstatus->mode; // Base mode
|
||||
if (val4) mode = static_cast<e_mode>(mode&~val4); // Del mode
|
||||
if (val3) mode = static_cast<e_mode>(mode|val3); // Add mode
|
||||
mode = val2 ? ((val2&~MD_MASK)|val2) : bstatus->mode; // Base mode
|
||||
if (val4) mode = (mode&~val4); // Del mode
|
||||
if (val3) mode = (mode|val3); // Add mode
|
||||
if (mode == bstatus->mode) { // No change.
|
||||
if (sc->data[type]) // Abort previous status
|
||||
return status_change_end(bl, type, INVALID_TIMER);
|
||||
@ -14982,7 +14982,7 @@ TIMER_FUNC(status_change_timer){
|
||||
if( !status_charge(bl,0,sce->val2) ) {
|
||||
struct block_list *s_bl = battle_get_master(bl);
|
||||
if (bl->type == BL_ELEM)
|
||||
elemental_change_mode(BL_CAST(BL_ELEM, bl), static_cast<e_mode>(MAX_ELESKILLTREE));
|
||||
elemental_change_mode(BL_CAST(BL_ELEM, bl), EL_MODE_PASSIVE);
|
||||
if( s_bl )
|
||||
status_change_end(s_bl,static_cast<sc_type>(type+1),INVALID_TIMER);
|
||||
status_change_end(bl,type,INVALID_TIMER);
|
||||
|
@ -2634,7 +2634,7 @@ struct status_data {
|
||||
matk_min, matk_max,
|
||||
speed,
|
||||
amotion, adelay, dmotion;
|
||||
enum e_mode mode;
|
||||
int mode;
|
||||
short
|
||||
hit, flee, cri, flee2,
|
||||
def2, mdef2,
|
||||
|
Loading…
x
Reference in New Issue
Block a user