2001-02-02 09:40:49 +01:00
/* vi: set ts=2:
*
2001-04-14 14:11:45 +02:00
*
2003-07-29 11:48:03 +02:00
* Eressea PB ( E ) M host Copyright ( C ) 1998 - 2003
2001-02-02 09:40:49 +01:00
* Christian Schlittchen ( corwin @ amber . kn - bremen . de )
* Katja Zedel ( katze @ felidae . kn - bremen . de )
* Henning Peters ( faroul @ beyond . kn - bremen . de )
* Enno Rehling ( enno @ eressea - pbem . de )
* Ingo Wilken ( Ingo . Wilken @ informatik . uni - oldenburg . de )
*
* This program may not be used , modified or distributed without
* prior permission by the authors of Eressea .
*/
# include <config.h>
# include <eressea.h>
# include "lmsreward.h"
/* kernel includes */
# include <item.h>
# include <region.h>
# include <unit.h>
# include <curse.h>
/* libc includes */
# include <assert.h>
# include <string.h>
2001-02-02 09:58:26 +01:00
# include <stdlib.h>
2001-02-02 09:40:49 +01:00
static int
2002-05-09 14:48:19 +02:00
info_lmsstory ( const struct locale * lang , const void * obj , typ_t typ , struct curse * c , int self )
2001-02-02 09:40:49 +01:00
{
2002-05-09 14:48:19 +02:00
unused ( lang ) ;
unused ( obj ) ;
unused ( typ ) ;
2001-02-02 09:40:49 +01:00
unused ( c ) ;
2002-05-09 14:48:19 +02:00
unused ( self ) ;
2001-02-02 09:40:49 +01:00
strcpy ( buf , " Die Bauern der Region erz<72> hlen sich die Geschichte von den glorreichen Siegern des Last-Man-Standing Turniers. " ) ;
return 1 ;
}
static curse_type ct_lmsstory = {
2002-05-01 21:08:32 +02:00
" lmsstory " , 0 , 0 , 0 , " xxx " , & info_lmsstory
2001-02-02 09:40:49 +01:00
} ;
static int
age_lmsstory ( attrib * a )
{
return - - a - > data . i ;
}
static attrib_type at_lmsstory = {
" lms_story " ,
NULL , NULL ,
age_lmsstory ,
a_writedefault ,
a_readdefault ,
2001-04-01 08:58:45 +02:00
ATF_UNIQUE /* | ATF_CURSE */ /* Das geht nicht, weil der Inhalt
des Attributs kein curse * ist */
2001-02-02 09:40:49 +01:00
} ;
2001-04-13 16:39:57 +02:00
#if 0
2001-02-02 09:40:49 +01:00
static int
use_lmsreward ( struct unit * u , const struct item_type * itype , const char * cmd )
{
region * r = u - > region ;
attrib * a = a_find ( r - > attribs , & at_lmsstory ) ;
if ( ! a ) a = a_add ( & r - > attribs , a_new ( & at_lmsstory ) ) ;
a - > data . i = 4 + ( rand ( ) % 8 ) ;
sprintf ( buf , " %s erz<72> hlt in allen Schenken die Geschichte vom glorreichen Sieg im Last-Man-Standing Turnier. Noch wochenlang werden die Bauern in %s sich diese Geschichte erz<72> hlen. " , unitname ( u ) , regionid ( r ) ) ;
addmessage ( r , NULL , buf , MSG_MESSAGE , ML_IMPORTANT ) ;
unused ( itype ) ;
unused ( cmd ) ;
return - 1 ;
}
2001-04-13 16:39:57 +02:00
# endif
2001-02-02 09:40:49 +01:00
static resource_type rt_lmsreward = {
2001-04-22 07:36:50 +02:00
{ " lmsreward " , " lmsreward_p " } ,
{ " lmsreward " , " lmsreward_p " } ,
2001-02-02 09:40:49 +01:00
RTF_ITEM ,
& res_changeitem
} ;
item_type it_lmsreward = {
& rt_lmsreward , /* resourcetype */
ITF_NOTLOST | ITF_CURSED , 0 , 0 , /* flags, weight, capacity */
NULL , /* construction */
2001-04-01 08:58:45 +02:00
NULL , /* anstelle von use_lmsreward */
/* &use_lmsreward, */
2001-02-02 09:40:49 +01:00
NULL
} ;
void
2002-01-09 09:20:33 +01:00
register_lmsreward ( void )
2001-02-02 09:40:49 +01:00
{
it_register ( & it_lmsreward ) ;
at_register ( & at_lmsstory ) ;
}