/* Plik:       weapon.c
 * Autor:      Silvy
 * Date:       16.07.98
 * Update:     16.07.98
 * Plik standardowy broni w Imperium
 */
 
inherit "/std/weapon";
 inherit "/lib/keep";

#pragma strict_types
#pragma save_binary

#include <stdproperties.h>
#include <macros.h>

/* Ten kawalek kodu bedzie dla zabezpieczania broni. Na razie 
   wylaczylem, bo jest pare pomyslow, ktore trzeba najpierw zrobic, 
   by miec dobre warunki na wprowadzenie */

 static int is_keep=0;
static mixed old_sell=0;

public void 
set_keep(int keep = 1)
{
   if (keep) 
      {
         old_sell=query_prop_setting(OBJ_M_NO_SELL);
         ::set_keep(keep);
         is_keep = 1;
      }
   else
      {
         is_keep = 0;
         ::set_keep(keep);
         add_prop(OBJ_M_NO_SELL,old_sell);
      }
}

public int
query_keep()
{
   return is_keep;
}

public void
add_prop(string prop, mixed val)
{
   if (prop==OBJ_M_NO_SELL&&query_keep())
      {
       old_sell=val;
       return;
      }
   ::add_prop(prop,val);
}

public void
remove_prop(string prop)
{
   if (prop==OBJ_M_NO_SELL&&query_keep()) return;
   ::remove_prop(prop);
}


void
set_hit(int class)
{
    ::set_hit(class);
    set_wf(this_object());
} 



/*
mixed
wield(object wep)
{
    int sila = this_player()->query_stat(0);
    int sila_wymagana = (this_object()->query_prop(OBJ_I_WEIGHT))/200;
    
    if((this_object()->query_prop(OBJ_I_WEIGHT)) < 5000) return 0;
    
    if(sila < sila_wymagana)
        return "Masz zbyt malo sily, aby wladac " + short(PL_NAR) + ".\n";
    return 0;
}
*/