Random Question about transformtions

Posted by Lex_Luther on Fri 09 Apr 2004 12:05 AM — 4 posts, 15,112 views.

Canada #0
How would i link the trans like you have to have ssj1 to do ssj2 and use the same command for that. If someone could do a demo for me it would help so much thanks.
USA #1
Its not too hard, just make it one (big) function, with a few ifchecks for the argument, so it can check what your typing.
USA #2
Ok, something like this? Note: not a command, just a bunch of checks..

if ( ch->form == NORMAL )
   transform_player( ch, SSJ1 );
else if ( ch->form == SSJ1 )
   transform_player( ch, SSJ2 );

return;

Then...

void transform_player( CHAR_DATA *ch, int form )
{
  ch->form = form;

  // double max pl
  if ( ch->form == SSJ1 )
  {
    send_to_char( "Your hair turns blonde and the air crackles with energy about you!\n\r", ch );
    ch->maxpl *= 2;
    return;
  }

  // 4 max times pl
  if ( ch->form == SSJ2 )
  {
    send_to_char( "Your hair grows and your muscles being to buldge with strength!\n\r", ch );
    ch->maxpl *= 2;
    return;
  }

  // 8 times max pl
  if ( ch->form == SSJ3 )
  {
    send_to_char( "Your hair is now obscenely long and you feel as strong as a god!\n\r", ch );
    ch->maxpl *= 2;
    return;
  }

  return;
}

Uh, something like that perhaps. Of course there are several things wrong with that, such as it increases max pl and not the persons actual pl at the moment. Also, you would have to add code (transform_player_down?) to downsize their pl again. Or perhaps store it in a variable withing the char_data struct.
USA #3
Also, I forgot, you would need something such as this in mud.h:

typedef enum { NORMAL, SSJ1, SSJ2, SSJ3 } forms;

So yeah. Let me know if you need me to flesh my idea out a bit more.