Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign up[CR]Giving NPCs mutagens, meds, food etc. #14654
Conversation
Coolthulhu
added some commits
Dec 27, 2015
Coolthulhu
changed the title
[WiP][CR]Giving NPCs mutagens and meds
[CR]Giving NPCs mutagens, meds, food etc.
Dec 29, 2015
This comment has been minimized.
This comment has been minimized.
|
Awesome, can not wait for this. It should make my npcs look pretty awesome, with their new bat wings and lizard skin and such. |
Coolthulhu
added some commits
Jan 7, 2016
This comment has been minimized.
This comment has been minimized.
Core0verload
commented
Jan 10, 2016
|
Why isn't it merged yet? |
kevingranade
reviewed
Jan 10, 2016
| // Players can abuse the crafting menu instead... | ||
| if( !it->has_flag( "HIDDEN_POISON" ) && | ||
| ( p->is_npc() || | ||
| !p->query_yn( _("Are you sure you want to eat this? It looks poisonous...") ) ) ) { |
This comment has been minimized.
This comment has been minimized.
kevingranade
Jan 10, 2016
Member
It specifically does not look poisonous, and the existence of a crafting menu exploit to test for it doesn't mean we should just nerf the feature into pointlessness.
This comment has been minimized.
This comment has been minimized.
kevingranade
Jan 10, 2016
Member
I'm reading that backwards, it prompts if it's known to be poisonous.
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jan 10, 2016
Author
Contributor
The exploit isn't very exploity here:
If the NPC doesn't want it, it is poisonous. But if the NPC wants it, you no longer have a shroom - the NPC won't tell you "I could eat it but I'm full", it's always either just eat or refuse.
Plus, having to haul around a NPC just to smell the shrooms (that stop hiding their status at 3 survival) makes the requirements for using it a bit too steep for it to appear in any exploit guide. Shrooms don't even spawn in considerable numbers until autumn.
kevingranade
reviewed
Jan 10, 2016
| @@ -1073,7 +1104,10 @@ static int marloss_reject_mutagen( player *p, item *it ) | |||
| return 0; | |||
| } | |||
| if (p->has_trait("THRESH_MARLOSS")) { | |||
| p->add_msg_if_player(m_warning, _("The %s burns white-hot inside you, and you collapse to the ground!"), it->tname().c_str()); | |||
| p->add_msg_if_player( m_warning, | |||
This comment has been minimized.
This comment has been minimized.
kevingranade
Jan 10, 2016
Member
Are we making a hard assumption here that the only thing causing NPCs to consume this is the player giving it to them? If not this needs to check that the NPC is visible.
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jan 10, 2016
Author
Contributor
Currently yes.
Although I just noticed that this line (and few similar ones) is wrong anyway: that add_msg_if_player should be add_msg_player_or_npc.
kevingranade
reviewed
Jan 10, 2016
| @@ -3072,6 +3146,8 @@ int iuse::noise_emitter_on(player *p, item *it, bool t, const tripoint &pos) | |||
|
|
|||
| int iuse::ma_manual(player *p, item *it, bool, const tripoint& ) | |||
| { | |||
| // [CR] - should NPCs just be allowed to learn this stuff? Just like that? | |||
This comment has been minimized.
This comment has been minimized.
kevingranade
Jan 10, 2016
Member
Same as players, I'd like to change it to a slow process of learning a style, so just getting the book wouldn't make you go, "I know kung-fu". But that's obviously future stuff, right now you just read it and bam, bruce lee.
This comment has been minimized.
This comment has been minimized.
Rivet-the-Zombie
Jan 11, 2016
Member
On that note, maybe we could stretch it out by requiring you to read the book for a variable duration of time, similar to leveling a skill via book.
Coolthulhu commentedDec 28, 2015
As in title.
This required some extra changes:
add_msg_or_saymethod toCreature. It prints a message for player, but for NPCs it makes them say the relevant message. For example, giving NPC cannabis will result in them commenting "I need a smoking device and a source of flame to consume cannabis!".[CR] mostly because of one hack that I made here:
I created a
character::query_ynmethod that is supposed to hide the existingquery_ynfunction.For
playerclass, it invokes the regularquery_yn, fornpcis simply returnsfalse, because if it needs to be asked for, NPCs don't want it. Later on it can be replaced with a more proper branch, where NPCs can figure out that they might actually like it (for example, NPCs forcing themselves to overeat).Is that
query_ynthing OK? Or should I rename it and search+replace where possible?