-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[RDY] Bionics installing overhaul #22877
[RDY] Bionics installing overhaul #22877
Conversation
Ideas for spawning: -A custom room in labs, similar to the armories and holding cells. Frequently |
I can see two major options for installation chance (you essentially have added the first option):
@John-Candlebury covered spawn locations pretty well 👍 I'd like to eventually have anesthesia, surgical tools, bandages, suturing material, etc be consumables for this, but we can get it working first and add those things later. Just getting installation working first is a great approach, it's by far the most common operation. In particular we don't want to remove the manual operations until this works pretty much perfectly. inb4 "what about innawoods characters". Your options will eventually be NPC surgeon or an autodoc (or a mod, sure do whatever in a mod), so innawoods characters with NPCs disabled will be unable to access CBMs, and that's fine. |
Also filled the room with lockers and racks
Added autodoc spawn at the previously empty hospital room, also filled it with lockers and racks. |
For now autodoc spawns at the hospital and is working almost fully right (installing bionics still requires painkillers despite autodoc injects anesthesia) for the first step of the overhaul, so I think the PR is ready for the review. |
src/iexamine.cpp
Outdated
|
||
uimenu amenu; | ||
amenu.selected = 0; | ||
amenu.text = string_format( _( "Autodoc Mk. XI. Status: %s. Please choose operation." ), status ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
. Please
Double whitespace required here.
src/iexamine.cpp
Outdated
amenu.selected = 0; | ||
amenu.text = string_format( _( "Autodoc Mk. XI. Status: %s. Please choose operation." ), status ); | ||
amenu.addentry( CONFIGURE, true, 'c', str_to_illiterate_str( _( "Configure Autodoc." ) ) ); | ||
amenu.addentry( INSTALL_CBM, uistate.iexamine_autodoc_config ? true : false, 'i', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uistate.iexamine_autodoc_config ? true : false
can be effectively shorten to just uistate.iexamine_autodoc_config
since it's already a boolean variable.
src/iexamine.cpp
Outdated
|
||
case INSTALL_CBM: { | ||
if( !adjacent_couch ) { | ||
popup( _( "No connected couches found. Operation impossible. Exiting." ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double whitespaces after periods required.
src/iexamine.cpp
Outdated
return; | ||
} | ||
if( !in_position ) { | ||
popup( _( "No patient found located on the connected couches. Operation impossible. Exiting." ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here as well.
src/iexamine.cpp
Outdated
bool adjacent_couch = false; | ||
bool in_position = false; | ||
for( const auto &couch_loc : g->m.points_in_radius( examp, 1, 0 ) ) { | ||
if( g->m.furn( couch_loc ).obj().id == "f_autodoc_couch" ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to get the furn_t
object to get its id. map::furn
returns an id that you can compare directly. I suggest you store "f_autodoc_couch" as local constant of type furn_str_id
and compare it to the result of map::furn
.
src/iexamine.cpp
Outdated
} | ||
|
||
const int bionic = g->inv_for_flag( "CBM", _( "Choose CBM to install" ) ); | ||
const item &it = p.i_at( bionic ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two references it
and itemtype
are only needed below the if
block, create them there (right before they are needed).
src/iexamine.cpp
Outdated
|
||
switch( static_cast<options>( amenu.ret ) ) { | ||
case CONFIGURE: | ||
uistate.iexamine_autodoc_config = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a global variable, setting it will affect all couches all over the world. It's also not saved anywhere, so it's reset whenever the player loads a game.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a global variable, setting it will affect all couches all over the world.
Can you recommend something to achieve the desired goal, but only for the couch player interacts with?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prob you need two furnitures: f_autodoc_unconfigured, f_autodoc_configured.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not add another furniture. Anybody know, if there is a way to add flags to furniture during runtime?
There is not, that's why there are furniture variants for things like open
door vs closed door.
Your best bet is to drop an item with your state on the same square.
…On Tue, Feb 27, 2018, 9:40 PM Anton Burmistrov ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/iexamine.cpp
<#22877 (comment)>
:
> + amenu.query();
+
+ bool adjacent_couch = false;
+ bool in_position = false;
+ for( const auto &couch_loc : g->m.points_in_radius( examp, 1, 0 ) ) {
+ if( g->m.furn( couch_loc ).obj().id == "f_autodoc_couch" ) {
+ adjacent_couch = true;
+ if( p.pos() == couch_loc ) {
+ in_position = true;
+ }
+ }
+ }
+
+ switch( static_cast<options>( amenu.ret ) ) {
+ case CONFIGURE:
+ uistate.iexamine_autodoc_config = true;
I'd rather not add another furniture. Anybody know, if there is a way to
add flags to furniture during runtime?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#22877 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA0gdKSA65l3SNka8kXxVBGMWM9JE2Hsks5tZOa8gaJpZM4R4suj>
.
|
It will secretly contain `autodoc_config` pseudo item if the player configures the autodoc
…fter player has configured it
After player configures the autodoc, the game places pseudo item |
We don't currently have the infrastructure to store data for a specific place on the map. It's currently solved by having various terrain types (see for example open/closed doors, filled/unfilled kiln). However, why does the autodoc need to be configure? According to the code, it does nothing, just consumes 3 turns time. This could be done automatically as part of the operation itself. In other words: why are configuration and operation separate steps? |
Well, there's no certain reason. The configuration step is for flavor mostly. I just thought that this will help players feel that they're involved in the process. Should I remove the separate configuration step? |
Yes remove it. This sounds more complicated than its worth. |
I think the quantity of text is fine, but I'd probably expect the "Using your knowledge..." text first in that list |
That is because the game first checks if player confirms the installation, and then prints text about knowledge and so on. |
Also removed separate blind effect to simulate sleeping
Moved message about configuring to popup from message in the side log - looks better imo. |
The |
If the quantity of text is an issue, can be shortened:
|
The "knowledge" part is important, I think it can help players understand that their skills are playing a role in success chance. |
Was reading through the open PRs out of curiosity but I had a thought on this if it's still getting worked on: Have the Autodoc "run" the installation program from an SD card just like a CNC machine or 3d printer would. (part of iexamine method) The player could find cards with the "official installation program" from the factory or use a laptop or console to encode cards themselves. The official factory made onse would result in near zero failure chance while the outcome of player made ones would be subject to the usual int and skill levels. Requiring a certain level of computers to write the program and/or having it affect the outcomes would be probably be called for in this case. I'm not familiar with how items are tracked but, given things decay, it should be possible to encode int and relevant skill levels at time of creation. If not, a rather lengthy copy pasted json file would do the trick. |
Using pre-written programs for bionics installation saved on SD cards I consider as next step in this overhaul. At first I just want to make installation work with no errors. |
This could be changed to [RDY], right? |
Two suggestions for subsequent PRs:
|
Added an alternative for manual and instant installing of CBM. Now you can use autodoc for this task.
Autodoc need to be configured prior to use;Power Storage
with difficulty 1) will take twenty minutes to install;Minor:
[CR] because I want to know if this approach is good enough.
Questions:
Right now autodoc isn't spawned anywhere. Where should it spawn, and how frequent?anesthesia
item, spawn it somewhere, and require to bring it to autodoc? Or we can abstract it like autodoc has it (unlimited?) somewhere in inner storage?