Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CF: Patch: real wizard mode



Hi,

since the DM feature of crossfire is just a "semi-feature" (useless
except for cheating), I decided to make it a real wizard mode. This
is based on the REAL_WIZ preprocessor define for no apparent reason -:(

------------------------------ Cut ------------------------------

diff -r -C 5 crossfire-0.93.7/include/define.h crossfire/include/define.h
*** crossfire-0.93.7/include/define.h	Tue Jan  6 10:29:28 1998
--- crossfire/include/define.h	Fri Jan  9 14:01:47 1998
***************
*** 24,33 ****
--- 24,35 ----
      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  
      The author can be reached via e-mail to mark@pyramid.com
  */
  
+ #define REAL_WIZ
+ 
  /* This file is really too large.  With all the .h files
   * around, this file should be better split between them - things
   * that deal with objects should be in objects.h, things dealing
   * with players in player.h, etc.  As it is, everything just seems
   * to be dumped in here.
diff -r -C 5 crossfire-0.93.7/server/c_object.c crossfire/server/c_object.c
*** crossfire-0.93.7/server/c_object.c	Tue Jan  6 10:29:23 1998
--- crossfire/server/c_object.c	Fri Jan  9 14:04:15 1998
***************
*** 435,446 ****
--- 435,448 ----
  	    esrv_del_item (pl->contr->eric_server, tmp->count);
  	remove_ob(tmp);
  	free_object(tmp);
  	return;
      }
+ #ifndef REAL_WIZ
      if(QUERY_FLAG(pl, FLAG_WAS_WIZ))
  	SET_FLAG(tmp, FLAG_WAS_WIZ);
+ #endif
  
      if(nrof && nrof != tmp->nrof) {
  	object *tmp2 = tmp;
  	tmp = get_split_ob (tmp, nrof);
  	if(!tmp) {
diff -r -C 5 crossfire-0.93.7/server/c_wiz.c crossfire/server/c_wiz.c
*** crossfire-0.93.7/server/c_wiz.c	Tue Jan  6 10:29:23 1998
--- crossfire/server/c_wiz.c	Fri Jan  9 14:10:22 1998
***************
*** 244,254 ****
--- 244,256 ----
          tmp=arch_to_object(at);
          tmp->x=op->x,tmp->y=op->y;
          if (set_nrof)
            tmp->nrof = nrof;
          tmp->map=op->map;
+ #ifndef REAL_WIZ
  	SET_FLAG(tmp, FLAG_WAS_WIZ);
+ #endif
          if (set_magic)
            set_abs_magic(tmp, magic);
          if (art)
            give_artifact_abilities(tmp, art->item);
          if (need_identify(tmp)) {
***************
*** 264,274 ****
--- 266,278 ----
        for (i=0 ; i < (set_nrof ? nrof : 1); i++) {
          archetype *atmp;
          object *prev=NULL,*head=NULL;
          for (atmp=at;atmp!=NULL;atmp=atmp->more) {
            tmp=arch_to_object(atmp);
+ #ifndef REAL_WIZ
  	  SET_FLAG(tmp, FLAG_WAS_WIZ);
+ #endif
            if(head==NULL)
              head=tmp;
            tmp->x=op->x+tmp->arch->clone.x;
            tmp->y=op->y+tmp->arch->clone.y;
            tmp->map=op->map;
***************
*** 379,389 ****
--- 383,395 ----
        new_draw_info(NDI_UNIQUE, 0,op,"Patch what values?");
        return 1;
      }
      if((arg2=strchr(++arg,' ')))
        arg2++;
+ #ifndef REAL_WIZ
      SET_FLAG(tmp, FLAG_WAS_WIZ); /* To avoid cheating */
+ #endif
      if(set_variable(tmp,arg) == -1)
        new_draw_info(NDI_UNIQUE, 0,op,errmsg);
      else {
        new_draw_info_format(NDI_UNIQUE, 0, op,
  	"(%s#%d)->%s=%s",tmp->name,tmp->count,arg,arg2);
***************
*** 455,465 ****
--- 461,473 ----
        return 1;
      }
  #endif
      pl->ob->stats.exp += i;
      add_exp(pl->ob,0);
+ #ifndef REAL_WIZ
      SET_FLAG(pl->ob, FLAG_WAS_WIZ);
+ #endif
      draw_stats(pl->ob);
      return 1;
    }
  
  int command_speed (object *op, char *params)
***************
*** 544,555 ****
      if (iii<MIN_STAT||iii>MAX_STAT) {
        new_draw_info(NDI_UNIQUE, 0,op,"Illegal range of stat.\n");
        return 1;
      }
      for(pl=first_player;pl!=NULL;pl=pl->next) 
!        if(!strcmp(pl->ob->name,thing)){   
  	  SET_FLAG(pl->ob, FLAG_WAS_WIZ);
            if(!strcmp("str",thing2))
              pl->ob->stats.Str = iii,pl->orig_stats.Str = iii;
            if(!strcmp("dex",thing2))   
              pl->ob->stats.Dex = iii,pl->orig_stats.Dex = iii;
            if(!strcmp("con",thing2))
--- 552,565 ----
      if (iii<MIN_STAT||iii>MAX_STAT) {
        new_draw_info(NDI_UNIQUE, 0,op,"Illegal range of stat.\n");
        return 1;
      }
      for(pl=first_player;pl!=NULL;pl=pl->next) 
!        if(!strcmp(pl->ob->name,thing)){ 
! #ifndef REAL_WIZ  
  	  SET_FLAG(pl->ob, FLAG_WAS_WIZ);
+ #endif
            if(!strcmp("str",thing2))
              pl->ob->stats.Str = iii,pl->orig_stats.Str = iii;
            if(!strcmp("dex",thing2))   
              pl->ob->stats.Dex = iii,pl->orig_stats.Dex = iii;
            if(!strcmp("con",thing2))
***************
*** 642,651 ****
--- 652,664 ----
         return 1;
       }
       CLEAR_FLAG(op, FLAG_WIZ);
       CLEAR_FLAG(op, FLAG_WIZPASS);
       CLEAR_FLAG(op, FLAG_FLYING);
+ #ifdef REAL_WIZ
+      CLEAR_FLAG(op, FLAG_WAS_WIZ);
+ #endif
       new_draw_info(NDI_UNIQUE | NDI_ALL, 1, NULL,
  	"The Dungeon Master is gone..");
       return 1;
    }
  
diff -r -C 5 crossfire-0.93.7/server/shop.c crossfire/server/shop.c
*** crossfire-0.93.7/server/shop.c	Tue Jan  6 10:29:24 1998
--- crossfire/server/shop.c	Fri Jan  9 14:12:29 1998
***************
*** 381,392 ****
--- 381,394 ----
  	    if (pl->contr->eric_server > 0)
  		esrv_send_item(pl, tmp);
  	} else
  	    free_object(coin_objs[i]);
      }
+ #ifndef REAL_WIZ
      if(QUERY_FLAG(pl,FLAG_WAS_WIZ))
        SET_FLAG(op, FLAG_WAS_WIZ);
+ #endif
      pl->contr->freeze_inv=0;
      fix_player(pl);
      return 1;
  }
  
[to unsubscribe etc., send mail to crossfire-request@ifi.uio.no]