New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable HP bar on Emperium and MVP by default #2821
Conversation
see compilation errors in travis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps consider something like these?
p.maxHP = -1;
p.HP = -1;
if (status_get_hp(bl) < status_get_max_hp(bl)) {
if ((battle_config.show_monster_hp_bar == 1 && !(md->class_ == MOBID_EMPELIUM || md->status.mode & MD_BOSS))
|| (battle_config.show_monster_hp_bar & 2 && md->status.mode & MD_BOSS)
|| (battle_config.show_monster_hp_bar & 4 && md->class_ == MOBID_EMPELIUM)
) {
p.maxHP = status_get_max_hp(bl);
p.HP = status_get_hp(bl);
}
}
less redundant? easier to read?
or even better create a new method
static bool is_show_monster_hp_bar(struct mob_data *md, struct block_list *bl) {
if (status_get_hp(bl) < status_get_max_hp(bl)) {
if ((battle_config.show_monster_hp_bar == 1 && !(md->class_ == MOBID_EMPELIUM || md->status.mode & MD_BOSS))
|| (battle_config.show_monster_hp_bar & 2 && md->status.mode & MD_BOSS)
|| (battle_config.show_monster_hp_bar & 4 && md->class_ == MOBID_EMPELIUM)
) {
return true;
}
}
return false;
}
so the code can reuse it at other places? since its applicable to more than 1 places.
@Emistry edited as a function just like you suggested. Please see changes, thank you! :) |
ops, i try to fix conflicts with github interface, and it created merge commit. |
@4144 so how do i do this? :D |
I also found this
About rebase. |
also need rebase and fix conflict. about this better read somewhere. i not sure what tools you using and how better explain it |
can do the way aegis do ? define all MVP as Class_MVP then the battle_config has 4 fields
barricade also do not show HP bar, it is Class_Guardian ? or Class_Boss ? btw I think this is the actual and correct fix, EDIT: rathena has this
CLASS_BATTLEFIELD ?? |
In mob.h we have this enumeration which is used in the monster spawn code: enum e_bosstype {
BTYPE_NONE = 0,
BTYPE_BOSS = 1,
BTYPE_MVP = 2,
}; if (strcmp(w2, "boss_monster") == 0)
mobspawn.state.boss = BTYPE_MVP;
else if (strcmp(w2, "miniboss_monster") == 0)
mobspawn.state.boss = BTYPE_BOSS;
else
mobspawn.state.boss = BTYPE_NONE; |
Added configuration via battle conf to enable again Redesigned showhpbar as a clif function Thanks to @Emistry for the information Signed-off-by: Samuel23 <johnsamuel_santos3@yahoo.com>
331a929
to
c51263c
Compare
Pull Request Prelude
Changes Proposed
Disable HP bar on Emperium and MVP by default
Added configuration via battle conf to enable again
Issues addressed:
#744 (comment)