From 6fb64ab3ac64b81a0891bdbbdd5c0b5d2d9b933c Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Fri, 9 Oct 2009 14:46:00 +0200 Subject: Trees -- a new wall type, can be seen through (2nd square blocks LOS). Available as 't' for vault builders. Can be ignited using wands of fire, but the fire can't be controlled. --- crawl-ref/source/losparam.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'crawl-ref/source/losparam.cc') diff --git a/crawl-ref/source/losparam.cc b/crawl-ref/source/losparam.cc index c0a3ed0298..f19412616e 100644 --- a/crawl-ref/source/losparam.cc +++ b/crawl-ref/source/losparam.cc @@ -97,6 +97,8 @@ opacity_type los_param_base::opacity(const coord_def& p) const return OPC_OPAQUE; else if (is_opaque_cloud(cloud_idx(p))) return OPC_HALF; + else if (f == DNGN_TREES) + return OPC_HALF; else return OPC_CLEAR; } -- cgit v1.2.3-54-g00ecf From 759d9c1e18f28af3d2e8f1bfc234ec25dcfc2081 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Mon, 12 Oct 2009 22:01:42 +0200 Subject: Bushes -- tree-like monsters than can be destroyed with any means of damage, and are much easier to set on fire than trees. --- crawl-ref/source/beam.cc | 23 +++++++---------------- crawl-ref/source/dat/database/quotes.txt | 7 +++++++ crawl-ref/source/dat/descript/monsters.txt | 4 ++++ crawl-ref/source/enum.h | 1 + crawl-ref/source/externs.h | 2 +- crawl-ref/source/losparam.cc | 3 +++ crawl-ref/source/mon-data.h | 11 +++++++++++ crawl-ref/source/mon-util.cc | 14 ++++++++++++-- 8 files changed, 46 insertions(+), 19 deletions(-) (limited to 'crawl-ref/source/losparam.cc') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index d323bb995a..33f810a08b 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -2229,25 +2229,16 @@ int mons_adjust_flavoured(monsters *monster, bolt &pbolt, int hurted, if (doFlavouredEffects) simple_monster_message(monster, " resists."); } - else if (original < hurted) + else if (original < hurted && doFlavouredEffects) { if (mons_is_icy(monster->type)) - { - if (doFlavouredEffects) - simple_monster_message(monster, " melts!"); - } + simple_monster_message(monster, " melts!"); + else if (monster->type == MONS_BUSH) + simple_monster_message(monster, " is on fire!"); + else if (pbolt.flavour == BEAM_FIRE) + simple_monster_message(monster, " is burned terribly!"); else - { - if (doFlavouredEffects) - { - if (pbolt.flavour == BEAM_FIRE) - simple_monster_message(monster, - " is burned terribly!"); - else - simple_monster_message(monster, - " is scalded terribly!"); - } - } + simple_monster_message(monster, " is scalded terribly!"); } break; diff --git a/crawl-ref/source/dat/database/quotes.txt b/crawl-ref/source/dat/database/quotes.txt index c9dd161661..1de77e5784 100644 --- a/crawl-ref/source/dat/database/quotes.txt +++ b/crawl-ref/source/dat/database/quotes.txt @@ -546,6 +546,13 @@ bumblebee From every opening Flower!" -Isaac Watts. 1715. %%%% +bush + +"And the angel of the LORD appeared unto him in a flame of fire out of the + midst of a bush: and he looked, and, behold, the bush burned with fire, and + the bush was not consumed." + -KJV Bible, Ex3:2. +%%%% butterfly "Happiness is a butterfly, which when pursued, is always just beyond your diff --git a/crawl-ref/source/dat/descript/monsters.txt b/crawl-ref/source/dat/descript/monsters.txt index 0908bacdc5..870c96c8f7 100644 --- a/crawl-ref/source/dat/descript/monsters.txt +++ b/crawl-ref/source/dat/descript/monsters.txt @@ -412,6 +412,10 @@ brown ooze A viscous liquid, flowing along the floor in search of organic matter to corrode. %%%% +bush + +A woody plant that, unlike trees, can be removed even with bare hands. It looks dry enough to be easily set on fire. +%%%% water moccasin A largish venomous brown snake. It usually lives near water, and is an able swimmer. diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 9fdfcfc2b0..d20cb38008 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -1870,6 +1870,7 @@ enum monster_type // (int) menv[].type MONS_FLAMING_CORPSE, MONS_HARPY, MONS_TOADSTOOL, // 198 + MONS_BUSH, //jmf: end new monsters MONS_WHITE_IMP = 220, // 220 MONS_LEMURE, diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index c675520e37..0a7d1ff3ba 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -1335,7 +1335,7 @@ public: void scale_hp(int num, int den); bool gain_exp(int exp); - void react_to_damage(int damage, beam_type flavour); + void react_to_damage(int damage, beam_type flavour, kill_category whose); void forget_random_spell(); diff --git a/crawl-ref/source/losparam.cc b/crawl-ref/source/losparam.cc index f19412616e..3e9d09390a 100644 --- a/crawl-ref/source/losparam.cc +++ b/crawl-ref/source/losparam.cc @@ -92,6 +92,7 @@ unsigned short los_param_base::cloud_idx(const coord_def& p) const opacity_type los_param_base::opacity(const coord_def& p) const { + int m; dungeon_feature_type f = feature(p); if (grid_is_opaque(f)) return OPC_OPAQUE; @@ -99,6 +100,8 @@ opacity_type los_param_base::opacity(const coord_def& p) const return OPC_HALF; else if (f == DNGN_TREES) return OPC_HALF; + else if ((m = mgrd(trans(p))) && menv[m].type == MONS_BUSH) + return OPC_HALF; else return OPC_CLEAR; } diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h index 106987988f..8cabf9b596 100644 --- a/crawl-ref/source/mon-data.h +++ b/crawl-ref/source/mon-data.h @@ -2520,6 +2520,17 @@ static monsterentry mondata[] = { HT_LAND, 10, DEFAULT_ENERGY, MONUSE_NOTHING, MONEAT_NOTHING, SIZE_SMALL }, +{ + MONS_BUSH, 'P', BROWN, "bush", + M_NO_EXP_GAIN | M_STATIONARY, + MR_RES_POISON | MR_VUL_FIRE | MR_RES_ASPHYX, + 0, 10, MONS_BUSH, MONS_BUSH, MH_PLANT, MAG_IMMUNE, + { AT_NO_ATK, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, + { 20, 3, 5, 0 }, + 30, 0, MST_NO_SPELLS, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT, I_PLANT, + HT_LAND, 0, DEFAULT_ENERGY, MONUSE_NOTHING, MONEAT_NOTHING, SIZE_BIG +}, + // queen insects ('Q') { MONS_QUEEN_BEE, 'Q', YELLOW, "queen bee", diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index e5c4cca512..28f50718d4 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -25,6 +25,7 @@ REVISION("$Rev$"); #include "artefact.h" #include "beam.h" +#include "cloud.h" #include "database.h" #include "debug.h" #include "delay.h" @@ -6292,7 +6293,11 @@ int monsters::hurt(const actor *agent, int amount, beam_type flavour, // Allow the victim to exhibit passive damage behaviour (royal // jelly). - react_to_damage(amount, flavour); + kill_category whose = (agent == NULL) ? KC_OTHER : + (agent->atype() == ACT_PLAYER) ? KC_YOU : + mons_friendly_real((monsters*)agent) ? KC_FRIENDLY : + KC_OTHER; + react_to_damage(amount, flavour, whose); } if (cleanup_dead && (hit_points <= 0 || hit_dice <= 0) && type != -1) @@ -8441,7 +8446,7 @@ item_type_id_state_type monsters::drink_potion_effect(potion_type ptype) return (ident); } -void monsters::react_to_damage(int damage, beam_type flavour) +void monsters::react_to_damage(int damage, beam_type flavour, kill_category whose) { if (!alive()) return; @@ -8507,6 +8512,11 @@ void monsters::react_to_damage(int damage, beam_type flavour) menv[number].hurt(&you, damage, flavour); } } + else if (type == MONS_BUSH && flavour == BEAM_FIRE + && damage>8 && x_chance_in_y(damage, 20)) + { + place_cloud(CLOUD_FIRE, pos(), 20+random2(15), whose, 5); + } } ///////////////////////////////////////////////////////////////////////// -- cgit v1.2.3-54-g00ecf From 9695f808e2bce7193484d46aa3ac33720ab65db9 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Mon, 12 Oct 2009 23:28:24 +0200 Subject: Fix an use of uninitialized menv[]. --- crawl-ref/source/losparam.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crawl-ref/source/losparam.cc') diff --git a/crawl-ref/source/losparam.cc b/crawl-ref/source/losparam.cc index 3e9d09390a..ccae696e55 100644 --- a/crawl-ref/source/losparam.cc +++ b/crawl-ref/source/losparam.cc @@ -100,7 +100,7 @@ opacity_type los_param_base::opacity(const coord_def& p) const return OPC_HALF; else if (f == DNGN_TREES) return OPC_HALF; - else if ((m = mgrd(trans(p))) && menv[m].type == MONS_BUSH) + else if ((m = mgrd(trans(p))) != NON_MONSTER && menv[m].type == MONS_BUSH) return OPC_HALF; else return OPC_CLEAR; -- cgit v1.2.3-54-g00ecf