@@ -358,7 +358,7 @@ std::string Game_BattleAlgorithm::AlgorithmBase::GetDeathMessage() const {
358358
359359 bool is_ally = GetTarget ()->GetType () == Game_Battler::Type_Ally;
360360 const lcf::rpg::State* state = lcf::ReaderUtil::GetElement (lcf::Data::states, 1 );
361- const std::string& message = is_ally ? state->message_actor
361+ StringView message = is_ally ? state->message_actor
362362 : state->message_enemy ;
363363
364364 if (Player::IsRPG2kE ()) {
@@ -369,15 +369,15 @@ std::string Game_BattleAlgorithm::AlgorithmBase::GetDeathMessage() const {
369369 );
370370 }
371371 else {
372- return GetTarget ()->GetName () + message;
372+ return ToString ( GetTarget ()->GetName ()) + ToString ( message) ;
373373 }
374374}
375375
376376lcf::rpg::State::Restriction Game_BattleAlgorithm::AlgorithmBase::GetSourceRestrictionWhenStarted () const {
377377 return source_restriction;
378378}
379379
380- std::string Game_BattleAlgorithm::AlgorithmBase::GetAttackFailureMessage (const std::string& message) const {
380+ std::string Game_BattleAlgorithm::AlgorithmBase::GetAttackFailureMessage (StringView message) const {
381381 if (Player::IsRPG2kE ()) {
382382 return Utils::ReplacePlaceholders (
383383 message,
@@ -386,11 +386,11 @@ std::string Game_BattleAlgorithm::AlgorithmBase::GetAttackFailureMessage(const s
386386 );
387387 }
388388 else {
389- return GetTarget ()->GetName () + message;
389+ return ToString ( GetTarget ()->GetName ()) + ToString ( message) ;
390390 }
391391}
392392
393- std::string Game_BattleAlgorithm::AlgorithmBase::GetHpSpRecoveredMessage (int value, const std::string& points) const {
393+ std::string Game_BattleAlgorithm::AlgorithmBase::GetHpSpRecoveredMessage (int value, StringView points) const {
394394 if (Player::IsRPG2kE ()) {
395395 return Utils::ReplacePlaceholders (
396396 lcf::Data::terms.hp_recovery ,
@@ -420,7 +420,7 @@ std::string Game_BattleAlgorithm::AlgorithmBase::GetHpSpRecoveredMessage(int val
420420std::string Game_BattleAlgorithm::AlgorithmBase::GetUndamagedMessage () const {
421421 bool target_is_ally = (GetTarget ()->GetType () ==
422422 Game_Battler::Type_Ally);
423- const std::string& message = target_is_ally ?
423+ StringView message = target_is_ally ?
424424 lcf::Data::terms.actor_undamaged :
425425 lcf::Data::terms.enemy_undamaged ;
426426
@@ -432,14 +432,14 @@ std::string Game_BattleAlgorithm::AlgorithmBase::GetUndamagedMessage() const {
432432 );
433433 }
434434 else {
435- return GetTarget ()->GetName () + message;
435+ return ToString ( GetTarget ()->GetName ()) + ToString ( message) ;
436436 }
437437}
438438
439439std::string Game_BattleAlgorithm::AlgorithmBase::GetCriticalHitMessage () const {
440440 bool target_is_ally = (GetTarget ()->GetType () ==
441441 Game_Battler::Type_Ally);
442- const std::string& message = target_is_ally ?
442+ StringView message = target_is_ally ?
443443 lcf::Data::terms.actor_critical :
444444 lcf::Data::terms.enemy_critical ;
445445
@@ -451,14 +451,14 @@ std::string Game_BattleAlgorithm::AlgorithmBase::GetCriticalHitMessage() const {
451451 );
452452 }
453453 else {
454- return message;
454+ return ToString ( message) ;
455455 }
456456}
457457
458- std::string Game_BattleAlgorithm::AlgorithmBase::GetHpSpAbsorbedMessage (int value, const std::string& points) const {
458+ std::string Game_BattleAlgorithm::AlgorithmBase::GetHpSpAbsorbedMessage (int value, StringView points) const {
459459 bool target_is_ally = (GetTarget ()->GetType () ==
460460 Game_Battler::Type_Ally);
461- const std::string& message = target_is_ally ?
461+ StringView message = target_is_ally ?
462462 lcf::Data::terms.actor_hp_absorbed :
463463 lcf::Data::terms.enemy_hp_absorbed ;
464464
@@ -492,7 +492,7 @@ std::string Game_BattleAlgorithm::AlgorithmBase::GetHpSpAbsorbedMessage(int valu
492492std::string Game_BattleAlgorithm::AlgorithmBase::GetDamagedMessage () const {
493493 bool target_is_ally = (GetTarget ()->GetType () ==
494494 Game_Battler::Type_Ally);
495- const std::string& message = target_is_ally ?
495+ StringView message = target_is_ally ?
496496 lcf::Data::terms.actor_damaged :
497497 lcf::Data::terms.enemy_damaged ;
498498 int value = GetAffectedHp ();
@@ -520,8 +520,8 @@ std::string Game_BattleAlgorithm::AlgorithmBase::GetDamagedMessage() const {
520520 }
521521}
522522
523- std::string Game_BattleAlgorithm::AlgorithmBase::GetParameterChangeMessage (bool is_positive, int value, const std::string& points) const {
524- const std::string& message = is_positive ?
523+ std::string Game_BattleAlgorithm::AlgorithmBase::GetParameterChangeMessage (bool is_positive, int value, StringView points) const {
524+ StringView message = is_positive ?
525525 lcf::Data::terms.parameter_increase :
526526 lcf::Data::terms.parameter_decrease ;
527527
@@ -552,7 +552,7 @@ std::string Game_BattleAlgorithm::AlgorithmBase::GetParameterChangeMessage(bool
552552 }
553553}
554554
555- std::string Game_BattleAlgorithm::AlgorithmBase::GetStateMessage (const std::string& message) const {
555+ std::string Game_BattleAlgorithm::AlgorithmBase::GetStateMessage (StringView message) const {
556556 if (Player::IsRPG2kE ()) {
557557 return Utils::ReplacePlaceholders (
558558 message,
@@ -561,12 +561,12 @@ std::string Game_BattleAlgorithm::AlgorithmBase::GetStateMessage(const std::stri
561561 );
562562 }
563563 else {
564- return GetTarget ()->GetName () + message;
564+ return ToString ( GetTarget ()->GetName ()) + ToString ( message) ;
565565 }
566566}
567567
568- std::string Game_BattleAlgorithm::AlgorithmBase::GetAttributeShiftMessage ( const std::string& attribute) const {
569- const std::string& message = IsPositive () ?
568+ std::string Game_BattleAlgorithm::AlgorithmBase::GetAttributeShiftMessage (StringView attribute) const {
569+ StringView message = IsPositive () ?
570570 lcf::Data::terms.resistance_increase :
571571 lcf::Data::terms.resistance_decrease ;
572572 std::stringstream ss;
@@ -1110,7 +1110,7 @@ std::string Game_BattleAlgorithm::Normal::GetStartMessage() const {
11101110 );
11111111 }
11121112 else {
1113- return source->GetName () + lcf::Data::terms.attacking ;
1113+ return ToString ( source->GetName ()) + ToString ( lcf::Data::terms.attacking ) ;
11141114 }
11151115 }
11161116 else {
@@ -1418,11 +1418,11 @@ std::string Game_BattleAlgorithm::Skill::GetStartMessage() const {
14181418 );
14191419 }
14201420 else {
1421- return source->GetName () + skill.using_message1 ;
1421+ return ToString ( source->GetName ()) + ToString ( skill.using_message1 ) ;
14221422 }
14231423 }
14241424 else {
1425- return skill.name ;
1425+ return ToString ( skill.name ) ;
14261426 }
14271427}
14281428
@@ -1444,7 +1444,7 @@ std::string Game_BattleAlgorithm::Skill::GetSecondStartMessage() const {
14441444 );
14451445 }
14461446 else {
1447- return skill.using_message2 ;
1447+ return ToString ( skill.using_message2 ) ;
14481448 }
14491449 }
14501450 else {
@@ -1678,10 +1678,10 @@ std::string Game_BattleAlgorithm::Item::GetStartMessage() const {
16781678 particle = " は" ;
16791679 else
16801680 particle = " " ;
1681- return source->GetName () + particle + item.name + lcf::Data::terms.use_item ;
1681+ return ToString ( source->GetName ()) + particle + ToString ( item.name ) + ToString ( lcf::Data::terms.use_item ) ;
16821682 }
16831683 else {
1684- return item.name ;
1684+ return ToString ( item.name ) ;
16851685 }
16861686}
16871687
@@ -1716,7 +1716,7 @@ std::string Game_BattleAlgorithm::Defend::GetStartMessage() const {
17161716 );
17171717 }
17181718 else if (Player::IsRPG2k ()) {
1719- return source->GetName () + lcf::Data::terms.defending ;
1719+ return ToString ( source->GetName ()) + ToString ( lcf::Data::terms.defending ) ;
17201720 }
17211721 else {
17221722 return " " ;
@@ -1750,7 +1750,7 @@ std::string Game_BattleAlgorithm::Observe::GetStartMessage() const {
17501750 );
17511751 }
17521752 else if (Player::IsRPG2k ()) {
1753- return source->GetName () + lcf::Data::terms.observing ;
1753+ return ToString ( source->GetName ()) + ToString ( lcf::Data::terms.observing ) ;
17541754 }
17551755 else {
17561756 return " " ;
@@ -1777,7 +1777,7 @@ std::string Game_BattleAlgorithm::Charge::GetStartMessage() const {
17771777 );
17781778 }
17791779 else if (Player::IsRPG2k ()) {
1780- return source->GetName () + lcf::Data::terms.focus ;
1780+ return ToString ( source->GetName ()) + ToString ( lcf::Data::terms.focus ) ;
17811781 }
17821782 else {
17831783 return " " ;
@@ -1808,7 +1808,7 @@ std::string Game_BattleAlgorithm::SelfDestruct::GetStartMessage() const {
18081808 );
18091809 }
18101810 else if (Player::IsRPG2k ()) {
1811- return source->GetName () + lcf::Data::terms.autodestruction ;
1811+ return ToString ( source->GetName ()) + ToString ( lcf::Data::terms.autodestruction ) ;
18121812 }
18131813 else {
18141814 return " " ;
@@ -1888,7 +1888,7 @@ std::string Game_BattleAlgorithm::Escape::GetStartMessage() const {
18881888 }
18891889 else if (Player::IsRPG2k ()) {
18901890 if (source->GetType () == Game_Battler::Type_Enemy) {
1891- return source->GetName () + lcf::Data::terms.enemy_escape ;
1891+ return ToString ( source->GetName ()) + ToString ( lcf::Data::terms.enemy_escape ) ;
18921892 }
18931893 }
18941894
@@ -1940,7 +1940,7 @@ std::string Game_BattleAlgorithm::Transform::GetStartMessage() const {
19401940 );
19411941 }
19421942 else if (Player::IsRPG2k ()) {
1943- return source->GetName () + lcf::Data::terms.enemy_transform ;
1943+ return ToString ( source->GetName ()) + ToString ( lcf::Data::terms.enemy_transform ) ;
19441944 }
19451945 else {
19461946 return " " ;
0 commit comments