From 1d85db40525a05846fb4392f5f1bfdb35de8372d Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Thu, 26 Sep 2024 10:58:14 +0200 Subject: [PATCH] =?UTF-8?q?-=20[FIX]=20Al=20moure=20en=20mode=20floating?= =?UTF-8?q?=20no=20guardava=20-=20[NEW]=20Cicle=20d'animaci=C3=B3=20[0=201?= =?UTF-8?q?=200=201]=20-=20[CHG]=20Forma=20diferent=20de=20pillat=20el=20t?= =?UTF-8?q?ipo=20de=20booster=20i=20el=20ID=20per=20a=20que=20no=20torne?= =?UTF-8?q?=20a=20apareixer=20-=20[NEW]=20Nou=20moviment:=20RANDJ=20-=20No?= =?UTF-8?q?us=20gr=C3=A0fics,=20enemics,=20objectes=20-=20M=C3=A9s=20habit?= =?UTF-8?q?acions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/altres.gif | Bin 3985 -> 4150 bytes data/rooms/02.txt | 2 +- data/rooms/16.txt | 20 ++--- data/rooms/21.txt | 4 +- data/rooms/23.txt | 2 +- data/rooms/24.txt | 92 ++++++++++++++++++++-- data/rooms/25.txt | 165 ++++++++++++++++++++++++++++++++-------- data/rooms/26.txt | 82 +++++++++++++++++++- data/templates.txt | 25 ++++++ source/actor.cpp | 29 ++++--- source/actor.h | 5 +- source/m_editor_map.cpp | 2 +- source/m_game.cpp | 6 +- 13 files changed, 367 insertions(+), 67 deletions(-) diff --git a/data/altres.gif b/data/altres.gif index 79f7e9384dc24818ae7a5309ece75800d8d26c01..77442b8880fed96fd751f3ab8730c07ac89919dd 100644 GIT binary patch delta 2061 zcmV+o2=e!lAGRQ{K?r}@wI`2NQr+OlkO7Hg(RF zr{K%BO~x`Zn2^m7=G(ey%hddCm}EU@I|Jp!xP+a84B{~QxH^AKOQy-w3JEcn{m5mF z+nR$)bB#}rlx0%d4z%LH5bK(4iWPZDc*@H*Cq5 ztUCo8BE-gHyc>UnY*fONSJ(`*s)YTLRB)HC0bWwE`y2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kZI}~G{8vporient = 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; diff --git a/source/actor.h b/source/actor.h index d1978ac..4538a93 100644 --- a/source/actor.h +++ b/source/actor.h @@ -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(); diff --git a/source/m_editor_map.cpp b/source/m_editor_map.cpp index 3c107dd..df6d4ec 100644 --- a/source/m_editor_map.cpp +++ b/source/m_editor_map.cpp @@ -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 diff --git a/source/m_game.cpp b/source/m_game.cpp index b5d638c..00dc30e 100644 --- a/source/m_game.cpp +++ b/source/m_game.cpp @@ -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);