Pol  Rev 533
RepSystem Class Reference

#include <repsys.h>

List of all members.

Static Private Member Functions

static void de_escalate (Character *amy, Character *bob)
static unsigned char hilite_color_idx (const Character *chr, const Character *who)
static unsigned short name_color (const Character *seen_by, const Character *who)
static void on_pc_attacks_pc (Character *attacker, Character *defender)
static void on_pc_damages_pc (Character *attacker, Character *defender)
static void on_pc_helps_pc (Character *helper, Character *helped)
static void repsys_task (Character *chr)
static void restart_crim_timer (Character *chr)
static void schedule_repsys_task (Character *chr, polclock_t runat)
static void show_repdata (Client *client, Character *mob)

Friends

unsigned char Character::hilite_color_idx (const Character *seen_by) const
void Character::make_aggressor_to (Character *chr)
void Character::make_criminal (int level)
void Character::make_lawfullydamaged_to (Character *chr)
void Character::make_murderer (bool newval)
unsigned short Character::name_color (const Character *seen_by) const
void Character::repsys_on_attack (Character *defender)
void Character::repsys_on_damage (Character *defender)
void Character::repsys_on_help (Character *helper)
unsigned char NPC::hilite_color_idx (const Character *seen_by) const
unsigned short NPC::name_color (const Character *seen_by) const
void show_repdata (Character *looker, Character *mob)

Detailed Description

Definition at line 25 of file repsys.h.


Member Function Documentation

void RepSystem::de_escalate ( Character amy,
Character bob 
) [static, private]

[7] De-Escalation To De-escalate Amy and Bob: if Amy's opponent is Bob, Amy clears her opponent If Bob's opponent is Amy, Bob clears his opponent

Definition at line 543 of file repsys.cpp.

References Character::opponent_, and Character::set_opponent().

Referenced by repsys_task().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned char RepSystem::hilite_color_idx ( const Character amy,
const Character bob 
) [static, private]

[8] Highlighting and Name Coloring if Amy looks at Bob, coloring is as follows: if Bob is invul and invul tag set 2, color Bob INVUL (yellow) if Bob is a Murderer color Bob MURDERER () if Bob is a Criminal, color Bob CRIMINAL (Red) If Bob is a guild ally of Amy's, color Bob FRIEND (Green) if Bob is an Aggressor to Amy, color Bob ATTACKABLE (Grey) if Amy has lawfully damaged Bob, color Bob ATTACKABLE (Grey) if Bob is a guild enemy of Amy's, color Bob ENEMY (Orange) otherwise color Bob INNOCENT (Blue)

Definition at line 569 of file repsys.cpp.

References ExportedFunction::call_long(), CHAR_HILITE_ATTACKABLE, CHAR_HILITE_CRIMINAL, CHAR_HILITE_ENEMY, CHAR_HILITE_FRIEND, CHAR_HILITE_INNOCENT, CHAR_HILITE_INVUL, CHAR_HILITE_MURDERER, Character::has_lawfully_damaged(), RepSys_Cfg::HighLightColor, RepSys_Cfg::Hooks, Character::invul, ServSpecOpt::invul_tag, Character::is_aggressor_to(), Character::is_criminal(), Character::is_guild_ally(), Character::is_guild_enemy(), Character::is_murderer(), Character::make_ref(), repsys_cfg, and ssopt.

+ Here is the call graph for this function:

void RepSystem::on_pc_attacks_pc ( Character amy_attacker,
Character bob_defender 
) [static, private]

[3] Player attacks another Player When Amy attacks Bob These rules are applied:

  • When Amy applies damage to Bob (on_pc_damaged_pc calls this)
  • repsys_on_attack (Amy attacks PC, or tamed creature)
    • apply_raw_damage_hundredths
    • amy sets opponent
    • melee attack
    • amy's NPC does any of these things
  • When Amy tries to apply any damage to Bob
  • When Amy selects Bob as her Opponent
  • When Amy swings at Bob
  • When Amy selects Bob with a Harmful target cursor

if Bob is Innocent to Amy, Set Amy's Criminal flag for CriminalFlagInterval seconds

if Bob is Aggressor to Amy, Set Bob as Aggressor to Amy for AggressorFlagTimeout seconds else, Tell Bob "Amy is Attacking you!" if this is news Set Amy as Aggressor to Bob for AggressorFlagTimeout seconds

Definition at line 425 of file repsys.cpp.

References RepSys_Cfg::AggressorFlagTimeout, Character::client, RepSys_Cfg::CriminalFlagInterval, earliest_timer(), RepSys_Cfg::General, Character::is_aggressor_to(), Character::is_criminal(), Character::is_innocent_to(), RepSys_Cfg::Murderer, UObject::name(), RepSys_Cfg::NameColoring, polclock(), POLCLOCKS_PER_SEC, private_say_above_ex(), repsys_cfg, Character::restart_aggressor_timer(), Character::restart_criminal_timer(), schedule_repsys_task(), send_create_mobile_to_nearby_cansee(), and send_move().

