1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-30 03:50:34 +00:00

racing:: guiding line feature

This commit is contained in:
Zeno Rogue 2019-01-07 04:53:09 +01:00
parent 21f85d6a44
commit a989214a46

View File

@ -9,6 +9,8 @@ namespace hr {
namespace racing { namespace racing {
bool guiding = false;
bool on; bool on;
bool player_relative = false; bool player_relative = false;
bool track_ready; bool track_ready;
@ -888,6 +890,9 @@ struct race_configurer {
dialog::editNumber(race_advance, 0, 360, 0.1, 1, XLAT("race advance"), ""); dialog::editNumber(race_advance, 0, 360, 0.1, 1, XLAT("race advance"), "");
}); });
dialog::addBoolItem(XLAT("guiding line"), guiding, 'g');
dialog::add_action([] () { guiding = !guiding; });
dialog::addItem(shmup::player_count_name(playercfg), 'n'); dialog::addItem(shmup::player_count_name(playercfg), 'n');
dialog::add_action([this] () { dialog::add_action([this] () {
playercfg = playercfg == 1 ? 2 : 1; playercfg = playercfg == 1 ? 2 : 1;
@ -1013,19 +1018,23 @@ void draw_ghost(ghost& ghost) {
if(!gmatrix.count(w)) return; if(!gmatrix.count(w)) return;
dynamicval<charstyle> x(getcs(), ghost.cs); dynamicval<charstyle> x(getcs(), ghost.cs);
transmatrix T = spin_uchar(p->alpha) * xpush(uchar_to_frac(p->distance) * distance_multiplier) * spin_uchar(p->beta);
if(ghost.cs.charid == -1) { if(ghost.cs.charid == -1) {
dynamicval<bool> pc(peace::on, true); dynamicval<bool> pc(peace::on, true);
drawMonsterType(eMonster(ghost.cs.uicolor), w, gmatrix[w] * T, ghost.cs.dresscolor, uchar_to_frac(p->footphase)); drawMonsterType(eMonster(ghost.cs.uicolor), w, get_ghostmoment(*p), ghost.cs.dresscolor, uchar_to_frac(p->footphase));
return; return;
} }
drawMonsterType(moPlayer, w, gmatrix[w] * T, 0, uchar_to_frac(p->footphase)); drawMonsterType(moPlayer, w, get_ghostmoment(*p), 0, uchar_to_frac(p->footphase));
} }
void markers() { void markers() {
if(!racing::on) return; if(!racing::on) return;
if(guiding) for(int i=0; i<multi::players; i++) {
shmup::monster *m = shmup::pc[i];
if(!m) continue;
for(int j=0; j<5; j++)
queueline(m->pat * xpush0(j), m->pat * xpush0(j+1), multi::scs[i].uicolor, 2);
}
if(racing::player_relative) { if(racing::player_relative) {
using namespace racing; using namespace racing;
cell *goal = NULL; cell *goal = NULL;