Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13916
Modified Files:
basechar.cpp basechar.h pythonscript.cpp pythonscript.h
Log Message:
Added an onResurrect event.
Changed char.resurrect to accept the source of the resurrection as an optional parameter.
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.87
retrieving revision 1.88
diff -C2 -d -r1.87 -r1.88
*** basechar.h 24 Sep 2004 04:47:23 -0000 1.87
--- basechar.h 26 Sep 2004 21:36:23 -0000 1.88
***************
*** 283,287 ****
double getStaminaRate();
double getManaRate();
! void resurrect();
virtual void turnTo( cUObject* object );
--- 283,287 ----
double getStaminaRate();
double getManaRate();
! bool resurrect( cUObject* source );
virtual void turnTo( cUObject* object );
***************
*** 326,329 ****
--- 326,330 ----
virtual bool onSkillUse( UI08 Skill ); // The character uses %Skill
virtual bool onDeath( cUObject* source, P_ITEM corpse );
+ virtual bool onResurrect( cUObject* source );
virtual bool onDropOnChar( P_ITEM pItem );
virtual QString onShowPaperdollName( P_CHAR pOrigin ); // only change the viewed name
Index: pythonscript.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/pythonscript.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** pythonscript.h 25 Sep 2004 19:57:12 -0000 1.42
--- pythonscript.h 26 Sep 2004 21:36:23 -0000 1.43
***************
*** 88,91 ****
--- 88,92 ----
EVENT_GETSELLPRICE,
EVENT_SHOWVIRTUEGUMP,
+ EVENT_RESURRECT,
EVENT_COUNT,
};
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.151
retrieving revision 1.152
diff -C2 -d -r1.151 -r1.152
*** basechar.cpp 26 Sep 2004 12:45:53 -0000 1.151
--- basechar.cpp 26 Sep 2004 21:36:23 -0000 1.152
***************
*** 783,790 ****
// corpse and if so, merge with our corpse instead of
// just resurrecting
! void cBaseChar::resurrect()
{
if ( !isDead() )
! return;
cCorpse* corpse = 0;
--- 783,793 ----
// corpse and if so, merge with our corpse instead of
// just resurrecting
! bool cBaseChar::resurrect( cUObject* source )
{
if ( !isDead() )
! return false;
!
! if ( onResurrect( source ) )
! return false;
cCorpse* corpse = 0;
***************
*** 898,901 ****
--- 901,905 ----
this->action( action, 2, true );
}
+ return true;
}
***************
*** 2671,2674 ****
--- 2675,2690 ----
}
+ bool cBaseChar::onResurrect( cUObject* source )
+ {
+ bool result = false;
+ if (canHandleEvent(EVENT_RESURRECT))
+ {
+ PyObject* args = Py_BuildValue( "(O&O&)", PyGetCharObject, this, PyGetObjectObject, source );
+ result = callEventHandler(EVENT_RESURRECT, args);
+ Py_DECREF( args );
+ }
+ return result;
+ }
+
bool cBaseChar::onCHLevelChange( unsigned int level )
{
Index: pythonscript.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/pythonscript.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** pythonscript.cpp 25 Sep 2004 19:57:12 -0000 1.51
--- pythonscript.cpp 26 Sep 2004 21:36:23 -0000 1.52
***************
*** 538,541 ****
--- 538,550 ----
"onShowVirtueGump",
+ /*
+ \event onResurrect
+ \param char The character being resurrected.
+ \param source The source of the resurrection. This may be None.
+ \condition Triggered when a character is resurrected.
+ \notes Return False to cancel the resurrection.
+ */
+ "onResurrect",
+
0
};
|