@@ -88,6 +88,14 @@ Game_BattleAlgorithm::AlgorithmBase::AlgorithmBase(Type ty, Game_Battler* source
88
88
party_target = target;
89
89
}
90
90
91
+ int Game_BattleAlgorithm::AlgorithmBase::GetActionType () {
92
+ return -1 ;
93
+ }
94
+
95
+ int Game_BattleAlgorithm::AlgorithmBase::GetActionId () {
96
+ return -1 ;
97
+ }
98
+
91
99
void Game_BattleAlgorithm::AlgorithmBase::Reset () {
92
100
hp = 0 ;
93
101
sp = 0 ;
@@ -185,7 +193,20 @@ int Game_BattleAlgorithm::AlgorithmBase::ApplySpEffect() {
185
193
// Only absorb the sp that were left
186
194
source->ChangeSp (-sp);
187
195
}
196
+
197
+ if (Player::IsPatchManiac ()) {
198
+ Game_Battle::ManiacBattleHook (
199
+ Game_Interpreter_Battle::ManiacBattleHookType::StatChange,
200
+ target->GetType () == Game_Battler::Type_Enemy,
201
+ target->GetPartyIndex (),
202
+ target->GetDisplayX (),
203
+ target->GetDisplayY (),
204
+ 3 ,
205
+ sp
206
+ );
207
+ }
188
208
}
209
+
189
210
return sp;
190
211
}
191
212
@@ -198,6 +219,18 @@ int Game_BattleAlgorithm::AlgorithmBase::ApplyAtkEffect() {
198
219
if (IsAbsorbAtk ()) {
199
220
source->ChangeAtkModifier (-atk);
200
221
}
222
+
223
+ if (Player::IsPatchManiac ()) {
224
+ Game_Battle::ManiacBattleHook (
225
+ Game_Interpreter_Battle::ManiacBattleHookType::StatChange,
226
+ target->GetType () == Game_Battler::Type_Enemy,
227
+ target->GetPartyIndex (),
228
+ target->GetDisplayX (),
229
+ target->GetDisplayY (),
230
+ 4 ,
231
+ atk
232
+ );
233
+ }
201
234
}
202
235
return atk;
203
236
}
@@ -211,6 +244,18 @@ int Game_BattleAlgorithm::AlgorithmBase::ApplyDefEffect() {
211
244
if (IsAbsorbDef ()) {
212
245
source->ChangeDefModifier (-def);
213
246
}
247
+
248
+ if (Player::IsPatchManiac ()) {
249
+ Game_Battle::ManiacBattleHook (
250
+ Game_Interpreter_Battle::ManiacBattleHookType::StatChange,
251
+ target->GetType () == Game_Battler::Type_Enemy,
252
+ target->GetPartyIndex (),
253
+ target->GetDisplayX (),
254
+ target->GetDisplayY (),
255
+ 5 ,
256
+ def
257
+ );
258
+ }
214
259
}
215
260
return def;
216
261
}
@@ -224,6 +269,18 @@ int Game_BattleAlgorithm::AlgorithmBase::ApplySpiEffect() {
224
269
if (IsAbsorbSpi ()) {
225
270
source->ChangeSpiModifier (-spi);
226
271
}
272
+
273
+ if (Player::IsPatchManiac ()) {
274
+ Game_Battle::ManiacBattleHook (
275
+ Game_Interpreter_Battle::ManiacBattleHookType::StatChange,
276
+ target->GetType () == Game_Battler::Type_Enemy,
277
+ target->GetPartyIndex (),
278
+ target->GetDisplayX (),
279
+ target->GetDisplayY (),
280
+ 6 ,
281
+ spi
282
+ );
283
+ }
227
284
}
228
285
return spi;
229
286
}
@@ -237,6 +294,18 @@ int Game_BattleAlgorithm::AlgorithmBase::ApplyAgiEffect() {
237
294
if (IsAbsorbAgi ()) {
238
295
source->ChangeAgiModifier (-agi);
239
296
}
297
+
298
+ if (Player::IsPatchManiac ()) {
299
+ Game_Battle::ManiacBattleHook (
300
+ Game_Interpreter_Battle::ManiacBattleHookType::StatChange,
301
+ target->GetType () == Game_Battler::Type_Enemy,
302
+ target->GetPartyIndex (),
303
+ target->GetDisplayX (),
304
+ target->GetDisplayY (),
305
+ 7 ,
306
+ agi
307
+ );
308
+ }
240
309
}
241
310
return agi;
242
311
}
@@ -532,6 +601,26 @@ AlgorithmBase(Type::None, source, source) {
532
601
// no-op
533
602
}
534
603
604
+ int Game_BattleAlgorithm::None::GetActionId () {
605
+ return lcf::rpg::EnemyAction::Basic_nothing;
606
+ }
607
+
608
+ int Game_BattleAlgorithm::None::GetActionType () {
609
+ return lcf::rpg::EnemyAction::Kind_basic;
610
+ }
611
+
612
+ int Game_BattleAlgorithm::Normal::GetActionId () {
613
+ if (IsDualAttack ()) {
614
+ return lcf::rpg::EnemyAction::Basic_dual_attack;
615
+ }
616
+
617
+ return lcf::rpg::EnemyAction::Basic_attack;
618
+ }
619
+
620
+ int Game_BattleAlgorithm::Normal::GetActionType () {
621
+ return lcf::rpg::EnemyAction::Kind_basic;
622
+ }
623
+
535
624
Game_BattleAlgorithm::Normal::Normal (Game_Battler* source, Game_Battler* target, int hits_multiplier, Style style) :
536
625
AlgorithmBase(Type::Normal, source, target), hits_multiplier(hits_multiplier)
537
626
{
@@ -740,12 +829,16 @@ bool Game_BattleAlgorithm::Normal::vExecute() {
740
829
return SetIsSuccess ();
741
830
}
742
831
832
+ bool Game_BattleAlgorithm::Normal::IsDualAttack () const {
833
+ return GetSource ()->GetType () == Game_Battler::Type_Enemy && hits_multiplier == 2 ;
834
+ }
835
+
743
836
std::string Game_BattleAlgorithm::Normal::GetStartMessage (int line) const {
744
837
if (line == 0 ) {
745
838
if (Feature::HasRpg2kBattleSystem ()) {
746
839
return BattleMessage::GetNormalAttackStartMessage2k (*GetSource ());
747
840
}
748
- if (GetSource ()-> GetType () == Game_Battler::Type_Enemy && hits_multiplier == 2 ) {
841
+ if (IsDualAttack () ) {
749
842
return BattleMessage::GetDoubleAttackStartMessage2k3 (*GetSource ());
750
843
}
751
844
}
@@ -849,6 +942,14 @@ Game_BattleAlgorithm::Skill::Skill(Game_Battler* source, const lcf::rpg::Skill&
849
942
{
850
943
}
851
944
945
+ int Game_BattleAlgorithm::Skill::GetActionType () {
946
+ return lcf::rpg::EnemyAction::Kind_skill;
947
+ }
948
+
949
+ int Game_BattleAlgorithm::Skill::GetActionId () {
950
+ return skill.ID ;
951
+ }
952
+
852
953
void Game_BattleAlgorithm::Skill::Init () {
853
954
}
854
955
@@ -1236,6 +1337,14 @@ Game_BattleAlgorithm::Item::Item(Game_Battler* source, Game_Party_Base* target,
1236
1337
// no-op
1237
1338
}
1238
1339
1340
+ int Game_BattleAlgorithm::Item::GetActionType () {
1341
+ return 3 ;
1342
+ }
1343
+
1344
+ int Game_BattleAlgorithm::Item::GetActionId () {
1345
+ return item.ID ;
1346
+ }
1347
+
1239
1348
bool Game_BattleAlgorithm::Item::vStart () {
1240
1349
Main_Data::game_party->ConsumeItemUse (item.ID );
1241
1350
return true ;
@@ -1340,6 +1449,14 @@ Game_BattleAlgorithm::Defend::Defend(Game_Battler* source) :
1340
1449
source->SetIsDefending (true );
1341
1450
}
1342
1451
1452
+ int Game_BattleAlgorithm::Defend::GetActionType () {
1453
+ return lcf::rpg::EnemyAction::Kind_basic;
1454
+ }
1455
+
1456
+ int Game_BattleAlgorithm::Defend::GetActionId () {
1457
+ return lcf::rpg::EnemyAction::Basic_defense;
1458
+ }
1459
+
1343
1460
std::string Game_BattleAlgorithm::Defend::GetStartMessage (int line) const {
1344
1461
if (line == 0 ) {
1345
1462
if (Feature::HasRpg2kBattleSystem ()) {
@@ -1360,6 +1477,14 @@ AlgorithmBase(Type::Observe, source, source) {
1360
1477
// no-op
1361
1478
}
1362
1479
1480
+ int Game_BattleAlgorithm::Observe::GetActionType () {
1481
+ return lcf::rpg::EnemyAction::Kind_basic;
1482
+ }
1483
+
1484
+ int Game_BattleAlgorithm::Observe::GetActionId () {
1485
+ return lcf::rpg::EnemyAction::Basic_observe;
1486
+ }
1487
+
1363
1488
std::string Game_BattleAlgorithm::Observe::GetStartMessage (int line) const {
1364
1489
if (line == 0 ) {
1365
1490
if (Feature::HasRpg2kBattleSystem ()) {
@@ -1376,6 +1501,14 @@ AlgorithmBase(Type::Charge, source, source) {
1376
1501
// no-op
1377
1502
}
1378
1503
1504
+ int Game_BattleAlgorithm::Charge::GetActionType () {
1505
+ return lcf::rpg::EnemyAction::Kind_basic;
1506
+ }
1507
+
1508
+ int Game_BattleAlgorithm::Charge::GetActionId () {
1509
+ return lcf::rpg::EnemyAction::Basic_charge;
1510
+ }
1511
+
1379
1512
std::string Game_BattleAlgorithm::Charge::GetStartMessage (int line) const {
1380
1513
if (line == 0 ) {
1381
1514
if (Feature::HasRpg2kBattleSystem ()) {
@@ -1396,6 +1529,14 @@ AlgorithmBase(Type::SelfDestruct, source, target) {
1396
1529
// no-op
1397
1530
}
1398
1531
1532
+ int Game_BattleAlgorithm::SelfDestruct::GetActionType () {
1533
+ return lcf::rpg::EnemyAction::Kind_basic;
1534
+ }
1535
+
1536
+ int Game_BattleAlgorithm::SelfDestruct::GetActionId () {
1537
+ return lcf::rpg::EnemyAction::Basic_autodestruction;
1538
+ }
1539
+
1399
1540
std::string Game_BattleAlgorithm::SelfDestruct::GetStartMessage (int line) const {
1400
1541
if (line == 0 ) {
1401
1542
if (Feature::HasRpg2kBattleSystem ()) {
@@ -1450,6 +1591,14 @@ Game_BattleAlgorithm::Escape::Escape(Game_Battler* source) :
1450
1591
// no-op
1451
1592
}
1452
1593
1594
+ int Game_BattleAlgorithm::Escape::GetActionType () {
1595
+ return lcf::rpg::EnemyAction::Kind_basic;
1596
+ }
1597
+
1598
+ int Game_BattleAlgorithm::Escape::GetActionId () {
1599
+ return lcf::rpg::EnemyAction::Basic_escape;
1600
+ }
1601
+
1453
1602
std::string Game_BattleAlgorithm::Escape::GetStartMessage (int line) const {
1454
1603
if (line == 0 ) {
1455
1604
if (Feature::HasRpg2kBattleSystem ()) {
@@ -1487,6 +1636,14 @@ AlgorithmBase(Type::Transform, source, source), new_monster_id(new_monster_id) {
1487
1636
// no-op
1488
1637
}
1489
1638
1639
+ int Game_BattleAlgorithm::Transform::GetActionType () {
1640
+ return lcf::rpg::EnemyAction::Kind_transformation;
1641
+ }
1642
+
1643
+ int Game_BattleAlgorithm::Transform::GetActionId () {
1644
+ return new_monster_id;
1645
+ }
1646
+
1490
1647
std::string Game_BattleAlgorithm::Transform::GetStartMessage (int line) const {
1491
1648
if (line == 0 && Feature::HasRpg2kBattleSystem ()) {
1492
1649
auto * enemy = lcf::ReaderUtil::GetElement (lcf::Data::enemies, new_monster_id);
@@ -1509,3 +1666,11 @@ AlgorithmBase(Type::DoNothing, source, source) {
1509
1666
// no-op
1510
1667
}
1511
1668
1669
+ int Game_BattleAlgorithm::DoNothing::GetActionType () {
1670
+ return lcf::rpg::EnemyAction::Kind_basic;
1671
+ }
1672
+
1673
+ int Game_BattleAlgorithm::DoNothing::GetActionId () {
1674
+ return lcf::rpg::EnemyAction::Basic_nothing;
1675
+ }
1676
+
0 commit comments