Pol  Revision:cb584c9
Pol::Core::RepSystem Class Reference

#include <repsys.h>

Static Private Member Functions

static void de_escalate (Mobile::Character *amy, Mobile::Character *bob)
 [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 More...
 
static unsigned char hilite_color_idx (const Mobile::Character *chr, const Mobile::Character *who)
 [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) More...
 
static unsigned short name_color (const Mobile::Character *seen_by, const Mobile::Character *who)
 
static void on_pc_attacks_pc (Mobile::Character *attacker, Mobile::Character *defender)
 [3] Player attacks another Player When Amy attacks Bob These rules are applied: More...
 
static void on_pc_damages_pc (Mobile::Character *attacker, Mobile::Character *defender)
 [4] Player Damages Player When Amy damages Bob These rules applied: More...
 
static void on_pc_helps_pc (Mobile::Character *helper, Mobile::Character *helped)
 [5] Player Helps Another Player When Amy Helps Bob These rules applied: More...
 
static void repsys_task (Mobile::Character *chr)
 [2] Timeouts When Any of Amy's Rep-system timers time out More...
 
static void restart_crim_timer (Mobile::Character *chr)
 
static void schedule_repsys_task (Mobile::Character *chr, polclock_t runat)
 
static void show_repdata (Network::Client *client, Mobile::Character *mob)
 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. More...
 

Friends

class Mobile::Character
 
class Mobile::NPC
 
void show_repdata (Mobile::Character *looker, Mobile::Character *mob)
 

Detailed Description

Definition at line 25 of file repsys.h.

Member Function Documentation

void Pol::Core::RepSystem::de_escalate ( Mobile::Character amy,
Mobile::Character bob 
)
staticprivate

[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 533 of file repsys.cpp.

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

Referenced by repsys_task().

unsigned char Pol::Core::RepSystem::hilite_color_idx ( const Mobile::Character chr,
const Mobile::Character who 
)
staticprivate

[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 559 of file repsys.cpp.

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

Referenced by Pol::Mobile::NPC::hilite_color_idx(), and Pol::Mobile::Character::hilite_color_idx().

void Pol::Core::RepSystem::on_pc_attacks_pc ( Mobile::Character amy_attacker,
Mobile::Character bob_defender 
)
staticprivate

[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 408 of file repsys.cpp.

References Pol::Core::RepSys_Cfg::AggressorFlagTimeout, Pol::Mobile::Character::client, Pol::Core::SettingsManager::combat_config, Pol::Core::RepSys_Cfg::CriminalFlagInterval, Pol::Core::earliest_timer(), Pol::Core::RepSys_Cfg::General, Pol::Mobile::Character::is_aggressor_to(), Pol::Mobile::Character::is_criminal(), Pol::Mobile::Character::is_innocent_to(), Pol::Core::RepSys_Cfg::Murderer, Pol::Core::UObject::name(), Pol::Core::RepSys_Cfg::NameColoring, Pol::Core::polclock(), Pol::Core::POLCLOCKS_PER_SEC, Pol::Core::private_say_above_ex(), Pol::Core::SettingsManager::repsys_cfg, Pol::Mobile::Character::restart_aggressor_timer(), Pol::Mobile::Character::restart_criminal_timer(), schedule_repsys_task(), Pol::Core::CombatConfig::send_attack_msg, Pol::Core::send_create_mobile_to_nearby_cansee(), Pol::Core::send_move(), and Pol::Core::settingsManager.

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

void Pol::Core::RepSystem::on_pc_damages_pc ( Mobile::Character amy,
Mobile::Character bob 
)
staticprivate

[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 479 of file repsys.cpp.

References Pol::Mobile::Character::add_to_be_reportable(), Pol::Core::RepSys_Cfg::AggressorFlagTimeout, Pol::Core::RepSys_Cfg::General, Pol::Mobile::Character::is_innocent_to(), on_pc_attacks_pc(), Pol::Core::polclock(), Pol::Core::POLCLOCKS_PER_SEC, Pol::Core::SettingsManager::repsys_cfg, Pol::Mobile::Character::restart_lawfully_damaged_timer(), schedule_repsys_task(), Pol::Core::ULWObject::serial, and Pol::Core::settingsManager.

Referenced by Pol::Mobile::Character::repsys_on_damage().

void Pol::Core::RepSystem::on_pc_helps_pc ( Mobile::Character amy,
Mobile::Character bob 
)
staticprivate

[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 513 of file repsys.cpp.

References Pol::Core::RepSys_Cfg::General, Pol::Mobile::Character::is_criminal(), Pol::Core::Party::is_member(), Pol::Mobile::Character::make_criminal(), Pol::Core::RepSys_Cfg::PartyHelpFullCountsAsCriminal, Pol::Core::SettingsManager::repsys_cfg, Pol::Core::ULWObject::serial, and Pol::Core::settingsManager.

Referenced by Pol::Mobile::Character::repsys_on_help().

void Pol::Core::RepSystem::repsys_task ( Mobile::Character amy)
staticprivate

[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 185 of file repsys.cpp.

References Pol::Mobile::Character::aggressor_to_, Pol::Mobile::Character::client, Pol::Mobile::Character::criminal_until_, de_escalate(), Pol::Core::earliest_timer(), Pol::Mobile::Character::is_innocent_to(), Pol::Mobile::Character::lawfully_damaged_, Pol::Mobile::Character::opponent_of, Pol::Core::ULWObject::orphan(), Pol::Core::polclock(), Pol::Core::POLCLOCKS_PER_SEC, POLLOG, schedule_repsys_task(), Pol::Core::send_create_mobile_to_nearby_cansee(), Pol::Core::send_move(), THREAD_CHECKPOINT, and Pol::Core::timer_expired().

Referenced by schedule_repsys_task().

static void Pol::Core::RepSystem::restart_crim_timer ( Mobile::Character chr)
staticprivate
void Pol::Core::RepSystem::show_repdata ( Network::Client client,
Mobile::Character mob 
)
staticprivate

Friends And Related Function Documentation

friend class Mobile::Character
friend

Definition at line 28 of file repsys.h.

friend class Mobile::NPC
friend

Definition at line 27 of file repsys.h.

void show_repdata ( Mobile::Character looker,
Mobile::Character mob 
)
friend

Definition at line 306 of file textcmd.cpp.


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