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

A patch



This is a patch to allow a character to brace himself. This just means that you
stand still and won't move when you press a direction key. You will still attack
things but you won't move. This is useful for when you are standing outside a 
door and you are attacking the monsters streaming out, but you don't want to 
jump into the room when one of them dies.
 To brace yourself, press 's'. It is a toggle, so pressing 's' again unbraces 
you.
Enjoy,

Rupert

-------------------cut here--------------------------------------------
diff -c crossfire-0.87.8/global.h crossfire.local/global.h
*** crossfire-0.87.8/global.h	Thu Sep 24 16:24:16 1992
--- crossfire.local/global.h	Thu Oct  1 18:38:33 1992
***************
*** 167,172 ****
--- 167,173 ----
    unsigned char key_down;     /* Last move-key still held down */
    unsigned char mode;         /* Mode of player: */
    unsigned char berzerk;      /* Affects usage of CTRL-direction */
+   unsigned braced:1;		  /* Will not move if braced, only attack */
    /* 0=normal, 1=pick up while walking, 2=stop after pick, 3=stop before pick */
    unsigned char state,infoline;
    unsigned char writing;   /* When true, the player is writing text */
diff -c crossfire-0.87.8/input.c crossfire.local/input.c
*** crossfire-0.87.8/input.c	Thu Sep 24 16:24:17 1992
--- crossfire.local/input.c	Thu Oct  1 18:38:35 1992
***************
*** 1713,1718 ****
--- 1713,1728 ----
        break;
      case 's': if (IS_WIZ(op))
        (void) fprintf(stderr,"%d used, %d free.\n",count_used(),count_free());
+ 	  		  else {
+ 			  	if (op->contr->braced) {
+ 					op->contr->braced = 0;
+ 					draw_info(op, "You are no longer braced.");
+ 				}
+ 				else {
+ 					op->contr->braced = 1;
+ 					draw_info(op, "You are now braced.");
+ 				}
+ 			  }
        break;
      case 'S': if(IS_WIZ(op))
        (void) ss_dump_table(1);
diff -c crossfire-0.87.8/main.c crossfire.local/main.c
*** crossfire-0.87.8/main.c	Thu Sep 24 16:24:17 1992
--- crossfire.local/main.c	Thu Oct  1 19:06:24 1992
***************
*** 1179,1185 ****
    if(op->contr->fire_on)
      fire(op,dir);
    else
!     if(!move_ob(op,dir)&&!out_of_map(op->map,op->x+dx,op->y+dy)) {
        stack=tmp=get_map_ob(op->map,op->x+freearr_x[dir],op->y+freearr_y[dir]);
        while(stack) {
  	if (IS_ALIVE(stack) || CAN_ROLL(stack)) tmp = stack;
--- 1179,1185 ----
    if(op->contr->fire_on)
      fire(op,dir);
    else
!     if((op->contr->braced||!move_ob(op,dir))&&!out_of_map(op->map,op->x+dx,op->y+dy)) {
        stack=tmp=get_map_ob(op->map,op->x+freearr_x[dir],op->y+freearr_y[dir]);
        while(stack) {
  	if (IS_ALIVE(stack) || CAN_ROLL(stack)) tmp = stack;
***************
*** 1195,1203 ****
              hit_player(tmp,9999,op,AT_PHYSICAL); /* Break through the door */
            }
          }
!         if(tmp->type==PLAYER&&op->contr->peaceful)
            (void) push_ob(tmp,dir,op);
!         else if(CAN_ROLL(tmp))
            recursive_roll(tmp,dir,op);
          else if(tmp->stats.hp>=0&&IS_ALIVE(tmp)) {
            attack_ob(tmp,op);
--- 1195,1203 ----
              hit_player(tmp,9999,op,AT_PHYSICAL); /* Break through the door */
            }
          }
!         if(tmp->type==PLAYER&&op->contr->peaceful&&(!op->contr->braced))
            (void) push_ob(tmp,dir,op);
!         else if(CAN_ROLL(tmp)&&(!op->contr->braced))
            recursive_roll(tmp,dir,op);
          else if(tmp->stats.hp>=0&&IS_ALIVE(tmp)) {
            attack_ob(tmp,op);


-- 
Rupert G. Goldie, Research Scientist                rgg@aaii.oz.au
Australian Artificial Intelligence Institute        
Life's a bitch and then you die.


----- End Included Message -----