diff options
author | Haru <haru@dotalux.com> | 2020-04-05 21:05:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-05 21:05:27 +0200 |
commit | 024c9c48d4a1d064ac9d37d997d3983fb1bff40f (patch) | |
tree | 0eae933a4a69c220f98dacfe17b9df2cc5b877ec /src/map/battle.c | |
parent | 02a84aa9870422bddb7b631dd09bb45c1e5e6856 (diff) | |
parent | 876cfa678d5e9a43d1ce419bd9d8300d9c8c6b36 (diff) | |
download | hercules-024c9c48d4a1d064ac9d37d997d3983fb1bff40f.tar.gz hercules-024c9c48d4a1d064ac9d37d997d3983fb1bff40f.tar.bz2 hercules-024c9c48d4a1d064ac9d37d997d3983fb1bff40f.tar.xz hercules-024c9c48d4a1d064ac9d37d997d3983fb1bff40f.zip |
Merge pull request #2657 from Kenpachi2k13/autocast_clean_up
Clean up auto-cast related code
Diffstat (limited to 'src/map/battle.c')
-rw-r--r-- | src/map/battle.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 985d2bca4..6519b1f37 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -5928,21 +5928,21 @@ static void battle_reflect_damage(struct block_list *target, struct block_list * delay += 100;/* gradual increase so the numbers don't clip in the client */ } if( sc->data[SC_LG_REFLECTDAMAGE] && rnd()%100 < (30 + 10*sc->data[SC_LG_REFLECTDAMAGE]->val1) ) { - bool change = false; - NORMALIZE_RDAMAGE(damage * sc->data[SC_LG_REFLECTDAMAGE]->val2 / 100); trdamage -= rdamage;/* wont count towards total */ - if( sd && !sd->state.autocast ) { - change = true; - sd->state.autocast = 1; + enum autocast_type ac_type; + + if (sd != NULL) { + ac_type = sd->autocast.type; + sd->autocast.type = AUTOCAST_TEMP; } map->foreachinshootrange(battle->damage_area,target,skill->get_splash(LG_REFLECTDAMAGE,1),BL_CHAR,tick,target,delay,wd->dmotion,rdamage,status_get_race(target)); - if( change ) - sd->state.autocast = 0; + if (sd != NULL) + sd->autocast.type = ac_type; delay += 150;/* gradual increase so the numbers don't clip in the client */ @@ -6132,7 +6132,7 @@ static int battle_damage_area(struct block_list *bl, va_list ap) else status_fix_damage(src,bl,damage,0); clif->damage(bl,bl,amotion,dmotion,damage,1,BDT_ENDURE,0); - if (src->type != BL_PC || !BL_UCCAST(BL_PC, src)->state.autocast) + if (src->type != BL_PC || BL_UCCAST(BL_PC, src)->autocast.type != AUTOCAST_TEMP) skill->additional_effect(src, bl, CR_REFLECTSHIELD, 1, BF_WEAPON|BF_SHORT|BF_NORMAL,ATK_DEF,tick); map->freeblock_unlock(); } @@ -6456,10 +6456,10 @@ static enum damage_lv battle_weapon_attack(struct block_list *src, struct block_ } } - sd->state.autocast = 1; + sd->autocast.type = AUTOCAST_TEMP; skill->consume_requirement(sd,r_skill,r_lv,3); skill->castend_type(type, src, target, r_skill, r_lv, tick, flag); - sd->state.autocast = 0; + sd->autocast.type = AUTOCAST_NONE; sd->ud.canact_tick = tick + skill->delay_fix(src, r_skill, r_lv); clif->status_change(src, status->get_sc_icon(SC_POSTDELAY), status->get_sc_relevant_bl_types(SC_POSTDELAY), 1, skill->delay_fix(src, r_skill, r_lv), 0, 0, 1); } |