Referenced by on_pc_damages_pc(), and Character::repsys_on_attack().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void RepSystem::on_pc_damages_pc ( Character amy,
Character bob 
) [static, private]

[4] Player Damages Player When Amy damages Bob These rules applied:

  • When Amy actually applies damage to Bob
  • When Amy poisons Bob (only with Bob.SetPoisoned(1)) (note damage due to poisoning will not fire this rule, only the initial application)
  • When Amy paralyzes Bob (only with Bob.SetParalyzed(1))

Apply all rules for "Player Attacks Another Player"[->3]

If Bob is Innocent to Amy, Add Amy to Bob's "ToBeReportable" list else Set Amy as having LawfullyDamaged Bob for AggressorFlagTimeout seconds

Definition at line 490 of file repsys.cpp.

References Character::add_to_be_reportable(), RepSys_Cfg::AggressorFlagTimeout, RepSys_Cfg::General, Character::is_innocent_to(), on_pc_attacks_pc(), polclock(), POLCLOCKS_PER_SEC, repsys_cfg, Character::restart_lawfully_damaged_timer(), schedule_repsys_task(), and UObject::serial.

Referenced by Character::repsys_on_damage().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void RepSystem::on_pc_helps_pc ( Character amy,
Character bob 
) [static, private]

[5] Player Helps Another Player When Amy Helps Bob These rules applied:

  • When Amy selects Bob with a Helpful target cursor
  • When Amy Heals Bob
  • When Amy clear's Bob's Poisoned flag
  • When Amy clear's Bob's Paralyzed flag

If PartyHelpFullCountsAsCriminal false and same party dont set If Bob is a Criminal, Set Amy Criminal

Definition at line 524 of file repsys.cpp.

References RepSys_Cfg::General, Character::is_criminal(), Party::is_member(), Character::make_criminal(), Character::party(), RepSys_Cfg::PartyHelpFullCountsAsCriminal, repsys_cfg, and UObject::serial.

Referenced by Character::repsys_on_help().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void RepSystem::repsys_task ( Character amy) [static, private]

[2] Timeouts When Any of Amy's Rep-system timers time out

If Amy's Criminal Timer has expired, Clear Amy's Criminal Timer

If Amy was Aggressor to Bob, but has timed out De-escalate[->7] Amy and Bob Update Bob to nearby clients

If Amy had Lawfully Damaged Bob, but has timed out De-escalate[->7] Amy and Bob Update Bob to nearby clients

If any of Amy's statuses changed, Update Amy to nearby clients

Definition at line 197 of file repsys.cpp.

References Character::aggressor_to_, Character::client, Character::criminal_until_, de_escalate(), earliest_timer(), ref_ptr< T >::get(), Character::is_innocent_to(), Character::lawfully_damaged_, Log(), Character::opponent_of, UObject::orphan(), polclock(), POLCLOCKS_PER_SEC, schedule_repsys_task(), send_create_mobile_to_nearby_cansee(), send_move(), THREAD_CHECKPOINT, and timer_expired().

Referenced by schedule_repsys_task().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void RepSystem::restart_crim_timer ( Character chr) [static, private]
void RepSystem::schedule_repsys_task ( Character chr,
polclock_t  runat 
) [static, private]
void RepSystem::show_repdata ( Client client,
Character mob 
) [static, private]

Internal Command: .i_repdata Show Reputation System Data for a Targetted Mobile Displays: Murderer status Criminal status and timeout LawfullyDamaged status and timeouts AggressorTo status and timeouts ToBeReportable list Reportable list RepSystem Task status

Definition at line 275 of file textcmd.cpp.

References Character::aggressor_to_, Character::criminal_until_, decint(), hexint(), Character::is_criminal(), Character::is_murderer(), Character::lawfully_damaged_, ScheduledTask::next_run_clock(), reportable_t::polclock, Character::reportable_, Character::repsys_task_, send_sysmessage(), reportable_t::serial, timeoutstr(), and Character::to_be_reportable_.

Referenced by show_repdata().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


Friends And Related Function Documentation

unsigned char Character::hilite_color_idx ( const Character seen_by) const [friend]
void Character::make_aggressor_to ( Character chr) [friend]
void Character::make_criminal ( int  level) [friend]
void Character::make_murderer ( bool  newval) [friend]
unsigned short Character::name_color ( const Character seen_by) const [friend]
void Character::repsys_on_attack ( Character defender) [friend]
void Character::repsys_on_damage ( Character defender) [friend]
void Character::repsys_on_help ( Character helper) [friend]
unsigned char NPC::hilite_color_idx ( const Character seen_by) const [friend]
unsigned short NPC::name_color ( const Character seen_by) const [friend]
void show_repdata ( Character looker,
Character mob 
) [friend]

Definition at line 329 of file textcmd.cpp.


The documentation for this class was generated from the following files: