author | ecalot
<ecalot> 2005-02-27 02:58:00 UTC |
committer | ecalot
<ecalot> 2005-02-27 02:58:00 UTC |
parent | 59564ae9a765f707f4fd37555132123d72473b5b |
FP/src/conf/awk/states_conf_static.awk | +6 | -2 |
FP/src/conf/states/main.conf | +7 | -1 |
FP/src/include/states.h | +1 | -1 |
FP/src/ker/room.c | +1 | -1 |
FP/src/ker/states.c | +3 | -0 |
diff --git a/FP/src/conf/awk/states_conf_static.awk b/FP/src/conf/awk/states_conf_static.awk index 1412501..36c0d00 100644 --- a/FP/src/conf/awk/states_conf_static.awk +++ b/FP/src/conf/awk/states_conf_static.awk @@ -100,9 +100,13 @@ function addExit (name) { if ($2!=sprintf("%d",$2)) { #if (1) { #defines[$2]) { if ($1~/^Map/) { - result=sprintf("TILES_%s",toupper($2),0) + result=sprintf("TILES_%s",toupper($2)) } else { - result=sprintf("STATES_COND_%s",toupper($2),0) + if ($1~/Looking/) { + result=sprintf("DIR_%s",toupper($2)) + } else { + result=sprintf("STATES_COND_%s",toupper($2)) + } } #} else { # diff --git a/FP/src/conf/states/main.conf b/FP/src/conf/states/main.conf index 8c40c06..d5af754 100644 --- a/FP/src/conf/states/main.conf +++ b/FP/src/conf/states/main.conf @@ -531,6 +531,7 @@ falling1: animation 15 f @50 212-216 + action falling to a walkable place conditions @@ -571,6 +572,7 @@ falling2: animation 15 f @50 212-216 + action falling to a walkable place conditions MapDown walkable @@ -633,15 +635,18 @@ falling3: 117 @20 117 +#dead spiked: action speaked forever next spiked animation 79 x + steps + absoluteOnStart -16 splash: - action death forever + action dead forever next splash animation @@ -656,6 +661,7 @@ chopped: animation 78 x +#others crashed action next diff --git a/FP/src/include/states.h b/FP/src/include/states.h index 6dd1b86..6d05ed2 100644 --- a/FP/src/include/states.h +++ b/FP/src/include/states.h @@ -6,7 +6,7 @@ #include "types.h" /* tMap */ #include "input.h" /* tKey */ -typedef enum {esLast=0,esKeyUp,esKeyDown,esKeyForward,esKeyBack,esKeyShift,esMapUp,esMapUpForward,esMapDown,esMapForward,esMapBack,esMapOn,esForwardTileNearerThan,esForwardTileFartherThan,esScreenUp,esScreenDown,esScreenLeft,esScreenRight,esInScreen,esInLevel,esForwardChangeToScreen,esInFloorTop,esInfloorMiddle,esInfloorBottom,esMapNotOn,esMapNotBack,esMapDownBack,esMapNotDownBack,esMapNotForward}tsConditionType; +typedef enum {esLast=0,esKeyUp,esKeyDown,esKeyForward,esKeyBack,esKeyShift,esMapUp,esMapUpForward,esMapDown,esMapForward,esMapBack,esMapOn,esForwardTileNearerThan,esForwardTileFartherThan,esScreenUp,esScreenDown,esScreenLeft,esScreenRight,esInScreen,esInLevel,esForwardChangeToScreen,esInFloorTop,esInfloorMiddle,esInfloorBottom,esMapNotOn,esMapNotBack,esMapDownBack,esMapNotDownBack,esMapNotForward,esKidLooking}tsConditionType; typedef enum {esDangerous,esNone,esWalk,esPotion,esSword,esMirror,esNotApplicable=0}tsTileType; diff --git a/FP/src/ker/room.c b/FP/src/ker/room.c index e5c8028..5c19c23 100644 --- a/FP/src/ker/room.c +++ b/FP/src/ker/room.c @@ -97,7 +97,7 @@ tTile roomGetTile(tRoom* room,int x, int y) { roomId=room->id; if ((!roomId)||(roomId>24)) { - fprintf(stderr,"Assert: invalid room read: %d\n",roomId); + fprintf(stderr,"Assert: kid outside the map\n"); exit(1); } diff --git a/FP/src/ker/states.c b/FP/src/ker/states.c index b0e0af0..057f01a 100644 --- a/FP/src/ker/states.c +++ b/FP/src/ker/states.c @@ -188,6 +188,9 @@ int evaluateCondition(int condition,tKey* key, tObject* kid, tRoom* room) { case esForwardChangeToScreen: DefaultFalse(kid); statesCondRet(((statesKidLeft)&&(kidX==1))||((!statesKidLeft)&&(kidX==10))); + case esKidLooking: + DefaultFalse(kid); + statesCondRet(kid->direction==c.argument); case esLast: return STATES_CONDRESULT_END; default: