mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-25 09:30:35 +00:00
Automatic evoking of Beauty/Freedom/Sword/SwordII on Inventory
This commit is contained in:
parent
02af85a871
commit
b8f7675878
12
complex.cpp
12
complex.cpp
@ -2485,10 +2485,18 @@ namespace sword {
|
|||||||
return ((s2*S42/c2->type - s1*S42/c1->type) + S21 + angle) % S42;
|
return ((s2*S42/c2->type - s1*S42/c1->type) + S21 + angle) % S42;
|
||||||
}
|
}
|
||||||
|
|
||||||
void shuffle() {
|
void shuffle(int i) {
|
||||||
for(int i=0; i<MAXPLAYER; i++)
|
|
||||||
sword::angle[i] = euclid ? S7*hrand(6) : purehepta ? 3*hrand(S14)+1 : hrand(S42);
|
sword::angle[i] = euclid ? S7*hrand(6) : purehepta ? 3*hrand(S14)+1 : hrand(S42);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void reset() {
|
||||||
|
items[itOrbSword] = items[itOrbSword2] = 0;
|
||||||
|
shuffle(multi::cpid);
|
||||||
|
}
|
||||||
|
|
||||||
|
void shuffle() {
|
||||||
|
for(int i=0; i<MAXPLAYER; i++) shuffle(i);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace kraken {
|
namespace kraken {
|
||||||
|
6
game.cpp
6
game.cpp
@ -4415,10 +4415,14 @@ bool swordAttack(cell *mt, eMonster who, cell *c, int bb) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void swordAttackStatic(int bb) {
|
||||||
|
swordAttack(cwt.c, moPlayer, sword::pos(multi::cpid, bb), bb);
|
||||||
|
}
|
||||||
|
|
||||||
void swordAttackStatic() {
|
void swordAttackStatic() {
|
||||||
for(int bb = 0; bb < 2; bb++)
|
for(int bb = 0; bb < 2; bb++)
|
||||||
if(sword::orbcount(bb))
|
if(sword::orbcount(bb))
|
||||||
swordAttack(cwt.c, moPlayer, sword::pos(multi::cpid, bb), bb);
|
swordAttackStatic(bb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void stabbingAttack(cell *mf, cell *mt, eMonster who, int bonuskill) {
|
void stabbingAttack(cell *mf, cell *mt, eMonster who, int bonuskill) {
|
||||||
|
@ -282,9 +282,46 @@ namespace inv {
|
|||||||
return " "+XLAT1(iinf[it].name) + " ("+s+")";
|
return " "+XLAT1(iinf[it].name) + " ("+s+")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void evokeBeautyAt(cell *c) {
|
||||||
|
forCellEx(c2, c)
|
||||||
|
if(c2->monst && !isFriendly(c2->monst) && !isIvy(c2->monst)) {
|
||||||
|
c2->stuntime += 3;
|
||||||
|
checkStunKill(c2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void evokeOrb(eItem it) {
|
||||||
|
if(it == itOrbFreedom)
|
||||||
|
for(int i=0; i<numplayers(); i++)
|
||||||
|
if(multi::playerActive(i))
|
||||||
|
checkFreedom(playerpos(i));
|
||||||
|
|
||||||
|
if(it == itOrbBeauty) {
|
||||||
|
for(int i=0; i<numplayers(); i++)
|
||||||
|
if(multi::playerActive(i))
|
||||||
|
evokeBeautyAt(playerpos(i));
|
||||||
|
if(items[itOrbEmpathy])
|
||||||
|
for(cell *c: dcal) if(isFriendly(c->monst))
|
||||||
|
evokeBeautyAt(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(it == itOrbSword || it == itOrbSword2) {
|
||||||
|
for(int i=0; i<numplayers(); i++)
|
||||||
|
if(multi::playerActive(i)) {
|
||||||
|
cwt.c = playerpos(i);
|
||||||
|
multi::cpid = i;
|
||||||
|
swordAttackStatic(it == itOrbSword2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void show() {
|
void show() {
|
||||||
|
|
||||||
|
if(remaining[itOrbSword]) items[itOrbSword]++;
|
||||||
|
if(remaining[itOrbSword2]) items[itOrbSword2]++;
|
||||||
gamescreen(2);
|
gamescreen(2);
|
||||||
|
if(remaining[itOrbSword]) items[itOrbSword]--;
|
||||||
|
if(remaining[itOrbSword2]) items[itOrbSword2]--;
|
||||||
cmode = sm::CENTER;
|
cmode = sm::CENTER;
|
||||||
|
|
||||||
orbcoord.clear();
|
orbcoord.clear();
|
||||||
@ -470,6 +507,7 @@ namespace inv {
|
|||||||
if(getOLR(it, getPrizeLand()))
|
if(getOLR(it, getPrizeLand()))
|
||||||
usedForbidden = true;
|
usedForbidden = true;
|
||||||
cwt.c->item = it;
|
cwt.c->item = it;
|
||||||
|
evokeOrb(orbmap[uni]);
|
||||||
checkmove();
|
checkmove();
|
||||||
popScreenAll();
|
popScreenAll();
|
||||||
}
|
}
|
||||||
|
5
orbs.cpp
5
orbs.cpp
@ -545,7 +545,7 @@ void teleportTo(cell *dest) {
|
|||||||
|
|
||||||
bfs();
|
bfs();
|
||||||
|
|
||||||
items[itOrbSword] = 0;
|
sword::reset();
|
||||||
items[itOrbSword2] = 0;
|
items[itOrbSword2] = 0;
|
||||||
if(shmup::on)
|
if(shmup::on)
|
||||||
shmup::teleported();
|
shmup::teleported();
|
||||||
@ -568,8 +568,7 @@ void jumpTo(cell *dest, eItem byWhat, int bonuskill = 0, eMonster dashmon = moNo
|
|||||||
}
|
}
|
||||||
countLocalTreasure();
|
countLocalTreasure();
|
||||||
|
|
||||||
items[itOrbSword] = 0;
|
sword::reset();
|
||||||
items[itOrbSword2] = 0;
|
|
||||||
stabbingAttack(c1, dest, moPlayer, bonuskill);
|
stabbingAttack(c1, dest, moPlayer, bonuskill);
|
||||||
playerMoveEffects(c1, dest);
|
playerMoveEffects(c1, dest);
|
||||||
if(cwt.c->item != itOrbYendor && cwt.c->item != itHolyGrail)
|
if(cwt.c->item != itOrbYendor && cwt.c->item != itHolyGrail)
|
||||||
|
Loading…
Reference in New Issue
Block a user