diff --git a/data/json/npcs/TALK_COMMON_ALLY.json b/data/json/npcs/TALK_COMMON_ALLY.json index 38c0a5a61cd1f..a86055ea095f7 100644 --- a/data/json/npcs/TALK_COMMON_ALLY.json +++ b/data/json/npcs/TALK_COMMON_ALLY.json @@ -122,6 +122,7 @@ { "npc_need": "hunger", "amount": 160 }, { "npc_need": "fatigue", "level": "TIRED" }, { "npc_has_effect": "asked_to_train" }, + { "npc_has_trait": "HALLUCINATION" }, "u_driving", "npc_driving" ] @@ -132,7 +133,7 @@ }, { "text": "Can you host a training seminar?", - "condition": { "not": "is_by_radio" }, + "condition": { "and": [ { "not": "is_by_radio" }, { "not": { "npc_has_trait": "HALLUCINATION" } } ] }, "trial": { "type": "CONDITION", "condition": { @@ -156,7 +157,8 @@ { "not": "u_driving" }, { "not": "npc_driving" }, { "not": "is_by_radio" }, - { "not": { "u_has_effect": "asked_to_train" } } + { "not": { "u_has_effect": "asked_to_train" } }, + { "not": { "npc_has_trait": "HALLUCINATION" } } ] }, "topic": "TALK_TRAIN_NPC" @@ -202,7 +204,7 @@ }, { "text": "Drop off any items you're not using.", - "condition": { "not": "is_by_radio" }, + "condition": { "and": [ { "not": "is_by_radio" }, { "not": { "npc_has_trait": "HALLUCINATION" } } ] }, "topic": "TALK_DONE", "effect": "drop_items_in_place" }, diff --git a/src/game.cpp b/src/game.cpp index 1fecd3bd2a4bc..7ace1bbe798c4 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -160,6 +160,7 @@ #include "string_input_popup.h" #include "submap.h" #include "talker.h" +#include "text_snippets.h" #include "tileray.h" #include "timed_event.h" #include "translations.h" @@ -5277,7 +5278,12 @@ bool game::npc_menu( npc &who ) } else if( choice == steal && query_yn( _( "You may be attacked! Proceed?" ) ) ) { u.steal( who ); } else if( choice == trade ) { - npc_trading::trade( who, 0, _( "Trade" ) ); + if( who.is_hallucination() ) { + who.say( SNIPPET.random_from_category( "" ).value_or( + translation() ).translated() ); + } else { + npc_trading::trade( who, 0, _( "Trade" ) ); + } } return true; diff --git a/src/melee.cpp b/src/melee.cpp index 2799ff9421517..fed1ea2be8eb4 100644 --- a/src/melee.cpp +++ b/src/melee.cpp @@ -2839,7 +2839,7 @@ void avatar::steal( npc &target ) int their_roll = dice( 5, target.get_per() ); const item *it = loc.get_item(); - if( my_roll >= their_roll ) { + if( my_roll >= their_roll && !target.is_hallucination() ) { add_msg( _( "You sneakily steal %1$s from %2$s!" ), it->tname(), target.get_name() ); i_add( target.i_rem( it ) ); diff --git a/src/npcmove.cpp b/src/npcmove.cpp index fe5af77d66a2c..dd9d0eb8bbb8b 100644 --- a/src/npcmove.cpp +++ b/src/npcmove.cpp @@ -2241,7 +2241,8 @@ bool npc::update_path( const tripoint &p, const bool no_bashing, bool force ) bool npc::can_open_door( const tripoint &p, const bool inside ) const { - return !rules.has_flag( ally_rule::avoid_doors ) && get_map().open_door( p, inside, true ); + return !is_hallucination() && !rules.has_flag( ally_rule::avoid_doors ) && + get_map().open_door( p, inside, true ); } bool npc::can_move_to( const tripoint &p, bool no_bashing ) const