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[DONE] Commune I #12347
Conversation
acidia
added some commits
May 11, 2015
BevapDin
reviewed
May 11, 2015
| void talk_function::buy_beer(npc *p) | ||
| { | ||
| item cont = item("bottle_glass", 0, false); | ||
| item liq = item("beer", 0); |
This comment has been minimized.
This comment has been minimized.
BevapDin
May 11, 2015
Contributor
You could use liq = liq.in_its_container(); here to put the liquid into its default container. liq will become a bottle with beer or so. The container item is taken from the item data of the liquid and it's automatically filled to the brim (the charges of the liquid are adjusted to match the container size).
This allows you to completely remove the cont item, the charge setting and the call to handle_liquid (which creates the message you complained about).
This comment has been minimized.
This comment has been minimized.
acidia
May 11, 2015
Author
Contributor
Hmmm... that doesn't really solve the problem for most of the drinks though. Without glasses, giving you a single shot in a glass bottle is about the best approximation I can think of. I had already traced out the message but I wasn't sure how I wanted to handle it so I just left it for now.
This comment has been minimized.
This comment has been minimized.
BevapDin
May 11, 2015
Contributor
I'm not sure what you need more (approximation of what?). If you need to set the charges of the liquid, just do it after it has been put into the container (or put it there manually):
item cont( "bottle", 0 );
cont.put_in( liq( "beer", 0 ) );
cont.content[0].charges = 10;
g->u.i_add( cont );
// Or set the charges before:
item liq( "beer", 0 );
item cont( "bottle", 0 );
liq.charges = 10;
cont.put_in( beer );
g->u.i_add( cont );
// You can use the contents vector direcly instead of put_in:
item cont( "bottle", 0 );
cont.contents.push_back( liq( "beer", 0 ) );
cont.content[0].charges = 10;
g->u.i_add( cont );Anything to avoid handle_liquid. That function is used to allow the player to choose the target container. Putting things into a container is not its purpose. You can put things direcly into the item using the item class.
If you want to avoid giving the player a free bottle, just call move_liquid and check the remaining charges (used that way in player::siphon, for example):
item liq( "beer", 0 );
const long default_charges = 10
liq.charges = default_charges;
const int remain = g->move_liquid( liq );
if( remain <= -1 ) {
// canceled, nothing has been used.
return;
}
const long used_charges = default_charges - remain;
// Note: used_charges may be 0, but that's fine here.
g->u.cash -= used_charges * price;You can check for enough container space with player::has_container_for (the crafting code does this).
This comment has been minimized.
This comment has been minimized.
acidia
May 12, 2015
Author
Contributor
Looks like put_in is all I actually needed. I tried in_its_container but that defaults to cans instead of bottles.
This comment has been minimized.
This comment has been minimized.
|
Woo! |
acidia
added some commits
May 12, 2015
acidia
added some commits
May 17, 2015
kevingranade
reviewed
May 18, 2015
| site = target_om_ter_random("ranch_camp_56", 1, miss, false); | ||
| bay.load(site.x * 2, site.y * 2, site.z, false); | ||
| bay.translate(t_underbrush, t_dirt); | ||
| bay.add_vehicle("hippie_van", 13, 20, 270); |
This comment has been minimized.
This comment has been minimized.
kevingranade
May 18, 2015
Member
calls to add_vehicle that supply a literal string need to look like this now:
bay.add_vehicle( vproto_id("hippie_van"), 13, 20, 270);
kevingranade
reviewed
May 18, 2015
| @@ -128,6 +128,9 @@ void game::init_morale() | |||
| //~ You really don't like wearing the Uncomfy Gear | |||
| _("Uncomfy Gear"), | |||
| _("Found kitten <3") | |||
This comment has been minimized.
This comment has been minimized.
Rivet-the-Zombie
reviewed
May 18, 2015
| return _("Can I interest you in a trim?"); | ||
|
|
||
| } else if( topic == "TALK_RANCH_BARBER_JOB" ) { | ||
| return _("What? I'm a barber... I cut hair. There's demand for cheap cuts and a shave out here."); |
This comment has been minimized.
This comment has been minimized.
Rivet-the-Zombie
May 18, 2015
Member
I've had a laughing fit over this one, imagining my character hoisting her hairy leg up onto the counter and saying, "Give me a shave, my good man."
This comment has been minimized.
This comment has been minimized.
|
Awesome content as I've come to expect, I'm super excited about the direction you're going with this one. |
This comment has been minimized.
This comment has been minimized.
|
Also tried to hire the Lumberjack to deliver some wood, but the dialog went straight to "The rate is a bit steep...", which I think is supposed to be the "never mind" dialog option. |
This comment has been minimized.
This comment has been minimized.
|
The well mission keeps asking for "stone", but the item they want is "rock", could be confusing. |
This comment has been minimized.
This comment has been minimized.
|
Once the palisade is up, you need to leave the perimeter to go from the garage to the barn, is that intended? |
kevingranade
reviewed
May 18, 2015
| if( state == "TALK_MISSION_DESCRIBE" ) { | ||
| return _("We need help..."); | ||
| } else if( state == "TALK_MISSION_OFFER" ) { | ||
| return _("Clothing that can withstand the wear and tare of climbing through windows and fighting back " |
This comment has been minimized.
This comment has been minimized.
acidia
added some commits
May 18, 2015
This comment has been minimized.
This comment has been minimized.
|
-Ok, so the barn does have a door on the East side that can be accessed by going around back of the garage and down. I don't remember which stalls have people in them but I could push it up one or two in the future. I've got the first few companion missions in game but I'm stuck on an error thrown when deserializing an NPC and adding it back to the list... seems to want to cast it as a player and throw a bunch of errors associated with morale_point??? I'll post it in pt 2 when this goes through. |
This comment has been minimized.
This comment has been minimized.
|
" I'll post it in pt 2 when this goes through." So are you creating another pull request for merge, or coming back to this one? As of now, it shows as unmergeable. I've been looking forward to this getting merged, but it seems to be in limbo for now. |
This comment has been minimized.
This comment has been minimized.
|
Good question, I was standing by to hear what the plan was. I can resolve the merge errors (hopefully) but unless someone is planning on merging it then it will be unmergeable shortly simply due to the number of files that it alters. |
This comment has been minimized.
This comment has been minimized.
|
Plz merge ASAP and then @acidia can just make a second PR. |
This comment has been minimized.
This comment has been minimized.
|
Sorry about that, had no free time recently. |
kevingranade
self-assigned this
May 24, 2015
kevingranade
merged commit 8c2d1d6
into
CleverRaven:master
May 24, 2015
1 check passed
This comment has been minimized.
This comment has been minimized.
|
Sees merge. Squees! |
This comment has been minimized.
This comment has been minimized.
|
Wooo, part II will be up shortly! |
This comment has been minimized.
This comment has been minimized.
Sirbab
commented
May 25, 2015
|
I see your squee, and raise you one. That being said, would it be safe to start a new game with the current part 1 Build, or would you recommend waiting for part 2? |
This comment has been minimized.
This comment has been minimized.
|
There shouldn't be any issues. NPCs will have weapons that actually match their skills in part 2, but that is the only major existing bug that I fixed so far. The content is accessed through chat topics that will update automatically once part 2 lands. These commune missions definitely start having a stronger RPG feel to them... so don't expect to knock out all of the missions quickly. By the time the average player hits the last mission they will have spent a number of hours getting there... I'll try and avoid having people restart the commune at all cost. |
acidia commentedMay 11, 2015
You can see old pictures in the forum post: http://smf.cataclysmdda.com/index.php?topic=9968.30
Due to the reformatting of all the mission and npc dialogue structures I had to cut the agricultural supervisor missions till later. I also pulled the special companion missions menu (trade run, patrol, scavenge, plant/harvest crops) till I can actually get it working without using z-10 to store people.
To find it, just follow the merchant missions in the refugee center... the third mission is now to retrieve a prospectus from the outpost (before this, the ranch is empty).
I also fixed the bug that prevented NPCs from receiving their misc. items... so NPCs and shopkeepers will be loaded with items once again.
Known issues to be fixed in later additions...
-The map updating can be very slow between missions... the search range didn't seem to work so it is currently searching the entire map for a tile that is 3 blocks away
-The nurse will currently perform first aid on smashed limbs on you and your companions (will be moved to doctor)
-The commune name isn't randomized
-The doctor is more of a place holder till his talk options are added.