Skip to content

Commit

Permalink
blame vile
Browse files Browse the repository at this point in the history
  • Loading branch information
luciensadi committed Sep 14, 2024
1 parent a6c167c commit 1bb7efa
Show file tree
Hide file tree
Showing 21 changed files with 394 additions and 303 deletions.
12 changes: 3 additions & 9 deletions src/act.drive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,21 +402,15 @@ void do_raw_ram(struct char_data *ch, struct veh_data *veh, struct veh_data *tve
return;
}

// Alarm all NPCs inside the ramming vehicle.
// Alarm all NPCs inside the ramming vehicle. They don't get mad at the PC in particular, just mad in general.
for (struct char_data *npc = veh->people; npc; npc = npc->next_in_veh) {
if (IS_NPC(npc)) {
GET_MOBALERT(npc) = MALERT_ALARM;
GET_MOBALERTTIME(npc) = 30;
}
set_mob_alarm(npc, NULL, 30);
}

if (tveh) {
// Alarm all NPCs inside the targeted vehicle.
for (struct char_data *npc = tveh->people; npc; npc = npc->next_in_veh) {
if (IS_NPC(npc)) {
GET_MOBALERT(npc) = MALERT_ALARM;
GET_MOBALERTTIME(npc) = 30;
}
set_mob_alarm(npc, ch, 30);
}

target = get_vehicle_modifier(veh) + veh->handling + modify_target(ch);
Expand Down
35 changes: 28 additions & 7 deletions src/act.informative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "zoomies.hpp"
#include "vehicles.hpp"
#include "moderation.hpp"
#include "player_exdescs.hpp"

const char *CCHAR;

Expand Down Expand Up @@ -942,13 +943,13 @@ const char *render_ware_for_viewer(struct obj_data *ware, bool privileged, bool
return render_buf;
}

void look_at_char(struct char_data * i, struct char_data * ch)
void look_at_char(struct char_data * i, struct char_data * ch, const char *used_keyword)
{
int j, found, weight;
float height;
struct obj_data *tmp_obj;


#ifdef USE_JANKY_EQUIPMENT_CONCEAL_SYSTEM
if (((GET_EQ(i, WEAR_HEAD) && GET_OBJ_VAL(GET_EQ(i, WEAR_HEAD), 7) > 1) ||
(GET_EQ(i, WEAR_FACE) && GET_OBJ_VAL(GET_EQ(i, WEAR_FACE), 7) > 1)) &&
success_test(GET_INT(ch) + GET_POWER(ch, ADEPT_IMPROVED_PERCEPT),
Expand All @@ -966,6 +967,7 @@ void look_at_char(struct char_data * i, struct char_data * ch)
else if (GET_EQ(i, WEAR_UNDER))
send_to_char(ch, GET_EQ(i, WEAR_UNDER)->text.look_desc);
} else
#endif
{
if (i->player.physical_text.look_desc)
send_to_char(i->player.physical_text.look_desc, ch);
Expand All @@ -977,6 +979,17 @@ void look_at_char(struct char_data * i, struct char_data * ch)
send_to_char("", ch);
}

if (CHAR_HAS_EXDESCS(i) && used_keyword && *used_keyword) {
char uppercase[strlen(used_keyword) + 1];
for (size_t idx = 0; idx < strlen(used_keyword); idx++) { uppercase[idx] = toupper(used_keyword[idx]); }
uppercase[strlen(used_keyword)] = '\0';

send_to_char(ch, "%s %s extra descriptions set. Use ^WLOOK %s EXDESCS^n for more.\r\n",
CAP(HSSH(i)),
HASHAVE(i),
uppercase);
}

if (i != ch && GET_HEIGHT(i) > 0 && GET_WEIGHT(i) > 0) {
if ((GET_HEIGHT(i) % 10) < 5)
height = (float)(GET_HEIGHT(i) - (GET_HEIGHT(i) % 10)) / 100;
Expand Down Expand Up @@ -1328,7 +1341,7 @@ void list_one_char(struct char_data * i, struct char_data * ch)
}
}

if (GET_MOBALERT(i) == MALERT_ALARM && (MOB_FLAGGED(i, MOB_HELPER) || MOB_FLAGGED(i, MOB_GUARD))) {
if (mob_is_alarmed_by_ch(i, ch) && (MOB_FLAGGED(i, MOB_HELPER) || MOB_FLAGGED(i, MOB_GUARD))) {
strlcat(buf, "^r(alarmed)^n ", sizeof(buf));
}

Expand Down Expand Up @@ -1538,7 +1551,7 @@ void list_one_char(struct char_data * i, struct char_data * ch)
}
}

if (GET_MOBALERT(i) == MALERT_ALARM && (MOB_FLAGGED(i, MOB_HELPER) || MOB_FLAGGED(i, MOB_GUARD))) {
if (mob_is_alarmed_by_ch(i, ch) && (MOB_FLAGGED(i, MOB_HELPER) || MOB_FLAGGED(i, MOB_GUARD))) {
strlcat(buf, " ^r(alarmed)^n", sizeof(buf));
}

Expand Down Expand Up @@ -2715,7 +2728,10 @@ void look_at_target(struct char_data * ch, char *arg)
/* Is the target a character? */
if (found_char != NULL)
{
look_at_char(found_char, ch);
// If this isn't an exdesc invocation, look at the character.
if (!look_at_exdescs(ch, found_char, arg)) {
look_at_char(found_char, ch, arg);
}
/*
if (ch != found_char && !ch->char_specials.rigging) {
if (CAN_SEE(found_char, ch))
Expand All @@ -2729,14 +2745,19 @@ void look_at_target(struct char_data * ch, char *arg)
{
found_char = get_char_veh(ch, arg, ch->in_veh);
if (found_char) {
look_at_char(found_char, ch);
// If this isn't an exdesc invocation, look at the character.
if (!look_at_exdescs(ch, found_char, arg)) {
look_at_char(found_char, ch, arg);
}
/*
if (ch != found_char) {
if (CAN_SEE(found_char, ch)) {
send_to_char(found_char, "%s looks at you.\r\n", GET_NAME(ch));
}
snprintf(buf, sizeof(buf), "%s looks at %s.\r\n", GET_NAME(ch), GET_NAME(found_char));
send_to_veh(buf, ch->in_veh, ch, found_char, FALSE);
}
*/
ch->in_room = was_in;
return;
}
Expand Down Expand Up @@ -7132,7 +7153,7 @@ const char *render_room_for_scan(struct char_data *ch, struct room_data *room, s
snprintf(ENDOF(results), sizeof(results) - strlen(results), " %s%s^n%s\r\n",
flag_line,
their_name,
FIGHTING(list) == ch ? " ^R(fighting you!)^n" : (GET_MOBALERT(list) == MALERT_ALARM && (MOB_FLAGGED(list, MOB_HELPER) || MOB_FLAGGED(list, MOB_GUARD)) ? " ^r(alarmed)^n" : ""));
FIGHTING(list) == ch ? " ^R(fighting you!)^n" : (mob_is_alarmed_by_ch(list, ch) && (MOB_FLAGGED(list, MOB_HELPER) || MOB_FLAGGED(list, MOB_GUARD)) ? " ^r(alarmed)^n" : ""));
}
}

