werewolftest.c

final_realms_fluffos_v1/lib/baseobs/races/werewolftest.c · 3.6 KB

From the archive final_realms_fluffos_v1.zip

Download the archive   « Back to the archive contents

inherit "/std/races/standard";
#include "light_defs.inc"
#define CONT_CHANCE 250
#define WOLF_SHADOW "/std/races/shadows/malik_sh.c"
#define WEATHERHAND "/obj/handlers/weather"
#define OLDRACE "old_race"
void change_race(object player);

void setup() {
  set_long("The demonical werewolf was once a normal being, now possessed "
           "by a fearful spirit..\n");
   set_name("werewolf");
  set_light_limits(LIGHT_DROW_LOW, LIGHT_DROW_HIGH);
}

//Needed for healing by the werewolf shadow
int query_enchant() { return 1; }

void set_racial_bonuses()
{
   previous_object()->adjust_bonus_str(10);
   previous_object()->adjust_bonus_dex(30);
   previous_object()->adjust_bonus_int(-5);
   previous_object()->adjust_bonus_wis(-5);
previous_object()->adjust_bonus_cha(-(previous_object()->query_cha()-3));
}

string query_desc(object ob) {
  return "A fierce looking wolf with red glowing eyes.\n";
}

void race_heartbeat(object player)
{
object *obs; 
string moon_str;
int i;

  if(!player||!ENV(player)||player->query_dead()) return;
  obs = all_inventory(ENV(player));
  obs -= ({ player });
  tell_room(ENV(player),player->query_cap_name()+" snarls viciously "
    "and attacks everything in sight.\n");
  for(i=0;i<sizeof(obs);i++)
  {
    if(!obs[i]->query_alive()) continue;
    if(obs[i]->query_property("wolfbane"))
    {
      tell_object(player,"A terrible smell assault your wolf senses "
          "driving you away.\n");
      player->run_away();
    return;
    }
    if(!interactive(player) && !random(CONT_CHANCE))
     {
      tell_object(obs[i],player->query_cap_name()+"'s teeth sinks deep "
       "into your thigh.\n");
      obs[i]->add_property("WEREWOLF",1);
     }
   player->attack_ob(obs[i]);
  }
  player->adjust_hp(100);
  if(WEATHERHAND->query_day(ENV(player)))
    change_race(player);
}

void start_player(object player)
{
object claws, shadow;
int i;

player->add_static_property("nocast",1);
player->add_static_property("noguild",1);
player->add_static_property("magical",70);
"/std/spells/wizard/useful_stuff"->force_drop_everything(player);
/*
for(i=0;i<2;i++)
   {
   claws = clone_object(CLAWS);
   claws->move(player);
   player->hold_ob(claws);
   claws->add_property("cursed",1);
   }
*/
 shadow = clone_object(WOLF_SHADOW);
 shadow->setup_shadow(player);
player->set_language("werewolf");

::start_player(player);
}



void change_race(object player)
{
 object *claws;
 int i;

 player->remove_werewolf_shadow();
 player->remove_static_property("nocast");
 player->remove_static_property("noguild");
 player->remove_static_property("magical");

 claws = find_match("claws",player);
 for(i=0;i<sizeof(claws);i++)
  {
    claws[i]->remove_property("cursed");
    claws[i]->dest_me();
  }
 player->set_race_ob("/std/races/"+player->query_property(OLDRACE));
}

void player_quit(object player)
{
 change_race(player);
}


mapping valid_attack() {
   return([
      "kick"     :({"$att_name$ rends $def_name$ horribly.\n",
                   "You rend $def_name$ horribly.\n",
                   "$att_name$ rends you horribly.\n"}), 
      "knee"     :({"$att_name$ rakes $def_name$ with its claws.\n",
                       "You rake $def_name$ with your claws.\n",
                   "$att_name$ rakes you with its claws.\n"}),
      "punch"    :({"$att_name$ tears $def_name$ with its claw.\n",
                   "You tear $def_name$ with your claws.\n",
                   "$def_name$ tears you with its fist.\n"}),
      "headbutt" :({"$att_name$ savages $def_name$ with its jaws.\n",
                   "You savage $def_name$ with your jaws.\n",
                   "$att_name$ savages you with its jaws.\n"})  ]);
}  /*  valid_attack()  */

Site Stats

Snippets: 1791
Codebases: 571