1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-29 13:07:40 +00:00

spaceship in turn-based mode attack is graphically represented by shooting a tiny missile, not by bumping

This commit is contained in:
Zeno Rogue
2024-10-12 10:39:30 +02:00
parent 831991d87e
commit 75247f9271
5 changed files with 25 additions and 7 deletions

View File

@@ -1710,6 +1710,11 @@ EX bool drawMonsterType(eMonster m, cell *where, const shiftmatrix& V1, color_t
return true;
case moBullet:
if(getcs().charid >= 10) {
ShadowV(V, cgi.shKnife);
queuepoly(VBODY, cgi.shMissile, getcs().swordcolor);
return true;
}
ShadowV(V, cgi.shKnife);
queuepoly(VBODY * spin270(), cgi.shKnife, getcs().swordcolor);
return true;
@@ -6102,6 +6107,7 @@ struct animation {
transmatrix attackat;
bool mirrored;
eItem thrown_item; /** for thrown items */
eMonster thrown_monster; /** for thrown monsters */
};
// we need separate animation layers for Orb of Domination and Tentacle+Ghost,
@@ -6153,7 +6159,7 @@ EX void animateMovement(const movei& m, int layer) {
a.mirrored = !a.mirrored;
}
EX void animate_item_throw(cell *from, cell *to, eItem it) {
EX void animate_item_throw(cell *from, cell *to, eItem it, eMonster mo IS(moNone)) {
bool steps = false;
again:
@@ -6169,6 +6175,7 @@ EX void animate_item_throw(cell *from, cell *to, eItem it) {
if(steps) {
animation& a = animations[LAYER_THROW][to];
a.thrown_item = it;
a.thrown_monster = mo;
}
}
@@ -6188,6 +6195,14 @@ EX void animateAttack(const movei& m, int layer) {
animateAttackOrHug(m, layer, 1, 1/3., 0);
}
EX void animateCorrectAttack(const movei& m, int layer, eMonster who) {
if(among(who, moPlayer, moMimic, moIllusion, moShadow) && getcs().charid >= 10) {
animate_item_throw(m.s, m.t, itNone, moBullet);
return;
}
animateAttackOrHug(m, layer, 1, 1/3., 0);
}
EX void animateHug(const movei& m, int layer) {
animateAttackOrHug(m, layer, 3, 0.5, -0.0713828 * cgi.scalefactor);
}