瀏覽代碼

Corrected SC_CLIMAX_BLOOM and SC_CLIMAX_EARTH (#8803)

Fixed #8802
Atemo 6 月之前
父節點
當前提交
0a6f7528de
共有 2 個文件被更改,包括 34 次插入15 次删除
  1. 34 11
      src/map/battle.cpp
  2. 0 4
      src/map/status.cpp

+ 34 - 11
src/map/battle.cpp

@@ -671,6 +671,32 @@ int64 battle_attr_fix(struct block_list *src, struct block_list *target, int64 d
 	return damage;
 }
 
+/**
+ * Statuses that affect the target's element in battle_calc_cardfix.
+ * @param tsc Target status change
+ * @param rh_ele Right-hand weapon element
+ * @return ele_fix ratio affecting damage
+ */
+static int32 battle_calc_cardfix_debuff( status_change& tsc, int32 rh_ele ){
+	int32 ele_fix = 0;
+
+	if (tsc.getSCE(SC_MAGIC_POISON))
+		ele_fix += 50;
+
+	// !TODO: unknown how it should work for physical damage, lh_ele is ignored for now
+	switch(rh_ele) {
+		case ELE_FIRE:
+			if (tsc.getSCE(SC_CLIMAX_BLOOM))
+				ele_fix += 100;
+			break;
+		case ELE_EARTH:
+			if (tsc.getSCE(SC_CLIMAX_EARTH))
+				ele_fix += 100;
+			break;
+	}
+	return ele_fix;
+}
+
 /**
  * Calculates card bonuses damage adjustments.
  * @param attack_type @see enum e_battle_flag
@@ -757,8 +783,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li
 			}
 			// Statuses that affect the target's element and should be calculated right after magic_addele, independently of it
 			if (tsc != nullptr && !nk[NK_IGNOREDEFCARD] && !nk[NK_IGNOREELEMENT]) {
-				if (tsc->getSCE(SC_MAGIC_POISON))
-					APPLY_CARDFIX_RE( damage, 50 );
+				APPLY_CARDFIX_RE( damage, battle_calc_cardfix_debuff( *tsc, rh_ele ) );
 			}
 			if( sd && !nk[NK_IGNOREATKCARD] ) {
 				if( !nk[NK_IGNOREELEMENT] ) {
@@ -809,9 +834,9 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li
 					if (s_defele != ELE_NONE)
 						ele_fix += tsd->indexed_bonus.magic_subdefele[s_defele] + tsd->indexed_bonus.magic_subdefele[ELE_ALL];
 #ifndef RENEWAL
-					// Custom to follow SC_MAGIC_POISON renewal behavior
-					if (tsc != nullptr && tsc->getSCE(SC_MAGIC_POISON))
-						ele_fix += 50;
+					// Custom to follow SC_ debuff renewal behavior
+					if (tsc != nullptr)
+						ele_fix += battle_calc_cardfix_debuff( *tsc, rh_ele );
 #endif
 					cardfix = cardfix * (100 - ele_fix) / 100;
 				}
@@ -1074,11 +1099,10 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li
 					cardfix = cardfix * (100 - tsc->getSCE(SC_DEF_RATE)->val1) / 100;
 				APPLY_CARDFIX(damage, cardfix);
 			}
-			// Custom on BF_WEAPON to follow SC_MAGIC_POISON BF_MAGIC renewal behavior
+			// Custom on BF_WEAPON to follow SC_ debuff BF_MAGIC renewal behavior
 			if (tsc != nullptr && !nk[NK_IGNOREDEFCARD] && !nk[NK_IGNOREELEMENT]) {
 				cardfix = 1000;
-				if (tsc->getSCE(SC_MAGIC_POISON))
-					cardfix = cardfix * (100 + 50) / 100;
+				cardfix = cardfix * (100 + battle_calc_cardfix_debuff( *tsc, rh_ele )) / 100;
 				APPLY_CARDFIX(damage, cardfix);
 			}
 			break;
@@ -1126,11 +1150,10 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li
 					cardfix = cardfix * (100 - tsd->bonus.long_attack_def_rate) / 100;
 				APPLY_CARDFIX(damage, cardfix);
 			}
-			// Custom on BF_MISC to follow SC_MAGIC_POISON BF_MAGIC renewal behavior
+			// Custom on BF_MISC to follow SC_ debuff BF_MAGIC renewal behavior
 			if (tsc != nullptr && !nk[NK_IGNOREDEFCARD] && !nk[NK_IGNOREELEMENT]) {
 				cardfix = 1000;
-				if (tsc->getSCE(SC_MAGIC_POISON))
-					cardfix = cardfix * (100 + 50) / 100;
+				cardfix = cardfix * (100 + battle_calc_cardfix_debuff( *tsc, rh_ele )) / 100;
 				APPLY_CARDFIX(damage, cardfix);
 			}
 			break;

+ 0 - 4
src/map/status.cpp

@@ -4834,10 +4834,6 @@ int status_calc_pc_sub(map_session_data* sd, uint8 opt)
 			sd->special_state.no_magic_damage = 0;
 		if (sc->getSCE(SC_CLIMAX_DES_HU))
 			sd->indexed_bonus.magic_atk_ele[ELE_WIND] += 30;
-		if (sc->getSCE(SC_CLIMAX_EARTH))
-			sd->indexed_bonus.subele[ELE_EARTH] -= 100;
-		if (sc->getSCE(SC_CLIMAX_BLOOM))
-			sd->indexed_bonus.subele[ELE_FIRE] -= 100;
 		if (sc->getSCE(SC_CLIMAX_CRYIMP)) {
 			sd->indexed_bonus.subele[ELE_WATER] += 30;
 			sd->indexed_bonus.magic_atk_ele[ELE_WATER] += 30;