[May 17 2007] - Rumble

Added AFF_FLYING/SCUBA and appropriate checks in act.movement.c. Room sector ty
  pes IN FLIGHT and UNDERWATER are finally being used!
  Removed all of the Dragon_Breathes.
  Removed context help system.
  Added invis level on reconnect.
[May 15 2007] - Rumble
  Fixed object stacking to match s-desc and item_number.
  Added wizupdate command.
  Added valid_dg_target check to object remove trigs.
This commit is contained in:
Rumble
2007-05-17 20:51:06 +00:00
parent 2f24e37bb8
commit 8315bc5da8
29 changed files with 191 additions and 1330 deletions

View File

@@ -52,7 +52,7 @@ int has_boat(struct char_data *ch)
if (GET_LEVEL(ch) > LVL_IMMORT)
return (1);
if (AFF_FLAGGED(ch, AFF_WATERWALK))
if (AFF_FLAGGED(ch, AFF_WATERWALK) || AFF_FLAGGED(ch, AFF_FLYING))
return (1);
/* non-wearable boats in inventory will do it */
@@ -68,6 +68,56 @@ int has_boat(struct char_data *ch)
return (0);
}
/* Simple function to determine if char can fly. */
int has_flight(struct char_data *ch)
{
struct obj_data *obj;
int i;
if (GET_LEVEL(ch) > LVL_IMMORT)
return (1);
if (AFF_FLAGGED(ch, AFF_FLYING))
return (1);
/* Non-wearable flying items in inventory will do it. */
for (obj = ch->carrying; obj; obj = obj->next_content)
if (OBJAFF_FLAGGED(obj, AFF_FLYING) && OBJAFF_FLAGGED(obj, AFF_FLYING))
return (1);
/* Any equipped objects with AFF_FLYING will do it too. */
for (i = 0; i < NUM_WEARS; i++)
if (GET_EQ(ch, i) && OBJAFF_FLAGGED(obj, AFF_FLYING))
return (1);
return (0);
}
/* Simple function to determine if char can scuba. */
int has_scuba(struct char_data *ch)
{
struct obj_data *obj;
int i;
if (GET_LEVEL(ch) > LVL_IMMORT)
return (1);
if (AFF_FLAGGED(ch, AFF_SCUBA))
return (1);
/* Non-wearable scuba items in inventory will do it. */
for (obj = ch->carrying; obj; obj = obj->next_content)
if (OBJAFF_FLAGGED(obj, AFF_SCUBA) && (find_eq_pos(ch, obj, NULL) < 0))
return (1);
/* Any equipped objects with AFF_SCUBA will do it too. */
for (i = 0; i < NUM_WEARS; i++)
if (GET_EQ(ch, i) && OBJAFF_FLAGGED(obj, AFF_SCUBA))
return (1);
return (0);
}
/* do_simple_move assumes that there is no master, no followers and that the
* direction exists. It returns 1 for success, 0 if failure. */
int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
@@ -104,6 +154,22 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
}
}
/* If this room or the one we're going to needs flight, check for it. */
if ((SECT(IN_ROOM(ch)) == SECT_FLYING) || (SECT(EXIT(ch, dir)->to_room) == SECT_FLYING)) {
if (!has_flight(ch)) {
send_to_char(ch, "You need to be flying to go there!\r\n");
return (0);
}
}
/* If this room or the one we're going to needs scuba, check for it. */
if ((SECT(IN_ROOM(ch)) == SECT_UNDERWATER) || (SECT(EXIT(ch, dir)->to_room) == SECT_UNDERWATER)) {
if (!has_scuba(ch)) {
send_to_char(ch, "You need to be able to breathe water to go there!\r\n");
return (0);
}
}
/* move points needed is avg. move loss for src and destination sect type */
need_movement = (movement_loss[SECT(IN_ROOM(ch))] +
movement_loss[SECT(EXIT(ch, dir)->to_room)]) / 2;