Rest of the code starting where the previous code left off..
else
{
SPACE_DATA * starsystem;
starsystem = ship->currjump;
if ( starsystem->star1 && strcmp(starsystem->star1,"") &&
abs(ship->jx - starsystem->s1x) < 300 &&
abs(ship->jy - starsystem->s1y) < 300 &&
abs(ship->jz - starsystem->s1z) < 300 )
{
echo_to_cockpit( AT_RED, ship, "WARNING.. Jump coordinates too close to stellar object.");
echo_to_cockpit( AT_RED, ship, "WARNING.. Hyperjump NOT set.");
ship->currjump = NULL;
return;
}
else if ( starsystem->star2 && strcmp(starsystem->star2,"") &&
abs(ship->jx - starsystem->s2x) < 300 &&
abs(ship->jy - starsystem->s2y) < 300 &&
abs(ship->jz - starsystem->s2z) < 300 )
{
echo_to_cockpit( AT_RED, ship, "WARNING.. Jump coordinates too close to stellar object.");
echo_to_cockpit( AT_RED, ship, "WARNING.. Hyperjump NOT set.");
ship->currjump = NULL;
return;
}
else if ( starsystem->planet1 && strcmp(starsystem->planet1,"") &&
abs(ship->jx - starsystem->p1x) < 300 &&
abs(ship->jy - starsystem->p1y) < 300 &&
abs(ship->jz - starsystem->p1z) < 300 )
{
echo_to_cockpit( AT_RED, ship, "WARNING.. Jump coordinates too close to stellar object.");
echo_to_cockpit( AT_RED, ship, "WARNING.. Hyperjump NOT set.");
ship->currjump = NULL;
return;
}
else if ( starsystem->planet2 && strcmp(starsystem->planet2,"") &&
abs(ship->jx - starsystem->p2x) < 300 &&
abs(ship->jy - starsystem->p2y) < 300 &&
abs(ship->jz - starsystem->p2z) < 300 )
{
echo_to_cockpit( AT_RED, ship, "WARNING.. Jump coordinates too close to stellar object.");
echo_to_cockpit( AT_RED, ship, "WARNING.. Hyperjump NOT set.");
ship->currjump = NULL;
return;
}
else if ( starsystem->planet3 && strcmp(starsystem->planet3,"") &&
abs(ship->jx - starsystem->p3x) < 300 &&
abs(ship->jy - starsystem->p3y) < 300 &&
abs(ship->jz - starsystem->p3z) < 300 )
{
echo_to_cockpit( AT_RED, ship, "WARNING.. Jump coordinates too close to stellar object.");
echo_to_cockpit( AT_RED, ship, "WARNING.. Hyperjump NOT set.");
ship->currjump = NULL;
return;
}
else
{
ship->jx += number_range ( -250 , 250 );
ship->jy += number_range ( -250 , 250 );
ship->jz += number_range ( -250 , 250 );
}
}
ship->hyperdistance = abs(ship->starsystem->xpos - ship->currjump->xpos) ;
ship->hyperdistance += abs(ship->starsystem->ypos - ship->currjump->ypos) ;
ship->hyperdistance /= 5;
if (ship->hyperdistance<100)
ship->hyperdistance = 100;
ship->hyperdistance += number_range(0, 200);
sound_to_room( ch->in_room , "!!SOUND(computer)" );
send_to_char( "&GHyperspace course set. Ready for the jump to hyperspace.\n\r", ch);
act( AT_PLAIN, "$n does some calculations using the ships computer.", ch,
NULL, argument , TO_ROOM );
learn_from_success( ch, gsn_navigation );
WAIT_STATE( ch , 2*PULSE_VIOLENCE );
}
|