- Comencem a implementar els actors especials
- [NEW] Run booster implementat
This commit is contained in:
@@ -9,6 +9,31 @@ under-door-texture: 0
|
|||||||
exit-xn: 5
|
exit-xn: 5
|
||||||
exit-zp: 7
|
exit-zp: 7
|
||||||
|
|
||||||
|
actor{
|
||||||
|
name: B1
|
||||||
|
bmp: objectes.gif
|
||||||
|
bmp-rect: 114 78 15 18
|
||||||
|
bmp-offset: -8 22
|
||||||
|
pos: 0 0 0
|
||||||
|
size: 4 4 4
|
||||||
|
anim-cycle: SEQ
|
||||||
|
anim-wait: 2
|
||||||
|
flags: ANIMATED SPECIAL
|
||||||
|
movement: CW
|
||||||
|
}
|
||||||
|
|
||||||
|
actor{
|
||||||
|
name: LIFT
|
||||||
|
bmp: caixes.gif
|
||||||
|
bmp-rect: 32 32 32 24
|
||||||
|
bmp-offset: 0 24
|
||||||
|
pos: 56 0 0
|
||||||
|
size: 8 8 4
|
||||||
|
orient: ZP
|
||||||
|
flags: MOVING
|
||||||
|
movement: Z
|
||||||
|
}
|
||||||
|
|
||||||
actor{
|
actor{
|
||||||
name: YONKI
|
name: YONKI
|
||||||
bmp: caixes.gif
|
bmp: caixes.gif
|
||||||
@@ -54,15 +79,3 @@ actor{
|
|||||||
size: 8 8 8
|
size: 8 8 8
|
||||||
movement: CW
|
movement: CW
|
||||||
}
|
}
|
||||||
|
|
||||||
actor{
|
|
||||||
name: LIFT
|
|
||||||
bmp: caixes.gif
|
|
||||||
bmp-rect: 32 32 32 24
|
|
||||||
bmp-offset: 0 24
|
|
||||||
pos: 56 0 0
|
|
||||||
size: 8 8 4
|
|
||||||
orient: ZP
|
|
||||||
flags: MOVING
|
|
||||||
movement: Z
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -53,3 +53,16 @@ actor{
|
|||||||
flags: MOVING
|
flags: MOVING
|
||||||
movement: Z
|
movement: Z
|
||||||
}
|
}
|
||||||
|
|
||||||
|
actor{
|
||||||
|
name: BOOSTER
|
||||||
|
bmp: objectes.gif
|
||||||
|
bmp-rect: 114 78 15 18
|
||||||
|
bmp-offset: -8 22
|
||||||
|
pos: 0 0 0
|
||||||
|
size: 4 4 4
|
||||||
|
anim-cycle: SEQ
|
||||||
|
anim-wait: 2
|
||||||
|
flags: ANIMATED SPECIAL
|
||||||
|
movement: CW
|
||||||
|
}
|
||||||
|
|||||||
@@ -429,6 +429,15 @@ namespace actor
|
|||||||
if ( (act->flags & FLAG_REACTIVE) && (act->react_mask & push) ) result = act->react_push;
|
if ( (act->flags & FLAG_REACTIVE) && (act->react_mask & push) ) result = act->react_push;
|
||||||
if (act->flags & FLAG_DEADLY) result |= PUSH_KILL;
|
if (act->flags & FLAG_DEADLY) result |= PUSH_KILL;
|
||||||
|
|
||||||
|
if (act->flags & FLAG_SPECIAL)
|
||||||
|
{
|
||||||
|
if (act->name[0]=='B') // Es un booster
|
||||||
|
{
|
||||||
|
hero::setBooster(act->name[1]-48);
|
||||||
|
actor::remove(act);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -642,6 +651,7 @@ namespace actor
|
|||||||
|
|
||||||
//if ((act->flags&FLAG_HERO) && (act->pos.x>max.x || act->pos.x<min.x || act->pos.y>max.y || act->pos.y<min.y) )
|
//if ((act->flags&FLAG_HERO) && (act->pos.x>max.x || act->pos.x<min.x || act->pos.y>max.y || act->pos.y<min.y) )
|
||||||
//return;
|
//return;
|
||||||
|
int vel = (act->flags&FLAG_HERO) && (hero::getBooster()==BOOST_RUN) ? 2 : 1;
|
||||||
|
|
||||||
if (act->push & PUSH_ZP) {
|
if (act->push & PUSH_ZP) {
|
||||||
if (act->pos.z>=max.z)
|
if (act->pos.z>=max.z)
|
||||||
@@ -689,12 +699,12 @@ namespace actor
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (act->push & PUSH_XN) {
|
if (act->push & PUSH_XN) {
|
||||||
act->pos.x--;
|
act->pos.x-=vel;
|
||||||
actor::actor_t *other = actor::get_collision(act);
|
actor::actor_t *other = actor::get_collision(act);
|
||||||
if (other || ( act->pos.x<min.x && ( !(room::getDoors()&DOOR_XN) || (act->pos.y!=28) || (act->pos.z!=room::getDoor(XN)*4) || !(act->flags&FLAG_HERO) ) ))
|
if (other || ( act->pos.x<min.x && ( !(room::getDoors()&DOOR_XN) || (act->pos.y!=28) || (act->pos.z!=room::getDoor(XN)*4) || !(act->flags&FLAG_HERO) ) ))
|
||||||
{
|
{
|
||||||
if (other) act->push |= push(other, PUSH_XN);
|
if (other) act->push |= push(other, PUSH_XN);
|
||||||
act->pos.x++;
|
act->pos.x+=vel;
|
||||||
if (act->flags & FLAG_MOVING) changeMoving(act);
|
if (act->flags & FLAG_MOVING) changeMoving(act);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -718,12 +728,12 @@ namespace actor
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (act->push & PUSH_XP) {
|
if (act->push & PUSH_XP) {
|
||||||
act->pos.x++;
|
act->pos.x+=vel;
|
||||||
actor::actor_t *other = actor::get_collision(act);
|
actor::actor_t *other = actor::get_collision(act);
|
||||||
if (other || ((act->pos.x+act->size.x)>max.x && ( !(room::getDoors()&DOOR_XP) || (act->pos.y!=28) || !(act->flags&FLAG_HERO) ) ))
|
if (other || ((act->pos.x+act->size.x)>max.x && ( !(room::getDoors()&DOOR_XP) || (act->pos.y!=28) || !(act->flags&FLAG_HERO) ) ))
|
||||||
{
|
{
|
||||||
if (other) act->push |= push(other, PUSH_XP);
|
if (other) act->push |= push(other, PUSH_XP);
|
||||||
act->pos.x--;
|
act->pos.x-=vel;
|
||||||
if (act->flags & FLAG_MOVING) changeMoving(act);
|
if (act->flags & FLAG_MOVING) changeMoving(act);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -745,12 +755,12 @@ namespace actor
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (act->push & PUSH_YN) {
|
if (act->push & PUSH_YN) {
|
||||||
act->pos.y--;
|
act->pos.y-=vel;
|
||||||
actor::actor_t *other = actor::get_collision(act);
|
actor::actor_t *other = actor::get_collision(act);
|
||||||
if (other || ( act->pos.y<min.y && ( !(room::getDoors()&DOOR_YN) || (act->pos.x!=28) || (act->pos.z!=room::getDoor(YN)*4) || !(act->flags&FLAG_HERO) ) ))
|
if (other || ( act->pos.y<min.y && ( !(room::getDoors()&DOOR_YN) || (act->pos.x!=28) || (act->pos.z!=room::getDoor(YN)*4) || !(act->flags&FLAG_HERO) ) ))
|
||||||
{
|
{
|
||||||
if (other) act->push |= push(other, PUSH_YN);
|
if (other) act->push |= push(other, PUSH_YN);
|
||||||
act->pos.y++;
|
act->pos.y+=vel;
|
||||||
if (act->flags & FLAG_MOVING) changeMoving(act);
|
if (act->flags & FLAG_MOVING) changeMoving(act);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -772,12 +782,12 @@ namespace actor
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (act->push & PUSH_YP) {
|
if (act->push & PUSH_YP) {
|
||||||
act->pos.y++;
|
act->pos.y+=vel;
|
||||||
actor::actor_t *other = actor::get_collision(act);
|
actor::actor_t *other = actor::get_collision(act);
|
||||||
if (other || ( (act->pos.y+act->size.y)>max.y && ( !(room::getDoors()&DOOR_YP) || (act->pos.x!=28) || !(act->flags&FLAG_HERO) ) ))
|
if (other || ( (act->pos.y+act->size.y)>max.y && ( !(room::getDoors()&DOOR_YP) || (act->pos.x!=28) || !(act->flags&FLAG_HERO) ) ))
|
||||||
{
|
{
|
||||||
if (other) act->push |= push(other, PUSH_YP);
|
if (other) act->push |= push(other, PUSH_YP);
|
||||||
act->pos.y--;
|
act->pos.y-=vel;
|
||||||
if (act->flags & FLAG_MOVING) changeMoving(act);
|
if (act->flags & FLAG_MOVING) changeMoving(act);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1217,4 +1227,41 @@ namespace actor
|
|||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace hero
|
||||||
|
{
|
||||||
|
int boosters = BOOST_NONE;
|
||||||
|
int skills = SKILL_NONE;
|
||||||
|
int parts = PART_NONE;
|
||||||
|
|
||||||
|
void setBooster(int booster)
|
||||||
|
{
|
||||||
|
boosters = booster;
|
||||||
|
}
|
||||||
|
|
||||||
|
int getBooster()
|
||||||
|
{
|
||||||
|
return boosters;
|
||||||
|
}
|
||||||
|
|
||||||
|
void giveSkill(int skill)
|
||||||
|
{
|
||||||
|
skills |= skill;
|
||||||
|
}
|
||||||
|
|
||||||
|
int getSkills()
|
||||||
|
{
|
||||||
|
return skills;
|
||||||
|
}
|
||||||
|
|
||||||
|
void pickPart(int part)
|
||||||
|
{
|
||||||
|
parts |= part;
|
||||||
|
}
|
||||||
|
|
||||||
|
int getParts()
|
||||||
|
{
|
||||||
|
return parts;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,28 @@
|
|||||||
#define MOV_RAND 6 // Es mou en direcció aleatòria
|
#define MOV_RAND 6 // Es mou en direcció aleatòria
|
||||||
#define MOV_HUNT 7 // Persegueix al heroi
|
#define MOV_HUNT 7 // Persegueix al heroi
|
||||||
|
|
||||||
|
// Boosters
|
||||||
|
#define BOOST_NONE 0
|
||||||
|
#define BOOST_RUN 1
|
||||||
|
#define BOOST_GOD 2
|
||||||
|
#define BOOST_LONG_JUMP 3
|
||||||
|
#define BOOST_TALL_JUMP 4
|
||||||
|
|
||||||
|
// Skills
|
||||||
|
#define SKILL_NONE 0
|
||||||
|
#define SKILL_SHOES 1
|
||||||
|
#define SKILL_GLOVES 2
|
||||||
|
#define SKILL_PANTS 4
|
||||||
|
#define SKILL_BAG 8
|
||||||
|
|
||||||
|
// Parts
|
||||||
|
#define PART_NONE 0
|
||||||
|
#define PART_FILTER 1
|
||||||
|
#define PART_PUMP 2
|
||||||
|
#define PART_TIMER 4
|
||||||
|
#define PART_SALT 8
|
||||||
|
#define PART_PIPE 16
|
||||||
|
#define PART_ELBOW 32
|
||||||
|
|
||||||
namespace actor
|
namespace actor
|
||||||
{
|
{
|
||||||
@@ -142,4 +164,16 @@ namespace actor
|
|||||||
void copy(actor_t *dest, actor_t *source);
|
void copy(actor_t *dest, actor_t *source);
|
||||||
void add(actor_t *act);
|
void add(actor_t *act);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace hero
|
||||||
|
{
|
||||||
|
void setBooster(int booster);
|
||||||
|
int getBooster();
|
||||||
|
|
||||||
|
void giveSkill(int skill);
|
||||||
|
int getSkills();
|
||||||
|
|
||||||
|
void pickPart(int part);
|
||||||
|
int getParts();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
2
todo.txt
2
todo.txt
@@ -35,7 +35,7 @@ x Gràfics de bancada de cuina
|
|||||||
x Tubo
|
x Tubo
|
||||||
x Codo
|
x Codo
|
||||||
|
|
||||||
- Implementar eixides per dalt
|
x Implementar eixides per dalt
|
||||||
x Implementar eixides per baix
|
x Implementar eixides per baix
|
||||||
x Implementar pickar objectes
|
x Implementar pickar objectes
|
||||||
- Implementar inventari
|
- Implementar inventari
|
||||||
|
|||||||
Reference in New Issue
Block a user