• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisiondcd378db5b3619e365a87669e2d35e54ce38320e (tree)
Time2019-01-07 22:06:09
AuthorDeskull <deskull@user...>
CommiterDeskull

Log Message

[Refactor] #37359 suppression_evil_dam()修正。 / Refactor suppression_evil_dam().

Change Summary

Incremental Difference

--- a/src/artifact.c
+++ b/src/artifact.c
@@ -14,7 +14,7 @@
1414 #include "cmd-activate.h"
1515 #include "object-curse.h"
1616
17-static int suppression_evil_dam(object_type *o_ptr);
17+static bool suppression_evil_dam(object_type *o_ptr);
1818 static int weakening_artifact(object_type *o_ptr);
1919
2020
@@ -2345,9 +2345,8 @@ int calc_arm_avgdamage(object_type *o_ptr)
23452345 return(dam);
23462346 }
23472347
2348-static int suppression_evil_dam(object_type *o_ptr)
2348+static bool suppression_evil_dam(object_type *o_ptr)
23492349 {
2350- int num = FALSE;
23512350 BIT_FLAGS flgs[TR_FLAG_SIZE];
23522351 object_flags(o_ptr, flgs);
23532352
@@ -2355,41 +2354,41 @@ static int suppression_evil_dam(object_type *o_ptr)
23552354 {
23562355 if(have_flag(flgs, TR_BLOWS) && (o_ptr->pval == 1) && (calc_arm_avgdamage(o_ptr) > 52))
23572356 {
2358- num = TRUE;
2357+ return TRUE;
23592358 }
23602359 else if(have_flag(flgs, TR_BLOWS) && (o_ptr->pval == 2) && (calc_arm_avgdamage(o_ptr) > 43))
23612360 {
2362- num = TRUE;
2361+ return TRUE;
23632362 }
23642363 else if( have_flag(flgs, TR_BLOWS) && (o_ptr->pval == 3) && (calc_arm_avgdamage(o_ptr) > 33))
23652364 {
2366- num = TRUE;
2365+ return TRUE;
23672366 }
23682367 else if (calc_arm_avgdamage(o_ptr) > 63)
23692368 {
2370- num = TRUE;
2369+ return TRUE;
23712370 }
23722371 }
23732372 else
23742373 {
23752374 if (have_flag(flgs, TR_BLOWS) && (o_ptr->pval == 1) && (calc_arm_avgdamage(o_ptr) > 65))
23762375 {
2377- num = TRUE;
2376+ return TRUE;
23782377 }
23792378 else if (have_flag(flgs, TR_BLOWS) && (o_ptr->pval == 2) && (calc_arm_avgdamage(o_ptr) > 52))
23802379 {
2381- num = TRUE;
2380+ return TRUE;
23822381 }
23832382 else if (have_flag(flgs, TR_BLOWS) && (o_ptr->pval == 3) && (calc_arm_avgdamage(o_ptr) > 40))
23842383 {
2385- num = TRUE;
2384+ return TRUE;
23862385 }
23872386 else if (calc_arm_avgdamage(o_ptr) > 75)
23882387 {
2389- num = TRUE;
2388+ return TRUE;
23902389 }
23912390 }
2392- return(num);
2391+ return FALSE;
23932392 }
23942393
23952394 static int weakening_artifact(object_type *o_ptr)
Show on old repository browser