minor_hit_sh.c

final_realms_fluffos_v1/lib/std/poisons/shadows/minor_hit_sh.c · 1.4 KB

From the archive final_realms_fluffos_v1.zip

Download the archive   « Back to the archive contents

/*** Poisoned weapon shadow ***/
/*** Minor hit poison.  Does an extra 1-10 ***/
/*** By Wonderflug ***/

#define STRENGTH 10

object my_weapon;

void destruct_shadow() 
{
  destruct(this_object());
}

void setup_shadow(object ob) 
{
  shadow(ob,1);
  my_weapon = ob;
}

int test_add_poison() { return 0; }

void do_poison_effect( object target, object me ) 
{
  int damage;

  damage = random(STRENGTH)+1;
  damage = damage*( (100 - (int)target->query_property("poison")) / 100 );

  target->adjust_hp(-damage, me);
}


int weapon_attack( object him, object me )
{
  int ret;

  ret = my_weapon->weapon_attack(him, me);
  if ( ret > 0 )
  {
    tell_object(me, him->query_cap_name()+" winces in pain from the poison "
    "on your weapon.\n");
    tell_object(him, "You notice some poison on the weapon and the wound "
    "seems to flare\nup and burn intensely for a moment.\n");
    tell_room(environment(me), him->query_cap_name()+" winces in pain as "+
    him->query_pronoun()+" gets hit.\n", ({ him, me}) );

    do_poison_effect( him, me );

    if ( (string)me->query_guild_name() != "assassin" )
    {
    tell_object(me,"The poison seems to have ruined your weapon.\n");
    this_object()->dest_me();
    }
    else call_out("destruct_shadow",0,0);
    return ret;
  }
  return ret;
}

string short()
{
   return "Poisoned "+(string)my_weapon->short();
}

string long()
{
   return (string)my_weapon->long()+"\nPoison glistens along the blade.\n";
}

Site Stats

Snippets: 1791
Codebases: 571