Added support for the Passage

Added support for the Passage (currently with only one room).
Characters will automatically get here when dead, and they will
need to find a way to reborn to the Planes (currently there is
no such way, but to logout and login again) (see newly created
TODO file).

Signed-off-by: Gergely Polonkai (W00d5t0ck) <polesz@w00d5t0ck.info>
This commit is contained in:
Gergely Polonkai (W00d5t0ck) 2012-03-06 17:55:06 +01:00
parent 4af543bcd0
commit 2ad84db2ff
3 changed files with 72 additions and 31 deletions

3
TODO Normal file
View File

@ -0,0 +1,3 @@
* Make the Passage work as intended:
o characters should get back here upon logoff/logon
o there must be a way to get out from there

View File

@ -363,16 +363,40 @@ void death_cry(struct char_data *ch)
void raw_kill(struct char_data *ch) void raw_kill(struct char_data *ch)
{ {
if (FIGHTING(ch)) if (FIGHTING(ch))
stop_fighting(ch); stop_fighting(ch);
while (ch->affected) while (ch->affected)
affect_remove(ch, ch->affected); affect_remove(ch, ch->affected);
death_cry(ch); death_cry(ch);
make_corpse(ch); if (IS_NPC(ch))
extract_char(ch); {
make_corpse(ch);
extract_char(ch);
}
else
{
send_to_char(ch, "You feel yourself being pulled into a bright light...\r\n");
char_from_room(ch);
char_to_room(ch, real_room(rand_number(PASSAGE_MIN, PASSAGE_MAX)));
GET_HIT(ch) = GET_MAX_HIT(ch);
GET_MANA(ch) = GET_MAX_MANA(ch);
GET_MOVE(ch) = GET_MAX_MOVE(ch);
update_pos(ch);
look_at_room(ch, 0);
if (!PLR_FLAGGED(ch, PLR_DEAD))
{
/* TODO: Do something here, like temporarily remove the player's gold...
GET_TEMP_GOLD(ch) = GET_GOLD(ch);
GET_GOLD(ch) = 0;
*/
/* TODO: Set the DEAD flag on the player. Later it has to be removed somehow!
SET_BIT(PLR_FLAGS(ch), PLR_DEAD);
*/
}
}
} }
@ -819,36 +843,45 @@ int damage(struct char_data *ch, struct char_data *victim, int dam, int attackty
if (GET_POS(victim) <= POS_STUNNED && FIGHTING(victim) != NULL) if (GET_POS(victim) <= POS_STUNNED && FIGHTING(victim) != NULL)
stop_fighting(victim); stop_fighting(victim);
/* Uh oh. Victim died. */ /* Uh oh. Victim died. */
if (GET_POS(victim) == POS_DEAD) { if (GET_POS(victim) == POS_DEAD)
if (ch != victim && (IS_NPC(victim) || victim->desc)) { {
if (AFF_FLAGGED(ch, AFF_GROUP)) if (
group_gain(ch, victim); (ch != victim)
else && (
solo_gain(ch, victim); IS_NPC(victim)
} || victim->desc
)
)
{
if (AFF_FLAGGED(ch, AFF_GROUP))
group_gain(ch, victim);
else
solo_gain(ch, victim);
}
if (!IS_NPC(victim)) { if (!IS_NPC(victim))
mudlog(BRF, LVL_IMMORT, TRUE, "%s killed by %s at %s", GET_NAME(victim), GET_NAME(ch), world[IN_ROOM(victim)].name); {
if (MOB_FLAGGED(ch, MOB_MEMORY)) mudlog(BRF, LVL_IMMORT, TRUE, "%s killed by %s at %s", GET_NAME(victim), GET_NAME(ch), world[IN_ROOM(victim)].name);
forget(ch, victim); if (MOB_FLAGGED(ch, MOB_MEMORY))
} forget(ch, victim);
die(victim); }
die(victim);
/* If AUTOLOOT is enabled, loot everything from corpse */ /* If AUTOLOOT is enabled, loot everything from corpse */
if (IS_NPC(victim) && !IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOLOOT)) if (IS_NPC(victim) && !IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOLOOT))
do_get(ch, "all corpse", 0, 0); do_get(ch, "all corpse", 0, 0);
/* IF AUTODRAIN is enabled, drain corpse */ /* IF AUTODRAIN is enabled, drain corpse */
if (IS_NPC(victim) && !IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTODRAIN)) if (IS_NPC(victim) && !IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTODRAIN))
do_drain(ch, "corpse", 0, 0); do_drain(ch, "corpse", 0, 0);
return (-1); return (-1);
} }
return (dam);
return (dam);
} }
/* /*
* Calculate the THAC0 of the attacker. * Calculate the THAC0 of the attacker.
* *

View File

@ -174,6 +174,7 @@
#define PLR_INVSTART (1 << 14) /* Player should enter game wizinvis */ #define PLR_INVSTART (1 << 14) /* Player should enter game wizinvis */
#define PLR_CRYO (1 << 15) /* Player is cryo-saved (purge prog) */ #define PLR_CRYO (1 << 15) /* Player is cryo-saved (purge prog) */
#define PLR_NOTDEADYET (1 << 16) /* (R) Player being extracted. */ #define PLR_NOTDEADYET (1 << 16) /* (R) Player being extracted. */
#define PLR_DEAD (1 << 17) /* Player is dead */
/* Mobile flags: used by char_data.char_specials.act */ /* Mobile flags: used by char_data.char_specials.act */
@ -468,6 +469,10 @@
#define LVL_GOD 32 #define LVL_GOD 32
#define LVL_IMMORT 31 #define LVL_IMMORT 31
/* Room numbers for the Passage ******************************************/
#define PASSAGE_MIN 101
#define PASSAGE_MAX 101
/* Level of the 'freeze' command */ /* Level of the 'freeze' command */
#define LVL_FREEZE LVL_GRGOD #define LVL_FREEZE LVL_GRGOD