Skip to content

Commit

Permalink
You should now be able to see and manipulate your inventory even when…
Browse files Browse the repository at this point in the history
… you can't see (darkness, blinded).

Added the kapak draconian advanced race
Added ability for charmies to perform more abilities and commands that were previously not performable my NPCs, grapple being one of them.
Race restrictions removed from arcane archer
Created a new object database for builder info and for players to find gear: https://krynn.d20mud.com/objectdb/
Functions that enable searching for players and mobs will prioritize players over mobs now
  • Loading branch information
GickerLDS committed Apr 24, 2024
1 parent 4519fce commit accffbb
Show file tree
Hide file tree
Showing 22 changed files with 600 additions and 71 deletions.
10 changes: 5 additions & 5 deletions act.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,7 @@ bool is_locked_race(int race);

/** Check if character is not a NPC. */
#define PREREQ_NOT_NPC() \
if (IS_NPC(ch)) \
{ \
send_to_char(ch, "But you don't know how!\r\n"); \
return; \
}
if (!can_npc_command(ch)) return;

/** Check if character is in a peaceful room. */
#define PREREQ_NOT_PEACEFUL_ROOM() \
Expand Down Expand Up @@ -268,6 +264,7 @@ ACMD_DECL(do_bane);
ACMD_DECL(do_slayer);
ACMD_DECL(do_true_judgement);
ACMD_DECL(do_flightlist);
ACMD_DECL(do_kapak_saliva);

int max_judgements_active(struct char_data *ch);
int num_judgements_active(struct char_data *ch);
Expand Down Expand Up @@ -321,6 +318,7 @@ void list_consumables(struct char_data *ch, int type);
void sort_object_bag(struct char_data *ch, char *objname, int subcmd, int bagnum);
/* do_look, do_inventory utility functions */
void list_obj_to_char(struct obj_data *list, struct char_data *ch, int mode, int show, int mxp_type);
void list_obj_to_char_full(struct obj_data *list, struct char_data *ch, int mode, int show, int mxp_type, bool can_see_always);

/* functions with subcommands */
/* do_drop */
Expand Down Expand Up @@ -861,6 +859,7 @@ void snoop_check(struct char_data *ch);
bool change_player_name(struct char_data *ch, struct char_data *vict, char *new_name);
bool AddRecentPlayer(char *chname, char *chhost, bool newplr, bool cpyplr);
int get_eq_score(obj_rnum a);
void save_objects_to_database(struct char_data *ch);
/* Functions with subcommands */
/* do_date */
ACMD_DECL(do_date);
Expand Down Expand Up @@ -982,6 +981,7 @@ ACMD_DECL(do_resetpassword);
ACMD_DECL(do_holyweapon);
ACMD_DECL(do_award);
ACMD_DECL(do_show_blockers);
ACMD_DECL(do_save_objects_to_database);

// encounters.c
ACMD_DECL(do_encounterinfo);
Expand Down
25 changes: 21 additions & 4 deletions act.informative.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,12 @@ static void show_obj_modifiers(struct obj_data *obj, struct char_data *ch)
send_to_char(ch, " \tD(burned out)\tn");
}

void list_obj_to_char(struct obj_data *list, struct char_data *ch,
int mode, int show, int mxp_type)
void list_obj_to_char(struct obj_data *list, struct char_data *ch, int mode, int show, int mxp_type)
{
list_obj_to_char_full(list, ch, mode, show, mxp_type, false);
}

