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] Unscrewable vehicle parts #14840

Merged
merged 5 commits into from Jan 16, 2016

Conversation

Projects
None yet
@Core0verload
Copy link

commented Jan 13, 2016

This PR adds a new car part flag: TOOL_SCREWDRIVER. Parts with this flag use screwdriver for attachment and removal. Screwdriver can be replaced with duct tape for attachment and with hacksaw/cutting torch for removal. This flag is intended to be used with electronics and other small parts. This flag is added to:

  • Lights, all types including floodlights, aisle lights, atomic lights and red/blue emergency lights
  • Horns, all types including back-up beeper and chimes
  • Seatbelts and curtains
  • Mirrors, cameras and camera screens
  • Box and bike wire basket
  • Small electric motor, door motor, motorbike alternator and medium storage battery (small one uses no tools)
  • Water purifier and water funnel
  • Other electronics: clock, stereo, recharger and tracker

Flag TOOL_WRENCH was changed a bit. Wrench now can be replaced with hacksaw for removal and with duct tape for attachment, just like with TOOL_SCREWDRIVER. Yes, I really like having a lot of options. This flag is added to:

  • All doors, hatches and tables
  • All seats except the military one
  • All solar panels
  • Fridge, water faucet and all tool rigs (kitchen rig, welding rig, etc)
  • Foot pedals and saddle
  • Regular electric motor, 1-cylinder engine and all alternators (except motorbike alternator that uses screws)

Small changes in parts flags: KITCHEN no longer auto-includes FAUCET, CRAFTRIG no longer auto-includes WATER_PURIFIER. Kitchen rig still has water faucet, FOODCO still has purifier: I set them in JSON separately.

Water faucet was added to chem rig - water is useful in chemistry, it makes sense to have a faucet nearby.

Kitchen unit recipe was moved to ELECTRONIC from OTHER and was unified with other car rig recipes - it uses frame instead of pipes. All car rigs recipes can use welding torch as welder now.

The way vehicle checks for welding googles was changed. Hardcoded items check was replaced with check for glare protection 2 quality or Anti-glare compensators CBM. This quality was added to RM13 armor (only when powered) and all power armor helmets.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Jan 13, 2016

@Core0verload

This comment has been minimized.

Copy link
Author

commented Jan 14, 2016

Small electric motor is 1.5kg - similar to the ones used in kids cars if not smaller. I disassembled one of those and the motor there was attached with screws. I googled "motorbike alternator" and it looks like they use screws too: http://www.hawkshawmotorcycles.com/altonajstwin.JPG

@illi-kun

View changes

