Alignment update 1

This commit is contained in:
kinther 2025-12-30 10:11:20 -08:00
parent b186c7e87c
commit 59a38beb3d
26 changed files with 252 additions and 466 deletions

View file

@ -574,13 +574,6 @@ static void list_one_char(struct char_data *i, struct char_data *ch)
if (AFF_FLAGGED(i, AFF_INVISIBLE))
send_to_char(ch, "*");
if (AFF_FLAGGED(ch, AFF_DETECT_ALIGN)) {
if (IS_EVIL(i))
send_to_char(ch, "(Red Aura) ");
else if (IS_GOOD(i))
send_to_char(ch, "(Blue Aura) ");
}
send_to_char(ch, "%s", i->player.long_descr);
if (AFF_FLAGGED(i, AFF_SANCTUARY))
@ -596,13 +589,6 @@ static void list_one_char(struct char_data *i, struct char_data *ch)
if (AFF_FLAGGED(i, AFF_INVISIBLE))
send_to_char(ch, "*");
if (AFF_FLAGGED(ch, AFF_DETECT_ALIGN)) {
if (IS_EVIL(i))
send_to_char(ch, "(Red Aura) ");
else if (IS_GOOD(i))
send_to_char(ch, "(Blue Aura) ");
}
send_to_char(ch, "%s", i->player.long_descr);
if (AFF_FLAGGED(i, AFF_SANCTUARY))
@ -661,13 +647,6 @@ static void list_one_char(struct char_data *i, struct char_data *ch)
send_to_char(ch, " is here struggling with thin air.");
}
if (AFF_FLAGGED(ch, AFF_DETECT_ALIGN)) {
if (IS_EVIL(i))
send_to_char(ch, " (Red Aura)");
else if (IS_GOOD(i))
send_to_char(ch, " (Blue Aura)");
}
send_to_char(ch, "\r\n");
if (AFF_FLAGGED(i, AFF_SANCTUARY))

View file

