mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 17:10:36 +00:00
'monster face the player: changed the code to simpler and better
This commit is contained in:
parent
922e289b14
commit
26a98237e0
10
graph.cpp
10
graph.cpp
@ -2807,7 +2807,7 @@ EX bool drawMonster(const shiftmatrix& Vparam, int ct, cell *c, color_t col, col
|
|||||||
|
|
||||||
if(!nospins) {
|
if(!nospins) {
|
||||||
if(WDIM == 2 || prod) {
|
if(WDIM == 2 || prod) {
|
||||||
hyperpoint V0 = inverse_shift(cwtV, tC0(Vs));
|
hyperpoint V0 = inverse_shift(Vs, tC0(cwtV));
|
||||||
ld z = 0;
|
ld z = 0;
|
||||||
if(prod) {
|
if(prod) {
|
||||||
auto d = product_decompose(V0);
|
auto d = product_decompose(V0);
|
||||||
@ -2815,16 +2815,14 @@ EX bool drawMonster(const shiftmatrix& Vparam, int ct, cell *c, color_t col, col
|
|||||||
V0 = d.second;
|
V0 = d.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
hyperpoint V1 = spintox(V0) * V0;
|
|
||||||
|
|
||||||
if(hypot_d(2, tC0(unshift(Vs))) > 1e-3) {
|
if(hypot_d(2, tC0(unshift(Vs))) > 1e-3) {
|
||||||
Vs = cwtV * rspintox(V0) * rpushxto0(V1) * pispin;
|
Vs = Vs * rspintox(V0);
|
||||||
if(prod) Vs = mscale(Vs, z);
|
if(prod) Vs = mscale(Vs, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(!sl2) {
|
else if(!sl2) {
|
||||||
hyperpoint V0 = inverse_shift(cwtV, tC0(Vs));
|
hyperpoint V0 = inverse_shift(Vs, tC0(cwtV));
|
||||||
Vs = cwtV * rspintox(V0) * xpush(hdist0(V0)) * cspin(0, 2, -M_PI);
|
Vs = Vs * rspintox(V0);
|
||||||
// cwtV * rgpushxto0(inverse(cwtV) * tC0(Vs));
|
// cwtV * rgpushxto0(inverse(cwtV) * tC0(Vs));
|
||||||
}
|
}
|
||||||
if(c->monst == moHunterChanging)
|
if(c->monst == moHunterChanging)
|
||||||
|
Loading…
Reference in New Issue
Block a user