diff options
Diffstat (limited to 'src/map/status.c')
-rw-r--r-- | src/map/status.c | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/src/map/status.c b/src/map/status.c index c98857736..e04769e3f 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -2713,9 +2713,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) sd->left_weapon.atkmods[1] = status->dbs->atkmods[1][sd->weapontype2]; sd->left_weapon.atkmods[2] = status->dbs->atkmods[2][sd->weapontype2]; - if ((pc_isridingpeco(sd) || pc_isridingdragon(sd)) - && (sd->status.weapon==W_1HSPEAR || sd->status.weapon==W_2HSPEAR) - ) { + if ((pc_isridingpeco(sd) || pc_isridingdragon(sd)) && (sd->weapontype == W_1HSPEAR || sd->weapontype == W_2HSPEAR)) { //When Riding with spear, damage modifier to mid-class becomes //same as versus large size. sd->right_weapon.atkmods[1] = sd->right_weapon.atkmods[2]; @@ -2779,8 +2777,8 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) // Base batk value is set on status->calc_misc // weapon-type bonus (FIXME: Why is the weapon_atk bonus applied to base attack?) - if (sd->status.weapon < MAX_SINGLE_WEAPON_TYPE && sd->weapon_atk[sd->status.weapon]) - bstatus->batk += sd->weapon_atk[sd->status.weapon]; + if (sd->weapontype < MAX_SINGLE_WEAPON_TYPE && sd->weapon_atk[sd->weapontype]) + bstatus->batk += sd->weapon_atk[sd->weapontype]; // Absolute modifiers from passive skills #ifndef RENEWAL if((skill_lv=pc->checkskill(sd,BS_HILTBINDING))>0) // it doesn't work in RE. @@ -2928,10 +2926,10 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) #ifndef RENEWAL bstatus->hit += skill_lv; #endif - if(sd->status.weapon == W_BOW) + if (sd->weapontype == W_BOW) bstatus->rhw.range += skill_lv; } - if(sd->status.weapon >= W_REVOLVER && sd->status.weapon <= W_GRENADE) { + if (sd->weapontype >= W_REVOLVER && sd->weapontype <= W_GRENADE) { if((skill_lv=pc->checkskill(sd,GS_SINGLEACTION))>0) bstatus->hit += 2*skill_lv; if((skill_lv=pc->checkskill(sd,GS_SNAKEEYE))>0) { @@ -2939,9 +2937,9 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) bstatus->rhw.range += skill_lv; } } - if( (sd->status.weapon == W_1HAXE || sd->status.weapon == W_2HAXE) && (skill_lv = pc->checkskill(sd,NC_TRAININGAXE)) > 0 ) + if ((sd->weapontype == W_1HAXE || sd->weapontype == W_2HAXE) && (skill_lv = pc->checkskill(sd,NC_TRAININGAXE)) > 0) bstatus->hit += 3*skill_lv; - if((sd->status.weapon == W_MACE || sd->status.weapon == W_2HMACE) && (skill_lv = pc->checkskill(sd,NC_TRAININGAXE)) > 0) + if ((sd->weapontype == W_MACE || sd->weapontype == W_2HMACE) && (skill_lv = pc->checkskill(sd,NC_TRAININGAXE)) > 0) bstatus->hit += 2*skill_lv; if (pc->checkskill(sd, SU_POWEROFLIFE) > 0) bstatus->hit += 20; @@ -3001,12 +2999,11 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) // Relative modifiers from passive skills #ifndef RENEWAL_ASPD - if((skill_lv=pc->checkskill(sd,SA_ADVANCEDBOOK))>0 && sd->status.weapon == W_BOOK) + if (sd->weapontype == W_BOOK && (skill_lv=pc->checkskill(sd,SA_ADVANCEDBOOK)) > 0) bstatus->aspd_rate -= 5*skill_lv; if((skill_lv = pc->checkskill(sd,SG_DEVIL)) > 0 && !pc->nextjobexp(sd)) bstatus->aspd_rate -= 30*skill_lv; - if((skill_lv=pc->checkskill(sd,GS_SINGLEACTION))>0 && - (sd->status.weapon >= W_REVOLVER && sd->status.weapon <= W_GRENADE)) + if (sd->weapontype >= W_REVOLVER && sd->weapontype <= W_GRENADE && (skill_lv=pc->checkskill(sd,GS_SINGLEACTION)) > 0) bstatus->aspd_rate -= ((skill_lv+1)/2) * 10; if (pc_isridingpeco(sd)) bstatus->aspd_rate += 500-100*pc->checkskill(sd,KN_CAVALIERMASTERY); @@ -3896,7 +3893,7 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag) } else { st->cri = status->calc_critical(bl, sc, bst->cri + 3*(st->luk - bst->luk), true); } - if (battle_config.show_katar_crit_bonus && bl->type == BL_PC && BL_UCAST(BL_PC, bl)->status.weapon == W_KATAR) { + if (battle_config.show_katar_crit_bonus && bl->type == BL_PC && BL_UCAST(BL_PC, bl)->weapontype == W_KATAR) { st->cri *= 2; } } @@ -4327,11 +4324,11 @@ int status_base_amotion_pc(struct map_session_data *sd, struct status_data *st) nullpo_ret(st); amotion = status->dbs->aspd_base[pc->class2idx(sd->status.class)][sd->weapontype1]; - if ( sd->status.weapon > MAX_SINGLE_WEAPON_TYPE) + if (sd->weapontype > MAX_SINGLE_WEAPON_TYPE) amotion += status->dbs->aspd_base[pc->class2idx(sd->status.class)][sd->weapontype2] / 4; - if ( sd->status.shield ) + if (sd->has_shield) amotion += status->dbs->aspd_base[pc->class2idx(sd->status.class)][MAX_SINGLE_WEAPON_TYPE]; - switch ( sd->status.weapon ) { + switch (sd->weapontype) { case W_BOW: case W_MUSICAL: case W_WHIP: @@ -4346,15 +4343,15 @@ int status_base_amotion_pc(struct map_session_data *sd, struct status_data *st) temp = st->dex * st->dex / 5.0f + st->agi * st->agi * 0.5f; } temp = (float)(sqrt(temp) * 0.25f) + 0xc4; - if ( (skill_lv = pc->checkskill(sd, SA_ADVANCEDBOOK)) > 0 && sd->status.weapon == W_BOOK ) + if (sd->weapontype == W_BOOK && (skill_lv = pc->checkskill(sd, SA_ADVANCEDBOOK)) > 0) val += (skill_lv - 1) / 2 + 1; if ( (skill_lv = pc->checkskill(sd, GS_SINGLEACTION)) > 0 ) val += ((skill_lv + 1) / 2); amotion = ((int)(temp + ((float)(status->calc_aspd(&sd->bl, &sd->sc, 1) + val) * st->agi / 200)) - min(amotion, 200)); #else // base weapon delay - amotion = (sd->status.weapon < MAX_SINGLE_WEAPON_TYPE) - ? (status->dbs->aspd_base[pc->class2idx(sd->status.class)][sd->status.weapon]) // single weapon + amotion = (sd->weapontype < MAX_SINGLE_WEAPON_TYPE) + ? (status->dbs->aspd_base[pc->class2idx(sd->status.class)][sd->weapontype]) // single weapon : (status->dbs->aspd_base[pc->class2idx(sd->status.class)][sd->weapontype1] + status->dbs->aspd_base[pc->class2idx(sd->status.class)][sd->weapontype2]) * 7 / 10; // dual-wield // percentual delay reduction from stats @@ -4381,7 +4378,7 @@ unsigned short status_base_atk(const struct block_list *bl, const struct status_ return 0; if (bl->type == BL_PC) { - switch (BL_UCCAST(BL_PC, bl)->status.weapon) { + switch (BL_UCCAST(BL_PC, bl)->weapontype) { case W_BOW: case W_MUSICAL: case W_WHIP: @@ -5942,7 +5939,7 @@ short status_calc_aspd(struct block_list *bl, struct status_change *sc, short fl if (bl->type != BL_PC) { bonus = sc->data[SC_ASSNCROS]->val2; } else { - switch (BL_UCCAST(BL_PC, bl)->status.weapon) { + switch (BL_UCCAST(BL_PC, bl)->weapontype) { case W_BOW: case W_REVOLVER: case W_RIFLE: @@ -6103,7 +6100,7 @@ short status_calc_aspd_rate(struct block_list *bl, struct status_change *sc, int if (bl->type != BL_PC) { max = sc->data[SC_ASSNCROS]->val2; } else { - switch (BL_UCCAST(BL_PC, bl)->status.weapon) { + switch (BL_UCCAST(BL_PC, bl)->weapontype) { case W_BOW: case W_REVOLVER: case W_RIFLE: @@ -6867,13 +6864,13 @@ void status_set_viewdata(struct block_list *bl, int class_) } sd->vd.class = class_; clif->get_weapon_view(sd, &sd->vd.weapon, &sd->vd.shield); - sd->vd.head_top = sd->status.head_top; - sd->vd.head_mid = sd->status.head_mid; - sd->vd.head_bottom = sd->status.head_bottom; + sd->vd.head_top = sd->status.look.head_top; + sd->vd.head_mid = sd->status.look.head_mid; + sd->vd.head_bottom = sd->status.look.head_bottom; sd->vd.hair_style = cap_value(sd->status.hair,0,battle_config.max_hair_style); sd->vd.hair_color = cap_value(sd->status.hair_color,0,battle_config.max_hair_color); sd->vd.cloth_color = cap_value(sd->status.clothes_color,0,battle_config.max_cloth_color); - sd->vd.robe = sd->status.robe; + sd->vd.robe = sd->status.look.robe; sd->vd.body_style = sd->status.body; sd->vd.sex = sd->status.sex; @@ -10747,7 +10744,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const } if (begin_spurt && sce->val1 >= 7 && DIFF_TICK(timer->gettick(), starttick) <= 1000 - && (!sd || (sd->weapontype1 == 0 && sd->weapontype2 == 0)) + && (!sd || (sd->weapontype1 == W_FIST && sd->weapontype2 == W_FIST)) ) sc_start(bl, bl,SC_STRUP,100,sce->val1,skill->get_time2(status->sc2skill(type), sce->val1)); } |