Difference for server/apply.c from version 1.166 to 1.167


version 1.166 version 1.167
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_apply_c =   * static char *rcsid_apply_c =
  *   "$Id: apply.c,v 1.166 2006/04/06 21:18:35 tchize Exp $";   *   "$Id: apply.c,v 1.167 2006/05/05 09:26:34 ryo_saeba Exp $";
  */   */
 /*  /*
     CrossFire, A Multiplayer game for X-windows      CrossFire, A Multiplayer game for X-windows
Line 41
 
Line 41
 /* need math lib for double-precision and pow() in dragon_eat_flesh() */  /* need math lib for double-precision and pow() in dragon_eat_flesh() */
 #include <math.h>  #include <math.h>
   
   static int dragon_eat_flesh(object *op, object *meal);
   static void apply_item_transformer(object *pl, object *transformer);
   static void apply_lighter(object *who, object *lighter);
   static void scroll_failure(object *op, int failure, int power);
   
 /** Can transport hold object op?  /** Can transport hold object op?
  * This is a pretty trivial function,   * This is a pretty trivial function,
  * but in the future, possible transport may have more restrictions   * but in the future, possible transport may have more restrictions
Line 641
 
Line 646
 /**  /**
  * Actually improves the weapon, and tells user.   * Actually improves the weapon, and tells user.
  */   */
 int improve_weapon_stat(object *op,object *improver,object *weapon,  static int improve_weapon_stat(object *op,object *improver,object *weapon,
  signed char *stat,int sacrifice_count,const char *statname)   signed char *stat,int sacrifice_count,const char *statname)
 {  {
   
Line 676
 
Line 681
  * Checks for sacrifice, and so on.   * Checks for sacrifice, and so on.
  */   */
   
 int prepare_weapon(object *op, object *improver, object *weapon)  static int prepare_weapon(object *op, object *improver, object *weapon)
 {  {
     int sacrifice_count,i;      int sacrifice_count,i;
     char buf[MAX_BUF];      char buf[MAX_BUF];
Line 732
 
Line 737
  * last_eat numbers for an object.  Hopefully this won't break anything ??    * last_eat numbers for an object.  Hopefully this won't break anything ??
  * level == max improve last_eat == current improve   * level == max improve last_eat == current improve
  */   */
 int improve_weapon(object *op,object *improver,object *weapon)  static int improve_weapon(object *op,object *improver,object *weapon)
 {  {
   int sacrifice_count, sacrifice_needed=0;    int sacrifice_count, sacrifice_needed=0;
   
Line 850
 
Line 855
  * Checks a few things (not on a non-magic square, marked weapon, ...),   * Checks a few things (not on a non-magic square, marked weapon, ...),
  * then calls improve_weapon to do the dirty work.   * then calls improve_weapon to do the dirty work.
  */   */
 int check_improve_weapon (object *op, object *tmp)  static int check_improve_weapon (object *op, object *tmp)
 {  {
     object *otmp;      object *otmp;
   
Line 897
 
Line 902
  * Modified by MSW for partial resistance.  Only support   * Modified by MSW for partial resistance.  Only support
  * changing of physical area right now.   * changing of physical area right now.
  */   */
 int improve_armour(object *op, object *improver, object *armour)  static int improve_armour(object *op, object *improver, object *armour)
 {  {
     object *tmp;      object *tmp;
   
Line 991
 
Line 996
  * item is the object that triggered the converter - if it is not   * item is the object that triggered the converter - if it is not
  * what the converter wants, this will not do anything.   * what the converter wants, this will not do anything.
  */   */
 int convert_item(object *item, object *converter) {  static int convert_item(object *item, object *converter) {
     int nr=0;      int nr=0;
     object *tmp;      object *tmp;
     int is_in_shop;      int is_in_shop;
Line 1089
 
Line 1094
  * added the alchemical cauldron to the code -b.t.   * added the alchemical cauldron to the code -b.t.
  */   */
   
 int apply_container (object *op, object *sack)  static int apply_container (object *op, object *sack)
 {  {
     char buf[MAX_BUF];      char buf[MAX_BUF];
     object *tmp;      object *tmp;
Line 2206
 
Line 2211
  * return:   * return:
  *     int               1 if eating successful, 0 if it doesn't work   *     int               1 if eating successful, 0 if it doesn't work
  */   */
 int dragon_eat_flesh(object *op, object *meal) {  static int dragon_eat_flesh(object *op, object *meal) {
   object *skin = NULL;    /* pointer to dragon skin force*/    object *skin = NULL;    /* pointer to dragon skin force*/
   object *abil = NULL;    /* pointer to dragon ability force*/    object *abil = NULL;    /* pointer to dragon ability force*/
   object *tmp = NULL;     /* tmp. object */    object *tmp = NULL;     /* tmp. object */
Line 2447
 
Line 2452
  * in the field exit->name cause the field exit->owner doesn't   * in the field exit->name cause the field exit->owner doesn't
  * survive in the swapping (in fact the whole exit doesn't survive).   * survive in the swapping (in fact the whole exit doesn't survive).
  */   */
 int is_legal_2ways_exit (object* op, object *exit)  static int is_legal_2ways_exit (object* op, object *exit)
    {     {
    object * tmp;     object * tmp;
    object * exit_owner;     object * exit_owner;
Line 2974
 
Line 2979
  * invisible other objects that use   * invisible other objects that use
  * up body locations can be used as restrictions.   * up body locations can be used as restrictions.
  */   */
 object *get_item_from_body_location(object *start, int loc)  static object *get_item_from_body_location(object *start, int loc)
 {  {
     object *tmp;      object *tmp;
   
Line 3000
 
Line 3005
  * instead of doing it.  This is a lot less code than having   * instead of doing it.  This is a lot less code than having
  * another function that does just that.   * another function that does just that.
  */   */
 int unapply_for_ob(object *who, object *op, int aflags)  static int unapply_for_ob(object *who, object *op, int aflags)
 {  {
     int i;      int i;
     object *tmp=NULL, *last;      object *tmp=NULL, *last;
Line 3521
 
Line 3526
 }  }
   
   
 int monster_apply_special (object *who, object *op, int aflags)  static int monster_apply_special (object *who, object *op, int aflags)
 {  {
   if (QUERY_FLAG (op, FLAG_UNPAID) && ! QUERY_FLAG (op, FLAG_APPLIED))    if (QUERY_FLAG (op, FLAG_UNPAID) && ! QUERY_FLAG (op, FLAG_APPLIED))
     return 1;      return 1;
Line 3763
 
Line 3768
  * the selected object to "burn". -b.t.   * the selected object to "burn". -b.t.
  */   */
   
 void apply_lighter(object *who, object *lighter) {  static void apply_lighter(object *who, object *lighter) {
     object *item;      object *item;
     int is_player_env=0;      int is_player_env=0;
     uint32 nrof;      uint32 nrof;
Line 3832
 
Line 3837
  * op made some mistake with a scroll, this takes care of punishment.   * op made some mistake with a scroll, this takes care of punishment.
  * scroll_failure()- hacked directly from spell_failure   * scroll_failure()- hacked directly from spell_failure
  */   */
 void scroll_failure(object *op, int failure, int power)  static void scroll_failure(object *op, int failure, int power)
 {  {
     if(abs(failure/4)>power) power=abs(failure/4); /* set minimum effect */      if(abs(failure/4)>power) power=abs(failure/4); /* set minimum effect */
   
Line 3954
 
Line 3959
  * This way an item can be transformed in many things, and/or many objects.   * This way an item can be transformed in many things, and/or many objects.
  * The 'slaying' field for transformer is used as verb for the action.   * The 'slaying' field for transformer is used as verb for the action.
  */   */
 void apply_item_transformer( object* pl, object* transformer )  static void apply_item_transformer( object* pl, object* transformer )
     {      {
     object* marked;      object* marked;
     object* new_item;      object* new_item;


Legend:
line(s) removed in v.1.166 
line(s) changed
 line(s) added in v.1.167

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:22