|
From: <gi...@cr...> - 2011-08-31 12:22:13
|
via 54c1e52da85050b04b1028e2cbab2b0b750db207 (commit)
via a03587e102aa795678688546765316fbd44a4538 (commit)
via c3c860bcac3e5f8a98b91202034c7375baa2ae94 (commit)
from 4305f1e5298fda1f2fb4706ffe9d5e0e90ce26e3 (commit)
-----------------------------------------------------------------------
commit 54c1e52da85050b04b1028e2cbab2b0b750db207
Author: Adam Borowski <kil...@an...>
Date: Wed Aug 31 14:21:11 2011 +0200
Napkin's changes to CIA.
commit a03587e102aa795678688546765316fbd44a4538
Author: Adam Borowski <kil...@an...>
Date: Wed Aug 31 14:18:12 2011 +0200
Don't place that many webs in the Crypt, way too spammy even for a test.
commit c3c860bcac3e5f8a98b91202034c7375baa2ae94
Author: Pete Hurst <pe...@do...>
Date: Wed Aug 31 03:09:15 2011 +0100
Generating webs on dungeon build
-----------------------------------------------------------------------
Summary of changes:
crawl-ref/git-hooks/crawl-ref-cia | 4 ++-
crawl-ref/source/dungeon.cc | 49 +++++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+), 1 deletions(-)
diff --git a/crawl-ref/git-hooks/crawl-ref-cia b/crawl-ref/git-hooks/crawl-ref-cia
index 63b7f97..810fefa 100755
--- a/crawl-ref/git-hooks/crawl-ref-cia
+++ b/crawl-ref/git-hooks/crawl-ref-cia
@@ -173,6 +173,7 @@ $user =~ s/scintilla/greensnark/;
$user =~ s/burnhamrobertp/Cryp71c/;
$user =~ s/^muu+$/Mu/i;
$user =~ s/raphael.langella/galehar/;
+$user =~ s/hyperelliptical/elliptic/;
$user =~ s/flodiebold/edlothiol/;
# Other regular contributorss
@@ -297,7 +298,8 @@ open (MAIL, "| $sendmail -t -oi -oem") or die "Cannot execute $sendmail : " . ($
print MAIL <<EOM;
From: $from_email
To: $dest_email
-Content-type: text/xml
+Content-Type: text/xml; charset=UTF-8
+Content-Transfer-Encoding: 8bit
Subject: DeliverXML
EOM
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 788a723..8fa53ee 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -2911,6 +2911,50 @@ static bool _shaft_is_in_corridor(const coord_def& c)
return (false);
}
+static void _place_webs(int num)
+{
+ int slot = 0;
+ for (int j = 0; j < num; j++)
+ {
+ for (;; slot++)
+ {
+ if (slot >= MAX_TRAPS)
+ return;
+ if (env.trap[++slot].type == TRAP_UNASSIGNED)
+ break;
+ };
+ trap_def& ts(env.trap[slot]);
+
+ int tries;
+ // TODO: reuse this logic to place new traps at regular intervals (out of LOS)
+ for (tries = 0; tries < 200; ++tries)
+ {
+ ts.pos.x = random2(GXM);
+ ts.pos.y = random2(GYM);
+ if (in_bounds(ts.pos)
+ && grd(ts.pos) == DNGN_FLOOR
+ && !map_masked(ts.pos, MMT_NO_TRAP))
+ {
+ // Calculate weight
+ int weight = 0;
+ for (adjacent_iterator ai(ts.pos); ai; ++ai)
+ if (feat_is_solid(grd(*ai)))
+ weight++;
+ if (one_chance_in(10 - weight))
+ break;
+ }
+ }
+
+ if (tries >= 200)
+ break;
+
+ ts.type = TRAP_WEB;
+ grd(ts.pos) = DNGN_UNDISCOVERED_TRAP;
+ env.tgrid(ts.pos) = slot;
+ ts.prepare_ammo();
+ }
+}
+
static void _place_traps(int level_number)
{
const int num_traps = num_traps_for_place(level_number);
@@ -2964,6 +3008,11 @@ static void _place_traps(int level_number)
ts.reveal();
ts.prepare_ammo();
}
+
+ if (player_in_branch(BRANCH_SPIDER_NEST))
+ _place_webs(400 - num_traps) / 2);
+ else if (player_in_branch(BRANCH_CRYPT))
+ _place_webs(random2(20));
}
static void _dgn_place_feature_at_random_floor_square(dungeon_feature_type feat,
--
Dungeon Crawl Stone Soup
|