Exemple #1
0
int take_damage(object tp) {
    if (present(tp)) {
	tell_object(tp, "You feel weaker from the lack of oxygen.");
	tp->add_hp(-10);
	tp->add_sp(-5);
        remove_call_out("take_damage");
	call_out("take_damage", 120, tp);
	return 1;
    }
}
Exemple #2
0
int harm_player(object ob, int hp) {
  if(!ob) return 0;
  ob->add_hp(-hp);
  ob->show_status_line();
  if(ob->query_hp()<1) {
    ob->set_hp(ob->query_max_hp());
    player_death(ob);
    return 0;
  }
  return 1;
}
Exemple #3
0
int take_damage(object tp) {
    if (present(tp)) {
	tell_object(tp, "%^BOLD%^%^BLACK%^A %^YELLOW%^rogue %^RESET%^%^MAGENTA%^li%^BOLD%^%^WHITE%^gh%^YELLOW%^tn%^BLACK%^in%^RESET%^%^RED%^g b%^BOLD%^%^RED%^ol%^BLACK%^t strikes from under the %^WHITE%^clouds%^BLACK%^, hitting your body so %^RED%^hard %^BLACK%^you begin to sm%^WHITE%^o%^BLACK%^ke.%^RESET%^");
	tp->add_hp(-200+random(50));
	tp->add_sp(-50+random(50));
	tp->add_mp(-50+random(50));
	remove_call_out("take_damage");
	call_out("take_damage", 120, tp);
	return 1;
    }
}
Exemple #4
0
int soulwell( object vic, object att )
{
    command( "say To me fiends! I crave your sustenence!" );
    
    ansi_tell_room( ENV( att ), "A black mist comprised of "
      "lost souls begins to rise from the ground. Rifrad breathes "
      "deeply.", HIK );
    
    att->add_hp( 30 + random( 30 ) );
    
    return 1;
}
Exemple #5
0
void tick() {
   if (!vict->query_is_living())
      destruct(this_object());
   switch (type) {
      case "mana":      vict->add_mana(speed); break;
      case "endurance": vict->add_endurance(speed); break;
      default:          vict->add_hp(speed);
   }
   msg_object(vict,"You feel energy returning to your body.");
   size -= speed;
   if (speed >= size)
      speed = size;
   if (size <= 0)
      destruct(this_object());
   call_out("tick",5);
}
Exemple #6
0
void on_action( object victim ) {
   mixed result;
   mapping wc;
   int damage;
   string buf = "";

   if( !BATTLE_DAEMON->check_legal_melee(victim, "throatbite") )
      return;

   if (this_player()->query_endurance() >= 2)
      this_player()->add_endurance(-2);
   else {
      msg("~CWRNYou are too tired to fight any more!~CDEF");
      this_player()->add_readiness(-1000);
      return;
   }

   wc = copy(this_player()->query_wc());
   if (!mappingp(wc))
     wc = (["piercing":7]);
   wc["piercing"] += wc["edged"] +
                     this_player()->query_str_wc() +
                     this_player()->query_attitude("attack");
   wc -= (["edged"]);

   result = BATTLE_DAEMON->execute_melee(this_player(), wc, victim, 2, 0);
   damage = result[RESULT_MOD];

   switch (result[RESULT_TYPE]) {
     case "miss":
       buf = "~[130~Name ~verbsnap ~poss teeth centimeters from ~npot neck!";
       break;
/*
     case "block":
     case "parry":
     case "dodge":
       if (damage)
         buf = "~[130~Targ almost ~vert"+result[RESULT_TYPE]+" ~npos punch, but not quite.";
       else
         buf = "~[130~Targ ~vert"+result[RESULT_TYPE]+" ~npos punch!";
       break;

     case "hit":
     case "counter":
*/
     default:
       if (damage > 10 && random(100) < 30-(victim->query_constitution())) {
         buf = "~[090~Name ~verbtear ~npot throat wide open with a ferocious bite!";
         victim->add_hp(-(victim->query_hp()));
         break;
       }
       if (damage >= 15)
         buf = "~[090~Name ~verbsink ~poss teeth into ~post neck!";
       else if (damage > 0)
         buf = "~[090~Name ~verbbite ~targ viciously on the shoulder!";
       else
         buf = "~[090~Name barely ~verbmanage to bite ~targ.";
       break;
   }
   if (result[RESULT_MSG])
     buf += "~[060 "+result[RESULT_MSG];

   this_player()->add_readiness(-1700);
   this_player()->msg_local(buf+"~CDEF");
}