tweaks.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10615 c06c8d41-db1a-0410-9941-cceddc491573
TR6F3WVSL6TS5SZVGJBGDK54FKAXYWRWXFRNMQ2AYYKHADSHR2EQC XCGPG77ZJUVU6TH4Z4I3K677TAG7XTDEEWRP7IGVO7MG7GBVPOSQC T3R2D5M4YSC6NFZ6YO3AEG4VWORECX72CHUM5UBADV4UPAAZG7WQC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC RDS3NSFOLBAEGHBFEQ4TODN5QSJ2DLDM2SIVVUMA6IVRHAZLRVKQC DKISJVKAJJK2SVZSXGJ37K5SOVTDARVX6RPK3MAKVNGC36Z4YAZQC UU5JLKAKZSTWFQJLUTPQZJ3ZQY7BEU2KROZETUNSKC6LFG6XVSZQC GK6AOQQV6RU2F6FQRT6O62FD633MH6SQNPLRL4U3KQ6UMXX6UQLQC B47CVG54WZNP3CQ7HOTKTWQA26GCOIKQADX2EK4ZOEYRRQ4T5W2AC SVY2PTCLXR3KNPQAWXVXTTGCC5DR334HOAKHYO3VDDRWM2BWMALAC KNCEMOC5TMWHTKCWF7CMYNHLGCXOLGMTXLEIHMEFBGM5FR26GRXAC SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC LY7DLLD7IKL6ZQPVROLDJ46XRM5CMAAEBRFDKJ4M53CPC5GFCGSQC IP4A3VRYFYIVLRUAU4DF4KDNP6E4UISWJX3LI2F4EGSSMIJYRJXAC SW7H3ABNOEJW3N7WIE6O2JTJQ3Y3RI7U6L2PLS6S2TSFYHVWG45AC WP5VP57D5BWKDAS7AA224OV2RX4O4BPTI2BLY7TS3T2O2PLUGXCQC J7GPW2YXLT6FGSKJ24FGQ24GTRZ6A2BDYM6CIXV4R6YBEHP6BGPAC KZWOHH536QBWAPWROR32EOXEK5LRY6I5VHVL7HHI7GOFKCMQTCSQC // Create a ring or partial ring around the caster.// User is prompted to select a stack of fruit then plants are placed on open// squares adjacent to the caster, of course 1 piece of fruit is consumed per// plant so a complete ring may not be formed.bool plant_ring_from_fruit()
// Prompt the user to select a stack of fruit from their inventory. The// user can optionally select only a partial stack of fruit (the count// variable will store the number of fruit the user wants). Return the// index of the item selected in the user's inventory, or a negative// number if the prompt failed (user canceled or had no fruit).int _prompt_for_fruit(int & count, const char * prompt_string)
return 0;
return (rc);// Return PROMPT_INAPPROPRIATE if the 'object selected isn't// actually fruit.if (!is_fruit(you.inv[rc]))return (PROMPT_INAPPROPRIATE);// Handle it if the user lies about the amount of fruit available.if (count > you.inv[rc].quantity)count = you.inv[rc].quantity;return (rc);}// Create a ring or partial ring around the caster. The user is// prompted to select a stack of fruit, and then plants are placed on open// squares adjacent to the user. Of course, one piece of fruit is// consumed per plant, so a complete ring may not be formed.bool plant_ring_from_fruit(){int possible_count;int created_count = 0;int rc = _prompt_for_fruit(possible_count, "Use which fruit?");// Prompt failed?if (rc < 0)return (false);
// Creates a circle of water around the target (radius is approximately 2)// Turns normal floor tiles into shallow water and turns (unoccupied) shallow// water into deep water.// Chance of spawning plants or fungus on unoccupied dry floor tiles outside// of the rainfall area// Returns the number of plants/fungus created
// Create a circle of water around the target, with a radius of// approximately 2. This turns normal floor tiles into shallow water// and turns (unoccupied) shallow water into deep water. There is a// chance of spawning plants or fungus on unoccupied dry floor tiles// outside of the rainfall area. Return the number of plants/fungi// created.
// Adjusting the shape of the rainfall slightly to make it look nicer.// I want a threshold of 2.5 on the euclidean distance so a threshold// of 6 prior to the sqrt is close enough.
// Adjust the shape of the rainfall slightly to make it look// nicer. I want a threshold of 2.5 on the euclidean distance,// so a threshold of 6 prior to the sqrt is close enough.
// Maybe spawn a plant on (dry, open) squares that are in LOS but// outside the rainfall area.// In open space there are 213 squares in LOS, and we are// going to drop water on (25-4) of those, so if we want x plants// to spawn on average in open space the trial probability should// be x/192
// Maybe spawn a plant on (dry, open) squares that are in// LOS but outside the rainfall area. In open space, there// are 213 squares in LOS, and we are going to drop water on// (25-4) of those, so if we want x plants to spawn on// average in open space, the trial probability should be// x/192.
// We can also turn shallow water into deep water, but we're just going// to skip cases where there is something on the shallow water.// Destroying items will probably annoy people and insta-killing// monsters is clearly out of the question.
// We can also turn shallow water into deep water, but we're// just going to skip cases where there is something on the// shallow water. Destroying items will probably be annoying,// and insta-killing monsters is clearly out of the question.
// Given a monster (well it should be a plant/fungus) see if evolve_flora can// upgrade it, and set up a monster_conversion structure for it. Returns true// (and fills in possible_monster) if input an be upgraded, and returns false// otherwise.
// Given a monster (which should be a plant/fungus), see if// evolve_flora() can upgrade it, and set up a monster_conversion// structure for it. Return true (and fill in possible_monster) if the// monster can be upgraded, and return false otherwise.
int points = 15;
char prompt_string[100];memset(prompt_string,0,100);sprintf(prompt_string,"Use which fruit (%1.1f oklob plants per fruit)?",approx_oklob_rate);rc = _prompt_for_fruit(available_count, prompt_string);// Prompt failed?if (rc < 0)return (false);int points = points_per_fruit * available_count;int starting_points = points;std::priority_queue<monster_conversion> available_targets;
return (false);int rc;int available_count;rc = prompt_invent_item("Use which fruit (must have at least 2)?",MT_INVLIST, OSEL_SOME_FRUIT, true, true, true, '\0', -1,&available_count);if (prompt_failed(rc))
{mpr("No flora in sight can be evolved.");
// messaging...if (plants_evolved > 0){mprf("%s can now spit acid.",(plants_evolved > 1 ? "Some plants" : "A plant"));}
// How many pieces of fruit did we use up?int points_used = starting_points - points;int fruit_used = points_used / points_per_fruit;if (points_used % points_per_fruit)fruit_used++;
const bool plural = toadstools_evolved > 1;mprf("%s toadstool%s gain%s stability.",(plural ? "Some" : "A"),(plural ? "s" : ""),(plural ? "" : "s"));
mpr("Not enough fruit to cause evolution.");return (false);
if (fungi_evolved > 0)
// Messaging for generated plants.if (plants_evolved > 1)mprf("%d plants can now spit acid.", plants_evolved);else if (plants_evolved == 1)mpr("A plant can now spit acid.");if (toadstools_evolved > 1)mprf("%d toadstools gained stability.", toadstools_evolved);else if (toadstools_evolved == 1)mpr("A toadstool gained stability.");if (fungi_evolved > 1)
const bool plural = fungi_evolved > 1;mprf("The fungal %s can now pick up %s mycelia and move.",(plural ? "colonies" : "colony"),(plural ? "their" : "its"));
mprf("%d fungal colonies can now pick up their mycelia and move.",fungi_evolved);
if (plant->type != MONS_OKLOB_PLANT&& plant->type != MONS_WANDERING_MUSHROOM&& !testbits(plant->flags, MF_ATT_CHANGE_ATTEMPT))
if ((plant->type != MONS_OKLOB_PLANT&& plant->type != MONS_WANDERING_MUSHROOM)|| testbits(plant->flags, MF_ATT_CHANGE_ATTEMPT))
// Going to expliclty override the die-off timer in this case// (this condition means we got called from fungal_bloom or// similar and are creating a lot of toadstools at once that// should die off quickly).
// Going to explicitly override the die-off timer in// this case (this condition means we got called from// fungal_bloom() or similar, and are creating a lot of// toadstools at once that should die off quickly).
bool mushroom_spawn_message(int seen_targets, int seen_corpses){if (seen_targets > 0){std::string what = seen_targets > 1 ? "Some toadstools": "A toadstool";std::string where = seen_corpses > 1 ? "nearby corpses" :seen_corpses == 1 ? "a nearby corpse": "the ground";mprf("%s grow%s from %s.",what.c_str(), seen_targets > 1 ? "" : "s", where.c_str());return (true);}return (false);}
if (seen_spawns > 0){std::string base = seen_spawns > 1 ? "Some toadstools" : "A toadstool";if (see_grid(corpse.pos))mprf("%s grows from a nearby corpse.", base.c_str());elsemprf("%s springs up from the ground.", base.c_str());}
mushroom_spawn_message(seen_spawns, see_grid(corpse.pos) ? 1 : 0);