src/pickup.cpp Outdated
@@ -33,7 +33,7 @@ Pickup::interact_results Pickup::interact_with_vehicle( vehicle *veh, const trip
const bool has_kitchen = (veh->part_with_feature(veh_root_part, "KITCHEN") >= 0);
const bool has_faucet = (veh->part_with_feature(veh_root_part, "FAUCET") >= 0);
const bool has_weldrig = (veh->part_with_feature(veh_root_part, "WELDRIG") >= 0);
const bool has_craftrig = (veh->part_with_feature(veh_root_part, "CRAFTRIG") >= 0);
//const bool has_craftrig = (veh->part_with_feature(veh_root_part, "CRAFTRIG") >= 0);

This comment has been minimized.

Copy link
@illi-kun

illi-kun Jan 14, 2016

Member

don't keep commented out code - remove it instead.

@BevapDin

View changes

src/veh_interact.cpp Outdated
} else if (is_screwable){
werase (w_msg);
fold_and_print(w_msg, 0, 1, msg_width - 2, c_ltgray,
_("Needs <color_%1$s>%2$s</color>, a <color_%3$s>screwdriver</color> or <color_%5$s>duct tape</color> and level <color_%4$s>%5$d</color> skill in mechanics.%6$s%7$s%8$s"),

This comment has been minimized.

Copy link
@BevapDin

BevapDin Jan 14, 2016

Contributor

Something is not right with the numbers. The 9. argument is not used at all and the 5. is used twice.

This comment has been minimized.

Copy link
@illi-kun

illi-kun Jan 14, 2016

Member

I have some doubts about correctness of string order (%3$s, %5$s, %4$s). Can you double check that please?

@BevapDin

View changes

src/veh_interact.cpp Outdated
@@ -1096,6 +1112,13 @@ bool veh_interact::can_remove_part(int veh_part_index, int mech_skill, int msg_w
has_wrench ? "ltgreen" : "red",
has_skill ? "ltgreen" : "red",
skill_req);
} else if (is_screwable) {
fold_and_print(w_msg, 0, 1, msg_width - 2, c_ltgray,
_("You need a <color_%1$s>screwdriver</color> or <color_%2$s>hacksaw, cutting torch and welding goggles, or circular saw (off)</color> and <color_%2$s>level %3$d</color> mechanics skill to remove this part."),

This comment has been minimized.

Copy link
@BevapDin

BevapDin Jan 14, 2016

Contributor

Same here. The 2. argument is used twice, the 4. is not used at all.

@illi-kun

This comment has been minimized.

Copy link
Member

commented Jan 14, 2016

Please your newly introduced flag in doc/JSON_FLAGS.md.

@mugling

This comment has been minimized.

Copy link
Contributor

commented Jan 14, 2016

alternators are generally going to use bolts

IRL most certainly the case - you can't apply anywhere near as much torque to a screw as a bolt. Also from a gameplay perspective it's better to require a variety of tools

@@ -77,6 +77,7 @@ class veh_interact
int name_w;

vehicle *veh;
bool has_screwdriver;

This comment has been minimized.

Copy link
@mugling

mugling Jan 14, 2016

Contributor

Potentially beyond the scope of your PR but we could consider a more generic implementation specifying required tool qualities (eg. SCREWING 2, BOLT TURNING 1) rather than has_foo()

This comment has been minimized.

Copy link
@Core0verload

Core0verload Jan 14, 2016

Author

It checks for tool qualitiy SCREW 1, not for screwdriver item. See veh_interact.cpp.

This comment has been minimized.

Copy link
@kevingranade

kevingranade via email Jan 14, 2016

Member
@Rivet-the-Zombie

This comment has been minimized.

Copy link
Member

commented Jan 14, 2016

A number of these things should require bolt turning in addition to screw turning - pretty much anything big that goes under the hood in particular.

Motors and alternators are generally going to use bolts rather than screws, aren't they?

I googled "motorbike alternator" and it looks like they use screws too

Automotive alternators (and other components) use lots of big bolts in addition to screws.

@chaosvolt

This comment has been minimized.

Copy link
Contributor

commented Jan 14, 2016

Hmm. Is there a sane reason that the kitchen unit is having its faucet removed? I thought the idea was that it included the kitchen sink, not everything but the kitchen sink. XP

Though since sinks are ubiquitous and serve no purpose besides being a source of ceramic and faucets, I GUESS I can understand the gameplay reasoning behind forcing players to add a faucet. That said, I can't see any realism argument that would explain this decision. >.>

@Malkeus

This comment has been minimized.

Copy link
Contributor

commented Jan 14, 2016

@chaosvolt I initially had the same thought, but if you look again, he added it to the vehicle part and removed it from the flag

@chaosvolt

This comment has been minimized.

Copy link
Contributor

commented Jan 14, 2016

...wait what? I'm gonna have to check that. o.O

@chaosvolt

This comment has been minimized.

Copy link
Contributor

commented Jan 14, 2016

Okay, I'm having one of that "what the fuck" moments. The kitchen unit didn't have the faucet flag to begin with? What, was it a hardcoded redundancy in the kitchen unit's signature flag?

@SeanMirrsen

This comment has been minimized.

Copy link
Contributor

commented Jan 14, 2016

Okay, I'm having one of that "what the fuck" moments. The kitchen unit didn't have the faucet flag to begin with? What, was it a hardcoded redundancy in the kitchen unit's signature flag?

Apparently, yes.

@chaosvolt

This comment has been minimized.

Copy link
Contributor

commented Jan 14, 2016

Hmm. What came first, the kitchen unit or the vehicle faucet? Either way, my derp senses are tingling. That strongly implies that someone went through the time and effort to add support for a faucet flag, independent of the kitchen's functionality, and then failed to utilize it sanely.

Sounds like something I would be stupid enough to do. XP

@Core0verload

This comment has been minimized.

Copy link
Author

commented Jan 14, 2016

The kitchen unit didn't have the faucet flag to begin with? What, was it a hardcoded redundancy in the kitchen unit's signature flag?

Yes.

Automotive alternators (and other components) use lots of big bolts in addition to screws.

I only changed motorbike alternator to screws. Bigger ones (car, truck) still use welder for attachment. They would be changed to bolts soon.

@SeanMirrsen

This comment has been minimized.

Copy link
Contributor

commented Jan 14, 2016

Yay, screws and bolts! :D
Would actually adding screws and bolts as an expendable (but widely available, a-la nails) resource be too much to ask?

@Core0verload

This comment has been minimized.

Copy link
Author

commented Jan 14, 2016

Adding them as a resource needed to screw/bolt anything is easy. Adding them to every recipe and all the furniture would be a lot harder.

@@ -5157,7 +5160,7 @@
"item" : "atomic_lamp",
"difficulty" : 1,
"location" : "on_ceiling",
"flags": ["ATOMIC_LIGHT", "LEAK_DAM", "RADIOACTIVE"],
"flags": ["ATOMIC_LIGHT", "LEAK_DAM", "RADIOACTIVE", "TOOL_SCREWDRIVER"],

This comment has been minimized.

Copy link
@Coolthulhu

Coolthulhu Jan 14, 2016

Contributor

Not really related to this PR, just noting: "LEAK_DAM" and "RADIOACTIVE" do nothing here

This comment has been minimized.

Copy link
@chaosvolt

chaosvolt Jan 14, 2016

Contributor

Very odd that someone added those in the first place.

This comment has been minimized.

Copy link
@Zireael07

Zireael07 Jan 14, 2016

Contributor

Someone did it b/c it's atomic :P Can't recall the PR but it was fairly recently.

c0

@Core0verload Core0verload force-pushed the Core0verload:screw branch to 96258bb Jan 14, 2016

@Core0verload

This comment has been minimized.

Copy link
Author

commented Jan 14, 2016

Changes to wrenchable parts are in.

@kevingranade kevingranade merged commit 96258bb into CleverRaven:master Jan 16, 2016

1 check passed

default
Details
@stk2008

This comment has been minimized.

Copy link

commented Jan 16, 2016

This is cool.

But alot of these items from the original post would use a wrence etc.
On 16 Jan 2016 07:33, "Kevin Granade" notifications@github.com wrote:

Merged #14840 #14840.


Reply to this email directly or view it on GitHub
#14840 (comment).

@Core0verload Core0verload deleted the Core0verload:screw branch Jan 18, 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.