[wpdev-commits] wolfpack territories.h,1.28,1.29 territories.cpp,1.48,1.49
Brought to you by:
rip,
thiagocorrea
From: Richard M. <dr...@us...> - 2004-07-10 23:03:39
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18357 Modified Files: territories.h territories.cpp Log Message: Updates to territories: <noentermessage /> and <noguardmessage /> added to flags. Fixed guard messages. <guardowner>the town</guardowner> will default to a cliloc message. Index: territories.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/territories.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** territories.cpp 10 Jul 2004 23:01:18 -0000 1.48 --- territories.cpp 10 Jul 2004 23:03:29 -0000 1.49 *************** *** 121,129 **** // <guardowner>text</guardowner> else if ( TagName == "guardowner" ) ! this->guardowner_ = Value; // <midilist>MIDI_COMBAT</midilist> else if ( TagName == "midilist" ) this->midilist_ = Value; else if ( TagName == "flags" ) { --- 121,133 ---- // <guardowner>text</guardowner> else if ( TagName == "guardowner" ) ! if ( Value == "the town" ) ! this->guardowner_ = ""; ! else ! this->guardowner_ = Value; // <midilist>MIDI_COMBAT</midilist> else if ( TagName == "midilist" ) this->midilist_ = Value; + else if ( TagName == "flags" ) { *************** *** 156,159 **** --- 160,167 ---- else if ( childNode->name() == "nomusic" ) setNoMusic( true ); + else if ( childNode->name() == "noguardmessage" ) + setNoGuardMessage( true ); + else if ( childNode->name() == "noentermessage" ) + setNoEnterMessage( true ); } } *************** *** 387,411 **** if ( !cPythonScript::callChainedEventHandler( EVENT_CHANGEREGION, pc->getEvents(), args ) && socket ) { ! if ( lastRegion && !lastRegion->name().isEmpty() ) socket->sysMessage( tr( "You have left %1." ).arg( lastRegion->name() ) ); ! if ( currRegion && !currRegion->name().isEmpty() ) socket->sysMessage( tr( "You have entered %1." ).arg( currRegion->name() ) ); if ( ( currRegion->isGuarded() != lastRegion->isGuarded() ) || ( currRegion->isGuarded() && ( currRegion->guardOwner() != lastRegion->guardOwner() ) ) ) { ! if ( currRegion->isGuarded() ) { ! if ( currRegion->guardOwner().isEmpty() ) ! socket->clilocMessage( 500112 ); // You are now under the protection of the town guards ! else ! socket->sysMessage( currRegion->guardOwner() ); } ! else { ! if ( lastRegion->guardOwner().isEmpty() ) ! socket->clilocMessage( 500113 ); // You have left the protection of the town guards. else ! socket->sysMessage( lastRegion->guardOwner() ); } } --- 395,437 ---- if ( !cPythonScript::callChainedEventHandler( EVENT_CHANGEREGION, pc->getEvents(), args ) && socket ) { ! if ( lastRegion && !lastRegion->name().isEmpty() && !lastRegion->isNoEnterMessage() ) socket->sysMessage( tr( "You have left %1." ).arg( lastRegion->name() ) ); ! if ( currRegion && !currRegion->name().isEmpty() && !currRegion->isNoEnterMessage() ) socket->sysMessage( tr( "You have entered %1." ).arg( currRegion->name() ) ); if ( ( currRegion->isGuarded() != lastRegion->isGuarded() ) || ( currRegion->isGuarded() && ( currRegion->guardOwner() != lastRegion->guardOwner() ) ) ) { ! /* Guarded Setting Changes */ ! if ( currRegion->isGuarded() != lastRegion->isGuarded() ) { ! if ( lastRegion->isGuarded() && !lastRegion->isNoGuardMessage() ) ! { ! if ( lastRegion->guardOwner().isEmpty() ) ! socket->clilocMessage( 500113 ); // You have left the protection of the town guards. ! else ! socket->sysMessage( tr( "You have left the protection of %1 guards." ).arg( lastRegion->guardOwner() ) ); ! } ! if ( currRegion->isGuarded() && !currRegion->isNoGuardMessage() ) ! { ! if ( currRegion->guardOwner().isEmpty() ) ! socket->clilocMessage( 500112 ); // You are now under the protection of the town guards ! else ! socket->sysMessage( tr( "You are now under the protection of %1 guards." ).arg( currRegion->guardOwner() ) ); ! } } ! } ! /* Remain Guarded */ ! if ( currRegion->isGuarded() == lastRegion->isGuarded() ) ! { ! /* Only show if you haven't gotten a message before. ! Or, only show if the guard owner changes. ! */ ! if ( ( !currRegion->isNoGuardMessage() && !lastRegion->isNoGuardMessage() ) && ( currRegion->guardOwner() != lastRegion->guardOwner() ) ) { ! if ( currRegion->guardOwner().isEmpty() ) ! socket->clilocMessage( 500112 ); // You are now under the protection of the town guards else ! socket->sysMessage( tr( "You are now under the protection of %1 guards." ).arg( currRegion->guardOwner() ) ); } } Index: territories.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/territories.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** territories.h 2 Jun 2004 15:04:07 -0000 1.28 --- territories.h 10 Jul 2004 23:03:29 -0000 1.29 *************** *** 107,110 **** --- 107,118 ---- return flags_ & 0x0400; } + bool isNoGuardMessage( void ) const + { + return flags_ & 0x0800; + } + bool isNoEnterMessage( void ) const + { + return flags_ & 0x1000; + } QString guardOwner( void ) const { *************** *** 202,205 **** --- 210,227 ---- flags_ &= ~0x0400; } + void setNoGuardMessage( bool data ) + { + if ( data ) + flags_ |= 0x0800; + else + flags_ &= ~0x0800; + } + void setNoEnterMessage( bool data ) + { + if ( data ) + flags_ |= 0x1000; + else + flags_ &= ~0x1000; + } virtual void processNode( const cElement* Tag ); |