From 5178ca9df008ecff5e78fb52baddedac9c318702 Mon Sep 17 00:00:00 2001 From: FlavioJS Date: Sun, 31 Dec 2006 12:12:42 +0000 Subject: * Refer to http://www.eathena.ws/board/index.php?showtopic=130285 - Renamed pc_checkweighticon to pc_updateweightstatus and cleaned it. - Updated pc_is50overweight to use battle_config.natural_heal_weight_rate. - Added 90% weight check when attacking. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9600 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/pc.c | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'src/map/pc.c') diff --git a/src/map/pc.c b/src/map/pc.c index fc61a65ba..eba537d9f 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1089,37 +1089,34 @@ int pc_calc_skilltree_normalize_job(struct map_session_data *sd) { } /*========================================== - * 重量アイコンの確認 + * Updates the weight status *------------------------------------------ */ -int pc_checkweighticon(struct map_session_data *sd) +int pc_updateweightstatus(struct map_session_data *sd) { int flag=0; nullpo_retr(0, sd); - //Consider the battle option 50% criteria.... - if(sd->weight*100 >= sd->max_weight*battle_config.natural_heal_weight_rate) - flag=1; - if(sd->weight*10 >= sd->max_weight*9) + if( pc_is90overweight(sd) ) flag=2; + else if( pc_is50overweight(sd) ) + flag=1; - if(flag==1){ - if(sd->sc.data[SC_WEIGHT50].timer==-1) - sc_start(&sd->bl,SC_WEIGHT50,100,0,0); - }else{ - if(sd->sc.data[SC_WEIGHT50].timer!=-1) - status_change_end(&sd->bl,SC_WEIGHT50,-1); - } - if(flag==2){ - if(sd->sc.data[SC_WEIGHT90].timer==-1) - sc_start(&sd->bl,SC_WEIGHT90,100,0,0); - }else{ - if(sd->sc.data[SC_WEIGHT90].timer!=-1) - status_change_end(&sd->bl,SC_WEIGHT90,-1); - } + // 50% overweight icon + if( flag == 1 && sd->sc.data[SC_WEIGHT50].timer == -1 ) + sc_start(&sd->bl,SC_WEIGHT50,100,0,0); + else if( sd->sc.data[SC_WEIGHT50].timer != -1 ) + status_change_end(&sd->bl,SC_WEIGHT50,-1); + // 90% overwheight icon + if( flag == 2 && sd->sc.data[SC_WEIGHT90].timer == -1 ) + sc_start(&sd->bl,SC_WEIGHT90,100,0,0); + else if( sd->sc.data[SC_WEIGHT90].timer != -1 ) + status_change_end(&sd->bl,SC_WEIGHT90,-1); + // update overweight status if (flag != sd->regen.state.overweight) sd->regen.state.overweight = flag; + return 0; } -- cgit v1.2.3-60-g2f50