Been fiddling around with this for the last hour and so far I managed to create the gas and make it only damage monsters with the FUNGUS-species. I took the dmg and slowdown calculations from other fields :>
Now I also want to make the fungal beds and trees go away and replace the tile below with the original one if there is any value for that? Otherwise it would just have to be a random value for dirt or grass (or snow, I guess depending on the season?).
How do I access the terain on the tile? I thought I’d be able to get it via submap getters but I dont even know the corresponding IDs for the fungus infected terrain. Where would I get those?
Have not compiled anything yet.
[...]
fd_hot_air3,
fd_hot_air4,
fd_fungicidal_gas,
num_fields
};
{
"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(30),
{0,0,0}
}
[...]
case fd_fungicidal_gas:
dirty_transparency_cache = true;
spread_gas( cur, p, curtype, 50, 30 );
break;
[...]
case fd_fungicidal_gas:
// Fungicidal gas makes you cough.
// Thick fungicidal gas has a chance to poison you.
{
bool inhaled = false;
if( cur->getFieldDensity() == 3 && !inside ) {
inhaled = u.add_env_effect("poison", bp_mouth, 5, 30);
} else if( cur->getFieldDensity() == 2 && !inside ) {
inhaled = u.add_env_effect("smoke", bp_mouth, 2, 7);
}
if( inhaled ) {
// player does not know how the npc feels, so no message.
u.add_msg_if_player(m_bad, _("You feel sick from inhaling the %s"), cur->name().c_str());
}
}
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( 10, 15 * density );
}