From f9ba0414513b348f93653e5d89b88ac9685862ab Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 4 Apr 2019 14:54:55 +0200 Subject: [PATCH] asteroids:: theming, changed look to invisible floors + grid, provided validity rules --- classes.cpp | 3 +++ content.cpp | 6 +++--- game.cpp | 2 ++ graph.cpp | 2 +- landgen.cpp | 1 + landlock.cpp | 7 +++++++ 6 files changed, 17 insertions(+), 4 deletions(-) diff --git a/classes.cpp b/classes.cpp index 8e4baec9..ce89e586 100644 --- a/classes.cpp +++ b/classes.cpp @@ -410,6 +410,9 @@ const char *ruindesc = "Once a beautiful city... but now overrun by the mighty Raiders of unknown origin.\n\n" "Raiders cannot be harmed with mundane weapons, but each color has its movement restrictions."; +const char *rock_description = + "Shoot the Space Rocks for score. Large Rocks will split into two smaller rocks."; + monstertype minf[motypes] = { #define MONSTER(a,b,c,d,e,f,g,h) {a,b,c,e,g,h}, #include "content.cpp" diff --git a/content.cpp b/content.cpp index 62ec25c8..ad793035 100644 --- a/content.cpp +++ b/content.cpp @@ -1257,9 +1257,9 @@ LAND( 0x30FF30, "Irradiated Field", laVariant, ZERO, itVarTreasure, RESERVED, // add new content here -LAND( 0x202020, "Asteroids", laAsteroids, ZERO, itAsteroid, RESERVED, NODESCYET) -ITEM( '*', 0xFFFFFF, "Ice Diamond", itAsteroid, IC_TREASURE, ZERO, RESERVED, osNone, NODESCYET) -MONSTER('A', 0x606040, "Asteroid", moAsteroid, ZERO, RESERVED, moAsteroid, NODESCYET) +LAND( 0x202020, "Space Rocks", laAsteroids, ZERO, itAsteroid, RESERVED, rock_description) +ITEM( '!', 0xFFD0D0, "Fuel", itAsteroid, IC_TREASURE, ZERO, RESERVED, osNone, rock_description) +MONSTER('A', 0x606040, "Space Rock", moAsteroid, ZERO, RESERVED, moAsteroid, rock_description) //shmupspecials MONSTER( '@', 0xC0C0C0, "Rogue", moPlayer, ZERO | CF_PLAYER, RESERVED, moNone, "In the Shoot'em Up mode, you are armed with thrown Knives.") diff --git a/game.cpp b/game.cpp index 6c30e4d9..78fe9415 100644 --- a/game.cpp +++ b/game.cpp @@ -3305,6 +3305,8 @@ bool makeEmpty(cell *c) { ; else if(c->wall == waGiantRug) ; + else if(c->wall == waInvisibleFloor) + ; else if(c->wall == waDock) ; else if(c->land == laDocks) diff --git a/graph.cpp b/graph.cpp index 5c7e7c0b..63c0b47d 100644 --- a/graph.cpp +++ b/graph.cpp @@ -5466,7 +5466,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { queuechr(V, 1, ch, darkenedby(asciicol, darken), 2); } - if(vid.grid || (DIM == 3 && c->land == laAsteroids)) { + if(vid.grid || c->land == laAsteroids) { dynamicval lw(vid.linewidth, vid.linewidth); vid.linewidth *= scalefactor; diff --git a/landgen.cpp b/landgen.cpp index 7d62fa51..4bb015ff 100644 --- a/landgen.cpp +++ b/landgen.cpp @@ -2379,6 +2379,7 @@ void giantLandSwitch(cell *c, int d, cell *from) { break; case laAsteroids: + c->wall = waInvisibleFloor; break; case landtypes: break; diff --git a/landlock.cpp b/landlock.cpp index 11865230..fc32a9d4 100644 --- a/landlock.cpp +++ b/landlock.cpp @@ -1001,6 +1001,7 @@ namespace lv { land_validity_t pattern_special = {3, qm3, "Special pattern implemented for this geometry."}; land_validity_t not_3d = {0, q0, "This land does not make much sense in 3D."}; land_validity_t not_binary = {0, q0, "This land does not make much sense in binary tiling."}; + land_validity_t shmup_only = {0, q0, "This land works only in the shmup mode."}; } // old Daily Challenges should keep their validity forever @@ -1023,6 +1024,12 @@ land_validity_t& land_validity(eLand l) { return disabled; #endif + if(l == laAsteroids) { + if(!shmup::on) return shmup_only; + if(!bounded) return bounded_only; + return specially_designed; + } + if(DIM == 3) { if(l == laWarpCoast) return ugly_version; if(l == laWineyard && hyperbolic && !binarytiling && S7 == 6) return lv::pattern_special;