1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-28 04:17:39 +00:00
This commit is contained in:
Zeno Rogue
2019-12-26 22:40:41 +01:00
23 changed files with 465 additions and 210 deletions

View File

@@ -306,9 +306,7 @@ EX namespace elec {
if(from != 1) charges[id].lowlink = 1;
}
for(int i=0; i<c->type; i++) {
cell *c2 = c->move(i);
if(!c2) continue;
for(cell *c2: adj_minefield_cells(c)) {
if(c2->listindex == from) continue;
eCharge ct = getCharge(c2);
if(conduct(chh, ct))
@@ -956,6 +954,46 @@ EX namespace clearing {
steps--; ds++;
}
}
typedef tuple<int, int, int, int> celltype;
map<celltype, pair<bignum, int> > stats;
EX bignum imputed;
EX int direct;
map<cell*, pair<bignum, int> > score;
celltype get_celltype(cell *c) {
cell *c1 = c;
if(c->mondir < c->type)
c1 = c->move(c->mondir);
return make_tuple(
celldistAlt(c), type_in(expansion, c, celldistAlt),
celldistAlt(c1), type_in(expansion, c1, celldistAlt)
);
}
EX void imput(cell *c) {
if(bounded) return;
if(score.count(c)) return;
auto& is = score[c];
celltype t = get_celltype(c);
auto& stat = stats[t];
is.second = c->mondir;
if(c->mpdist <= 6) {
is.first = 1;
forCellEx(c2, c) if(score.count(c2) && c2->move(score[c2].second) == c)
is.first += score[c2].first;
stat.first += is.first;
stat.second++;
}
else {
is.first = stat.second ? stat.first.randomized_div(stat.second) : bignum(1);
imputed += is.first;
}
}
EX }
EX namespace whirlpool {
@@ -2047,14 +2085,16 @@ EX namespace heat {
if(isFire(c)) hmod += 4 * xrate;
if(isPrincess(c->monst)) hmod += (markEmpathy(itOrbWinter) ? -1.2 : 1.2) * xrate;
forCellEx(ct, c) {
auto ls = adj_minefield_cells(c);
for(cell* ct: ls) {
if(!isIcyLand(ct) && isFire(ct))
hmod += xrate*.1;
if(ct->land == laVolcano)
hmod += xrate * (ct->wall == waMagma ? .4 : .2);
}
forCellEx(ct, c) {
for(cell* ct: ls) {
if(!isIcyLand(ct)) {
// make sure that we can still enter Cocytus,
// it won't heat up right away even without Orb of Winter or Orb of Speed
@@ -2139,7 +2179,8 @@ EX namespace heat {
cell *last = c->move(c->type-1);
forCellEx(c2, c) {
auto ls = adj_minefield_cells(c);
for(cell* c2: ls) {
if(c->wall == waPartialFire) {
// two partial fires adjacent are necessary to spread
@@ -2260,7 +2301,7 @@ EX void livecaves() {
hv = 0;
if(c->monst == moDarkTroll) c->monst = moTroll;
if(c->item || c->monst || c->cpdist == 0) continue;
forCellEx(c2, c) {
for(cell *c2: adj_minefield_cells(c)) {
eWall w = c2->wall;
if(w == waDeadfloor) hv++, bringlife.push_back(c2);
else if(w == waDeadwall || (w == waDeadfloor2 && !c2->monst))