Anyone finished throw?

Posted by Zeno on Sat 28 Aug 2004 02:56 AM — 2 posts, 11,785 views.

USA #0

/* -- working on --
 * Syntaxes: throw object  (assumed already fighting)
 *           throw object direction target  (all needed args for distance
 *                throwing)
 *           throw object  (assumed same room throw)

void do_throw( CHAR_DATA *ch, char *argument )
{
  ROOM_INDEX_DATA *was_in_room;
  CHAR_DATA *victim;
  OBJ_DATA *throw_obj;
  EXIT_DATA *pexit;
  sh_int dir;
  sh_int dist;
  sh_int max_dist = 3;
  char arg[MAX_INPUT_LENGTH];
  char arg1[MAX_INPUT_LENGTH];
  char arg2[MAX_INPUT_LENGTH];

  argument = one_argument( argument, arg );
  argument = one_argument( argument, arg1 );
  argument = one_argument( argument, arg2 );

  for ( throw_obj = ch->last_carrying; throw_obj;
        throw_obj = throw_obj=>prev_content )
  {
---    if ( can_see_obj( ch, throw_obj )
        && ( throw_obj->wear_loc == WEAR_HELD || throw_obj->wear_loc ==
        WEAR_WIELDED || throw_obj->wear_loc == WEAR_DUAL_WIELDED )
        && nifty_is_name( arg, throw_obj->name ) )
      break;
 ----
    if ( can_see_obj( ch, throw_obj ) && nifty_is_name( arg, throw_obj->name )
      break;
  }


  if ( !throw_obj )
  {
    send_to_char( "You aren't holding or wielding anything like that.\n\r", ch );
    return;
  }

----
  if ( ( throw_obj->item_type != ITEM_WEAPON)
  {
    send_to_char("You can only throw weapons.\n\r", ch );
    return;
  }
----

  if (get_obj_weight( throw_obj ) - ( 3 * (get_curr_str(ch) - 15) ) > 0)
  {
    send_to_char("That is too heavy for you to throw.\n\r", ch);
    if (!number_range(0,10))
      learn_from_failure( ch, gsn_throw );
    return;
  }

  if ( ch->fighting )
    victim = ch->fighting;
   else
    {
      if ( ( ( victim = get_char_room( ch, arg1 ) ) == NULL )
        && ( arg2[0] == '\0' ) )
      {
        act( AT_GREY, "Throw $t at whom?", ch, obj->short_descr, NULL,
          TO_CHAR );
        return;
      }
    }
}*/


Was wondering if anyone finished this function. Its better than starting my own. Time wise, at least.
#1
Ahh...I have a finished version but you wouldnt be able to use it, because it's custom coded for my muds targeting system. That wouldnt be hard at all to finish thou if you really dont want to just port swrs.


Spike