Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv13883
Modified Files:
basechar.cpp basechar.h books.h corpse.h items.h npc.cpp npc.h
player.h uobject.cpp
Log Message:
definition tags also use setProperty
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** basechar.cpp 11 Aug 2003 03:34:40 -0000 1.30
--- basechar.cpp 11 Aug 2003 12:17:57 -0000 1.31
***************
*** 1204,1211 ****
}
- //<name>my this</name>
- if( TagName == "name" )
- this->setName(Value);
-
//<backpack>
// <color>0x132</color>
--- 1204,1207 ----
***************
*** 1323,1346 ****
}
- //<defense>10</defense>
- else if( TagName == "defense" )
- this->bodyArmor_ = Value.toUInt();
-
- //<emotecolor>0x482</emotecolor>
- else if( TagName == "emotecolor" )
- this->emoteColor_ = Value.toUShort();
-
- //<fame>8000</fame>
- else if( TagName == "fame" )
- this->fame_ = Value.toInt();
-
- //<food>3</food>
- else if( TagName == "food" )
- {
- UI16 bit = Value.toUShort();
- if( bit < 32 && bit > 0 )
- this->nutriment_ |= ( 1 << (bit-1) );
- }
-
//<gold>100</gold>
else if( TagName == "gold" )
--- 1319,1322 ----
***************
*** 1349,1382 ****
}
- //<id>0x11</id>
- else if( TagName == "id" )
- {
- bodyID_ = Value.toInt();
- orgBodyID_ = bodyID_;
- }
-
- //<karma>-500</karma>
- else if( TagName == "karma" )
- this->karma_ = Value.toInt();
-
- //<poison>2</poison>
- else if( TagName == "poison" )
- this->setPoison( Value.toInt() );
-
- //<skin>0x342</skin>
- else if( TagName == "skin" )
- {
- skin_ = Value.toUShort();
- orgSkin_ = Value.toUShort();
- }
-
- //<saycolor>0x110</saycolor>
- else if( TagName == "saycolor" )
- saycolor_ = Value.toUShort();
-
- //<title>the king</title>
- else if( TagName == "title" )
- this->setTitle( Value );
-
//<skill type="alchemy">100</skill>
//<skill type="1">100</skill>
--- 1325,1328 ----
***************
*** 1457,1473 ****
}
- else if( TagName == "inherit" )
- {
- QString inheritID;
- if( Tag->hasAttribute( "id" ) )
- inheritID = Tag->getAttribute( "id" );
- else
- inheritID = Value;
-
- const cElement *element = DefManager->getDefinition( WPDT_NPC, inheritID );
- if( element )
- applyDefinition( element );
- }
-
else
{
--- 1403,1406 ----
***************
*** 1480,1484 ****
}
- // cUObject::processNode( Tag );
}
--- 1413,1416 ----
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** basechar.h 11 Aug 2003 03:34:40 -0000 1.21
--- basechar.h 11 Aug 2003 12:17:57 -0000 1.22
***************
*** 105,110 ****
// other public methods
// Simple Property setting and getting for script engines.
! stError *setProperty( const QString &name, const cVariant &value );
! stError *getProperty( const QString &name, cVariant &value ) const;
void updateHealth( void );
void action( uchar id ); // Do an action
--- 105,110 ----
// other public methods
// Simple Property setting and getting for script engines.
! virtual stError *setProperty( const QString &name, const cVariant &value );
! virtual stError *getProperty( const QString &name, cVariant &value ) const;
void updateHealth( void );
void action( uchar id ); // Do an action
Index: books.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/books.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** books.h 6 Jul 2003 13:48:01 -0000 1.24
--- books.h 11 Aug 2003 12:17:57 -0000 1.25
***************
*** 90,95 ****
void refresh( void );
! stError *setProperty( const QString &name, const cVariant &value );
! stError *getProperty( const QString &name, cVariant &value ) const;
private:
bool predefined_;
--- 90,95 ----
void refresh( void );
! virtual stError *setProperty( const QString &name, const cVariant &value );
! virtual stError *getProperty( const QString &name, cVariant &value ) const;
private:
bool predefined_;
Index: corpse.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/corpse.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** corpse.h 14 Jul 2003 16:58:49 -0000 1.11
--- corpse.h 11 Aug 2003 12:17:57 -0000 1.12
***************
*** 103,108 ****
virtual void update( cUOSocket *mSock = 0 );
! stError *setProperty( const QString &name, const cVariant &value );
! stError *getProperty( const QString &name, cVariant &value ) const;
};
--- 103,108 ----
virtual void update( cUOSocket *mSock = 0 );
! virtual stError *setProperty( const QString &name, const cVariant &value );
! virtual stError *getProperty( const QString &name, cVariant &value ) const;
};
Index: items.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.h,v
retrieving revision 1.163
retrieving revision 1.164
diff -C2 -d -r1.163 -r1.164
*** items.h 11 Aug 2003 03:34:40 -0000 1.163
--- items.h 11 Aug 2003 12:17:57 -0000 1.164
***************
*** 368,373 ****
P_CHAR getOutmostChar();
! stError *setProperty( const QString &name, const cVariant &value );
! stError *getProperty( const QString &name, cVariant &value ) const;
////
--- 368,373 ----
P_CHAR getOutmostChar();
! virtual stError *setProperty( const QString &name, const cVariant &value );
! virtual stError *getProperty( const QString &name, cVariant &value ) const;
////
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** npc.cpp 11 Aug 2003 03:34:40 -0000 1.28
--- npc.cpp 11 Aug 2003 12:17:57 -0000 1.29
***************
*** 919,933 ****
QDomNodeList ChildTags;
- //<carve>3</carve>
- if( TagName == "carve" )
- this->setCarve( Value );
-
- /* //<cantrain />
- else if( TagName == "cantrain" )
- this->setCantrain( true );*/
-
//<attack min=".." max= "" />
//<attack>10</attack>
! else if( TagName == "attack" )
{
if( Tag->hasAttribute("min") && Tag->hasAttribute("max") )
--- 919,925 ----
QDomNodeList ChildTags;
//<attack min=".." max= "" />
//<attack>10</attack>
! if( TagName == "attack" )
{
if( Tag->hasAttribute("min") && Tag->hasAttribute("max") )
***************
*** 943,968 ****
}
- //<fleeat>10</fleeat>
- else if( TagName == "fleeat" )
- this->setCriticalHealth( Value.toShort() );
-
- //<hidamage>10</hidamage>
- else if( TagName == "hidamage" )
- this->minDamage_ = Value.toInt();
-
- //<loot>lootlist</loot>
- else if( TagName == "loot" )
- {
- this->setLootList( Value );
- }
-
- //<lodamage>10</lodamage>
- else if( TagName == "lodamage" )
- this->maxDamage_ = Value.toInt();
-
- /* //<notrain />
- else if( TagName == "notrain" )
- this->setCantrain( false );*/
-
//<npcwander type="rectangle" x1="-10" x2="12" y1="5" y2="7" />
//<......... type="rect" ... />
--- 935,938 ----
***************
*** 1001,1009 ****
}
- //<ai>Monster_Aggressive_L1</ai>
- //<ai>Monster_Aggressive_L1,Monster_Aggr_L1_Wander</ai>
- else if( TagName == "ai" )
- this->setAI( Value );
-
//<shopkeeper>
// <sellable>...handled like item-<contains>-section...</sellable>
--- 971,974 ----
***************
*** 1037,1054 ****
}
}
-
- /* //<split>1</split>
- else if( TagName == "split" )
- this->setSplit( Value.toUShort() );
! //<splitchance>10</splitchance>
! else if( TagName == "splitchance" )
! this->setSplitchnc( Value.toUShort() );*/
! //<totame>115</totame>
! else if( TagName == "totame" )
! tamingMinSkill_ = Value.toInt();
! else
cBaseChar::processNode( Tag );
--- 1002,1020 ----
}
}
! else if( TagName == "inherit" )
! {
! QString inheritID;
! if( Tag->hasAttribute( "id" ) )
! inheritID = Tag->getAttribute( "id" );
! else
! inheritID = Value;
! const cElement *element = DefManager->getDefinition( WPDT_NPC, inheritID );
! if( element )
! applyDefinition( element );
! }
! else
cBaseChar::processNode( Tag );
***************
*** 1067,1070 ****
--- 1033,1037 ----
else SET_INT_PROPERTY( "stablemaster", stablemasterSerial_ )
else SET_STR_PROPERTY( "lootlist", lootList_ )
+ else SET_STR_PROPERTY( "loot", lootList_ )
else SET_INT_PROPERTY( "maxdamage", maxDamage_ )
else SET_INT_PROPERTY( "mindamage", minDamage_ )
***************
*** 1157,1160 ****
--- 1124,1128 ----
else GET_PROPERTY( "stablemaster", FindCharBySerial( stablemasterSerial_ ) )
else GET_PROPERTY( "lootlist", lootList_ )
+ else GET_PROPERTY( "loot", lootList_ )
else GET_PROPERTY( "maxdamage", maxDamage_ )
else GET_PROPERTY( "mindamage", minDamage_ )
Index: npc.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** npc.h 6 Jul 2003 13:48:01 -0000 1.16
--- npc.h 11 Aug 2003 12:17:57 -0000 1.17
***************
*** 103,108 ****
// other public methods
! stError *setProperty( const QString &name, const cVariant &value );
! stError *getProperty( const QString &name, cVariant &value ) const;
void attackTarget( P_CHAR defender );
void toggleCombat();
--- 103,108 ----
// other public methods
! virtual stError *setProperty( const QString &name, const cVariant &value );
! virtual stError *getProperty( const QString &name, cVariant &value ) const;
void attackTarget( P_CHAR defender );
void toggleCombat();
Index: player.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** player.h 6 Jul 2003 13:48:01 -0000 1.13
--- player.h 11 Aug 2003 12:17:57 -0000 1.14
***************
*** 80,85 ****
// other public methods
! stError *setProperty( const QString &name, const cVariant &value );
! stError *getProperty( const QString &name, cVariant &value ) const;
void turnTo( cUObject *object ); // override
void turnTo( const Coord_cl& data ); // override
--- 80,85 ----
// other public methods
! virtual stError *setProperty( const QString &name, const cVariant &value );
! virtual stError *getProperty( const QString &name, cVariant &value ) const;
void turnTo( cUObject *object ); // override
void turnTo( const Coord_cl& data ); // override
Index: uobject.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v
retrieving revision 1.102
retrieving revision 1.103
diff -C2 -d -r1.102 -r1.103
*** uobject.cpp 11 Aug 2003 03:34:40 -0000 1.102
--- uobject.cpp 11 Aug 2003 12:17:57 -0000 1.103
***************
*** 555,560 ****
recreateEvents();
}
! else
! qWarning( tr("Unknown tag %1").arg(TagName) );
}
--- 555,561 ----
recreateEvents();
}
! else
! setProperty( TagName, Value );
! // qWarning( tr("Unknown tag %1").arg(TagName) );
}
|