Attached Files |
notapatch.txt [^] (5,819 bytes) 2013-04-03 23:40 [Show Content] [Hide Content]*Kay, so I suck with git and can't generate a patch to save my life, so here's the code in a text file.
*In mon-data.h replace the code for small abominations with this:
{
// A demonically controlled mass of undead flesh theme-wise, this makes
// them MH_DEMONIC|MH_UNDEAD, but this is mostly the same as just
// MH_UNDEAD (save for some god interactions).
MONS_ABOMINATION_SMALL, 'x', LIGHTRED, "small abomination",
M_NO_REGEN,
MR_NO_FLAGS,
0, 10, MONS_ABOMINATION_SMALL, MONS_ABOMINATION_SMALL, MH_UNDEAD, -5,
{ {AT_HIT, AF_PLAIN, 23}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
{ 6, 2, 5, 0 },
0, 0, MST_NO_SPELLS, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT,
I_PLANT, HT_LAND, FL_NONE, 10, DEFAULT_ENERGY,
MONUSE_NOTHING, MONEAT_NOTHING, SIZE_LARGE
},
*And the code for large abominations with this:
{
// See comment under MONS_ABOMINATION_SMALL regarding holiness.
MONS_ABOMINATION_LARGE, 'X', LIGHTRED, "large abomination",
M_NO_REGEN,
MR_NO_FLAGS,
0, 10, MONS_ABOMINATION_SMALL, MONS_ABOMINATION_LARGE, MH_UNDEAD, -7,
{ {AT_HIT, AF_PLAIN, 40}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
{ 11, 2, 5, 0 },
0, 0, MST_NO_SPELLS, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT,
I_PLANT, HT_LAND, FL_NONE, 10, DEFAULT_ENERGY,
MONUSE_NOTHING, MONEAT_NOTHING, SIZE_BIG
},
*Then, in mon-abil.cc replace _do_merge_crawlies with this:
static bool _do_merge_crawlies(monster* crawlie, monster* merge_to)
{
bool willmerge = true;
int orighd = merge_to->hit_dice;
int addhd = crawlie->hit_dice;
// Need twice as many HD past 15.
if (orighd > 15)
addhd = (1 + addhd)/2;
else if (orighd + addhd > 15)
addhd = (15 - orighd) + (1 + addhd - (15 - orighd))/2;
int newhd = orighd + addhd;
monster_type new_type;
int hp, mhp;
if (newhd < 6)
{
// Not big enough for an abomination yet
new_type = MONS_MACABRE_MASS;
mhp = merge_to->max_hit_points + crawlie->max_hit_points;
hp = merge_to->hit_points += crawlie->hit_points;
}
else
{
// Need 11 HD and 3 corpses for a large abomination
if (newhd < 11
|| (crawlie->type == MONS_CRAWLING_CORPSE
&& merge_to->type == MONS_CRAWLING_CORPSE))
{
new_type = MONS_ABOMINATION_SMALL;
newhd = min(newhd, 15);
}
else
{
new_type = MONS_ABOMINATION_LARGE;
newhd = min(newhd, 30);
}
// Recompute in case we limited newhd.
addhd = newhd - orighd;
if (merge_to->type == MONS_ABOMINATION_SMALL)
{
// Adding to an existing abomination
int hp_gain = hit_points(addhd, 2, 5);
mhp = merge_to->max_hit_points + hp_gain;
hp = merge_to->hit_points + hp_gain;
hp = hp + hp/10;
}
if (merge_to->type == MONS_ABOMINATION_LARGE)
{
int hp_gain = 0;
mhp = merge_to->max_hit_points + hp_gain;
if (mhp > hp){
hp = merge_to->hit_points + hp_gain;
hp = hp + hp/10;}
else{
willmerge = false;
}
}
else
// Making a new abomination
hp = mhp = hit_points(newhd, 2, 5);
}
if (willmerge == true){
monster_type old_type = merge_to->type;
string old_name = merge_to->name(DESC_A);
// Change the monster's type if we need to.
if (new_type != old_type)
change_monster_type(merge_to, new_type);
// Combine enchantment durations (weighted by original HD).
merge_to->hit_dice = orighd;
_merge_ench_durations(crawlie, merge_to, true);
init_abomination(merge_to, newhd);
merge_to->max_hit_points = mhp;
merge_to->hit_points = hp;
// TODO: probably should be more careful about which flags.
merge_to->flags |= crawlie->flags;
_lose_turn(merge_to, merge_to->mindex() < crawlie->mindex());
behaviour_event(merge_to, ME_EVAL);
// Messaging.
if (you.can_see(merge_to))
{
bool changed = new_type != old_type;
if (you.can_see(crawlie))
{
if (crawlie->type == old_type)
mprf("Two %s merge%s%s.",
pluralise(crawlie->name(DESC_PLAIN)).c_str(),
changed ? " to form " : "",
changed ? merge_to->name(DESC_A).c_str() : "");
else
mprf("%s merges with %s%s%s.",
crawlie->name(DESC_A).c_str(),
old_name.c_str(),
changed ? " to form " : "",
changed ? merge_to->name(DESC_A).c_str() : "");
}
else if (changed)
{
mprf("%s suddenly becomes %s.",
uppercase_first(old_name).c_str(),
merge_to->name(DESC_A).c_str());
}
else
mprf("%s twists grotesquely.", merge_to->name(DESC_A).c_str());
}
else if (you.can_see(crawlie))
mprf("%s suddenly disappears!", crawlie->name(DESC_A).c_str());
// Now kill the other monster
monster_die(crawlie, KILL_DISMISSED, NON_MONSTER, true);
}
return true;
}
*and replace _crawlie_is_mergable with this:
static bool _crawlie_is_mergeable(monster *mons)
{
if (!mons)
return false;
switch (mons->type)
{
case MONS_ABOMINATION_SMALL:
case MONS_CRAWLING_CORPSE:
case MONS_MACABRE_MASS:
case MONS_ABOMINATION_LARGE:
break;
default:
return false;
}
return !(mons->is_shapeshifter() || _disabled_merge(mons));
}
*If there's something wrong, please let me know.
notapatchv2.txt [^] (5,977 bytes) 2013-04-04 21:05 [Show Content] [Hide Content]*Kay, so I suck with git and can't generate a patch to save my life, so here's the code in a text file.
*In mon-data.h replace the code for small abominations with this:
{
// A demonically controlled mass of undead flesh theme-wise, this makes
// them MH_DEMONIC|MH_UNDEAD, but this is mostly the same as just
// MH_UNDEAD (save for some god interactions).
MONS_ABOMINATION_SMALL, 'x', LIGHTRED, "small abomination",
M_NO_REGEN,
MR_NO_FLAGS,
0, 10, MONS_ABOMINATION_SMALL, MONS_ABOMINATION_SMALL, MH_UNDEAD, -5,
{ {AT_HIT, AF_PLAIN, 23}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
{ 6, 2, 5, 0 },
0, 0, MST_NO_SPELLS, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT,
I_PLANT, HT_LAND, FL_NONE, 10, DEFAULT_ENERGY,
MONUSE_NOTHING, MONEAT_NOTHING, SIZE_LARGE
},
*And the code for large abominations with this:
{
// See comment under MONS_ABOMINATION_SMALL regarding holiness.
MONS_ABOMINATION_LARGE, 'X', LIGHTRED, "large abomination",
M_NO_REGEN,
MR_NO_FLAGS,
0, 10, MONS_ABOMINATION_SMALL, MONS_ABOMINATION_LARGE, MH_UNDEAD, -7,
{ {AT_HIT, AF_PLAIN, 40}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
{ 11, 2, 5, 0 },
0, 0, MST_NO_SPELLS, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT,
I_PLANT, HT_LAND, FL_NONE, 10, DEFAULT_ENERGY,
MONUSE_NOTHING, MONEAT_NOTHING, SIZE_BIG
},
*Then, in mon-abil.cc replace _do_merge_crawlies with this:
static bool _do_merge_crawlies(monster* crawlie, monster* merge_to)
{
bool willmerge;
int orighd = merge_to->hit_dice;
int addhd = crawlie->hit_dice;
if (merge_to->type == MONS_ABOMINATION_LARGE && merge_to->max_hit_points == merge_to->hit_points){willmerge = false;}
else {willmerge = true;}
if (willmerge == true){
// Need twice as many HD past 15.
if (orighd > 15)
addhd = (1 + addhd)/2;
else if (orighd + addhd > 15)
addhd = (15 - orighd) + (1 + addhd - (15 - orighd))/2;
int newhd = orighd + addhd;
monster_type new_type;
int hp, mhp;
if (newhd < 6)
{
// Not big enough for an abomination yet
new_type = MONS_MACABRE_MASS;
mhp = merge_to->max_hit_points + crawlie->max_hit_points;
hp = merge_to->hit_points += crawlie->hit_points;
}
else
{
// Need 11 HD and 3 corpses for a large abomination
if (newhd < 11
|| (crawlie->type == MONS_CRAWLING_CORPSE
&& merge_to->type == MONS_CRAWLING_CORPSE))
{
new_type = MONS_ABOMINATION_SMALL;
newhd = min(newhd, 15);
}
else
{
new_type = MONS_ABOMINATION_LARGE;
newhd = min(newhd, 30);
}
// Recompute in case we limited newhd.
addhd = newhd - orighd;
if (merge_to->type == MONS_ABOMINATION_SMALL)
{
// Adding to an existing abomination
int hp_gain = hit_points(addhd, 2, 5);
mhp = merge_to->max_hit_points + hp_gain;
hp = merge_to->hit_points + hp_gain;
hp = hp + hp/10;
}
if (merge_to->type == MONS_ABOMINATION_LARGE)
{
if (merge_to->max_hit_points == merge_to->hit_points){willmerge = false;}
else if (merge_to->max_hit_points <= merge_to->hit_points + merge_to->max_hit_points/10){hp = mhp;}
else{
hp = hp + mhp/10;}
}
else
// Making a new abomination
hp = mhp = hit_points(newhd, 2, 5);
}
monster_type old_type = merge_to->type;
string old_name = merge_to->name(DESC_A);
// Change the monster's type if we need to.
if (new_type != old_type)
change_monster_type(merge_to, new_type);
// Combine enchantment durations (weighted by original HD).
merge_to->hit_dice = orighd;
_merge_ench_durations(crawlie, merge_to, true);
init_abomination(merge_to, newhd);
merge_to->max_hit_points = mhp;
merge_to->hit_points = hp;
// TODO: probably should be more careful about which flags.
merge_to->flags |= crawlie->flags;
_lose_turn(merge_to, merge_to->mindex() < crawlie->mindex());
behaviour_event(merge_to, ME_EVAL);
// Messaging.
if (you.can_see(merge_to))
{
bool changed = new_type != old_type;
if (you.can_see(crawlie))
{
if (crawlie->type == old_type)
mprf("Two %s merge%s%s.",
pluralise(crawlie->name(DESC_PLAIN)).c_str(),
changed ? " to form " : "",
changed ? merge_to->name(DESC_A).c_str() : "");
else
mprf("%s merges with %s%s%s.",
crawlie->name(DESC_A).c_str(),
old_name.c_str(),
changed ? " to form " : "",
changed ? merge_to->name(DESC_A).c_str() : "");
}
else if (changed)
{
mprf("%s suddenly becomes %s.",
uppercase_first(old_name).c_str(),
merge_to->name(DESC_A).c_str());
}
else
mprf("%s twists grotesquely.", merge_to->name(DESC_A).c_str());
}
else if (you.can_see(crawlie))
mprf("%s suddenly disappears!", crawlie->name(DESC_A).c_str());
// Now kill the other monster
monster_die(crawlie, KILL_DISMISSED, NON_MONSTER, true);
}
return true;
}
*and replace _crawlie_is_mergable with this:
static bool _crawlie_is_mergeable(monster *mons)
{
if (!mons)
return false;
switch (mons->type)
{
case MONS_ABOMINATION_SMALL:
case MONS_CRAWLING_CORPSE:
case MONS_MACABRE_MASS:
case MONS_ABOMINATION_LARGE:
break;
default:
return false;
}
return !(mons->is_shapeshifter() || _disabled_merge(mons));
}
*If there's something wrong, please let me know.
0001-Make-aboms-from-twisted-resurrection-heal-from-corps.patch [^] (3,000 bytes) 2013-04-04 23:11 [Show Content] [Hide Content]From 6eea9a8e12f69067e137e23b3241cca5a0a6e38a Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <dolorous@users.sourceforge.net>
Date: Thu, 4 Apr 2013 15:46:24 -0500
Subject: [PATCH] Make aboms from twisted resurrection heal from corpses,
version 2.
Done using khalil's code in Mantis 6871, version 2 (slightly tweaked).
---
crawl-ref/source/mon-abil.cc | 19 +++++++++++++++++++
crawl-ref/source/mon-data.h | 4 ++--
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/crawl-ref/source/mon-abil.cc b/crawl-ref/source/mon-abil.cc
index 002c6ba..1fa2c89 100644
--- a/crawl-ref/source/mon-abil.cc
+++ b/crawl-ref/source/mon-abil.cc
@@ -444,6 +444,13 @@ static bool _do_merge_crawlies(monster* crawlie, monster* merge_to)
const int orighd = merge_to->hit_dice;
int addhd = crawlie->hit_dice;
+ // Abomination is fully healed.
+ if (merge_to->type == MONS_ABOMINATION_LARGE
+ && merge_to->max_hit_points == merge_to->hit_points)
+ {
+ return false;
+ }
+
// Need twice as many HD past 15.
if (orighd > 15)
addhd = (1 + addhd)/2;
@@ -486,6 +493,17 @@ static bool _do_merge_crawlies(monster* crawlie, monster* merge_to)
const int hp_gain = hit_points(addhd, 2, 5);
mhp = merge_to->max_hit_points + hp_gain;
hp = merge_to->hit_points + hp_gain;
+ hp += hp/10;
+ }
+ else if (merge_to->type == MONS_ABOMINATION_LARGE)
+ {
+ // Healing an existing abomination.
+ mhp = merge_to->max_hit_points;
+ hp = merge_to->hit_points;
+ if (mhp <= hp + mhp/10)
+ hp = mhp;
+ else
+ hp += mhp/10;
}
else
{
@@ -704,6 +722,7 @@ static bool _crawlie_is_mergeable(monster *mons)
switch (mons->type)
{
case MONS_ABOMINATION_SMALL:
+ case MONS_ABOMINATION_LARGE:
case MONS_CRAWLING_CORPSE:
case MONS_MACABRE_MASS:
break;
diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h
index 33cd40f..7419d83 100644
--- a/crawl-ref/source/mon-data.h
+++ b/crawl-ref/source/mon-data.h
@@ -2288,7 +2288,7 @@ static monsterentry mondata[] = {
// them MH_DEMONIC|MH_UNDEAD, but this is mostly the same as just
// MH_UNDEAD (save for some god interactions).
MONS_ABOMINATION_SMALL, 'x', LIGHTRED, "small abomination",
- M_NO_FLAGS,
+ M_NO_REGEN,
MR_NO_FLAGS,
0, 10, MONS_ABOMINATION_SMALL, MONS_ABOMINATION_SMALL, MH_UNDEAD, -5,
{ {AT_HIT, AF_PLAIN, 23}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
@@ -4085,7 +4085,7 @@ static monsterentry mondata[] = {
{
// See comment under MONS_ABOMINATION_SMALL regarding holiness.
MONS_ABOMINATION_LARGE, 'X', LIGHTRED, "large abomination",
- M_NO_FLAGS,
+ M_NO_REGEN,
MR_NO_FLAGS,
0, 10, MONS_ABOMINATION_SMALL, MONS_ABOMINATION_LARGE, MH_UNDEAD, -7,
{ {AT_HIT, AF_PLAIN, 40}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
--
1.7.4.4
|