OSDN Git Service

[Refactor] #40634 Reshaped activate_artifact()
authorHourier <hourier@users.sourceforge.jp>
Mon, 17 Aug 2020 14:59:30 +0000 (23:59 +0900)
committerHourier <hourier@users.sourceforge.jp>
Mon, 17 Aug 2020 14:59:30 +0000 (23:59 +0900)
src/object-activation/activation-switcher.c

index 126a24e..c695689 100644 (file)
@@ -938,24 +938,24 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
         o_ptr->timeout = (s16b)act_ptr->timeout.constant;
         if (act_ptr->timeout.dice > 0)
             o_ptr->timeout += randint1(act_ptr->timeout.dice);
-    } else {
-        switch (act_ptr->index) {
-        case ACT_BR_FIRE:
-            o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) ? 200 : 250;
-            break;
-        case ACT_BR_COLD:
-            o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) ? 200 : 250;
-            break;
-        case ACT_TERROR:
-            o_ptr->timeout = 3 * (user_ptr->lev + 10);
-            break;
-        case ACT_MURAMASA:
-            break;
-        default:
-            msg_format("Special timeout is not implemented: %d.", act_ptr->index);
-            return FALSE;
-        }
+
+        return TRUE;
     }
 
-    return TRUE;
+    switch (act_ptr->index) {
+    case ACT_BR_FIRE:
+        o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) ? 200 : 250;
+        return TRUE;
+    case ACT_BR_COLD:
+        o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) ? 200 : 250;
+        return TRUE;
+    case ACT_TERROR:
+        o_ptr->timeout = 3 * (user_ptr->lev + 10);
+        return TRUE;
+    case ACT_MURAMASA:
+        return TRUE;
+    default:
+        msg_format("Special timeout is not implemented: %d.", act_ptr->index);
+        return FALSE;
+    }
 }