- [FIX] Al moure en mode floating no guardava
- [NEW] Cicle d'animació [0 1 0 1] - [CHG] Forma diferent de pillat el tipo de booster i el ID per a que no torne a apareixer - [NEW] Nou moviment: RANDJ - Nous gràfics, enemics, objectes - Més habitacions
This commit is contained in:
@@ -11,10 +11,11 @@
|
||||
|
||||
namespace actor
|
||||
{
|
||||
uint8_t anims[3][4] = {
|
||||
uint8_t anims[4][4] = {
|
||||
{0, 1, 0, 2},
|
||||
{0, 1, 2, 3},
|
||||
{0, 1, 2, 0}
|
||||
{0, 1, 2, 0},
|
||||
{0, 1, 0, 1}
|
||||
};
|
||||
|
||||
actor_t *first = nullptr;
|
||||
@@ -135,9 +136,9 @@ namespace actor
|
||||
} else if (util::strcomp(key, "orient:")) {
|
||||
t->orient = util::stringToInt(file::readString(buffer), {"none", "xp", "xn", "yp", "yn", "zp", "zn"}, {0, 1, 2, 4, 8, 16, 32});
|
||||
} else if (util::strcomp(key, "movement:")) {
|
||||
t->movement = util::stringToInt(file::readString(buffer), {"none", "x", "y", "z", "cw", "ccw", "rand", "randv", "hunt"},{MOV_NONE, MOV_X, MOV_Y, MOV_Z, MOV_CW, MOV_CCW, MOV_RAND, MOV_RANDV, MOV_HUNT});
|
||||
t->movement = util::stringToInt(file::readString(buffer), {"none", "x", "y", "z", "cw", "ccw", "rand", "randv", "hunt", "randj"},{MOV_NONE, MOV_X, MOV_Y, MOV_Z, MOV_CW, MOV_CCW, MOV_RAND, MOV_RANDV, MOV_HUNT, MOV_RANDJ});
|
||||
} else if (util::strcomp(key, "anim-cycle:")) {
|
||||
t->anim_cycle = util::stringToInt(file::readString(buffer), {"walk", "seq", "min"},{0, 1, 2});
|
||||
t->anim_cycle = util::stringToInt(file::readString(buffer), {"walk", "seq", "min", "duo"},{0, 1, 2, 3});
|
||||
} else if (util::strcomp(key, "anim-wait:")) {
|
||||
t->anim_wait = file::readInt(buffer);
|
||||
} else if (util::strcomp(key, "flags:")) {
|
||||
@@ -283,6 +284,7 @@ namespace actor
|
||||
if (value==6) return "RAND";
|
||||
if (value==7) return "RANDV";
|
||||
if (value==8) return "HUNT";
|
||||
if (value==9) return "RANDJ";
|
||||
return "NONE";
|
||||
}
|
||||
|
||||
@@ -349,7 +351,7 @@ namespace actor
|
||||
fprintf(f, " %spos: %i %i %i\n", ws, act->pos.x, act->pos.y, act->pos.z);
|
||||
fprintf(f, " %ssize: %i %i %i\n", ws, act->size.x, act->size.y, act->size.z);
|
||||
if (act->orient!=0) fprintf(f, " %sorient: %s\n", ws, numToOrient(act->orient));
|
||||
if (act->anim_cycle!=0) fprintf(f, " %sanim-cycle: %s\n", ws, act->anim_cycle==0 ? "WALK" : act->anim_cycle==1 ? "SEQ" : "MIN");
|
||||
if (act->anim_cycle!=0) fprintf(f, " %sanim-cycle: %s\n", ws, act->anim_cycle==0 ? "WALK" : act->anim_cycle==1 ? "SEQ" : act->anim_cycle==2 ? "MIN" : "DUO");
|
||||
if (act->anim_wait!=0) fprintf(f, " %sanim-wait: %i\n", ws, act->anim_wait);
|
||||
if (act->flags!=0) fprintf(f, " %sflags: %s\n", ws, numToFlags(act->flags));
|
||||
if (act->react_mask!=0) fprintf(f, " %sreact-mask: %s\n", ws, numToOrient(act->react_mask));
|
||||
@@ -539,7 +541,7 @@ namespace actor
|
||||
if (act->flags & FLAG_SPECIAL)
|
||||
{
|
||||
if (act->name[0]=='B') { // Es un booster
|
||||
hero::collectBooster(act->name[1]-48, (act->name[3]-48)*10+(act->name[4]-48));
|
||||
hero::collectBooster(&act->name[5], (act->name[2]-48)*10+(act->name[3]-48));
|
||||
} else if (act->name[0]=='S') { // Es un skill
|
||||
hero::giveSkill(&act->name[2]);
|
||||
} else if (act->name[0]=='P') {
|
||||
@@ -763,6 +765,7 @@ namespace actor
|
||||
}
|
||||
break;
|
||||
case MOV_RANDV:
|
||||
case MOV_RANDJ:
|
||||
switch (rand()%8)
|
||||
{
|
||||
case 0: act->mov_push=PUSH_YP; break;
|
||||
@@ -814,6 +817,14 @@ namespace actor
|
||||
return;
|
||||
}
|
||||
|
||||
// [RZC 26/09/2024] Hack usant react_push en les bambolles de café per al dz del moviment de anar pegant botets
|
||||
if (act->movement==MOV_RANDJ)
|
||||
{
|
||||
if (act->pos.z==0) act->react_push=1;
|
||||
if (act->pos.z>=6) act->react_push=-1;
|
||||
act->pos.z += act->react_push;
|
||||
}
|
||||
|
||||
int vel = (act->flags&FLAG_HERO) && (hero::getBoostRun()>0) ? 2 : 1;
|
||||
|
||||
if (act->push & PUSH_ZP) {
|
||||
@@ -1576,7 +1587,7 @@ namespace actor
|
||||
return dead;
|
||||
}
|
||||
|
||||
const int getBoosterFromString(char *booster)
|
||||
const int getBoosterFromString(const char *booster)
|
||||
{
|
||||
static const char *boostset_name[4] = {"RUN", "GOD", "JUMP", "LIVE"};
|
||||
for (int i=0;i<4;++i)
|
||||
@@ -1613,10 +1624,10 @@ namespace actor
|
||||
return value!=0;
|
||||
}
|
||||
|
||||
void collectBooster(int booster, int id)
|
||||
void collectBooster(const char *booster, int id)
|
||||
{
|
||||
boosters_collected[id] = true;
|
||||
switch (booster)
|
||||
switch (getBoosterFromString(booster))
|
||||
{
|
||||
case BOOST_GOD: boost_god = 99*2; break;
|
||||
case BOOST_RUN: boost_steps = 99*2; break;
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#define MOV_RAND 6 // Es mou en direcció aleatòria
|
||||
#define MOV_RANDV 7 // Es mou en direcció aleatòria, diagonals incloses
|
||||
#define MOV_HUNT 8 // Persegueix al heroi
|
||||
#define MOV_RANDJ 9 // Es mou en direcció aleatòria, diagonals incloses, pegant botets
|
||||
|
||||
// Boosters
|
||||
#define BOOST_NONE 0
|
||||
@@ -202,10 +203,10 @@ namespace actor
|
||||
void die();
|
||||
bool isDead();
|
||||
|
||||
const int getBoosterFromString(char *booster);
|
||||
const int getBoosterFromString(const char *booster);
|
||||
const char *getBoosterName(int booster);
|
||||
bool giveBooster(char *booster);
|
||||
void collectBooster(int booster, int id);
|
||||
void collectBooster(const char *booster, int id);
|
||||
bool wasBoosterCollected(int id);
|
||||
int getBoostGod();
|
||||
int getBoostRun();
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace modules
|
||||
if (act->flags & FLAG_SPECIAL)
|
||||
{
|
||||
if (act->name[0]=='B') { // Es un booster
|
||||
minirooms[room].specials |= actor::hero::getBoosterFromString(&act->name[2]);
|
||||
minirooms[room].specials |= actor::hero::getBoosterFromString(&act->name[5]);
|
||||
} else if (act->name[0]=='S') { // Es un skill
|
||||
minirooms[room].specials |= (actor::hero::getSkillFromString(&act->name[2])<<8);
|
||||
} else if (act->name[0]=='P') { // Es una part
|
||||
|
||||
@@ -342,7 +342,7 @@ namespace modules
|
||||
selected->pos.y = floating_position.y*8;
|
||||
}
|
||||
draw::draw(148+floating_position.x*16-floating_position.y*16,75+floating_position.x*8+floating_position.y*8,32,16,160,0);
|
||||
if (input::mouseClk(1)) actor::setFloatingEditing(false);
|
||||
if (input::mouseClk(1)) { actor::setFloatingEditing(false); room::editor::modify(); }
|
||||
}
|
||||
|
||||
draw::stencil::enable();
|
||||
@@ -829,9 +829,9 @@ namespace modules
|
||||
}
|
||||
line+=10;
|
||||
|
||||
changed |= btn_opt("MOVEMNT", 2, line, act->movement, {MOV_NONE, MOV_X, MOV_Y, MOV_Z, MOV_CW, MOV_CCW, MOV_RAND, MOV_RANDV, MOV_HUNT}, {"NONE", "X", "Y", "Z", "CW", "CCW", "RAND", "RANDV", "HUNT"}, 48);
|
||||
changed |= btn_opt("MOVEMNT", 2, line, act->movement, {MOV_NONE, MOV_X, MOV_Y, MOV_Z, MOV_CW, MOV_CCW, MOV_RAND, MOV_RANDV, MOV_HUNT, MOV_RANDJ}, {"NONE", "X", "Y", "Z", "CW", "CCW", "RAND", "RANDV", "HUNT", "RANDJ"}, 48);
|
||||
line+=10;
|
||||
changed |= btn_opt("ANIMCYC", 2, line, act->anim_cycle, {0, 1, 2}, {"0 1 0 2", "0 1 2 3", "0 1 2"}, 48);
|
||||
changed |= btn_opt("ANIMCYC", 2, line, act->anim_cycle, {0, 1, 2, 3}, {"0 1 0 2", "0 1 2 3", "0 1 2", "0 1 0 1"}, 48);
|
||||
line+=10;
|
||||
|
||||
//draw::print("ANIM SPEED:", 2, 156, 15, 0);
|
||||
|
||||
Reference in New Issue
Block a user