Large diffs are not rendered by default.

Binary file not shown.
"bg" : -1,
"rotates" : false,
"multitile" : false
}
},
{
"id" : "chemical_thrower",
"fg" : 2012,
"bg" : -1,
"rotates" : false,
"multitile" : false
},
{
"id":"fd_fungicidal_gas",
"fg":2018,
"multitile":true,
"additional_tiles":
[
{
"id": "center",
"fg": 2013
},
{
"id": "corner",
"fg": 2014
},
{
"id": "edge",
"fg": 2015
},
{
"id": "t_connection",
"fg": 2016
},
{
"id": "end_piece",
"fg": 2017
},
{
"id": "unconnected",
"fg": 2018
}
],
"rotates" : false
},
{
"id" : "gas_fungicidal",
"fg" : 952,
"bg" : -1,
"rotates" : false,
"multitile" : false
}
],
"ascii":
[
@@ -190,7 +190,11 @@ void ammo_effects( const tripoint &p, const std::set<std::string> &effects )
g->m.add_field( pt, fd_tear_gas, 3, 0 );
}
}

if( effects.count( "GAS_FUNGICIDAL" ) > 0 ) {
for( auto &&pt : g->m.points_in_radius( p, 1, 0 ) ) {

This comment has been minimized.

Copy link
@skYYman

skYYman Jun 25, 2015

Author Contributor

Should this be the line that allows defining the point of impact, rather than the point of origin?

This comment has been minimized.

Copy link
@Coolthulhu

Coolthulhu Jun 25, 2015

Contributor

Yes

This comment has been minimized.

Copy link
@skYYman

skYYman Jun 25, 2015

Author Contributor

I don't know where to get the tripoint from, sorry 😭

This comment has been minimized.

Copy link
@Coolthulhu

Coolthulhu Jun 25, 2015

Contributor

I thought you are just asking whether this is the solution to the problem of not having the point of impact.
Because it is: p is the last point the projectile reached and so the point of impact and the last possible point of impact at that.

This part is good.

This comment has been minimized.

Copy link
@skYYman

skYYman Jun 25, 2015

Author Contributor

Ah, well that's an hour of code crawling well spent then.

The problem now is that the gas spawns in the tile the player is in, not the tile at which the launcher aims. Do I have to define a projectile somewhere?

This comment has been minimized.

Copy link
@Coolthulhu

Coolthulhu Jun 25, 2015

Contributor

It probably means the projectile loses all force before it reaches the target. In ranged.cpp, you've got Creature::projectile_attack - this deals with most of the projectile calculations.

Pretty sure just adding a "JET" flag to the ammo or adding an ammo effect "JET" to the launcher should be enough. "JET" flag has only one effect: negating the usual mechanic of projectile stopping when its damage reaches 0.

This comment has been minimized.

Copy link
@skYYman

skYYman Jun 25, 2015

Author Contributor

Yessssssssssssssssssssssssssss. You know your code 👯

Thank you for taking your time with me.

g->m.add_field( pt, fd_fungicidal_gas, 3, 0 );
}
}
if( effects.count( "SMOKE" ) > 0 ) {
for( auto &&pt : g->m.points_in_radius( p, 1, 0 ) ) {
g->m.add_field( pt, fd_smoke, 3, 0 );
@@ -323,6 +323,13 @@ void game::init_fields()
{"", "", ""}, '&', -1,
{c_white, c_yellow, c_red}, {true, true, true}, {false, false, false}, MINUTES(50),
{0,0,0}
},

{
"fd_fungicidal_gas",
{_("hazy cloud"),_("fungicidal gas"),_("thick fungicidal gas")}, '8', 8,
{c_white, c_ltgray, c_dkgray}, {true, true, false}, {false, true, true}, MINUTES(90),
{0,0,0}
}

};
@@ -753,7 +760,7 @@ bool map::process_fields_in_submap( submap *const current_submap,
// because the only trap we're checking for is brazier
const auto &ter = map_tile.get_ter_t();
const auto &frn = map_tile.get_furn_t();

const auto &trp = map_tile.get_trap();
// We've got ter/furn cached, so let's use that
const bool is_sealed = ter_furn_has_flag( ter, frn, TFLAG_SEALED ) &&
@@ -1004,7 +1011,7 @@ bool map::process_fields_in_submap( submap *const current_submap,
// The fire feeds on the ground itself until max density.
time_added += 4 - cur->getFieldDensity();
smoke += 2;
if( cur->getFieldDensity() > 1 &&
if( cur->getFieldDensity() > 1 &&
one_in( 200 - cur->getFieldDensity() * 50 ) ) {
destroy( p, true );
}
@@ -1013,7 +1020,7 @@ bool map::process_fields_in_submap( submap *const current_submap,
// The fire feeds on the ground itself until max density.
time_added += 5 - cur->getFieldDensity();
smoke += 2;
if( cur->getFieldDensity() > 1 &&
if( cur->getFieldDensity() > 1 &&
one_in( 200 - cur->getFieldDensity() * 50 ) ) {
ter_set( p, t_dirt );
furn_set( p, f_ash );
@@ -1030,7 +1037,7 @@ bool map::process_fields_in_submap( submap *const current_submap,
} else {
// Don't fuel raging fires or they'll burn forever
// as they can produce small fires above themselves
int new_density = std::max( cur->getFieldDensity(),
int new_density = std::max( cur->getFieldDensity(),
fire_there->getFieldDensity() );
// Allow smaller fires to combine
if( new_density < 3 &&
@@ -1162,7 +1169,7 @@ bool map::process_fields_in_submap( submap *const current_submap,
// Our iterator will start at end_i + 1 and increment from there and then wrap around.
// This guarantees it will check all neighbors, starting from a random one
const size_t end_i = (size_t)rng( 0, neighs.size() - 1 );
for( size_t i = ( end_i + 1 ) % neighs.size();
for( size_t i = ( end_i + 1 ) % neighs.size();
i != end_i; i = ( i + 1 ) % neighs.size() ) {
if( one_in( cur->getFieldDensity() * 2 ) ) {
// Skip some processing to save on CPU
@@ -1595,6 +1602,7 @@ bool map::process_fields_in_submap( submap *const current_submap,
curfield.findField( fd_relax_gas ) ||
curfield.findField( fd_nuke_gas ) ||
curfield.findField( fd_gas_vent ) ||
curfield.findField( fd_fungicidal_gas ) ||
curfield.findField( fd_fire_vent ) ||
curfield.findField( fd_flame_burst ) ||
curfield.findField( fd_electricity ) ||
@@ -1661,6 +1669,23 @@ bool map::process_fields_in_submap( submap *const current_submap,
make_rubble( p );
break;

case fd_fungicidal_gas:
{
dirty_transparency_cache = true;
spread_gas( cur, p, curtype, 120, 10 );

This comment has been minimized.

Copy link
@Coolthulhu

Coolthulhu Jul 2, 2015

Contributor

120 in the third parameter of spread_gas shouldn't do anything above 100. It's a percentage chance.

//check the terrain and replace it accordingly to simulate the fungus dieing off
const auto &ter = map_tile.get_ter_t();
const auto &frn = map_tile.get_furn_t();
const int density = cur->getFieldDensity();
if( ter.has_flag( "FUNGUS" ) && one_in( 10 / density ) ) {
ter_set( p, t_dirt );
}
if( frn.has_flag( "FUNGUS" ) && one_in( 10 / density ) ) {
furn_set( p, f_null );
}
}
break;

default:
//Suppress warnings
break;
@@ -2060,7 +2085,7 @@ void map::player_in_field( player &u )
break;

case fd_incendiary:
// Mysterious incendiary substance melts you horribly.
// Mysterious incendiary substance melts you horribly.
if (u.has_trait("M_SKIN2") || cur->getFieldDensity() == 1) {
u.add_msg_player_or_npc(m_bad, _("The incendiary burns you!"), _("The incendiary burns <npcname>!"));
u.hurtall(rng(1, 3), nullptr);
@@ -2071,6 +2096,28 @@ void map::player_in_field( player &u )
}
break;

case fd_fungicidal_gas:
// Fungicidal gas is unhealthy and becomes deadly if you cross a related threshold.
{
// The gas won't harm you inside a vehicle.
if (inside) {
break;
}
// Full body suits protect you from the effects of the gas.
if ( u.worn_with_flag("GAS_PROOF") ) {
break;
}
bool inhaled = false;
const int density = cur->getFieldDensity();
inhaled = u.add_env_effect( "poison", bp_mouth, 5, density * 10 );
if( u.has_trait("THRESH_MYCUS") || u.has_trait("THRESH_MARLOSS") ) {
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, _("The %s makes you feel sick."), cur->name().c_str() );
}
}

This comment has been minimized.

Copy link
@Coolthulhu

Coolthulhu Jul 2, 2015

Contributor

You don't do anything with the inhaled variable.

break;

default:
//Suppress warnings
break;
@@ -2366,7 +2413,14 @@ void map::monster_in_field( monster &z )
z.moves -= rng( 10 * density, 30 * density );
dam += rng( 0, 10 * density );
}
break;

case fd_fungicidal_gas:
if( z.type->in_species("FUNGUS") ) {
const int density = cur->getFieldDensity();
z.moves -= rng( 10 * density, 30 * density );
dam += rng( 4, 7 * density );
}
break;

default:
@@ -86,6 +86,7 @@ enum field_id : int {
fd_hot_air2,
fd_hot_air3,
fd_hot_air4,
fd_fungicidal_gas,
num_fields
};

@@ -2375,6 +2375,7 @@ void map::decay_fields_and_scent( const int amount )
break;
case fd_smoke:
case fd_toxic_gas:
case fd_fungicidal_gas:
case fd_tear_gas:
case fd_nuke_gas:
case fd_cigsmoke:
@@ -3011,7 +3012,7 @@ std::pair<bool, bool> map::bash_ter_furn( const tripoint &p, const int str,
if( !sound.empty() && !silent ) {
sounds::sound( p, sound_volume, sound, false, "bash", sound );
}

return std::pair<bool, bool>( smashed_something, success );
}

@@ -3382,6 +3383,10 @@ void map::shoot( const tripoint &p, int &dam,
add_field(p, fd_fire, rng(1, 2), 0 );
}

if (ammo_effects.count("STREAM_GAS_FUNGICIDAL") && !one_in(3)) {
add_field(p, fd_fungicidal_gas, rng(1, 2), 0 );
}

if (ammo_effects.count("STREAM_BIG") && !one_in(4)) {
add_field(p, fd_fire, 2, 0 );
}