@ -13,6 +13,7 @@
# include "error.h"
# include "init.h"
# include "utils/language.h"
# include "utils/utf8.hpp"
namespace devilution {
@ -410,7 +411,7 @@ bool ForceL1Trig()
for ( int i = 0 ; L1UpList [ i ] ! = - 1 ; i + + ) {
if ( dPiece [ cursPosition . x ] [ cursPosition . y ] = = L1UpList [ i ] ) {
if ( currlevel > 1 )
strcpy ( infostr , fmt : : format ( _ ( " Up to level {:d} " ) , currlevel - 1 ) . c_str ( ) ) ;
CopyUtf8 ( infostr , fmt : : format ( _ ( " Up to level {:d} " ) , currlevel - 1 ) , sizeof ( infostr ) ) ;
else
strcpy ( infostr , _ ( " Up to town " ) ) ;
for ( int j = 0 ; j < numtrigs ; j + + ) {
@ -423,7 +424,7 @@ bool ForceL1Trig()
}
for ( int i = 0 ; L1DownList [ i ] ! = - 1 ; i + + ) {
if ( dPiece [ cursPosition . x ] [ cursPosition . y ] = = L1DownList [ i ] ) {
strcpy ( infostr , fmt : : format ( _ ( " Down to level {:d} " ) , currlevel + 1 ) . c_str ( ) ) ;
CopyUtf8 ( infostr , fmt : : format ( _ ( " Down to level {:d} " ) , currlevel + 1 ) , sizeof ( infostr ) ) ;
for ( int j = 0 ; j < numtrigs ; j + + ) {
if ( trigs [ j ] . _tmsg = = WM_DIABNEXTLVL ) {
cursPosition = trigs [ j ] . position ;
@ -435,7 +436,7 @@ bool ForceL1Trig()
} else {
for ( int i = 0 ; L5UpList [ i ] ! = - 1 ; i + + ) {
if ( dPiece [ cursPosition . x ] [ cursPosition . y ] = = L5UpList [ i ] ) {
strcpy ( infostr , fmt : : format ( _ ( " Up to Crypt level {:d} " ) , currlevel - 21 ) . c_str ( ) ) ;
CopyUtf8 ( infostr , fmt : : format ( _ ( " Up to Crypt level {:d} " ) , currlevel - 21 ) , sizeof ( infostr ) ) ;
for ( int j = 0 ; j < numtrigs ; j + + ) {
if ( trigs [ j ] . _tmsg = = WM_DIABPREVLVL ) {
cursPosition = trigs [ j ] . position ;
@ -450,7 +451,7 @@ bool ForceL1Trig()
}
for ( int i = 0 ; L5DownList [ i ] ! = - 1 ; i + + ) {
if ( dPiece [ cursPosition . x ] [ cursPosition . y ] = = L5DownList [ i ] ) {
strcpy ( infostr , fmt : : format ( _ ( " Down to Crypt level {:d} " ) , currlevel - 19 ) . c_str ( ) ) ;
CopyUtf8 ( infostr , fmt : : format ( _ ( " Down to Crypt level {:d} " ) , currlevel - 19 ) , sizeof ( infostr ) ) ;
for ( int j = 0 ; j < numtrigs ; j + + ) {
if ( trigs [ j ] . _tmsg = = WM_DIABNEXTLVL ) {
cursPosition = trigs [ j ] . position ;
@ -490,7 +491,7 @@ bool ForceL2Trig()
int dx = abs ( trigs [ j ] . position . x - cursPosition . x ) ;
int dy = abs ( trigs [ j ] . position . y - cursPosition . y ) ;
if ( dx < 4 & & dy < 4 ) {
strcpy ( infostr , fmt : : format ( _ ( " Up to level {:d} " ) , currlevel - 1 ) . c_str ( ) ) ;
CopyUtf8 ( infostr , fmt : : format ( _ ( " Up to level {:d} " ) , currlevel - 1 ) , sizeof ( infostr ) ) ;
cursPosition = trigs [ j ] . position ;
return true ;
}
@ -501,7 +502,7 @@ bool ForceL2Trig()
for ( int i = 0 ; L2DownList [ i ] ! = - 1 ; i + + ) {
if ( dPiece [ cursPosition . x ] [ cursPosition . y ] = = L2DownList [ i ] ) {
strcpy ( infostr , fmt : : format ( _ ( " Down to level {:d} " ) , currlevel + 1 ) . c_str ( ) ) ;
CopyUtf8 ( infostr , fmt : : format ( _ ( " Down to level {:d} " ) , currlevel + 1 ) , sizeof ( infostr ) ) ;
for ( int j = 0 ; j < numtrigs ; j + + ) {
if ( trigs [ j ] . _tmsg = = WM_DIABNEXTLVL ) {
cursPosition = trigs [ j ] . position ;
@ -537,7 +538,7 @@ bool ForceL3Trig()
if ( currlevel < 17 ) {
for ( int i = 0 ; L3UpList [ i ] ! = - 1 ; + + i ) {
if ( dPiece [ cursPosition . x ] [ cursPosition . y ] = = L3UpList [ i ] ) {
strcpy ( infostr , fmt : : format ( _ ( " Up to level {:d} " ) , currlevel - 1 ) . c_str ( ) ) ;
CopyUtf8 ( infostr , fmt : : format ( _ ( " Up to level {:d} " ) , currlevel - 1 ) , sizeof ( infostr ) ) ;
for ( int j = 0 ; j < numtrigs ; j + + ) {
if ( trigs [ j ] . _tmsg = = WM_DIABPREVLVL ) {
int dx = abs ( trigs [ j ] . position . x - cursPosition . x ) ;
@ -554,7 +555,7 @@ bool ForceL3Trig()
if ( dPiece [ cursPosition . x ] [ cursPosition . y ] = = L3DownList [ i ]
| | dPiece [ cursPosition . x + 1 ] [ cursPosition . y ] = = L3DownList [ i ]
| | dPiece [ cursPosition . x + 2 ] [ cursPosition . y ] = = L3DownList [ i ] ) {
strcpy ( infostr , fmt : : format ( _ ( " Down to level {:d} " ) , currlevel + 1 ) . c_str ( ) ) ;
CopyUtf8 ( infostr , fmt : : format ( _ ( " Down to level {:d} " ) , currlevel + 1 ) , sizeof ( infostr ) ) ;
for ( int j = 0 ; j < numtrigs ; j + + ) {
if ( trigs [ j ] . _tmsg = = WM_DIABNEXTLVL ) {
cursPosition = trigs [ j ] . position ;
@ -566,7 +567,7 @@ bool ForceL3Trig()
} else {
for ( int i = 0 ; L6UpList [ i ] ! = - 1 ; + + i ) {
if ( dPiece [ cursPosition . x ] [ cursPosition . y ] = = L6UpList [ i ] ) {
strcpy ( infostr , fmt : : format ( _ ( " Up to Nest level {:d} " ) , currlevel - 17 ) . c_str ( ) ) ;
CopyUtf8 ( infostr , fmt : : format ( _ ( " Up to Nest level {:d} " ) , currlevel - 17 ) , sizeof ( infostr ) ) ;
for ( int j = 0 ; j < numtrigs ; j + + ) {
if ( trigs [ j ] . _tmsg = = WM_DIABPREVLVL ) {
cursPosition = trigs [ j ] . position ;
@ -579,7 +580,7 @@ bool ForceL3Trig()
if ( dPiece [ cursPosition . x ] [ cursPosition . y ] = = L6DownList [ i ]
| | dPiece [ cursPosition . x + 1 ] [ cursPosition . y ] = = L6DownList [ i ]
| | dPiece [ cursPosition . x + 2 ] [ cursPosition . y ] = = L6DownList [ i ] ) {
strcpy ( infostr , fmt : : format ( _ ( " Down to level {:d} " ) , currlevel - 15 ) . c_str ( ) ) ;
CopyUtf8 ( infostr , fmt : : format ( _ ( " Down to level {:d} " ) , currlevel - 15 ) , sizeof ( infostr ) ) ;
for ( int j = 0 ; j < numtrigs ; j + + ) {
if ( trigs [ j ] . _tmsg = = WM_DIABNEXTLVL ) {
cursPosition = trigs [ j ] . position ;
@ -632,7 +633,7 @@ bool ForceL4Trig()
{
for ( int i = 0 ; L4UpList [ i ] ! = - 1 ; + + i ) {
if ( dPiece [ cursPosition . x ] [ cursPosition . y ] = = L4UpList [ i ] ) {
strcpy ( infostr , fmt : : format ( _ ( " Up to level {:d} " ) , currlevel - 1 ) . c_str ( ) ) ;
CopyUtf8 ( infostr , fmt : : format ( _ ( " Up to level {:d} " ) , currlevel - 1 ) , sizeof ( infostr ) ) ;
for ( int j = 0 ; j < numtrigs ; j + + ) {
if ( trigs [ j ] . _tmsg = = WM_DIABPREVLVL ) {
cursPosition = trigs [ j ] . position ;
@ -644,7 +645,7 @@ bool ForceL4Trig()
for ( int i = 0 ; L4DownList [ i ] ! = - 1 ; i + + ) {
if ( dPiece [ cursPosition . x ] [ cursPosition . y ] = = L4DownList [ i ] ) {
strcpy ( infostr , fmt : : format ( _ ( " Down to level {:d} " ) , currlevel + 1 ) . c_str ( ) ) ;
CopyUtf8 ( infostr , fmt : : format ( _ ( " Down to level {:d} " ) , currlevel + 1 ) , sizeof ( infostr ) ) ;
for ( int j = 0 ; j < numtrigs ; j + + ) {
if ( trigs [ j ] . _tmsg = = WM_DIABNEXTLVL ) {
cursPosition = trigs [ j ] . position ;
@ -708,7 +709,7 @@ bool ForceSKingTrig()
{
for ( int i = 0 ; L1UpList [ i ] ! = - 1 ; i + + ) {
if ( dPiece [ cursPosition . x ] [ cursPosition . y ] = = L1UpList [ i ] ) {
strcpy ( infostr , fmt : : format ( _ ( " Back to Level {:d} " ) , Quests [ Q_SKELKING ] . _qlevel ) . c_str ( ) ) ;
CopyUtf8 ( infostr , fmt : : format ( _ ( " Back to Level {:d} " ) , Quests [ Q_SKELKING ] . _qlevel ) , sizeof ( infostr ) ) ;
cursPosition = trigs [ 0 ] . position ;
return true ;
@ -722,7 +723,7 @@ bool ForceSChambTrig()
{
for ( int i = 0 ; L2DownList [ i ] ! = - 1 ; i + + ) {
if ( dPiece [ cursPosition . x ] [ cursPosition . y ] = = L2DownList [ i ] ) {
strcpy ( infostr , fmt : : format ( _ ( " Back to Level {:d} " ) , Quests [ Q_SCHAMB ] . _qlevel ) . c_str ( ) ) ;
CopyUtf8 ( infostr , fmt : : format ( _ ( " Back to Level {:d} " ) , Quests [ Q_SCHAMB ] . _qlevel ) , sizeof ( infostr ) ) ;
cursPosition = trigs [ 0 ] . position ;
return true ;
@ -736,7 +737,7 @@ bool ForcePWaterTrig()
{
for ( int i = 0 ; L3DownList [ i ] ! = - 1 ; i + + ) {
if ( dPiece [ cursPosition . x ] [ cursPosition . y ] = = L3DownList [ i ] ) {
strcpy ( infostr , fmt : : format ( _ ( " Back to Level {:d} " ) , Quests [ Q_PWATER ] . _qlevel ) . c_str ( ) ) ;
CopyUtf8 ( infostr , fmt : : format ( _ ( " Back to Level {:d} " ) , Quests [ Q_PWATER ] . _qlevel ) , sizeof ( infostr ) ) ;
cursPosition = trigs [ 0 ] . position ;
return true ;