1 #pragma once 2 #ifndef CATA_SRC_TALKER_NPC_H 3 #define CATA_SRC_TALKER_NPC_H 4 5 #include <iosfwd> 6 #include <vector> 7 8 #include "faction.h" 9 #include "npc.h" 10 #include "talker_character.h" 11 #include "type_id.h" 12 13 class Character; 14 class item; 15 class mission; 16 class player; 17 class talker; 18 19 /* 20 */ 21 class talker_npc : public talker_character 22 { 23 public: talker_npc(npc * new_me)24 explicit talker_npc( npc *new_me ): talker_character( new_me ), me_npc( new_me ) { 25 } 26 ~talker_npc() override = default; 27 get_npc()28 npc *get_npc() override { 29 return me_npc; 30 } get_npc()31 npc *get_npc() const override { 32 return me_npc; 33 } 34 35 // identity and location 36 std::string distance_to_goal() const override; 37 38 // mandatory functions for starting a dialogue 39 bool will_talk_to_u( const player &u, bool force ) override; 40 std::vector<std::string> get_topics( bool radio_contact ) override; 41 void check_missions() override; 42 void update_missions( const std::vector<mission *> &missions_assigned ) override; 43 bool check_hostile_response( int anger ) const override; 44 int parse_mod( const std::string &attribute, int factor ) const override; 45 int trial_chance_mod( const std::string &trial_type ) const override; 46 47 // stats, skills, traits, bionics, magic, and proficiencies 48 std::vector<skill_id> skills_offered_to( const talker &student ) const override; 49 std::string skill_training_text( const talker &, const skill_id & ) const override; 50 std::vector<proficiency_id> proficiencies_offered_to( const talker &student ) const override; 51 std::string proficiency_training_text( const talker &student, 52 const proficiency_id &proficiency ) const override; 53 std::vector<matype_id> styles_offered_to( const talker &student ) const override; 54 std::string style_training_text( const talker &, const matype_id & ) const override; 55 std::vector<spell_id> spells_offered_to( talker &student ) override; 56 std::string spell_training_text( talker &, const spell_id & ) override; 57 void store_chosen_training( const skill_id &c_skill, const matype_id &c_style, 58 const spell_id &c_spell, const proficiency_id &c_proficiency ) override; 59 60 // inventory, buying, and selling 61 void add_debt( int cost ) override; 62 int debt() const override; 63 int cash_to_favor( int value ) const override; 64 std::string give_item_to( bool to_use ) override; 65 bool buy_from( int amount ) override; 66 int value( const item &it ) const override; 67 68 // missions 69 std::vector<mission *> available_missions() const override; 70 std::vector<mission *> assigned_missions() const override; 71 mission *selected_mission() const override; 72 void select_mission( mission *selected ) override; 73 void add_mission( const mission_type_id &mission_id ) override; 74 void set_companion_mission( const std::string &role_id ) override; 75 76 // factions and alliances 77 void set_fac( const faction_id &new_fac_name ) override; 78 void add_faction_rep( int rep_change ) override; 79 bool is_following() const override; 80 bool is_friendly( const Character &guy ) const override; 81 bool is_enemy() const override; 82 bool is_player_ally() const override; 83 bool turned_hostile() const override; 84 void make_angry() override; 85 86 // ai rules 87 bool has_ai_rule( const std::string &type, const std::string &rule ) const override; 88 void toggle_ai_rule( const std::string &type, const std::string &rule ) override; 89 void set_ai_rule( const std::string &type, const std::string &rule ) override; 90 void clear_ai_rule( const std::string &type, const std::string &rule ) override; 91 92 // other descriptors 93 std::string get_job_description() const override; 94 std::string evaluation_by( const talker &alpha ) const override; 95 bool has_activity() const override; 96 bool is_myclass( const npc_class_id &class_to_check ) const override; 97 void set_class( const npc_class_id &new_class ) override; 98 99 // speaking 100 void say( const std::string &speech ) override; 101 102 // miscellaneous 103 std::string opinion_text() const override; 104 void add_opinion( int trust, int fear, int value, int anger, int debt ) override; 105 bool enslave_mind() override; 106 void set_first_topic( const std::string &chat_topic ) override; 107 bool is_safe() const override; 108 109 protected: 110 npc *me_npc; 111 }; 112 #endif // CATA_SRC_TALKER_NPC_H 113