summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-31 12:12:42 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-31 12:12:42 +0000
commit5178ca9df008ecff5e78fb52baddedac9c318702 (patch)
tree9ebbaf51e6050147a949d24a0107f939488a4aae /src/map/pc.c
parentb81e57a9a349e06fba2ad56757ea3d08b01db586 (diff)
downloadhercules-5178ca9df008ecff5e78fb52baddedac9c318702.tar.gz
hercules-5178ca9df008ecff5e78fb52baddedac9c318702.tar.bz2
hercules-5178ca9df008ecff5e78fb52baddedac9c318702.tar.xz
hercules-5178ca9df008ecff5e78fb52baddedac9c318702.zip
* 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
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c37
1 files changed, 17 insertions, 20 deletions
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;
}