Make splitting while out of sight actually work
When merging average enchantment durations for the two slimes When splitting add the parents ench durations to the offspring slime
Better messaging for merging/splitting
Cap the merge count to 5, use size adjectives instead of numbers for the combiend slime creature names.
Don't group different size slime creatures together in the monster list
AR3VHZCH5RGEGEFCV2SDOHTTA4WEE4UT3RC3NFA5QNAMGRZTGUVAC
LL7ZA3RH2A6WGA7YD7XWIZFYG5QNFNSA3UMSUFUMIHHSJZ3SWR4QC
BUSA7O6EFBZVAG2RL5T7MD2WTWKOEKKIAAZ2VS4Y3L6ECT4HQR6QC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
3RNRFLMD2X4RUFTDVITLXAP377YB6F6YMQLL3DAXSUZDZBTWSLRQC
2UO6ZOW7UCP5XJ2TJ26PJNQABILK2BZ4J3BAKLOKMZPJDQHW24MAC
KEANRIMF5CGFVZ2XJYNFPOAKLXOSOJUOVA73IWBWOG576265ERHAC
}
// Inflict any enchantments the parent slime has on its offspring,
// leaving durations unchanged I guess. -cao
static void _split_ench_durations(monsters * initial_slime, monsters * split_off)
{
mon_enchant_list::iterator i;
for( i=initial_slime->enchantments.begin();
i!=initial_slime->enchantments.end(); ++i)
{
split_off->add_ench(i->second);
}
}
// What to do about any enchantments these two slimes may have?
// For now we are averaging the durations -cao
static void _merge_ench_durations(monsters * initial_slime, monsters * merge_to)
{
mon_enchant_list::iterator i;
int initial_count = initial_slime->number;
int merge_to_count = merge_to->number;
int total_count = initial_count + merge_to_count;
for (i = initial_slime->enchantments.begin();
i != initial_slime->enchantments.end(); ++i)
{
// does the other slime have this enchantment as well?
mon_enchant temp = merge_to->get_ench(i->first);
// If not use duration 0 for their part of the average.
int duration = temp.ench == ENCH_NONE ? 0 : temp.duration;
i->second.duration = (i->second.duration * initial_count
+ duration * merge_to_count)/total_count;
if(!i->second.duration)
i->second.duration=1;
merge_to->add_ench(i->second);
}
for (i = merge_to->enchantments.begin();
i != merge_to->enchantments.end(); ++i)
{
if(initial_slime->enchantments.find(i->first)
!= initial_slime->enchantments.end()
&& i->second.duration > 1)
{
i->second.duration = (merge_to_count * i->second.duration)
/total_count;
merge_to->update_ench(i->second);
}
}
// Overwrite the state of the slime getting merged into because
// it might have been resting or something.
merge_to->behaviour = initial_slime->behaviour;
merge_to->foe = initial_slime->foe;
behaviour_event(merge_to, ME_EVAL);
// Messaging
if(you.can_see(merge_to))
{
if(you.can_see(initial_slime))
{
mprf("Two slime creatures merge to form %s.",
merge_to->name(DESC_NOCAP_A).c_str());
}
else
{
mprf("A slime creatures suddenly becomes %s.",
merge_to->name(DESC_NOCAP_A).c_str());
}
}
if (!mons_near(monster)
|| mons_is_sleeping(monster)
|| mons_is_submerged(monster))
// Slime creatures can split while out of sight.
if ((!mons_near(monster)
|| mons_is_sleeping(monster)
|| mons_is_submerged(monster))
&& monster->mons_species() != MONS_SLIME_CREATURE)
if (mon.number < 11)
{
const char* cardinals[] = {"one", "two", "three", "four", "five",
"six", "seven", "eight", "nine", "ten"};
result += cardinals[mon.number - 1];
}
else
result += make_stringf("%d", mon.number);
ASSERT(mon.number <=5);
const char* cardinals[] = {"", "large ", "very large ",
"enormous ", "titanic "};
result += cardinals[mon.number - 1];
}