Support separate poses for ice and force floors, and spin on ice

This commit is contained in:
Eevee (Evelyn Woods) 2020-09-19 22:59:50 -06:00
parent 582a875c52
commit ec8992a0fc
2 changed files with 20 additions and 4 deletions

View File

@ -288,9 +288,9 @@ export const CC2_TILESET_LAYOUT = {
},
moving: {
north: [[0, 22], [1, 22], [2, 22], [3, 22], [4, 22], [5, 22], [6, 22], [7, 22]],
east: [[8, 22], [9, 22], [10, 22], [11, 22], [12, 22], [13, 22], [14, 22], [15, 22]],
south: [[0, 23], [1, 23], [2, 23], [3, 23], [4, 23], [5, 23], [6, 23], [7, 23]],
west: [[8, 23], [9, 23], [10, 23], [11, 23], [12, 23], [13, 23], [14, 23], [15, 23]],
east: [[8, 22], [9, 22], [10, 22], [11, 22], [12, 22], [13, 22], [14, 22], [15, 22]],
},
pushing: {
north: [8, 24],
@ -304,6 +304,15 @@ export const CC2_TILESET_LAYOUT = {
south: [[4, 24], [5, 24]],
west: [[6, 24], [7, 24]],
},
// The classic CC2 behavior, spinning on ice
skating: [[0, 22], [8, 22], [0, 23], [8, 23]],
// TODO i don't know what CC2 does
forced: {
north: [2, 22],
east: [10, 22],
south: [2, 23],
west: [10, 23],
},
// These are frames from the splash/explosion animations
drowned: [5, 5],
burned: [1, 5],
@ -517,6 +526,8 @@ export const TILE_WORLD_TILESET_LAYOUT = {
south: [3, 14],
east: [3, 15],
},
skating: 'normal',
forced: 'normal',
burned: [3, 4], // TODO TW's lynx mode doesn't use this! it uses the generic failed
exploded: [3, 6],
failed: [3, 7],

View File

@ -24,11 +24,16 @@ function player_visual_state(me) {
else if (me.fail_reason) {
return 'failed';
}
else if (me.cell && me.cell.some(t => t.type.name === 'water') &&
(! me.previous_cell || me.previous_cell.some(t => t.type.name === 'water')))
{
else if (me.cell && (me.previous_cell || me.cell).some(t => t.type.name === 'water')) {
// CC2 shows a swimming pose while still in water, or moving away from water
return 'swimming';
}
else if (me.slide_mode === 'ice') {
return 'skating';
}
else if (me.slide_mode === 'force') {
return 'forced';
}
else if (me.animation_speed) {
return 'moving';
}