Expand Down
9 changes: 4 additions & 5 deletions src/act.movement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

/* external functs */
int special(struct char_data * ch, int cmd, char *arg);
void death_cry(struct char_data * ch);
void death_cry(struct char_data * ch, idnum_t cause_of_death_idnum);
bool perform_fall(struct char_data *);
bool check_fall(struct char_data *, int, bool need_to_send_fall_message);
extern int modify_target(struct char_data *);
Expand Down Expand Up @@ -324,8 +324,7 @@ bool should_tch_see_chs_movement_message(struct char_data *viewer, struct char_d
// Spotting someone sneaking around puts NPCs on edge.
if (IS_NPC(viewer) && !IS_PROJECT(viewer)) {
// Extend their alert time and ensure they're at least Alert.
GET_MOBALERT(viewer) = MAX(GET_MOBALERT(viewer), MALERT_ALERT);
GET_MOBALERTTIME(viewer) = MAX(GET_MOBALERTTIME(viewer), 10);
extend_mob_alarm_time(viewer, actor, 10);

// Send messages, but only for the room you're walking into.
if (is_arriving) {
Expand Down Expand Up @@ -552,7 +551,7 @@ int do_simple_move(struct char_data *ch, int dir, int extra, struct char_data *v
#ifdef DEATH_FLAGS
if (ROOM_FLAGGED(ch->in_room, ROOM_DEATH) && !IS_NPC(ch) && !IS_SENATOR(ch)) {
send_to_char("You feel the world slip into darkness, you better hope a wandering DocWagon finds you.\r\n", ch);
death_cry(ch);
death_cry(ch, 0);
act("$n vanishes into thin air.", FALSE, ch, 0, 0, TO_ROOM);
death_penalty(ch);
for (struct obj_data *bio = ch->bioware; bio; bio = bio->next_content)
Expand Down Expand Up @@ -703,7 +702,7 @@ bool perform_fall(struct char_data *ch)
if (ROOM_FLAGGED(ch->in_room, ROOM_DEATH) && !IS_NPC(ch) &&
!IS_SENATOR(ch)) {
send_to_char("You feel the world slip into darkness, you better hope a wandering DocWagon finds you.\r\n", ch);
death_cry(ch);
death_cry(ch, 0);
act("$n vanishes into thin air.", FALSE, ch, 0, 0, TO_ROOM);
death_penalty(ch);
for (struct obj_data *bio = ch->bioware; bio; bio = bio->next_content)
Expand Down
4 changes: 2 additions & 2 deletions src/act.offensive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extern int convert_look[];
extern const char *KILLER_FLAG_MESSAGE;

/* extern functions */
void raw_kill(struct char_data * ch);
void raw_kill(struct char_data * ch, idnum_t cause_of_death_idnum);
extern void range_combat(struct char_data *ch, char target[MAX_INPUT_LENGTH],
struct obj_data *weapon, int range, int dir);
extern int find_weapon_range(struct char_data *ch, struct obj_data *weapon);
Expand Down Expand Up @@ -472,7 +472,7 @@ ACMD(do_kill)
mudlog(buf2, vict, LOG_DEATHLOG, TRUE);
}

raw_kill(vict);
raw_kill(vict, GET_IDNUM(ch));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/act.other.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ ACMD(do_quit)
send_to_char("You have to type quit - no less, to quit!\r\n", ch);
return;
}
void die(struct char_data * ch);
void die(struct char_data * ch, idnum_t cause_of_death);
struct descriptor_data *d, *next_d;

if (IS_NPC(ch) || !ch->desc)
Expand All @@ -114,7 +114,7 @@ ACMD(do_quit)
if (GET_POS(ch) <= POS_STUNNED) {
send_to_char("You die before your time...\r\n", ch);
act("$n gives up the struggle to live...", TRUE, ch, 0, 0, TO_ROOM);
die(ch);
die(ch, 0);
} else {
GET_LAST_IN(ch) = GET_ROOM_VNUM(ch->in_room);
struct room_data *save_room = ch->in_room;
Expand Down
16 changes: 12 additions & 4 deletions src/act.wizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1965,10 +1965,18 @@ void do_stat_mobile(struct char_data * ch, struct char_data * k)
MOB_FLAGS(k).PrintBits(buf2, MAX_STRING_LENGTH, action_bits, MOB_MAX);
snprintf(ENDOF(buf), sizeof(buf) - strlen(buf), "NPC flags: ^c%s^n\r\n", buf2);

snprintf(ENDOF(buf), sizeof(buf) - strlen(buf), "Alert status: ^c%s^n with ^c%d^n ticks cooldown.\r\n",
GET_MOBALERT(k) == MALERT_ALARM ? "^rAlarm^n" : (GET_MOBALERT(k) == MALERT_ALERT ? "^yAlert^n" : "^gCalm^n"),
GET_MOBALERTTIME(k)
);
if (mob_is_alert(k)) {
snprintf(ENDOF(buf), sizeof(buf) - strlen(buf), "Alarmed at ^c%ld^n characters: ", GET_MOB_ALARM_MAP(k).size());
for (auto itr : GET_MOB_ALARM_MAP(k)) {
if (itr.first == 0) {
snprintf(ENDOF(buf), sizeof(buf) - strlen(buf), "<alert %lds>", itr.second - time(0));
} else {
const char *ch_name = get_player_name(itr.first);
snprintf(ENDOF(buf), sizeof(buf) - strlen(buf), "%s %lds>", ch_name, itr.second - time(0));
delete [] ch_name;
}
}
}

snprintf(ENDOF(buf), sizeof(buf) - strlen(buf), "Height: %d cm, Weight: %d kg\r\n", GET_HEIGHT(k), GET_WEIGHT(k));

Expand Down
5 changes: 0 additions & 5 deletions src/awake.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2376,11 +2376,6 @@ enum {
#define IC_SHIFT 6
#define IC_TRAP 7

/* MOB Alert Levels */
#define MALERT_CALM 0
#define MALERT_ALERT 1
#define MALERT_ALARM 2

#define LIGHT 1
#define MODERATE 2
#define SERIOUS 3
Expand Down
Loading

0 comments on commit 1bb7efa

Please sign in to comment.