Merge branch 'death'

This commit is contained in:
Gergely Polonkai (W00d5t0ck) 2012-03-07 13:26:44 +01:00
commit d3f0781900
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

@ -371,8 +371,32 @@ void raw_kill(struct char_data *ch)
death_cry(ch); death_cry(ch);
if (IS_NPC(ch))
{
make_corpse(ch); make_corpse(ch);
extract_char(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);
*/
}
}
} }
@ -820,15 +844,24 @@ int damage(struct char_data *ch, struct char_data *victim, int dam, int attackty
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 (
(ch != victim)
&& (
IS_NPC(victim)
|| victim->desc
)
)
{
if (AFF_FLAGGED(ch, AFF_GROUP)) if (AFF_FLAGGED(ch, AFF_GROUP))
group_gain(ch, victim); group_gain(ch, victim);
else else
solo_gain(ch, victim); 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); 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)) if (MOB_FLAGGED(ch, MOB_MEMORY))
forget(ch, victim); forget(ch, victim);
@ -845,10 +878,10 @@ int damage(struct char_data *ch, struct char_data *victim, int dam, int attackty
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