mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-03 02:12:48 +00:00
ads:: preliminary lands
This commit is contained in:
parent
7627fd9255
commit
3cefee3a54
@ -32,6 +32,7 @@ namespace rogueviz { std::vector<hr::reaction_t> cleanup; }
|
|||||||
#include "globals.cpp"
|
#include "globals.cpp"
|
||||||
#include "shapes.cpp"
|
#include "shapes.cpp"
|
||||||
#include "resources.cpp"
|
#include "resources.cpp"
|
||||||
|
#include "ads-lands.cpp"
|
||||||
#include "map.cpp"
|
#include "map.cpp"
|
||||||
#include "control.cpp"
|
#include "control.cpp"
|
||||||
#include "display.cpp"
|
#include "display.cpp"
|
||||||
@ -207,7 +208,7 @@ void gamedata(hr::gamedata* gd) {
|
|||||||
|
|
||||||
void set_config() {
|
void set_config() {
|
||||||
lps_enable(&lps_relhell);
|
lps_enable(&lps_relhell);
|
||||||
enable_canvas();
|
// enable_canvas();
|
||||||
}
|
}
|
||||||
|
|
||||||
void run_ads_game_std() {
|
void run_ads_game_std() {
|
||||||
|
@ -89,11 +89,14 @@ void draw_game_cell(const cell_to_draw& cd) {
|
|||||||
color_t col =
|
color_t col =
|
||||||
t == wtSolid ? 0x603000FF :
|
t == wtSolid ? 0x603000FF :
|
||||||
t == wtDestructible ? 0x301800FF :
|
t == wtDestructible ? 0x301800FF :
|
||||||
0x181818FF;
|
t == wtBarrier ? 0xC0C0C0FF :
|
||||||
|
empty_color(c);
|
||||||
|
|
||||||
|
color_t out = t == wtNone ? empty_outline(c) : 0xFF;
|
||||||
|
|
||||||
for(auto h: hlist) curvepoint(h.h);
|
for(auto h: hlist) curvepoint(h.h);
|
||||||
addaura(shiftless(cd.center.h), col >> 8, 0);
|
addaura(shiftless(cd.center.h), col >> 8, 0);
|
||||||
queuecurve(shiftless(Id), 0x101010FF, col, PPR::WALL);
|
queuecurve(shiftless(Id), out, col, PPR::WALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(view_proper_times) {
|
if(view_proper_times) {
|
||||||
|
@ -155,7 +155,7 @@ color_t ghost_color = 0x800080FF;
|
|||||||
|
|
||||||
enum eObjType { oRock, oMissile, oParticle, oResource, oMainRock, oTurret, oTurretMissile };
|
enum eObjType { oRock, oMissile, oParticle, oResource, oMainRock, oTurret, oTurretMissile };
|
||||||
enum eResourceType { rtNone, rtHull, rtGold, rtAmmo, rtFuel, rtOxygen };
|
enum eResourceType { rtNone, rtHull, rtGold, rtAmmo, rtFuel, rtOxygen };
|
||||||
enum eWalltype { wtNone, wtDestructible, wtSolid, wtGate };
|
enum eWalltype { wtNone, wtDestructible, wtSolid, wtGate, wtBarrier };
|
||||||
|
|
||||||
PPR obj_prio[7] = { PPR::MONSTER_BODY, PPR::ITEMa, PPR::ITEM_BELOW, PPR::ITEM, PPR::MONSTER_HEAD, PPR::MONSTER_BODY, PPR::ITEMa };
|
PPR obj_prio[7] = { PPR::MONSTER_BODY, PPR::ITEMa, PPR::ITEM_BELOW, PPR::ITEM, PPR::MONSTER_HEAD, PPR::MONSTER_BODY, PPR::ITEMa };
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ map<int, int> genstats;
|
|||||||
int gen_budget;
|
int gen_budget;
|
||||||
|
|
||||||
void gen_terrain(cell *c, cellinfo& ci, int level = 0) {
|
void gen_terrain(cell *c, cellinfo& ci, int level = 0) {
|
||||||
|
setdist(c, 7, nullptr);
|
||||||
if(level >= ci.mpd_terrain) return;
|
if(level >= ci.mpd_terrain) return;
|
||||||
if(!hyperbolic) { println(hlog, "wrong geometry detected in gen_terrain!"); exit(1); }
|
if(!hyperbolic) { println(hlog, "wrong geometry detected in gen_terrain!"); exit(1); }
|
||||||
if(ci.mpd_terrain > level + 1) gen_terrain(c, ci, level+1);
|
if(ci.mpd_terrain > level + 1) gen_terrain(c, ci, level+1);
|
||||||
@ -82,9 +83,21 @@ void gen_terrain(cell *c, cellinfo& ci, int level = 0) {
|
|||||||
ci_at[c].type = wtGate;
|
ci_at[c].type = wtGate;
|
||||||
}
|
}
|
||||||
ci.mpd_terrain = level;
|
ci.mpd_terrain = level;
|
||||||
|
|
||||||
|
if(c->land == laBarrier)
|
||||||
|
ci_at[c].type = wtBarrier;
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_rock(cell *c, cellinfo& ci, const ads_matrix& T) {
|
void add_rock(cell *c, cellinfo& ci, const ads_matrix& T) {
|
||||||
|
|
||||||
|
bool fail = false;
|
||||||
|
compute_life(hybrid::get_at(c, 0), unshift(T), [&] (cell *c, ld t) {
|
||||||
|
setdist(c, 7, nullptr);
|
||||||
|
if(c->land == laBarrier) fail = true;
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
if(fail) return;
|
||||||
|
|
||||||
eResourceType rt = eResourceType(rand() % 6);
|
eResourceType rt = eResourceType(rand() % 6);
|
||||||
auto r = std::make_unique<ads_object> (oRock, c, T, rock_color[rt]);
|
auto r = std::make_unique<ads_object> (oRock, c, T, rock_color[rt]);
|
||||||
r->resource = rt;
|
r->resource = rt;
|
||||||
@ -102,7 +115,7 @@ void add_rock(cell *c, cellinfo& ci, const ads_matrix& T) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if(q == 0) ci.type = wtNone;
|
if(q == 0) ci.type = wtNone;
|
||||||
compute_life(hybrid::get_at(c, 0), unshift(r->at), cleanup);
|
compute_life(hybrid::get_at(c, 0), unshift(T), cleanup);
|
||||||
|
|
||||||
/* for(int i=0; i<isize(r->shape[0]); i += 2) { // exact check is too slow here
|
/* for(int i=0; i<isize(r->shape[0]); i += 2) { // exact check is too slow here
|
||||||
hyperpoint h;
|
hyperpoint h;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user