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[RDY] Adds weapon chemical launcher and new fungicidal gas type as ammo #12765
Conversation
Coolthulhu
reviewed
Jun 23, 2015
| "qualities":[ | ||
| {"id":"SAW_M_FINE","level":1,"amount":1}, | ||
| {"id":"SCREW_FINE","level":1,"amount":1}, | ||
| {"id":"HAMMER","level":2,"amount":1} |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
reviewed
Jun 23, 2015
| @@ -1661,6 +1668,11 @@ bool map::process_fields_in_submap( submap *const current_submap, | |||
| make_rubble( p ); | |||
| break; | |||
|
|
|||
| case fd_fungicidal_gas: | |||
This comment has been minimized.
This comment has been minimized.
Coolthulhu
reviewed
Jun 23, 2015
| @@ -3382,6 +3382,10 @@ void map::shoot( const tripoint &p, int &dam, | |||
| add_field(p, fd_fire, rng(1, 2), 0 ); | |||
| } | |||
|
|
|||
| if (ammo_effects.count("STREAM_GAS") && !one_in(3)) { | |||
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 23, 2015
Contributor
Something more descriptive would be better. Something like "FUNGICIDAL_STREAM" or "FUNGICIDAL_TRAIL".
This comment has been minimized.
This comment has been minimized.
Coolthulhu
reviewed
Jun 23, 2015
| "symbol" : "=", | ||
| "color" : "yellow", | ||
| "description" : "Fungicide enhanced with sulfur to create sprayable anti-fungal ammo for the chemical thrower.", | ||
| "material" : "hydrocarbons", |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 23, 2015
Contributor
You should probably give it some other material. "null" should be fine.
Hydrocarbons is for stuff that fuels fires really well.
Coolthulhu
reviewed
Jun 23, 2015
| ], "tools": [ | ||
| [ | ||
| [ "fire", -1 ], | ||
| [ "toolset", 2 ], |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 23, 2015
Contributor
Bump up those numbers a bit. 2 is only enough heat to boil a cup of water.
This comment has been minimized.
This comment has been minimized.
skYYman
Jun 23, 2015
Author
Contributor
Ok, didn't really know what that number was supposed to be ^.^
Coolthulhu
reviewed
Jun 23, 2015
| "description": "A bulky, self-made chemical sprayer with an internal conversion mechanism that allows all sorts of chemicals to be dispersed to your surroundings.", | ||
| "price": 15000, | ||
| "material": ["steel", "plastic"], | ||
| "flags": ["FIRE_100", "NEVER_JAMS"], |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 23, 2015
Contributor
Fire 100 is quite a lot. With flamethrowers you can acquire the ammo easily by siphoning it from cars. Here you've got to craft every shot.
Fire 20 or 50 should be fine, unless you intend to make the gas very powerful.
This comment has been minimized.
This comment has been minimized.
skYYman
Jun 23, 2015
Author
Contributor
I thought that one canister filling of 2000 units (so 20 uses) should be enough to eradicate one large patch of fungus. I can't really tell how the gas will spread by only looking at the code though, so I don't know when it would be considered overpowered. This thing shouldn't be the end-all anti-fungus tool.
Coolthulhu
reviewed
Jun 23, 2015
| [ "pilot_light", 1 ] | ||
| ], | ||
| [ | ||
| [ "wrench", 1] |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 23, 2015
Contributor
Is it supposed to consume the wrench for the construction? You probably want it as a tool quality, not something to be consumed.
If you want something to pump the fuel, foot crank seems to be the common choice. I think pneumatic rifle has it as a component.
This comment has been minimized.
This comment has been minimized.
skYYman
Jun 23, 2015
Author
Contributor
Yeah I got inspired by this http://www.sharpe-art.com/wp-content/uploads/2009/12/ChemicalThrowerLayout.JPG
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 23, 2015
Contributor
Wrenches can be quire valuable here. Since the recipe involves welding, a pipe would be enough here.
Also, add a small or tiny metal tank to the recipe.
Coolthulhu
reviewed
Jun 23, 2015
| "subcategory": "CSC_WEAPON_RANGED", | ||
| "skill_used": "mechanics", | ||
| "skills_required": [[ "gun", 3 ], [ "cooking", 3]], | ||
| "difficulty": 7, |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 23, 2015
Contributor
That's quite a lot of requirements there.
I'd drop the gun requirement. Maybe change it to [[ "launchers", 1 ]] or 2.
And 5 mechanics would also be plenty - 7 is for complex, precise stuff. Since the thrower is really bulky, you could also make it more "makeshift".
Early availability is quite important for this kind of stuff, because later on it will be obsoleted by the chain lightning CBM.
This comment has been minimized.
This comment has been minimized.
skYYman
Jun 23, 2015
Author
Contributor
Fair point. Never actually got to the point where I had the chain lightning.
Althought the biggest argument for making this thing harder to craft is the fact that it will at some point defungify terrain and afaik there is nothing in the game yet, that does that.
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 23, 2015
Contributor
Fire does it very cheaply. Digging holes into fungal bed is a work-intensive, but precise method of fixing it.
This comment has been minimized.
This comment has been minimized.
skYYman
Jun 23, 2015
Author
Contributor
:D true
But fire is risky and hard to control and digging is only for masochists.
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 23, 2015
Contributor
Still, you can counter a fungal infestation by digging out a small area surrounding your useful stuff and then burning the rest.
This comment has been minimized.
This comment has been minimized.
|
Also, check that "Details" button on the page, right to "Failed". It can be informative. |
This comment has been minimized.
This comment has been minimized.
|
Indeed, it is. Jenkins you old scallywag. |
This comment has been minimized.
This comment has been minimized.
|
Would this work? Edit: Jenkins says no. I need to crawl deeper. |
This comment has been minimized.
This comment has been minimized.
|
damn tabstops :> |
This comment has been minimized.
This comment has been minimized.
|
Sadly I have to admit that I don't know enouh C++ to decipher how I'd go about getting the conditions for the if-statements. I was told that it would work with flags but there is no fungus-related flag for terrain. And I can't think of any other way to compare the terrain/furniture on the tile. |
Coolthulhu
reviewed
Jun 24, 2015
| //check the terrain and replace it accordingly to simulate the fungus dieing off | ||
| auto ter = map_tile.get_ter_t(); | ||
| auto frn = map_tile.get_furn_t(); | ||
| if( ) { |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 24, 2015
Contributor
if( ter.has_flag( "FUNGAL" ) ) {
ter_set( p, t_dirt );
}
Don't bring back fungal trees, dirt mounds etc. Fungalized stuff is pretty much only held together by the fungus, once that died it all falls apart.
This comment has been minimized.
This comment has been minimized.
skYYman
Jun 24, 2015
Author
Contributor
Wow, I feel silly. That`s pretty much what I wrote in the very beginning. Where exactly is that flag defined? Feels like I searched everywhere for it.
But thank you.
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 24, 2015
Contributor
It isn't really defined anywhere - it doesn't do anything on its own. Check the terrain jsons.
This comment has been minimized.
This comment has been minimized.
|
Jenkins and my compiler point to this line causing trouble with initializations but I don't understand where the difference in this case and fd_acid and fd_fire lies. Edit: problem was the missing scope for the case. |
This comment has been minimized.
This comment has been minimized.
|
Minor note: perhaps call the ammo type "chemical spray", since it can eventually be expanded to other types, not just fungicide? |
skYYman
added some commits
Jun 24, 2015
skYYman
changed the title
[WiP] Chemical Launcher
Chemical Launcher
Jun 24, 2015
skYYman
changed the title
Chemical Launcher
Add weapon chemical launcher and new fungicidal gas type as ammo
Jun 24, 2015
This comment has been minimized.
This comment has been minimized.
|
Another thing: |
This comment has been minimized.
This comment has been minimized.
|
May be just your IDE (codeblocks?). It sometimes cleans up badly ended lines, such as when there's a space before the newline. |
Coolthulhu
reviewed
Jun 24, 2015
| const auto &ter = map_tile.get_ter_t(); | ||
| if( ter.has_flag( "FUNGUS" ) ) { | ||
| ter_set( p, t_dirt ); | ||
| furn_set( p, f_null ); |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 24, 2015
Contributor
You need to have separate check for furniture. Otherwise when a fungal terrain has a non-fungal furniture, it will be destroyed too.
This comment has been minimized.
This comment has been minimized.
|
That explains that. |
skYYman
changed the title
Add weapon chemical launcher and new fungicidal gas type as ammo
[WiP] Add weapon chemical launcher and new fungicidal gas type as ammo
Jun 24, 2015
skYYman
reviewed
Jun 25, 2015
| "type" : "ammunition_type", | ||
| "id" : "gas_fungicidal", | ||
| "name" : "fungicidal gas", | ||
| "default" : "gas_fungicidal" |
This comment has been minimized.
This comment has been minimized.
skYYman
Jun 25, 2015
Author
Contributor
I was having trouble with assigning a more general chemical_spray ammo-type. I wanted something like this:
{
"type" : "ammunition_type",
"id" : "chemical_spray",
"name" : "sprayable chemical",
"default" : "gas_fungicidal"
}
But it throws a debug-message, saying gas_fungicidal is not a valid ammo.
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 25, 2015
Contributor
Sounds like you only changed it in ammo_types, but not in ammo.json: "gas_fungicidal" had the old "ammo_type" field.
"ammo" field refers to the ammo type id. So if you're changing ammo id to "chemical_spray", the fungicidal gas needs "ammo_type": "chemical_spray".
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
skYYman
Jun 25, 2015
Author
Contributor
That's it! Also, it makes much more sense, now that I think about it.
skYYman
changed the title
[WiP] Add weapon chemical launcher and new fungicidal gas type as ammo
Add weapon chemical launcher and new fungicidal gas type as ammo
Jun 25, 2015
skYYman
closed this
Jun 25, 2015
skYYman
reopened this
Jun 25, 2015
Coolthulhu
self-assigned this
Jun 25, 2015
This comment has been minimized.
This comment has been minimized.
|
Seems like Notepad++ was a little eager and changed all tabstops in the tile_config.json to 4 spaces |
Coolthulhu
reviewed
Jun 25, 2015
| inhaled = u.add_env_effect("poison", bp_mouth, 5, 30); | ||
| } else if( cur->getFieldDensity() == 2 ) { | ||
| inhaled = u.add_env_effect("smoke", bp_mouth, 2, 7); | ||
| } else if( u.has_trait("THRESH_MYCUS") || u.has_trait("THRESH_MARLOSS" ) ) { |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 25, 2015
Contributor
Both of those else ifs are wrong:
- Thick gas will not cause coughing, only poison. In many cases coughing can actually be more dangerous than poison
- Mycus mutant will only get the mycus effect if the density == 1
- In the mycus block: you don't need to compare density to any of 1, 2 or 3. It can never be lower than 1 or higher than 3
- Density 1 should do something too. Maybe just a weak (5 turns?) poison effect?
- Mycus mutants will take the damage even when in full hazmat
This comment has been minimized.
This comment has been minimized.
|
Balancing:
|
Coolthulhu
removed their assignment
Jun 25, 2015
This comment has been minimized.
This comment has been minimized.
|
This would probably be better handled with some kind of ENV_PROTECT flag on the related and new clothing. |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
commented on src/field.cpp in c77226d
Jun 28, 2015
|
Why such a huge difference in dispersal speed between indoors and outdoors? It disperses 70 times faster outdoor, meaning that it is going to hang in the air for ages in a house, but will barely last few turns in the open. Since it is supposed to be used outdoors, it should probably be closer to 20-30 difference, if not even less. |
Coolthulhu
reviewed
Jun 28, 2015
| // The gas won't harm you inside a vehicle. | ||
| bool inhaled = false; | ||
| // Full body suits protect you from the effects of the gas. | ||
| if( !u.worn_with_flag("GAS_PROOF") ) { |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
reviewed
Jun 28, 2015
| case fd_fungicidal_gas: | ||
| // Fungicidal gas is unhealthyand becomes deadly if you cross a related threshold. | ||
| { | ||
| if (inside) break; |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
reviewed
Jun 28, 2015
| bool inhaled = false; | ||
| // Full body suits protect you from the effects of the gas. | ||
| if( !u.worn_with_flag("GAS_PROOF") ) { | ||
| if( cur->getFieldDensity() == 3 ) { |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 28, 2015
Contributor
Invert those ifs and make them more like a formula. Field code is currently quite bad with the whole if( density == 3) { something; } else if( density == 2 ) type coding, no need to make it worse.
It could work like this: first handle the effects that happen to everyone (inhaled poison), like this:
const int density = cur->getFieldDensity();
inhaled = u.add_env_effect( "poison", bp_mouth, 5, density * 10 );
Then just the fungus stuff:
if( u. fungus check here ) {
inhaled |= u.add_env_effect( "badpoison", bp_mouth, 5, density * 10 );
u.hurtall( rng( density, density * 2 ), nullptr );
u.add_msg_if_player( m_bad, _("hurts")...
}
Note that |=. If you use just the =, partially resisting the gas would give no message. Regular poison inhalation could set it to true, then bad poison could set it back to false if resisted.
No need to have separate messages for burns. If you can get them "for free" it's fine, but here it would look cleaner without a big if/else block.
Coolthulhu
reviewed
Jun 28, 2015
| @@ -2974,7 +2974,7 @@ | |||
| "environmental_protection" : 20, | |||
| "encumbrance" : 37, | |||
| "bashing" : -5, | |||
| "flags" : ["VARSIZE", "WATERPROOF", "RAINPROOF", "RAD_PROOF","ELECTRIC_IMMUNE", "OUTER"], | |||
| "flags" : ["VARSIZE", "WATERPROOF", "RAINPROOF", "RAD_PROOF", "ELECTRIC_IMMUNE", "GAS_PROOF", "OUTER"], | |||
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 28, 2015
Contributor
GAS_PROOF would be better as an environmental protection formula (so that you could partially resist it), but it's OK as a tag for now.
When (if?) you add more chemical types later it may be worth considering adding a gas resistance check as a separate function, but probably not as a part of this PR.
This comment has been minimized.
This comment has been minimized.
skYYman
Jun 29, 2015
Author
Contributor
I do plan on adding a variety of ammo for the thrower. Will keep that in mind.
kevingranade
assigned
kevingranade
and unassigned
kevingranade
Jun 28, 2015
This comment has been minimized.
This comment has been minimized.
|
Working great in a quick test I gave it (annihilating a fungal tower), but I agree with Coolthulu's points. |
skYYman
changed the title
Add weapon chemical launcher and new fungicidal gas type as ammo
[RDY] Adds weapon chemical launcher and new fungicidal gas type as ammo
Jun 29, 2015
Coolthulhu
self-assigned this
Jul 2, 2015
Coolthulhu
reviewed
Jul 2, 2015
| u.hurtall( rng( density, density * 2 ), nullptr ); | ||
| u.add_msg_if_player( m_bad, _("The %s makes you feel sick."), cur->name().c_str() ); | ||
| } | ||
| } |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
reviewed
Jul 2, 2015
| case fd_fungicidal_gas: | ||
| { | ||
| dirty_transparency_cache = true; | ||
| spread_gas( cur, p, curtype, 120, 10 ); |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jul 2, 2015
Contributor
120 in the third parameter of spread_gas shouldn't do anything above 100. It's a percentage chance.
Coolthulhu
merged commit 7324aef
into
CleverRaven:master
Jul 2, 2015
1 check passed
This comment has been minimized.
This comment has been minimized.
|
Fixed missing messages on my side. For the future:
|
skYYman commentedJun 23, 2015
So here is my first ever contribution to CDDA.
I am a total newbie when it comes to git and I am not really sure where everything goes so far, so please bear with me while I learn.
The idea for this weapon originates from http://smf.cataclysmdda.com/index.php?topic=10630.msg238369#msg238369.
With guidance from Coolthulhu I managed to come up with the below stuff so far.