void list_obj_to_char_full(struct obj_data *list, struct char_data *ch, int mode, int show, int mxp_type, bool can_see_always)
{
struct obj_data *i = NULL, *j = NULL, *display = NULL;
bool found = FALSE;
Expand All @@ -525,7 +529,7 @@ void list_obj_to_char(struct obj_data *list, struct char_data *ch,
/* This if-clause should be exactly the same as the one in the loop above */
if ((j->short_description == i->short_description && j->name == i->name) ||
(!strcmp(j->short_description, i->short_description) && !strcmp(j->name, i->name)))
if (CAN_SEE_OBJ(ch, j) /*|| (!AFF_FLAGGED(ch, AFF_BLIND) && OBJ_FLAGGED(j, ITEM_GLOW))*/)
if (CAN_SEE_OBJ(ch, j) || can_see_always /*|| (!AFF_FLAGGED(ch, AFF_BLIND) && OBJ_FLAGGED(j, ITEM_GLOW))*/)
{
/* added the ability for players to see glowing items in their inventory in the dark
* as long as they are not blind! maybe add this to CAN_SEE_OBJ macro? */
Expand Down Expand Up @@ -1460,6 +1464,12 @@ void look_at_room(struct char_data *ch, int ignore_brief)
(!IS_SET_AR(ROOM_FLAGS(target_room), ROOM_FOG) || GET_LEVEL(ch) >= LVL_IMMORT))
do_auto_exits(ch);

if (ROOM_AFFECTED(ch->in_room, RAFF_KAPAK_ACID))
{
send_to_char(ch, "\tMA pool of acid covers the area.\tn\r\n");
return;
}

/* now list characters & objects */
list_obj_to_char(world[IN_ROOM(ch)].contents, ch, SHOW_OBJ_LONG, FALSE, 0);
list_char_to_char(world[IN_ROOM(ch)].people, ch);
Expand Down Expand Up @@ -2051,6 +2061,8 @@ void perform_cooldowns(struct char_data *ch, struct char_data *k)
send_to_char(ch, "Incorporeal Form (Undead Bloodline) Cooldown - Duration: %d seconds\r\n", INCORPOREAL_FORM_TIMER(ch) * 6);
if (GET_MISSION_COOLDOWN(k) > 0)
send_to_char(ch, "Mission Ready Cooldown - Duration: %d seconds\r\n", GET_MISSION_COOLDOWN(k) * 6);
if (GET_KAPAK_SALIVA_HEALING_COOLDOWN(k) > 0)
send_to_char(ch, "Kapak Saliva Healing - Duration: %d seconds\r\n", GET_KAPAK_SALIVA_HEALING_COOLDOWN(k) * 6);

send_to_char(ch, "\tC");
draw_line(ch, 80, '-', '-');
Expand Down Expand Up @@ -3476,7 +3488,7 @@ ACMD(do_score)
ACMD(do_inventory)
{
send_to_char(ch, "You are carrying:\r\n");
list_obj_to_char(ch->carrying, ch, SHOW_OBJ_SHORT, TRUE, 1);
list_obj_to_char_full(ch->carrying, ch, SHOW_OBJ_SHORT, TRUE, 1, true);

if (!IS_NPC(ch))
if (ch->desc)
Expand Down Expand Up @@ -3669,7 +3681,12 @@ ACMD(do_equipment)
if (GET_EQ(ch, eq_ordering_1[i]))
{
found = TRUE;
#if defined(CAMPAIGN_DL)
// In Dragonlance, we always want to be able to see our equipment unless it's invis and we can't see invis
if (!OBJ_FLAGGED(GET_EQ(ch, eq_ordering_1[i]), ITEM_INVISIBLE) || AFF_FLAGGED(ch, AFF_DETECT_INVIS) || AFF_FLAGGED(ch, AFF_TRUE_SIGHT))
#else
if (CAN_SEE_OBJ(ch, GET_EQ(ch, eq_ordering_1[i])))
#endif
{
send_to_char(ch, "%s", wear_where[eq_ordering_1[i]]);
/* added this as a clue to players */
Expand Down
89 changes: 89 additions & 0 deletions act.other.c
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,9 @@ ACMD(do_applypoison)
return;
}

if (is_abbrev(arg1, "kapak") && HAS_FEAT(ch, FEAT_KAPAK_SALIVA))
poison = read_object(OBJ_VNUM_KAPAK_POISON, VIRTUAL);

poison = get_obj_in_list_vis(ch, arg1, NULL, ch->carrying);

if (!poison)
Expand Down Expand Up @@ -9088,6 +9091,92 @@ ACMDU(do_borrow)
}
}


ACMD(do_kapak_saliva)
{

char arg[200];
struct char_data *vict = NULL;
int healing = 0;

if (!is_action_available(ch, atSWIFT, TRUE))
{
send_to_char(ch, "You need a swift action to use this ability.\r\n");
return;
}

if (!HAS_FEAT(ch, FEAT_KAPAK_SALIVA))
{
send_to_char(ch, "Only Kapak Draconians can use this ability");
return;
}

if (GET_SEX(ch) == SEX_MALE)
{
send_to_char(ch, "Male Kapaks can apply poison to their weapons using the command: applypoison kapak (weapon name)\r\n");
return;
}

one_argument(argument, arg, sizeof(arg));

if (!*arg)
vict = ch;
else
{
if (!(vict = get_char_vis(ch, arg, NULL, FIND_CHAR_ROOM)))
{
send_to_char(ch, "There's no one here by that description.\r\n");
return;
}
}

if (GET_HIT(vict) >= GET_MAX_HIT(vict))
{
send_to_char(ch, "They are already fully healed.\r\n");
return;
}

if (GET_KAPAK_SALIVA_HEALING_COOLDOWN(vict) > 0)
{
if (vict == ch)
{
act("You lick your wounds, but feel only numbness as residues of your saliva still remain.", TRUE, ch, 0, vict, TO_CHAR);
act("$n licks $s wounds with healing saliva.", TRUE, ch, 0, vict, TO_ROOM);
}
else
{
act("You lick $N's wounds, but see no effect as residues of kapak saliva still remain.", TRUE, ch, 0, vict, TO_CHAR);
act("$n licks Your wounds, but there is no effect as residues of kapak saliva still remain.", TRUE, ch, 0, vict, TO_VICT);
act("$n licks $N's wounds with healing saliva.", TRUE, ch, 0, vict, TO_NOTVICT);
}
return;
}

GET_KAPAK_SALIVA_HEALING_COOLDOWN(vict) = 60;
healing = dice(GET_LEVEL(ch), 4) + 20;
if ((GET_HIT(vict) + healing) > GET_MAX_HIT(vict))
{
healing = GET_MAX_HIT(vict) - GET_HIT(vict);
}

if (vict == ch)
{
act("You lick your wounds and feel healing relief from your kapak saliva.", TRUE, ch, 0, vict, TO_CHAR);
act("$n licks $s wounds with healing saliva.", TRUE, ch, 0, vict, TO_ROOM);
send_to_char(ch, "You are healed for %d hp.\r\n", healing);
}
else
{
act("You lick $N's wounds and they feel healing relief from your kapak saliva.", TRUE, ch, 0, vict, TO_CHAR);
act("$n licks Your wounds and you feel healing relief from the kapak saliva.", TRUE, ch, 0, vict, TO_VICT);
act("$n licks $N's wounds with healing saliva.", TRUE, ch, 0, vict, TO_NOTVICT);
send_to_char(vict, "You are healed for %d hp.\r\n", healing);
send_to_char(ch, "They are healed for %d hp.\r\n", healing);
}

USE_SWIFT_ACTION(ch);

}
/* undefines */
#undef DEBUG_MODE

Expand Down
7 changes: 7 additions & 0 deletions act.wizard.c
Original file line number Diff line number Diff line change
Expand Up @@ -9602,4 +9602,11 @@ ACMD(do_show_blockers)

}

ACMD(do_save_objects_to_database)
{
send_to_char(ch, "Saving objects to database...\r\n");
save_objects_to_database(ch);
send_to_char(ch, "Objects successfully exported to database.\r\n");
}

/* EOF */
6 changes: 4 additions & 2 deletions class.c
Original file line number Diff line number Diff line change
Expand Up @@ -6587,10 +6587,12 @@ void load_class_list(void)
/* no spell assignment */
/* class prereqs */
class_prereq_bab(CLASS_ARCANE_ARCHER, 5);
#if !defined(CAMPAIGN_DL)
/* elf, half-elf, drow only */
class_prereq_race(CLASS_ARCANE_ARCHER, RACE_DROW);
class_prereq_race(CLASS_ARCANE_ARCHER, RACE_ELF);
class_prereq_race(CLASS_ARCANE_ARCHER, RACE_HALF_ELF);
#endif
class_prereq_feat(CLASS_ARCANE_ARCHER, FEAT_POINT_BLANK_SHOT, 1);
class_prereq_feat(CLASS_ARCANE_ARCHER, FEAT_PRECISE_SHOT, 1);
class_prereq_spellcasting(CLASS_ARCANE_ARCHER, CASTING_TYPE_ARCANE,
Expand Down Expand Up @@ -7091,7 +7093,7 @@ void load_class_list(void)
/* class-number name abrv clr-abrv menu-name*/
classo(CLASS_KNIGHT_OF_THE_CROWN, "knightofthecrown", "KCr", "\tWKCr\tn", "g) \tWKnight of the Crown\tn",
/* max-lvl lock? prestige? BAB HD psp move trains in-game? unlkCst, eFeatp*/
5, N, Y, H, 12, 0, 1, 2, Y, 0, 0,
5, Y, Y, H, 12, 0, 1, 2, Y, 2500, 0,
/*prestige spell progression*/ "none",
/*primary attributes*/ "Strength, Con/Dex for survivability",
/*descrip*/
Expand Down Expand Up @@ -7243,7 +7245,7 @@ void load_class_list(void)
/* class-number name abrv clr-abrv menu-name*/
classo(CLASS_KNIGHT_OF_THE_SWORD, "knightofthesword", "KSw", "\tWKSw\tn", "g) \tWKnight of the Sword\tn",
/* max-lvl lock? prestige? BAB HD psp move trains in-game? unlkCst, eFeatp*/
5, Y, Y, H, 10, 0, 1, 2, Y, 5000, 0,
5, Y, Y, H, 10, 0, 1, 2, Y, 2500, 0,
/*prestige spell progression*/ "none",
/*primary attributes*/ "Strength, Con/Dex for survivability, Cha for class abilities",
/*descrip*/
Expand Down
5 changes: 3 additions & 2 deletions constants.c
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,7 @@ const char *room_affections[] = {
"Obscuring-Mist",
"Difficult-Terrain",
"Sacred-Space",
"Kapak-Acid",
"\n"};
CHECK_TABLE_SIZE(room_affections, NUM_RAFF + 1);

Expand Down Expand Up @@ -2253,7 +2254,7 @@ const char *item_types[] = {
"Armor/Shield",
"Potion", // 10
"Wearable",
"OTHER",
"Other",
"Trash",
"Ammo",
"Container", // 15
Expand Down Expand Up @@ -3811,7 +3812,7 @@ const char *languages[] =
"gnome",
"goblin",
"gullytalk",
"halfling",
"kenderspeak",
"minotaur",
"nerakese",
"ogre",
Expand Down
Loading

0 comments on commit accffbb

Please sign in to comment.