File tree Expand file tree Collapse file tree 3 files changed +37
-7
lines changed
BattleSys/RoundAnim/Source Expand file tree Collapse file tree 3 files changed +37
-7
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ const struct KernelDesigerConfig gKernelDesigerConfig = {
3434 .kernel_tutorial_level = CONFIG_KTUT_LEVEL ,
3535
3636#ifdef CONFIG_USE_COMBO_ATTACK
37- .combo_attack_en = true , // true, // can be opened by the user
37+ .combo_attack_en = false , // true, // can be opened by the user
3838#endif
3939
4040#ifdef CONFIG_BATTLE_SURROUND
Original file line number Diff line number Diff line change 11#include <common-chax.h>
22#include <strmag.h>
33#include <battle-system.h>
4+ #include <combo-attack.h>
45
56#define LOCAL_TRACE 0
67
@@ -173,6 +174,28 @@ void ParseBattleHitToBanimCmd(void)
173174 gpEkrTriangleUnits [1 ] = gBattleStats .taUnitB ;
174175 }
175176
177+ #ifdef CONFIG_USE_COMBO_ATTACK
178+ /**
179+ * Modify for combo attack
180+ */
181+ if (gpKernelDesigerConfig -> combo_attack_en ) {
182+ if (i < COMBO_ATK_MAX ) {
183+ struct ComboAtkTarget * combo = & gComboAtkList [i ];
184+
185+ if (combo -> uid != COMBO_ATK_UID_INVALID ) {
186+ int weapon = combo -> weapon ;
187+
188+ magic_attack = IsMagicAttackAttr (GetItemAttributes (weapon ));
189+
190+ if (CheckForceFarAttackAnimItem (weapon ))
191+ distance_modes_cur [attacker_pos ] = EKR_DISTANCE_FAR ;
192+ else
193+ distance_modes_cur [attacker_pos ] = gEkrDistanceType ;
194+ }
195+ }
196+ }
197+ #endif /* USE_COMBO_ATTACK */
198+
176199 /**
177200 * Attacker round base types
178201 */
Original file line number Diff line number Diff line change @@ -15,7 +15,15 @@ void ResetComboAtkList(void)
1515 gComboAtkList [i ].uid = COMBO_ATK_UID_INVALID ;
1616}
1717
18- STATIC_DECLAR bool CheckMeleeWeapon (int weapon )
18+ STATIC_DECLAR bool ChecComboMagi (int weapon )
19+ {
20+ if (GetItemAttributes (weapon ) & (IA_MAGIC | IA_MAGICDAMAGE ))
21+ return true;
22+
23+ return true;
24+ }
25+
26+ STATIC_DECLAR bool CheckComboMelee (int weapon )
1927{
2028 int max_range ;
2129
@@ -36,7 +44,7 @@ void BattleGenerateComboAtkList(void)
3644 struct Unit * unit ;
3745 u16 item ;
3846 int range , battle_range ;
39- bool melee_combo , melee_attack ;
47+ bool melee_attack ;
4048 int i , cnt = 0 ;
4149
4250 ResetComboAtkList ();
@@ -95,17 +103,16 @@ void BattleGenerateComboAtkList(void)
95103 continue ;
96104 }
97105
106+ if (!ChecComboMagi (item ) && CheckComboMelee (item ) != melee_attack )
107+ continue ;
108+
98109 /**
99110 * ! check in range
100111 */
101112 range = RECT_DISTANCE (
102113 unit -> xPos , unit -> yPos ,
103114 gBattleTarget .unit .xPos , gBattleTarget .unit .yPos );
104115
105- melee_combo = CheckMeleeWeapon (item );
106- if (melee_attack != melee_combo )
107- continue ;
108-
109116 if (!IsItemCoveringRangeRework (item , range , unit ))
110117 continue ;
111118
You can’t perform that action at this time.
0 commit comments