mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-02 12:19:18 +00:00
adjacency rule now also affects: slime spill, storms, heat, dry, live caves
This commit is contained in:
parent
9173c255ab
commit
0b7faa4b46
@ -293,14 +293,14 @@ EX void prespill(cell* c, eWall t, int rad, cell *from) {
|
|||||||
// block spill
|
// block spill
|
||||||
if(t == waTemporary) return;
|
if(t == waTemporary) return;
|
||||||
// cwt.at->item = itNone;
|
// cwt.at->item = itNone;
|
||||||
if(rad) for(int i=0; i<c->type; i++) if(c->move(i))
|
if(rad) for(cell *c2: adj_minefield_cells(c))
|
||||||
prespill(c->move(i), t, rad-1, c);
|
prespill(c2, t, rad-1, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
EX void spillfix(cell* c, eWall t, int rad) {
|
EX void spillfix(cell* c, eWall t, int rad) {
|
||||||
if(c->wall == waTemporary) c->wall = t;
|
if(c->wall == waTemporary) c->wall = t;
|
||||||
if(rad) for(int i=0; i<c->type; i++) if(c->move(i))
|
if(rad) for(cell *c2: adj_minefield_cells(c))
|
||||||
spillfix(c->move(i), t, rad-1);
|
spillfix(c2, t, rad-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
EX void spill(cell* c, eWall t, int rad) {
|
EX void spill(cell* c, eWall t, int rad) {
|
||||||
|
@ -2242,10 +2242,21 @@ void celldrawer::add_map_effects() {
|
|||||||
int tim = ticks - lightat;
|
int tim = ticks - lightat;
|
||||||
if(tim > 1000) tim = 800;
|
if(tim > 1000) tim = 800;
|
||||||
if(elec::havecharge && tim > 400) tim = 400;
|
if(elec::havecharge && tim > 400) tim = 400;
|
||||||
for(int t=0; t<c->type; t++) if(c->move(t) && c->move(t)->ligon) {
|
for(int t=0; t<c->type; t++) if(c->move(t)) {
|
||||||
|
if(c->move(t)->ligon) {
|
||||||
int lcol = darkena(gradient(iinf[itOrbLightning].color, 0, 0, tim, 1100), 0, 0xFF);
|
int lcol = darkena(gradient(iinf[itOrbLightning].color, 0, 0, tim, 1100), 0, 0xFF);
|
||||||
queueline(V*chei(xspinpush(ticks * M_PI / cgi.S42, cgi.hexf/2), rand() % 1000, 1000) * C0, V*chei(currentmap->adj(c, t), rand() % 1000, 1000) * C0, lcol, 2 + vid.linequality);
|
queueline(V*chei(xspinpush(ticks * M_PI / cgi.S42, cgi.hexf/2), rand() % 1000, 1000) * C0, V*chei(currentmap->adj(c, t), rand() % 1000, 1000) * C0, lcol, 2 + vid.linequality);
|
||||||
}
|
}
|
||||||
|
for(int u: {-1, 1}) {
|
||||||
|
cellwalker cw = cellwalker(c, t) + wstep + u;
|
||||||
|
if(u == -1 && VALENCE == 4) continue;
|
||||||
|
cell *c2 = cw.peek();
|
||||||
|
if(c2 && c2->ligon) {
|
||||||
|
int lcol = darkena(gradient(iinf[itOrbLightning].color, 0, 0, tim, 1100), 0, 0xFF);
|
||||||
|
queueline(V*chei(xspinpush(ticks * M_PI / cgi.S42, cgi.hexf/2), rand() % 1000, 1000) * C0, V*chei(currentmap->adj(c, t)*currentmap->adj(cw.at, cw.spin), rand() % 1000, 1000) * C0, lcol, 2 + vid.linequality);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(c->land == laWhirlwind) {
|
if(c->land == laWhirlwind) {
|
||||||
|
15
complex.cpp
15
complex.cpp
@ -306,9 +306,7 @@ EX namespace elec {
|
|||||||
if(from != 1) charges[id].lowlink = 1;
|
if(from != 1) charges[id].lowlink = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i=0; i<c->type; i++) {
|
for(cell *c2: adj_minefield_cells(c)) {
|
||||||
cell *c2 = c->move(i);
|
|
||||||
if(!c2) continue;
|
|
||||||
if(c2->listindex == from) continue;
|
if(c2->listindex == from) continue;
|
||||||
eCharge ct = getCharge(c2);
|
eCharge ct = getCharge(c2);
|
||||||
if(conduct(chh, ct))
|
if(conduct(chh, ct))
|
||||||
@ -2087,14 +2085,16 @@ EX namespace heat {
|
|||||||
if(isFire(c)) hmod += 4 * xrate;
|
if(isFire(c)) hmod += 4 * xrate;
|
||||||
if(isPrincess(c->monst)) hmod += (markEmpathy(itOrbWinter) ? -1.2 : 1.2) * 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))
|
if(!isIcyLand(ct) && isFire(ct))
|
||||||
hmod += xrate*.1;
|
hmod += xrate*.1;
|
||||||
if(ct->land == laVolcano)
|
if(ct->land == laVolcano)
|
||||||
hmod += xrate * (ct->wall == waMagma ? .4 : .2);
|
hmod += xrate * (ct->wall == waMagma ? .4 : .2);
|
||||||
}
|
}
|
||||||
|
|
||||||
forCellEx(ct, c) {
|
for(cell* ct: ls) {
|
||||||
if(!isIcyLand(ct)) {
|
if(!isIcyLand(ct)) {
|
||||||
// make sure that we can still enter Cocytus,
|
// make sure that we can still enter Cocytus,
|
||||||
// it won't heat up right away even without Orb of Winter or Orb of Speed
|
// it won't heat up right away even without Orb of Winter or Orb of Speed
|
||||||
@ -2179,7 +2179,8 @@ EX namespace heat {
|
|||||||
|
|
||||||
cell *last = c->move(c->type-1);
|
cell *last = c->move(c->type-1);
|
||||||
|
|
||||||
forCellEx(c2, c) {
|
auto ls = adj_minefield_cells(c);
|
||||||
|
for(cell* c2: ls) {
|
||||||
|
|
||||||
if(c->wall == waPartialFire) {
|
if(c->wall == waPartialFire) {
|
||||||
// two partial fires adjacent are necessary to spread
|
// two partial fires adjacent are necessary to spread
|
||||||
@ -2300,7 +2301,7 @@ EX void livecaves() {
|
|||||||
hv = 0;
|
hv = 0;
|
||||||
if(c->monst == moDarkTroll) c->monst = moTroll;
|
if(c->monst == moDarkTroll) c->monst = moTroll;
|
||||||
if(c->item || c->monst || c->cpdist == 0) continue;
|
if(c->item || c->monst || c->cpdist == 0) continue;
|
||||||
forCellEx(c2, c) {
|
for(cell *c2: adj_minefield_cells(c)) {
|
||||||
eWall w = c2->wall;
|
eWall w = c2->wall;
|
||||||
if(w == waDeadfloor) hv++, bringlife.push_back(c2);
|
if(w == waDeadfloor) hv++, bringlife.push_back(c2);
|
||||||
else if(w == waDeadwall || (w == waDeadfloor2 && !c2->monst))
|
else if(w == waDeadwall || (w == waDeadfloor2 && !c2->monst))
|
||||||
|
@ -750,12 +750,13 @@ EX void showEuclideanMenu() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if(among(specialland, laMinefield, laCA) && geometry_has_alt_mine_rule()) {
|
if(geometry_has_alt_mine_rule()) {
|
||||||
dialog::addSelItem(XLAT("mine adjacency rule"), XLAT(mine_adjacency_rule ? "vertex" : WDIM == 3 ? "face" : "edge"), 'M');
|
dialog::addSelItem(XLAT("adjacency rule"), XLAT(mine_adjacency_rule ? "vertex" : WDIM == 3 ? "face" : "edge"), 'M');
|
||||||
dialog::add_action([] {
|
dialog::add_action([] {
|
||||||
stop_game();
|
stop_game();
|
||||||
mine_adjacency_rule = !mine_adjacency_rule;
|
mine_adjacency_rule = !mine_adjacency_rule;
|
||||||
start_game();
|
start_game();
|
||||||
|
addMessage(XLAT("Note: adjacency rule affects environmental effects, but not movement."));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user