summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2009-11-18 15:46:58 +0100
committerAdam Borowski <kilobyte@angband.pl>2009-11-26 00:06:31 +0100
commit58c32846fce869fb03fc45ae0d137b55c6097b39 (patch)
treee6fee061fd5468f6ef3909fb1129e6a0d14b214c /crawl-ref/source
parent4e9088e3e1e500b31d321c696c67ade46df08b8c (diff)
downloadcrawl-ref-58c32846fce869fb03fc45ae0d137b55c6097b39.tar.gz
crawl-ref-58c32846fce869fb03fc45ae0d137b55c6097b39.zip
Un-underpopulate '4's by adding sixfirhy: elec theme, unorthodox timings.
Sixfirhies move in bursts: speed 30, but act only on 4 turns out of 12. They also get a bonus to moving compared to other actions (move cost 60%). Damage brand is AF_ELEC -- it's unproportionately dangerous, so the numbers only look small. Also, electricity heals them! It won't bring the back from over the edge if physical part of damage got them to 0 hp or less, in this case, they'll explode instead. Keeping with the long tradition of Crawl's demon names, the credit for this one goes to timecircuits' cat.
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/dat/descript/monsters.txt4
-rw-r--r--crawl-ref/source/enum.h2
-rw-r--r--crawl-ref/source/fight.cc31
-rw-r--r--crawl-ref/source/fight.h2
-rw-r--r--crawl-ref/source/item_use.cc13
-rw-r--r--crawl-ref/source/mon-act.cc4
-rw-r--r--crawl-ref/source/mon-data.h13
-rw-r--r--crawl-ref/source/monster.cc9
8 files changed, 59 insertions, 19 deletions
diff --git a/crawl-ref/source/dat/descript/monsters.txt b/crawl-ref/source/dat/descript/monsters.txt
index 5940e183b0..5f40ce17a2 100644
--- a/crawl-ref/source/dat/descript/monsters.txt
+++ b/crawl-ref/source/dat/descript/monsters.txt
@@ -1347,6 +1347,10 @@ A beautiful statue of silvery hue. Its eyes glow with an otherworldly radiance.
It looks brittle.
%%%%
+sixfirhy
+
+A small vile creature that moves in bursts, stopping then darting with lightning speed. The small trident it pokes people with seems to throw sparks all around.
+%%%%
skeletal dragon
A huge undead abomination, pieced together from the broken bones of many dragons.
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index d14fd76c9a..ac2973bb92 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -1702,7 +1702,7 @@ enum monster_type // (int) menv[].type
MONS_BLUE_DEVIL,
MONS_BEAST,
MONS_IRON_DEVIL, // 89
- // 90
+ MONS_SIXFIRHY,
//
//
//
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 7a3288680e..3429f71570 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -351,9 +351,11 @@ melee_attack::melee_attack(actor *attk, actor *defn,
final_attack_delay(0), noise_factor(0), extra_noise(0), weapon(NULL),
damage_brand(SPWPN_NORMAL), wpn_skill(SK_UNARMED_COMBAT), hands(HANDS_ONE),
hand_half_bonus(false), art_props(0), unrand_entry(NULL),
- attack_verb("bug"), verb_degree(), no_damage_message(),
- special_damage_message(), unarmed_attack(), shield(NULL),
- defender_shield(NULL), heavy_armour_penalty(0), can_do_unarmed(false),
+ attack_verb("bug"), verb_degree(),
+ no_damage_message(), special_damage_message(), unarmed_attack(),
+ special_damage_flavour(BEAM_NONE),
+ shield(NULL), defender_shield(NULL),
+ heavy_armour_penalty(0), can_do_unarmed(false),
water_attack(false), miscast_level(-1), miscast_type(SPTYP_NONE),
miscast_target(NULL), final_effects()
{
@@ -933,7 +935,7 @@ bool melee_attack::player_attack()
defender->name(DESC_NOCAP_THE).c_str());
}
- player_hurt_monster();
+ defender->hurt(&you, damage_done, special_damage_flavour, false);
if (damage_done)
player_exercise_combat_skills();
@@ -1922,12 +1924,6 @@ int melee_attack::player_weapon_type_modify(int damage)
return (damage);
}
-bool melee_attack::player_hurt_monster()
-{
- return damage_done && (damage_done = defender->hurt(&you, damage_done,
- BEAM_MISSILE, false));
-}
-
void melee_attack::player_exercise_combat_skills()
{
const bool helpless = defender->cannot_fight();
@@ -2077,12 +2073,12 @@ bool melee_attack::player_monattk_hit_effects(bool mondied)
}
#ifdef DEBUG_DIAGNOSTICS
- mprf(MSGCH_DIAGNOSTICS, "Special damage to %s: %d",
+ mprf(MSGCH_DIAGNOSTICS, "Special damage to %s: %d, flavour: %d",
defender->name(DESC_NOCAP_THE).c_str(),
- special_damage);
+ special_damage, special_damage_flavour);
#endif
- special_damage = defender->hurt(&you, special_damage, BEAM_MISSILE, false);
+ special_damage = defender->hurt(&you, special_damage, special_damage_flavour, false);
if (!defender->alive())
{
@@ -3194,6 +3190,7 @@ bool melee_attack::apply_damage_brand()
"You are electrocuted!"
: "There is a sudden explosion of sparks!";
special_damage = 10 + random2(15);
+ special_damage_flavour = BEAM_ELECTRICITY;
// Check for arcing in water, and add the final effect.
const coord_def& pos = defender->pos();
@@ -3639,6 +3636,7 @@ void melee_attack::player_apply_staff_damage()
special_damage_message =
make_stringf("%s is jolted!",
defender->name(DESC_CAP_THE).c_str());
+ special_damage_flavour = BEAM_ELECTRICITY;
}
break;
@@ -4975,6 +4973,7 @@ void melee_attack::mons_apply_attack_flavour(const mon_attack_def &attk)
defender->res_elec(),
attacker->get_experience_level() +
random2(attacker->get_experience_level() / 2));
+ special_damage_flavour = BEAM_ELECTRICITY;
if (defender->airborne())
special_damage = special_damage * 2 / 3;
@@ -5439,6 +5438,7 @@ void melee_attack::mons_perform_attack_rounds()
special_damage = 0;
special_damage_message.clear();
+ special_damage_flavour = BEAM_NONE;
// Monsters attacking themselves don't get attack flavour.
// The message sequences look too weird.
@@ -5461,7 +5461,7 @@ void melee_attack::mons_perform_attack_rounds()
break;
}
- defender->hurt(attacker, damage_done + special_damage);
+ defender->hurt(attacker, damage_done + special_damage, special_damage_flavour);
if (!defender->alive())
{
@@ -5488,6 +5488,7 @@ void melee_attack::mons_perform_attack_rounds()
special_damage = 0;
special_damage_message.clear();
+ special_damage_flavour = BEAM_NONE;
apply_damage_brand();
if (!special_damage_message.empty())
@@ -5500,7 +5501,7 @@ void melee_attack::mons_perform_attack_rounds()
}
if (special_damage > 0)
- defender->hurt(attacker, special_damage);
+ defender->hurt(attacker, special_damage, special_damage_flavour);
if (!defender->alive())
{
diff --git a/crawl-ref/source/fight.h b/crawl-ref/source/fight.h
index 3b18c6fea1..70e29f2a02 100644
--- a/crawl-ref/source/fight.h
+++ b/crawl-ref/source/fight.h
@@ -127,6 +127,7 @@ public:
std::string no_damage_message;
std::string special_damage_message;
std::string unarmed_attack;
+ beam_type special_damage_flavour;
item_def *shield;
item_def *defender_shield;
@@ -261,7 +262,6 @@ private:
bool player_hits_monster();
int player_calc_base_weapon_damage();
int player_calc_base_unarmed_damage();
- bool player_hurt_monster();
void player_exercise_combat_skills();
bool player_monattk_final_hit_effects(bool mondied);
bool player_monattk_hit_effects(bool mondied);
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 698a066220..515c54c414 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1880,7 +1880,16 @@ static bool _charged_hit_victim(bolt &beam, actor* victim, int &dmg,
if (victim->airborne() || victim->res_elec() > 0 || !one_chance_in(3))
return (false);
- dmg += 10 + random2(15);
+ // A hack and code duplication, but that's easier than adding accounting
+ // for each of multiple brands.
+ if (victim->id() == MONS_SIXFIRHY)
+ {
+ if (!beam.is_tracer)
+ victim->heal(10 + random2(15), false);
+ // physical damage is still done
+ }
+ else
+ dmg += 10 + random2(15);
if (beam.is_tracer)
return (false);
@@ -1888,6 +1897,8 @@ static bool _charged_hit_victim(bolt &beam, actor* victim, int &dmg,
if (you.can_see(victim))
if (victim->atype() == ACT_PLAYER)
dmg_msg = "You are electrocuted!";
+ else if (victim->id() == MONS_SIXFIRHY)
+ dmg_msg = victim->name(DESC_CAP_THE) + " is charged up!";
else
dmg_msg = "There is a sudden explosion of sparks!";
diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc
index 1501d747a8..d930815296 100644
--- a/crawl-ref/source/mon-act.cc
+++ b/crawl-ref/source/mon-act.cc
@@ -1747,7 +1747,9 @@ static void _handle_monster_move(monsters *monster)
_monster_regenerate(monster);
- if (monster->cannot_act())
+ if (monster->cannot_act()
+ || monster->type == MONS_SIXFIRHY // these move only 4 of 12 turns
+ && ++monster->number / 4 % 3 != 2) // but are not helpless
{
monster->speed_increment -= non_move_energy;
continue;
diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h
index 9c24c20fff..ae377d7c15 100644
--- a/crawl-ref/source/mon-data.h
+++ b/crawl-ref/source/mon-data.h
@@ -3687,6 +3687,19 @@ static monsterentry mondata[] = {
},
{
+ MONS_SIXFIRHY, '4', LIGHTBLUE, "sixfirhy",
+ M_NO_FLAGS,
+ MR_NO_FLAGS, // can't have RES_ELEC since most sources of damage do nothing
+ // in that case. We want to "suffer" the damage to get healed.
+ 0, 6, MONS_SIXFIRHY, MONS_SIXFIRHY, MH_DEMONIC, -6,
+ { {AT_HIT, AF_ELEC, 12}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
+ { 6, 3, 5, 0 },
+ 2, 20, MST_NO_SPELLS, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT,
+ I_NORMAL, HT_LAND, FL_NONE, 30, MOVE_ENERGY(6), // speed is cut to 1/3 later
+ MONUSE_OPEN_DOORS, MONEAT_NOTHING, SIZE_LITTLE
+},
+
+{
MONS_HELLWING, '4', LIGHTGREY, "hellwing",
M_SPELLCASTER,
MR_RES_POISON,
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index 8d37374679..ede1fd4807 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -5881,6 +5881,15 @@ item_type_id_state_type monsters::drink_potion_effect(potion_type ptype)
void monsters::react_to_damage(int damage, beam_type flavour, kill_category whose)
{
+ if (type == MONS_SIXFIRHY && flavour == BEAM_ELECTRICITY)
+ {
+ if (!alive()) // overcharging is deadly
+ simple_monster_message(this, " explodes in an explosion of sparks!");
+ else if (heal(damage*2, false))
+ simple_monster_message(this, " seems to be charged up!");
+ return;
+ }
+
if (!alive())
return;