@ -3564,9 +3564,8 @@ ACMD(do_show)
send_to_char(ch, "Player: %-12s (%s) [%2d %s]\r\n", GET_NAME(vict),
genders[(int) GET_SEX(vict)], GET_LEVEL(vict), CLASS_ABBR(vict));
send_to_char(ch, "Coins: %-8d Bal: %-8d Exp: %-8d Align: %-5d\r\n",
GET_COINS(vict), GET_BANK_COINS(vict), GET_EXP(vict),
GET_ALIGNMENT(vict));
send_to_char(ch, "Coins: %-8d Bal: %-8d Exp: %-8d\r\n",
GET_COINS(vict), GET_BANK_COINS(vict), GET_EXP(vict));
send_to_char(ch, "Started: %-25.25s Last: %-25.25s\r\n", buf1, buf2);
send_to_char(ch, "Played: %dh %dm\r\n",
(int) (vict->player.time.played / 3600),
@ -3761,9 +3760,8 @@ static struct set_struct {
{ "ac", LVL_BUILDER, BOTH, NUMBER }, /* 0 */
{ "afk", LVL_BUILDER, PC, BINARY }, /* 1 */
{ "age", LVL_GOD, BOTH, NUMBER },
{ "align", LVL_BUILDER, BOTH, NUMBER },
{ "bank", LVL_BUILDER, PC, NUMBER },
{ "brief", LVL_GOD, PC, BINARY }, /* 5 */
{ "brief", LVL_GOD, PC, BINARY }, /* 4 */
{ "cha", LVL_BUILDER, BOTH, NUMBER },
{ "class", LVL_BUILDER, BOTH, MISC },
{ "color", LVL_GOD, PC, BINARY },
@ -3772,20 +3770,20 @@ static struct set_struct {
{ "dex", LVL_BUILDER, BOTH, NUMBER },
{ "drunk", LVL_BUILDER, BOTH, MISC },
{ "exp", LVL_GOD, BOTH, NUMBER },
{ "frozen", LVL_GRGOD, PC, BINARY }, /* 14 */
{ "frozen", LVL_GRGOD, PC, BINARY }, /* 13 */
{ "coins", LVL_BUILDER, BOTH, NUMBER },
{ "height", LVL_BUILDER, BOTH, NUMBER },
{ "hitpoints", LVL_BUILDER, BOTH, NUMBER },
{ "hunger", LVL_BUILDER, BOTH, MISC }, /* 18 */
{ "hunger", LVL_BUILDER, BOTH, MISC }, /* 17 */
{ "int", LVL_BUILDER, BOTH, NUMBER },
{ "invis", LVL_GOD, PC, NUMBER },
{ "invstart", LVL_BUILDER, PC, BINARY },
{ "level", LVL_GRGOD, BOTH, NUMBER }, /* 22 */
{ "level", LVL_GRGOD, BOTH, NUMBER }, /* 21 */
{ "loadroom", LVL_BUILDER, PC, MISC },
{ "mana", LVL_BUILDER, BOTH, NUMBER },
{ "maxhit", LVL_BUILDER, BOTH, NUMBER },
{ "maxmana", LVL_BUILDER, BOTH, NUMBER },
{ "maxstam", LVL_BUILDER, BOTH, NUMBER }, /* 27 */
{ "maxstam", LVL_BUILDER, BOTH, NUMBER }, /* 26 */
{ "name", LVL_IMMORT, PC, MISC },
{ "nodelete", LVL_GOD, PC, BINARY },
{ "nohassle", LVL_GOD, PC, BINARY },
@ -3797,18 +3795,18 @@ static struct set_struct {
{ "poofout", LVL_IMMORT, PC, MISC },
{ "quest", LVL_GOD, PC, BINARY },
{ "room", LVL_BUILDER, BOTH, NUMBER },
{ "screenwidth", LVL_GOD, PC, NUMBER }, /* 39 */
{ "screenwidth", LVL_GOD, PC, NUMBER }, /* 38 */
{ "sex", LVL_GOD, BOTH, MISC },
{ "showvnums", LVL_BUILDER, PC, BINARY },
{ "siteok", LVL_GOD, PC, BINARY },
{ "skill", LVL_GOD, BOTH, NUMBER },
{ "stam", LVL_BUILDER, BOTH, NUMBER }, /* 44 */
{ "stam", LVL_BUILDER, BOTH, NUMBER }, /* 43 */
{ "str", LVL_BUILDER, BOTH, NUMBER },
{ "thirst", LVL_BUILDER, BOTH, MISC },
{ "variable", LVL_GRGOD, PC, MISC },
{ "weight", LVL_BUILDER, BOTH, NUMBER },
{ "wis", LVL_BUILDER, BOTH, NUMBER },
{ "questpoints", LVL_GOD, PC, NUMBER }, /* 50 */
{ "questpoints", LVL_GOD, PC, NUMBER }, /* 49 */
{ "questhistory", LVL_GOD, PC, NUMBER },
{ "species", LVL_BUILDER, BOTH, MISC },
{ "\n", 0, BOTH, MISC }
@ -3870,17 +3868,13 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
GET_ROLEPLAY_AGE(vict) = LIMIT(value, MIN_CHAR_AGE, MAX_CHAR_AGE);
GET_ROLEPLAY_AGE_YEAR(vict) = time_info.year;
break;
case 3: /* align */
GET_ALIGNMENT(vict) = RANGE(-1000, 1000);
affect_total(vict);
break;
case 4: /* bank */
case 3: /* bank */
GET_BANK_COINS(vict) = RANGE(0, 100000000);
break;
case 5: /* brief */
case 4: /* brief */
SET_OR_REMOVE(PRF_FLAGS(vict), PRF_BRIEF);
break;
case 6: /* cha */
case 5: /* cha */
if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
RANGE(3, 25);
else
@ -3888,18 +3882,18 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
vict->real_abils.cha = value;
affect_total(vict);
break;
case 7: /* class */
case 6: /* class */
if ((i = parse_class(*val_arg)) == CLASS_UNDEFINED) {
send_to_char(ch, "That is not a class.\r\n");
return (0);
}
GET_CLASS(vict) = i;
break;
case 8: /* color */
case 7: /* color */
SET_OR_REMOVE(PRF_FLAGS(vict), (PRF_COLOR_1));
SET_OR_REMOVE(PRF_FLAGS(vict), (PRF_COLOR_2));
break;
case 9: /* con */
case 8: /* con */
if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
RANGE(3, 25);
else
@ -3907,10 +3901,10 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
vict->real_abils.con = value;
affect_total(vict);
break;
case 10: /* delete */
case 9: /* delete */
SET_OR_REMOVE(PLR_FLAGS(vict), PLR_DELETED);
break;
case 11: /* dex */
case 10: /* dex */
if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
RANGE(3, 25);
else
@ -3918,7 +3912,7 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
vict->real_abils.dex = value;
affect_total(vict);
break;
case 12: /* drunk */
case 11: /* drunk */
if (!str_cmp(val_arg, "off")) {
GET_COND(vict, DRUNK) = -1;
send_to_char(ch, "%s's drunkenness is now off.\r\n", GET_NAME(vict));
@ -3932,17 +3926,17 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
return (0);
}
break;
case 13: /* exp */
case 12: /* exp */
vict->points.exp = RANGE(0, 50000000);
break;
case 14: /* frozen */
case 13: /* frozen */
if (ch == vict && on) {
send_to_char(ch, "Better not -- could be a long winter!\r\n");
return (0);
}
SET_OR_REMOVE(PLR_FLAGS(vict), PLR_FROZEN);
break;
case 15: { /* coins */
case 14: { /* coins */
struct obj_data *coin_obj;
int i;
@ -3978,15 +3972,15 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
send_to_char(ch, "Ok.\r\n");
return (1);
}
case 16: /* height */
case 15: /* height */
GET_HEIGHT(vict) = value;
affect_total(vict);
break;
case 17: /* hit */
case 16: /* hit */
vict->points.hit = RANGE(-9, vict->points.max_hit);
affect_total(vict);
break;
case 18: /* hunger */
case 17: /* hunger */
if (!str_cmp(val_arg, "off")) {
GET_COND(vict, HUNGER) = -1;
send_to_char(ch, "%s's hunger is now off.\r\n", GET_NAME(vict));
@ -4000,7 +3994,7 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
return (0);
}
break;
case 19: /* int */
case 18: /* int */
if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
RANGE(3, 25);
else
@ -4008,17 +4002,17 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
vict->real_abils.intel = value;
affect_total(vict);
break;
case 20: /* invis */
case 19: /* invis */
if (GET_LEVEL(ch) < LVL_IMPL && ch != vict) {
send_to_char(ch, "You aren't godly enough for that!\r\n");
return (0);
}
GET_INVIS_LEV(vict) = RANGE(0, GET_LEVEL(vict));
break;
case 21: /* invistart */
case 20: /* invistart */
SET_OR_REMOVE(PLR_FLAGS(vict), PLR_INVSTART);
break;
case 22: /* level */
case 21: /* level */
if ((!IS_NPC(vict) && value > GET_LEVEL(ch)) || value > LVL_IMPL) {
send_to_char(ch, "You can't do that.\r\n");
return (0);
@ -4026,7 +4020,7 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
RANGE(1, LVL_IMPL);
vict->player.level = value;
break;
case 23: /* loadroom */
case 22: /* loadroom */
if (!str_cmp(val_arg, "off")) {
REMOVE_BIT_AR(PLR_FLAGS(vict), PLR_LOADROOM);
} else if (is_number(val_arg)) {
@ -4044,23 +4038,23 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
return (0);
}
break;
case 24: /* mana */
case 23: /* mana */
vict->points.mana = RANGE(0, vict->points.max_mana);
affect_total(vict);
break;
case 25: /* maxhit */
case 24: /* maxhit */
vict->points.max_hit = RANGE(1, 5000);
affect_total(vict);
break;
case 26: /* maxmana */
case 25: /* maxmana */
vict->points.max_mana = RANGE(1, 5000);
affect_total(vict);
break;
case 27: /* maxstam */
case 26: /* maxstam */
vict->points.max_stamina = RANGE(1, 5000);
affect_total(vict);
break;
case 28: /* name */
case 27: /* name */
if (ch != vict && GET_LEVEL(ch) < LVL_IMPL) {
send_to_char(ch, "Only Imps can change the name of other players.\r\n");
return (0);
@ -4070,24 +4064,24 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
return (0);
}
break;
case 29: /* nodelete */
case 28: /* nodelete */
SET_OR_REMOVE(PLR_FLAGS(vict), PLR_NODELETE);
break;
case 30: /* nohassle */
case 29: /* nohassle */
if (GET_LEVEL(ch) < LVL_GOD && ch != vict) {
send_to_char(ch, "You aren't godly enough for that!\r\n");
return (0);
}
SET_OR_REMOVE(PRF_FLAGS(vict), PRF_NOHASSLE);
break;
case 31: /* nosummon */
case 30: /* nosummon */
SET_OR_REMOVE(PRF_FLAGS(vict), PRF_SUMMONABLE);
send_to_char(ch, "Nosummon %s for %s.\r\n", ONOFF(!on), GET_NAME(vict));
break;
case 32: /* nowiz */
case 31: /* nowiz */
SET_OR_REMOVE(PLR_FLAGS(vict), PLR_NOWIZLIST);
break;
case 33: /* olc */
case 32: /* olc */
if (is_abbrev(val_arg, "socials") || is_abbrev(val_arg, "actions") || is_abbrev(val_arg, "aedit"))
GET_OLC_ZONE(vict) = AEDIT_PERMISSION;
else if (is_abbrev(val_arg, "hedit") || is_abbrev(val_arg, "help"))
@ -4102,7 +4096,7 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
} else
GET_OLC_ZONE(vict) = atoi(val_arg);
break;
case 34: /* password */
case 33: /* password */
if (GET_LEVEL(vict) >= LVL_GRGOD) {
send_to_char(ch, "You cannot change that.\r\n");
return (0);
@ -4111,7 +4105,7 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
*(GET_PASSWD(vict) + MAX_PWD_LENGTH) = '\0';
send_to_char(ch, "Password changed to '%s'.\r\n", val_arg);
break;
case 35: /* poofin */
case 34: /* poofin */
if ((vict == ch) || (GET_LEVEL(ch) == LVL_IMPL)) {
skip_spaces(&val_arg);
parse_at(val_arg);
@ -4125,7 +4119,7 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
POOFIN(vict) = strdup(val_arg);
}
break;
case 36: /* poofout */
case 35: /* poofout */
if ((vict == ch) || (GET_LEVEL(ch) == LVL_IMPL)) {
skip_spaces(&val_arg);
parse_at(val_arg);
@ -4139,10 +4133,10 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
POOFOUT(vict) = strdup(val_arg);
}
break;
case 37: /* quest */
case 36: /* quest */
SET_OR_REMOVE(PRF_FLAGS(vict), PRF_QUEST);
break;
case 38: /* room */
case 37: /* room */
if ((rnum = real_room(value)) == NOWHERE) {
send_to_char(ch, "No room exists with that number.\r\n");
return (0);
@ -4151,23 +4145,23 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
char_from_room(vict);
char_to_room(vict, rnum);
break;
case 39: /* screenwidth */
case 38: /* screenwidth */
GET_SCREEN_WIDTH(vict) = RANGE(40, 200);
break;
case 40: /* sex */
case 39: /* sex */
if ((i = search_block(val_arg, genders, FALSE)) < 0) {
send_to_char(ch, "Must be 'male', 'female', or 'neutral'.\r\n");
return (0);
}
GET_SEX(vict) = i;
break;
case 41: /* showvnums */
case 40: /* showvnums */
SET_OR_REMOVE(PRF_FLAGS(vict), PRF_SHOWVNUMS);
break;
case 42: /* siteok */
case 41: /* siteok */
SET_OR_REMOVE(PLR_FLAGS(vict), PLR_SITEOK);
break;
case 43: /* skills/spells */
case 42: /* skills/spells */
{
char local_buf[MAX_INPUT_LENGTH], *value_arg, *name_end;
char skill_name[MAX_INPUT_LENGTH];
@ -4252,12 +4246,12 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
}
break;
case 44: /* stam */
case 43: /* stam */
vict->points.stamina = RANGE(0, vict->points.max_stamina);
affect_total(vict);
break;
case 45: /* str */
case 44: /* str */
if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
RANGE(3, 25);
else
@ -4265,7 +4259,7 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
vict->real_abils.str = value;
affect_total(vict);
break;
case 46: /* thirst */
case 45: /* thirst */
if (!str_cmp(val_arg, "off")) {
GET_COND(vict, THIRST) = -1;
send_to_char(ch, "%s's thirst is now off.\r\n", GET_NAME(vict));
@ -4279,13 +4273,13 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
return (0);
}
break;
case 47: /* variable */
case 46: /* variable */
return perform_set_dg_var(ch, vict, val_arg);
case 48: /* weight */
case 47: /* weight */
GET_WEIGHT(vict) = value;
affect_total(vict);
break;
case 49: /* wis */
case 48: /* wis */
if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
RANGE(3, 25);
else
@ -4293,10 +4287,10 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
vict->real_abils.wis = value;
affect_total(vict);
break;
case 50: /* questpoints */
case 49: /* questpoints */
GET_QUESTPOINTS(vict) = RANGE(0, 100000000);
break;
case 51: /* questhistory */
case 50: /* questhistory */
qvnum = atoi(val_arg);
if (real_quest(qvnum) == NOTHING) {
send_to_char(ch, "That quest doesn't exist.\r\n");
@ -4313,7 +4307,7 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
}
break;
}
case 52: /* species */
case 51: /* species */
if ((i = parse_species(val_arg)) == SPECIES_UNDEFINED) {
send_to_char(ch, "That is not a species.\r\n");
return (0);
@ -4718,10 +4712,6 @@ ACMD (do_zcheck)
"- No unarmed combat proficiency set (add skill or weapon)\r\n");
}
if (MOB_FLAGGED(mob, MOB_AGGRESSIVE) && (MOB_FLAGGED(mob, MOB_AGGR_GOOD) || MOB_FLAGGED(mob, MOB_AGGR_EVIL) || MOB_FLAGGED(mob, MOB_AGGR_NEUTRAL)) && (found=1))
len += snprintf(buf + len, sizeof(buf) - len,
"- Both aggresive and agressive to align.\r\n");
if (GET_EXP(mob)>MAX_EXP_ALLOWED && (found=1))
len += snprintf(buf + len, sizeof(buf) - len,
"- Has %d experience (limit: %d)\r\n",

View file

@ -228,9 +228,9 @@ const char *action_bits[] = {
"AGGR",
"STAY-ZONE",
"WIMPY",
"AGGR_EVIL",
"AGGR_GOOD",
"AGGR_NEUTRAL",
"RESERVED",
"RESERVED",
"RESERVED",
"MEMORY",
"HELPER",
"NO_CHARM",
@ -299,8 +299,8 @@ const char *affected_bits[] =
"CURSE",
"INFRA",
"POISON",
"PROT-EVIL",
"PROT-GOOD",
"RESERVED",
"RESERVED",
"SLEEP",
"NO_TRACK",
"FLY",
@ -485,9 +485,9 @@ const char *extra_bits[] = {
"MAGIC",
"NO_DROP",
"BLESS",
"ANTI_GOOD",
"ANTI_EVIL",
"ANTI_NEUTRAL",
"RESERVED",
"RESERVED",
"RESERVED",
"ANTI_SORCEROR",
"ANTI_CLERIC",
"ANTI_ROGUE",

View file

@ -1902,13 +1902,6 @@ void parse_mobile(FILE *mob_f, int nr)
REMOVE_BIT_AR(AFF_FLAGS(mob_proto + i), AFF_CHARM);
REMOVE_BIT_AR(AFF_FLAGS(mob_proto + i), AFF_POISON);
REMOVE_BIT_AR(AFF_FLAGS(mob_proto + i), AFF_SLEEP);
if (MOB_FLAGGED(mob_proto + i, MOB_AGGRESSIVE) && MOB_FLAGGED(mob_proto + i, MOB_AGGR_GOOD))
REMOVE_BIT_AR(MOB_FLAGS(mob_proto + i), MOB_AGGR_GOOD);
if (MOB_FLAGGED(mob_proto + i, MOB_AGGRESSIVE) && MOB_FLAGGED(mob_proto + i, MOB_AGGR_NEUTRAL))
REMOVE_BIT_AR(MOB_FLAGS(mob_proto + i), MOB_AGGR_NEUTRAL);
if (MOB_FLAGGED(mob_proto + i, MOB_AGGRESSIVE) && MOB_FLAGGED(mob_proto + i, MOB_AGGR_EVIL))
REMOVE_BIT_AR(MOB_FLAGS(mob_proto + i), MOB_AGGR_EVIL);
check_bitvector_names(AFF_FLAGS(mob_proto + i)[0], affected_bits_count, buf2, "mobile affect");
/* This is necessary, since if we have conventional world files, &letter is

View file

@ -57,7 +57,6 @@ static struct char_data *next_combat_list = NULL;
static void perform_group_gain(struct char_data *ch, int base, struct char_data *victim);
static void dam_message(int dam, struct char_data *ch, struct char_data *victim, int w_type);
static void make_corpse(struct char_data *ch);
static void change_alignment(struct char_data *ch, struct char_data *victim);
static void group_gain(struct char_data *ch, struct char_data *victim);
static void solo_gain(struct char_data *ch, struct char_data *victim);
/** @todo refactor this function name */
@ -281,14 +280,6 @@ static void make_corpse(struct char_data *ch)
obj_to_room(corpse, IN_ROOM(ch));
}
/* When ch kills victim */
static void change_alignment(struct char_data *ch, struct char_data *victim)
{
/* new alignment change algorithm: if you kill a monster with alignment A,
* you move 1/16th of the way to having alignment -A. Simple and fast. */
GET_ALIGNMENT(ch) += (-GET_ALIGNMENT(victim) - GET_ALIGNMENT(ch)) / 16;
}
void death_cry(struct char_data *ch)
{
int door;
@ -354,11 +345,9 @@ void die(struct char_data * ch, struct char_data * killer)
static void perform_group_gain(struct char_data *ch, int base,
struct char_data *victim)
{
int share;
share = MIN(CONFIG_MAX_EXP_GAIN, MAX(1, base));
change_alignment(ch, victim);
(void)ch;
(void)base;
(void)victim;
}
static void group_gain(struct char_data *ch, struct char_data *victim)
@ -400,8 +389,6 @@ static void solo_gain(struct char_data *ch, struct char_data *victim)
exp += MAX(0, (exp * MIN(8, (GET_LEVEL(victim) - GET_LEVEL(ch)))) / 8);
exp = MAX(exp, 1);
change_alignment(ch, victim);
}
static char *replace_string(const char *str, const char *weapon_singular, const char *weapon_plural)

View file

@ -525,17 +525,6 @@ static int apply_ac(struct char_data *ch, int eq_pos)
return (factor * GET_OBJ_VAL(GET_EQ(ch, eq_pos), 0));
}
int invalid_align(struct char_data *ch, struct obj_data *obj)
{
if (OBJ_FLAGGED(obj, ITEM_ANTI_EVIL) && IS_EVIL(ch))
return TRUE;
if (OBJ_FLAGGED(obj, ITEM_ANTI_GOOD) && IS_GOOD(ch))
return TRUE;
if (OBJ_FLAGGED(obj, ITEM_ANTI_NEUTRAL) && IS_NEUTRAL(ch))
return TRUE;
return FALSE;
}
void equip_char(struct char_data *ch, struct obj_data *obj, int pos)
{
int j;
@ -558,7 +547,7 @@ void equip_char(struct char_data *ch, struct obj_data *obj, int pos)
log("SYSERR: EQUIP: Obj is in_room when equip.");
return;
}
if (invalid_align(ch, obj) || invalid_class(ch, obj)) {
if (invalid_class(ch, obj)) {
act("You are zapped by $p and instantly let go of it.", FALSE, ch, obj, 0, TO_CHAR);
act("$n is zapped by $p and instantly lets go of it.", FALSE, ch, obj, 0, TO_ROOM);
/* Changed to drop in inventory instead of the ground. */

View file

@ -40,7 +40,6 @@ void obj_from_char(struct obj_data *object);
void equip_char(struct char_data *ch, struct obj_data *obj, int pos);
struct obj_data *unequip_char(struct char_data *ch, int pos);
int invalid_align(struct char_data *ch, struct obj_data *obj);
void obj_to_room(struct obj_data *object, room_rnum room);
void obj_from_room(struct obj_data *object);

View file

@ -237,23 +237,9 @@ int mag_damage(int level, struct char_data *ch, struct char_data *victim,
/* Mostly clerics */
case SPELL_DISPEL_EVIL:
dam = dice(6, 8) + 6;
if (IS_EVIL(ch)) {
victim = ch;
dam = GET_HIT(ch) - 1;
} else if (IS_GOOD(victim)) {
act("The gods protect $N.", FALSE, ch, 0, victim, TO_CHAR);
return (0);
}
break;
case SPELL_DISPEL_GOOD:
dam = dice(6, 8) + 6;
if (IS_GOOD(ch)) {
victim = ch;
dam = GET_HIT(ch) - 1;
} else if (IS_EVIL(victim)) {
act("The gods protect $N.", FALSE, ch, 0, victim, TO_CHAR);
return (0);
}
break;
@ -461,13 +447,6 @@ void mag_affects(int level, struct char_data *ch, struct char_data *victim,
to_room = "$n gets violently ill!";
break;
case SPELL_PROT_FROM_EVIL:
af[0].duration = 24;
SET_BIT_AR(af[0].bitvector, AFF_PROTECT_EVIL);
accum_duration = TRUE;
to_vict = "You feel invulnerable!";
break;
case SPELL_SANCTUARY:
af[0].duration = 4;
SET_BIT_AR(af[0].bitvector, AFF_SANCTUARY);

View file

@ -99,10 +99,7 @@ void mobile_activity(void)
if (MOB_FLAGGED(ch, MOB_WIMPY) && AWAKE(vict))
continue;
if (MOB_FLAGGED(ch, MOB_AGGRESSIVE ) ||
(MOB_FLAGGED(ch, MOB_AGGR_EVIL ) && IS_EVIL(vict)) ||
(MOB_FLAGGED(ch, MOB_AGGR_NEUTRAL) && IS_NEUTRAL(vict)) ||
(MOB_FLAGGED(ch, MOB_AGGR_GOOD ) && IS_GOOD(vict))) {
if (MOB_FLAGGED(ch, MOB_AGGRESSIVE)) {
/* Can a master successfully control the charmed monster? */
if (aggressive_mob_on_a_leash(ch, ch->master, vict))
@ -267,4 +264,3 @@ static bool aggressive_mob_on_a_leash(struct char_data *slave, struct char_data
/* So sorry, now you're a player killer... Tsk tsk. */
return (FALSE);
}

View file

@ -226,9 +226,7 @@ static void auto_equip(struct char_data *ch, struct obj_data *obj, int location)
if (location > 0) { /* Wearable. */
if (!GET_EQ(ch,j)) {
/* Check the characters's alignment to prevent them from being zapped
* through the auto-equipping. */
if (invalid_align(ch, obj) || invalid_class(ch, obj))
if (invalid_class(ch, obj))
location = LOC_INVENTORY;
else
equip_char(ch, obj, j);

View file

@ -19,7 +19,6 @@
#define PFDEF_LEVEL 0
#define PFDEF_HEIGHT 0
#define PFDEF_WEIGHT 0
#define PFDEF_ALIGNMENT 0
#define PFDEF_PLRFLAGS 0
#define PFDEF_AFFFLAGS 0
#define PFDEF_SAVETHROW 0

View file

@ -276,7 +276,6 @@ int load_char(const char *name, struct char_data *ch)
GET_WEIGHT(ch) = PFDEF_WEIGHT;
GET_ROLEPLAY_AGE(ch) = 0;
GET_ROLEPLAY_AGE_YEAR(ch) = 0;
GET_ALIGNMENT(ch) = PFDEF_ALIGNMENT;
for (i = 0; i < NUM_OF_SAVING_THROWS; i++)
GET_SAVE(ch, i) = PFDEF_SAVETHROW;
GET_LOADROOM(ch) = PFDEF_LOADROOM;
@ -361,7 +360,6 @@ int load_char(const char *name, struct char_data *ch)
AFF_FLAGS(ch)[0] = asciiflag_conv(line);
}
if (!strcmp(tag, "Affs")) load_affects(fl, ch);
else if (!strcmp(tag, "Alin")) GET_ALIGNMENT(ch) = atoi(line);
else if (!strcmp(tag, "Alis")) read_aliases_ascii(fl, ch, atoi(line));
break;
@ -696,7 +694,6 @@ void save_char(struct char_data * ch)
if (GET_HOST(ch)) fprintf(fl, "Host: %s\n", GET_HOST(ch));
if (GET_HEIGHT(ch) != PFDEF_HEIGHT) fprintf(fl, "Hite: %d\n", GET_HEIGHT(ch));
if (GET_WEIGHT(ch) != PFDEF_WEIGHT) fprintf(fl, "Wate: %d\n", GET_WEIGHT(ch));
if (GET_ALIGNMENT(ch) != PFDEF_ALIGNMENT) fprintf(fl, "Alin: %d\n", GET_ALIGNMENT(ch));
sprintascii(bits, PLR_FLAGS(ch)[0]);

View file

@ -31,6 +31,7 @@ static void sedit_shop_flags_menu(struct descriptor_data *d);
static void sedit_no_trade_menu(struct descriptor_data *d);
static void sedit_types_menu(struct descriptor_data *d);
static void sedit_disp_menu(struct descriptor_data *d);
static void format_notrade_classes(bitvector_t flags, char *out, size_t outsz);
void sedit_save_internally(struct descriptor_data *d)
@ -44,6 +45,34 @@ static void sedit_save_to_disk(int num)
save_shops(num);
}
static void format_notrade_classes(bitvector_t flags, char *out, size_t outsz)
{
size_t len = 0;
int i, found = 0;
if (!out || outsz == 0)
return;
out[0] = '\0';
for (i = TRADE_CLASS_START; i < NUM_TRADERS; i++) {
if (IS_SET(flags, 1 << i)) {
int n = snprintf(out + len, outsz - len, "%s%s", found ? " " : "", trade_letters[i]);
if (n < 0 || (size_t)n >= outsz - len) {
out[outsz - 1] = '\0';
return;
}
len += (size_t)n;
found = 1;
}
}
if (!found)
strlcpy(out, "NOBITS", outsz);
}
/* utility functions */
ACMD(do_oasis_sedit)
{
@ -346,11 +375,12 @@ static void sedit_no_trade_menu(struct descriptor_data *d)
get_char_colors(d->character);
clear_screen(d);
for (i = 0; i < NUM_TRADERS; i++) {
write_to_output(d, "%s%2d%s) %-20.20s %s", grn, i + 1, nrm, trade_letters[i],
for (i = 0; i < NUM_TRADE_CLASSES; i++) {
write_to_output(d, "%s%2d%s) %-20.20s %s", grn, i + 1, nrm,
trade_letters[TRADE_CLASS_START + i],
!(++count % 2) ? "\r\n" : "");
}
sprintbit(S_NOTRADE(OLC_SHOP(d)), trade_letters, bits, sizeof(bits));
format_notrade_classes(S_NOTRADE(OLC_SHOP(d)), bits, sizeof(bits));
write_to_output(d, "\r\nCurrently won't trade with: %s%s%s\r\n"
"Enter choice : ", cyn, bits, nrm);
OLC_MODE(d) = SEDIT_NOTRADE;
@ -382,7 +412,7 @@ static void sedit_disp_menu(struct descriptor_data *d)
get_char_colors(d->character);
clear_screen(d);
sprintbit(S_NOTRADE(shop), trade_letters, buf1, sizeof(buf1));
format_notrade_classes(S_NOTRADE(shop), buf1, sizeof(buf1));
sprintbit(S_BITVECTOR(shop), shop_bits, buf2, sizeof(buf2));
write_to_output(d,
"-- Shop Number : [%s%d%s]\r\n"
@ -756,8 +786,8 @@ void sedit_parse(struct descriptor_data *d, char *arg)
}
break;
case SEDIT_NOTRADE:
if ((i = LIMIT(atoi(arg), 0, NUM_TRADERS)) > 0) {
TOGGLE_BIT(S_NOTRADE(OLC_SHOP(d)), 1 << (i - 1));
if ((i = LIMIT(atoi(arg), 0, NUM_TRADE_CLASSES)) > 0) {
TOGGLE_BIT(S_NOTRADE(OLC_SHOP(d)), 1 << (TRADE_CLASS_START + i - 1));
sedit_no_trade_menu(d);
return;
}

View file

@ -29,9 +29,9 @@
/* Global variables definitions used externally */
/* Constant list for printing out who we sell to */
const char *trade_letters[] = {
"Good", /* First, the alignment based ones */
"Evil",
"Neutral",
"RESERVED1",
"RESERVED2",
"RESERVED3",
"Sorceror", /* Then the class based ones */
"Cleric",
"Rogue",
@ -119,13 +119,6 @@ static int is_ok_char(struct char_data *keeper, struct char_data *ch, int shop_n
if (IS_GOD(ch))
return (TRUE);
if ((IS_GOOD(ch) && NOTRADE_GOOD(shop_nr)) ||
(IS_EVIL(ch) && NOTRADE_EVIL(shop_nr)) ||
(IS_NEUTRAL(ch) && NOTRADE_NEUTRAL(shop_nr))) {
snprintf(buf, sizeof(buf), "%s %s", GET_NAME(ch), MSG_NO_SELL_ALIGN);
do_tell(keeper, buf, cmd_tell, 0);
return (FALSE);
}
if (IS_NPC(ch))
return (TRUE);
@ -1361,7 +1354,7 @@ void assign_the_shopkeepers(void)
static char *customer_string(int shop_nr, int detailed)
{
int sindex = 0, flag = 1, nlen;
int sindex = TRADE_CLASS_START, flag = (1 << TRADE_CLASS_START), nlen;
size_t len = 0;
static char buf[256];
@ -1433,7 +1426,7 @@ static void list_all_shops(struct char_data *ch)
static void list_detailed_shop(struct char_data *ch, int shop_nr)
{
struct char_data *k;
int sindex, column, flag = 1, found = 0;
int sindex, column, flag = (1 << TRADE_CLASS_START), found = 0;
/* char *ptrsave; */
send_to_char(ch, "Vnum: [%5d], Rnum: [%5d]\r\n", SHOP_NUM(shop_nr), shop_nr + 1);
@ -1484,7 +1477,7 @@ static void list_detailed_shop(struct char_data *ch, int shop_nr)
/* send_to_char(ch, "Customers: %s\r\n", (ptrsave = customer_string(shop_nr, TRUE)) ? ptrsave : "None"); */
send_to_char(ch, "Customers: ");
column = 12; /* ^^^ strlen ^^^ */
for (sindex = 0; *trade_letters[sindex] != '\n'; sindex++) {
for (sindex = TRADE_CLASS_START; *trade_letters[sindex] != '\n'; sindex++) {
char buf1[128];
int linelen;

View file

@ -74,9 +74,9 @@ struct shop_data {
#define LIST_ROOM 2
/* Whom will we not trade with (bitvector for SHOP_TRADE_WITH()) */
#define TRADE_NOGOOD (1 << 0)
#define TRADE_NOEVIL (1 << 1)
#define TRADE_NONEUTRAL (1 << 2)
#define TRADE_RESERVED1 (1 << 0)
#define TRADE_RESERVED2 (1 << 1)
#define TRADE_RESERVED3 (1 << 2)
#define TRADE_NOSORCEROR (1 << 3)
#define TRADE_NOCLERIC (1 << 4)
#define TRADE_NOROGUE (1 << 5)
@ -87,6 +87,9 @@ struct shop_data {
#define TRADE_NODRUID (1 << 10)
/** Total number of trade types */
#define NUM_TRADERS 11
#define TRADE_RESERVED_COUNT 3
#define TRADE_CLASS_START TRADE_RESERVED_COUNT
#define NUM_TRADE_CLASSES (NUM_TRADERS - TRADE_RESERVED_COUNT)
struct stack_data {
int data[100];
@ -123,9 +126,6 @@ struct stack_data {
#define SHOP_SELLPROFIT(i) (shop_index[(i)].profit_sell)
#define SHOP_FUNC(i) (shop_index[(i)].func)
#define NOTRADE_GOOD(i) (IS_SET(SHOP_TRADE_WITH((i)), TRADE_NOGOOD))
#define NOTRADE_EVIL(i) (IS_SET(SHOP_TRADE_WITH((i)), TRADE_NOEVIL))
#define NOTRADE_NEUTRAL(i) (IS_SET(SHOP_TRADE_WITH((i)), TRADE_NONEUTRAL))
#define NOTRADE_SORCEROR(i) (IS_SET(SHOP_TRADE_WITH((i)), TRADE_NOSORCEROR))
#define NOTRADE_CLERIC(i) (IS_SET(SHOP_TRADE_WITH((i)), TRADE_NOCLERIC))
#define NOTRADE_ROGUE(i) (IS_SET(SHOP_TRADE_WITH((i)), TRADE_NOROGUE))
@ -153,7 +153,6 @@ struct stack_data {
#define MSG_CLOSED_FOR_DAY "Sorry, come back tomorrow."
#define MSG_NO_STEAL_HERE "$n is a bloody thief!"
#define MSG_NO_SEE_CHAR "I don't trade with someone I can't see!"
#define MSG_NO_SELL_ALIGN "Get out of here before I call the guards!"
#define MSG_NO_SELL_CLASS "We don't serve your kind here!"
#define MSG_NO_USED_WANDSTAFF "I don't buy used up wands or staves!"
#define MSG_CANT_KILL_KEEPER "Get out of here before I call the guards!"

View file

@ -319,13 +319,6 @@ SPECIAL(sorceror)
if (GET_LEVEL(ch) > 7 && rand_number(0, 8) == 0)
cast_spell(ch, vict, NULL, SPELL_BLINDNESS);
if (GET_LEVEL(ch) > 12 && rand_number(0, 12) == 0) {
if (IS_EVIL(ch))
cast_spell(ch, vict, NULL, SPELL_ENERGY_DRAIN);
else if (IS_GOOD(ch))
cast_spell(ch, vict, NULL, SPELL_DISPEL_EVIL);
}
if (rand_number(0, 4))
return (TRUE);

View file

@ -388,14 +388,7 @@ ASPELL(spell_enchant_weapon)
obj->affected[1].location = APPLY_PROFICIENCY;
obj->affected[1].modifier = 1 + (level >= 20);
if (IS_GOOD(ch)) {
SET_BIT_AR(GET_OBJ_EXTRA(obj), ITEM_ANTI_EVIL);
act("$p glows blue.", FALSE, ch, obj, 0, TO_CHAR);
} else if (IS_EVIL(ch)) {
SET_BIT_AR(GET_OBJ_EXTRA(obj), ITEM_ANTI_GOOD);
act("$p glows red.", FALSE, ch, obj, 0, TO_CHAR);
} else
act("$p glows yellow.", FALSE, ch, obj, 0, TO_CHAR);
act("$p glows yellow.", FALSE, ch, obj, 0, TO_CHAR);
}
ASPELL(spell_detect_poison)

View file

@ -255,9 +255,9 @@
#define MOB_AGGRESSIVE 5 /**< Mob auto-attacks everybody nearby */
#define MOB_STAY_ZONE 6 /**< Mob shouldn't wander out of zone */
#define MOB_WIMPY 7 /**< Mob flees if severely injured */
#define MOB_AGGR_EVIL 8 /**< Auto-attack any evil PC's */
#define MOB_AGGR_GOOD 9 /**< Auto-attack any good PC's */
#define MOB_AGGR_NEUTRAL 10 /**< Auto-attack any neutral PC's */
#define MOB_AGGR_RESERVED1 8 /**< Reserved (unused) */
#define MOB_AGGR_RESERVED2 9 /**< Reserved (unused) */
#define MOB_AGGR_RESERVED3 10 /**< Reserved (unused) */
#define MOB_MEMORY 11 /**< remember attackers if attacked */
#define MOB_HELPER 12 /**< attack PCs fighting other NPCs */
#define MOB_NOCHARM 13 /**< Mob can't be charmed */
@ -321,8 +321,8 @@
#define AFF_CURSE 10 /**< Char is cursed */
#define AFF_INFRAVISION 11 /**< Char can see in dark */
#define AFF_POISON 12 /**< (R) Char is poisoned */
#define AFF_PROTECT_EVIL 13 /**< Char protected from evil */
#define AFF_PROTECT_GOOD 14 /**< Char protected from good */
#define AFF_RESERVED13 13 /**< Reserved (unused) */
#define AFF_RESERVED14 14 /**< Reserved (unused) */
#define AFF_SLEEP 15 /**< (R) Char magically asleep */
#define AFF_NOTRACK 16 /**< Char can't be tracked */
#define AFF_FLYING 17 /**< Char is flying */
@ -474,9 +474,9 @@
#define ITEM_MAGIC 6 /**< Item is magical */
#define ITEM_NODROP 7 /**< Item is cursed: can't drop */
#define ITEM_BLESS 8 /**< Item is blessed */
#define ITEM_ANTI_GOOD 9 /**< Not usable by good people */
#define ITEM_ANTI_EVIL 10 /**< Not usable by evil people */
#define ITEM_ANTI_NEUTRAL 11 /**< Not usable by neutral people */
#define ITEM_RESERVED9 9 /**< Reserved (unused) */
#define ITEM_RESERVED10 10 /**< Reserved (unused) */
#define ITEM_RESERVED11 11 /**< Reserved (unused) */
#define ITEM_ANTI_SORCEROR 12 /**< Not usable by sorcerors */
#define ITEM_ANTI_CLERIC 13 /**< Not usable by clerics */
#define ITEM_ANTI_ROGUE 14 /**< Not usable by rogues */

View file

@ -59,7 +59,7 @@ struct char_point_data_plrtoascii {
* in player_special_data.
*/
struct char_special_data_saved_plrtoascii {
int alignment; /* +-1000 for alignments */
int alignment;
long idnum; /* player's idnum; -1 for mobiles */
long /*bitvector_t*/ act; /* act flag for NPC's; player flag for PC's */
@ -212,8 +212,6 @@ void convert(char *filename)
/* char_special_data_saved */
csds = &(player.char_specials_saved);
if (csds->alignment != PFDEF_ALIGNMENT)
fprintf(outfile, "Alin: %d\n", csds->alignment);
fprintf(outfile, "Id : %d\n", (int)csds->idnum);
if (csds->act != PFDEF_PLRFLAGS)
fprintf(outfile, "Act : %d\n", (int)csds->act);

View file

@ -749,13 +749,6 @@ do \
#define CAN_SEE_IN_DARK(ch) \
(AFF_FLAGGED(ch, AFF_INFRAVISION) || (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_HOLYLIGHT)))
/** Defines if ch is good. */
#define IS_GOOD(ch) (GET_ALIGNMENT(ch) >= 350)
/** Defines if ch is evil. */
#define IS_EVIL(ch) (GET_ALIGNMENT(ch) <= -350)
/** Defines if ch is neither good nor evil. */
#define IS_NEUTRAL(ch) (!IS_GOOD(ch) && !IS_EVIL(ch))
/** Old wait state function.
* @deprecated Use GET_WAIT_STATE */
#define WAIT_STATE(ch, cycle) do { GET_WAIT_STATE(ch) = (cycle); } while(0)