Skip to content

Commit

Permalink
Removed Basedamage Variable from Renewal (#8264)
Browse files Browse the repository at this point in the history
- As this variable is unused and is very hard to calculate in renewal's structure, it was removed completely from renewal to make the renewal code cleaner
- In pre-re it still works exactly the same as before (used for the EDP and Magnum Break bonus - renewal uses weaponATK for this instead)
- Follow-up to b5e3e5e
  • Loading branch information
Playtester committed Apr 20, 2024
1 parent b5e3e5e commit 75f5188
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/map/battle.cpp
Expand Up @@ -3641,7 +3641,9 @@ int battle_get_misc_element(struct block_list* src, struct block_list* target, u
static void battle_min_damage(struct Damage &wd, struct block_list &src, uint16 skill_id, int64 min) {
if (is_attack_right_handed(&src, skill_id)) {
wd.damage = cap_value(wd.damage, min, INT64_MAX);
#ifndef RENEWAL
wd.basedamage = cap_value(wd.basedamage, min, INT64_MAX);
#endif
}
// Left-hand damage is always capped to 0
if (is_attack_left_handed(&src, skill_id)) {
Expand Down Expand Up @@ -3839,9 +3841,11 @@ static void battle_calc_attack_masteries(struct Damage* wd, struct block_list *s
struct status_data *sstatus = status_get_status_data(src);
int t_class = status_get_class(target);

#ifndef RENEWAL
if (sd) {
wd->basedamage = battle_addmastery(sd, target, wd->basedamage, 0);
}
#endif

// Check if mastery damage applies to current skill
if (sd && battle_skill_stacks_masteries_vvs(skill_id, BCHK_ALL))
Expand Down Expand Up @@ -7054,10 +7058,12 @@ static struct Damage initialize_weapon_data(struct block_list *src, struct block
wd.flag = BF_WEAPON; //Initial Flag
wd.flag |= (skill_id||wd.miscflag)?BF_SKILL:BF_NORMAL; // Baphomet card's splash damage is counted as a skill. [Inkfish]
wd.isspdamage = false;
wd.damage = wd.damage2 = wd.basedamage =
wd.damage = wd.damage2 =
#ifdef RENEWAL
wd.statusAtk = wd.statusAtk2 = wd.equipAtk = wd.equipAtk2 = wd.weaponAtk = wd.weaponAtk2 = wd.masteryAtk = wd.masteryAtk2 =
wd.percentAtk = wd.percentAtk2 =
#else
wd.basedamage =
#endif
0;

Expand Down
5 changes: 3 additions & 2 deletions src/map/battle.hpp
Expand Up @@ -89,10 +89,11 @@ enum e_bonus_chk_flag : uint8 {
struct Damage {
#ifdef RENEWAL
int64 statusAtk, statusAtk2, weaponAtk, weaponAtk2, equipAtk, equipAtk2, masteryAtk, masteryAtk2, percentAtk, percentAtk2;
#else
int64 basedamage; /// Right hand damage that a normal attack would deal
#endif
int64 damage, /// Right hand damage
damage2, /// Left hand damage
basedamage; /// Right hand damage that a normal attack would deal
damage2; /// Left hand damage
enum e_damage_type type; /// Check clif_damage for type
short div_; /// Number of hit
int amotion,
Expand Down

0 comments on commit 75f5188

Please sign in to comment.