Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CR]Giving NPCs mutagens, meds, food etc. #14654

Merged
merged 13 commits into from Jan 14, 2016

Conversation

Projects
None yet
5 participants
@Coolthulhu
Copy link
Contributor

commented Dec 28, 2015

As in title.

This required some extra changes:

  • Made mutation code a bit NPC-aware. For now all newly gained mutations are listed, later on they will probably be filtered by visibility. But that's when the player gets to identify mutants on sight (rather than through "Tell me more about yourself", "Oh you know, I'm a huge, deformed, sapiovorous bear-man with tentacle arms").
  • NPC give command is now treated as "use now or refuse" rather than "use, keep or refuse". The other command ("hold on to") is for keeping stuff.
  • NPCs can be given food now. But that's WiP because they can't tell what's food and what's poison.
  • NPCs can be given drugs now, but they need all the tools and don't check for dangerous effects. WiP because they won't tell you they need a syringe to shoot up heroin.
  • Added a add_msg_or_say method to Creature. 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_yn method that is supposed to hide the existing query_yn function.
For player class, it invokes the regular query_yn, for npc is simply returns false, 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_yn thing OK? Or should I rename it and search+replace where possible?

@Coolthulhu Coolthulhu changed the title [WiP][CR]Giving NPCs mutagens and meds [CR]Giving NPCs mutagens, meds, food etc. Dec 29, 2015

@Chezzo

This comment has been minimized.

Copy link
Contributor

commented Dec 29, 2015

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

Merge branch 'master' into mutation-npc
Conflicts:
	src/iuse.cpp
@Core0verload

This comment has been minimized.

Copy link

commented Jan 10, 2016

Why isn't it merged yet?

// 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.

Copy link
@kevingranade

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.

Copy link
@kevingranade

kevingranade Jan 10, 2016

Member

I'm reading that backwards, it prompts if it's known to be poisonous.

This comment has been minimized.

Copy link
@Coolthulhu

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.

@@ -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.

Copy link
@kevingranade

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.

Copy link
@Coolthulhu

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.

@@ -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.

Copy link
@kevingranade

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.

Copy link
@Rivet-the-Zombie

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.

This comment has been minimized.

Copy link
@kevingranade

kevingranade via email Jan 11, 2016

Member

@kevingranade kevingranade merged commit 22b2e3f into CleverRaven:master Jan 14, 2016

1 check passed

default
Details

@Coolthulhu Coolthulhu deleted the cataclysmbnteam:mutation-npc branch Feb 23, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.