1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

choice of the magic sword graphics now depends on the scale; in shmup, the tip is now set automatically based on the graphics

This commit is contained in:
Zeno Rogue 2019-03-09 17:36:04 +01:00
parent d9b90d8a8e
commit 14ea73be06
4 changed files with 12 additions and 6 deletions

View File

@ -25,6 +25,8 @@ transmatrix invheptmove[MAX_EDGE], invhexmove[MAX_EDGE];
ld hexshift;
ld sword_size = 0;
// the results are:
// hexf = 0.378077 hcrossf = 0.620672 tessf = 1.090550
// hexhexdist = 0.566256

View File

@ -3434,6 +3434,7 @@ void queuereset(eModel m, PPR prio);
extern ld tessf, crossf, hexf, hcrossf, hexhexdist, hexvdist, hepvdist, rhexf;
extern ld sword_size;
extern ld scalefactor, orbsize, floorrad0, floorrad1, zhexf;

View File

@ -2924,11 +2924,14 @@ void buildpolys() {
for(int v=0; v<13; v++) for(int z=0; z<2; z++)
copyshape(shTortoise[v][4+z], shTortoise[v][2+z], PPR(shTortoise[v][2+z].prio + (PPR::CARRIED-PPR::ITEM)));
if(!BITRUNCATED) bshape(shMagicSword, PPR::MAGICSWORD, scalefactor, 243);
else bshape(shMagicSword, PPR::MAGICSWORD, 1, 244);
if(scalefactor > 1.5) bshape(shMagicSword, PPR::MAGICSWORD, scalefactor / 1.7570466583108084, 243);
else bshape(shMagicSword, PPR::MAGICSWORD, scalefactor, 244);
sword_size = 0;
for(int i=shMagicSword.s; i<shMagicSword.e; i++)
sword_size = max(sword_size, hdist0(hpc[i]));
if(!BITRUNCATED) bshape(shMagicShovel, PPR::MAGICSWORD, scalefactor, 333);
else bshape(shMagicShovel, PPR::MAGICSWORD, 1, 333);
bshape(shMagicShovel, PPR::MAGICSWORD, scalefactor, 333);
bshape(shBead0, PPR(20), 1, 250);
bshape(shBead1, PPR(20), 1, 251);

View File

@ -1460,8 +1460,8 @@ hyperpoint keytarget(int i) {
return 0;
} */
double getSwordSize() { return 0.7255; }
double getHornsSize() { return 0.33; }
double getSwordSize() { return sword_size; }
double getHornsSize() { return scalefactor * 0.33; }
hyperpoint swordpos(int id, bool rev, double frac) {
return pc[id]->pat * xspinpush0(pc[id]->swordangle, (rev?-frac:frac) * getSwordSize());