Skip to content

Free games for graphing calculators: NumWorks, TI-Nspire CX, Casio fx-CG50 and soon TI-84 Plus CE. Balatro, Celeste, Hollow Knight, Minecraft and more.

Hollow Knight: the Dreamers' scene in Greenpath

Mason Chend6847b359b9a
diff --git a/games/hollowknight/src/data.bin b/games/hollowknight/src/data.bin
index ab2458af..3d43bf0d 100644
Binary files a/games/hollowknight/src/data.bin and b/games/hollowknight/src/data.bin differ
diff --git a/games/hollowknight/src/data.h b/games/hollowknight/src/data.h
index bf09967d..f684356c 100644
--- a/games/hollowknight/src/data.h
+++ b/games/hollowknight/src/data.h
@@ -77,472 +77,481 @@
#define CLIP_KNIGHT_DEATH_HEAD_NORMAL 17
#define CLIP_KNIGHT_DOWNSLASH 18
#define CLIP_KNIGHT_DOWNSLASHEFFECT 19
-#define CLIP_KNIGHT_ENTER 20
-#define CLIP_KNIGHT_EXIT 21
-#define CLIP_KNIGHT_EXIT_DOOR_TO_IDLE 22
-#define CLIP_KNIGHT_FALL 23
-#define CLIP_KNIGHT_FIREBALL_ANTIC 24
-#define CLIP_KNIGHT_FIREBALL1_CAST 25
-#define CLIP_KNIGHT_FOCUS 26
-#define CLIP_KNIGHT_FOCUS_END 27
-#define CLIP_KNIGHT_FOCUS_GET 28
-#define CLIP_KNIGHT_FOCUS_GET_ONCE 29
-#define CLIP_KNIGHT_GET_OFF 30
-#define CLIP_KNIGHT_GETUPTOIDLE 31
-#define CLIP_KNIGHT_HARDLAND 32
-#define CLIP_KNIGHT_HAZARD_RESPAWN 33
-#define CLIP_KNIGHT_IDLE 34
-#define CLIP_KNIGHT_IDLE_HURT 35
-#define CLIP_KNIGHT_IDLE_WIND 36
-#define CLIP_KNIGHT_LAND 37
-#define CLIP_KNIGHT_LOOKDOWN 38
-#define CLIP_KNIGHT_LOOKDOWNEND 39
-#define CLIP_KNIGHT_LOOKDOWNTOIDLE 40
-#define CLIP_KNIGHT_LOOKUP 41
-#define CLIP_KNIGHT_LOOKUPEND 42
-#define CLIP_KNIGHT_LOOKUPTOIDLE 43
-#define CLIP_KNIGHT_MAP_AWAY 44
-#define CLIP_KNIGHT_MAP_IDLE 45
-#define CLIP_KNIGHT_MAP_OPEN 46
-#define CLIP_KNIGHT_MAP_TURN 47
-#define CLIP_KNIGHT_MAP_UPDATE 48
-#define CLIP_KNIGHT_MAP_WALK 49
-#define CLIP_KNIGHT_PROSTRATE 50
-#define CLIP_KNIGHT_PROSTRATE_RISE 51
-#define CLIP_KNIGHT_RECOIL 52
-#define CLIP_KNIGHT_RESPAWN_WAKE 53
-#define CLIP_KNIGHT_ROAR_LOCK 54
-#define CLIP_KNIGHT_RUN 55
-#define CLIP_KNIGHT_RUN_TO_IDLE 56
-#define CLIP_KNIGHT_SIT 57
-#define CLIP_KNIGHT_SIT_FALL_ASLEEP 58
-#define CLIP_KNIGHT_SIT_IDLE 59
-#define CLIP_KNIGHT_SIT_LEAN 60
-#define CLIP_KNIGHT_SIT_MAP_CLOSE 61
-#define CLIP_KNIGHT_SIT_MAP_OPEN 62
-#define CLIP_KNIGHT_SITTING_ASLEEP 63
-#define CLIP_KNIGHT_SLASH 64
-#define CLIP_KNIGHT_SLASHALT 65
-#define CLIP_KNIGHT_SLASHEFFECT 66
-#define CLIP_KNIGHT_SLASHEFFECTALT 67
-#define CLIP_KNIGHT_SPIKE_DEATH 68
-#define CLIP_KNIGHT_SPIKE_DEATH_ANTIC 69
-#define CLIP_KNIGHT_STUN 70
-#define CLIP_KNIGHT_TURN 71
-#define CLIP_KNIGHT_TURNFROMBG 72
-#define CLIP_KNIGHT_TURNTOBG 73
-#define CLIP_KNIGHT_TURNTOIDLE 74
-#define CLIP_KNIGHT_UPSLASH 75
-#define CLIP_KNIGHT_UPSLASHEFFECT 76
-#define CLIP_KNIGHT_WAKE 77
-#define CLIP_KNIGHT_WAKE_TO_SIT 78
-#define CLIP_KNIGHT_WAKE_UP_GROUND 79
-#define CLIP_KNIGHT_WALK 80
-#define CLIP_GEOROCK_IDLE_1 81
-#define CLIP_GEOROCK_GLEAM_1 82
-#define CLIP_GEOROCK_BROKEN_1 83
-#define CLIP_GEOROCK_IDLE_2 84
-#define CLIP_GEOROCK_GLEAM_2 85
-#define CLIP_GEOROCK_BROKEN_2 86
-#define CLIP_CHEST_IDLE 87
-#define CLIP_CHEST_OPEN 88
-#define CLIP_CHEST_BURST 89
-#define CLIP_CHEST_OPENED 90
-#define CLIP_HUD_HEALTH_EMPTY 91
-#define CLIP_HUD_HEALTH_IDLE 92
-#define CLIP_HUD_HEALTH_BREAK 93
-#define CLIP_HUD_HEALTH_REFILL 94
-#define CLIP_HUD_HEALTH_APPEAR 95
-#define CLIP_HUD_BLUE_APPEAR 96
-#define CLIP_HUD_BLUE_IDLE 97
-#define CLIP_HUD_BLUE_BREAK 98
-#define CLIP_HUD_BLUE_BREAK_FAST 99
-#define CLIP_HUD_HUD_FRAME 100
-#define CLIP_HUD_HUD_FRAME_IDLE 101
-#define CLIP_HUD_HUD_FRAME_CRACKAPPEAR 102
-#define CLIP_HUD_HUD_FRAME_CRACKED 103
-#define CLIP_HUD_COIN_APPEAR 104
-#define CLIP_HUD_COIN_IDLE 105
-#define CLIP_HUD_COIN_GET 106
-#define CLIP_HUD_SOUL_BURST 107
-#define CLIP_LIQUID_FILL 108
-#define CLIP_LIQUID_IDLE 109
-#define CLIP_LIQUID_SHRINK 110
-#define CLIP_LIQUID_DRAIN 111
-#define CLIP_GEO_SMALL_IDLE 112
-#define CLIP_GEO_SMALL_AIR 113
-#define CLIP_GEO_MED_IDLE 114
-#define CLIP_GEO_MED_AIR 115
-#define CLIP_GEO_LARGE_IDLE 116
-#define CLIP_GEO_LARGE_AIR 117
-#define CLIP_DIALOGUE_ARROW_UP 118
-#define CLIP_DIALOGUE_ARROW_DOWN 119
-#define CLIP_DIALOGUE_STOP_UP 120
-#define CLIP_DIALOGUE_STOP_DOWN 121
-#define CLIP_DIALOGUE_FLEUR_TOP_UP 122
-#define CLIP_DIALOGUE_FLEUR_TOP_DOWN 123
-#define CLIP_DIALOGUE_FLEUR_BOT_UP 124
-#define CLIP_DIALOGUE_FLEUR_BOT_DOWN 125
-#define CLIP_PROMPT_BLANK 126
-#define CLIP_PROMPT_DOWN 127
-#define CLIP_PROMPT_ENTER_DOWN 128
-#define CLIP_PROMPT_ENTER_IDLE 129
-#define CLIP_PROMPT_ENTER_UP 130
-#define CLIP_PROMPT_IDLE 131
-#define CLIP_PROMPT_LISTEN_DOWN 132
-#define CLIP_PROMPT_LISTEN_IDLE 133
-#define CLIP_PROMPT_LISTEN_UP 134
-#define CLIP_PROMPT_UP 135
-#define CLIP_SHADE_APPEAR 136
-#define CLIP_SHADE_CAST 137
-#define CLIP_SHADE_CAST_ANTIC 138
-#define CLIP_SHADE_CAST_CHARGE 139
-#define CLIP_SHADE_CAST_RING 140
-#define CLIP_SHADE_DEATH 141
-#define CLIP_SHADE_DEATH_GLOW 142
-#define CLIP_SHADE_DEATH_START 143
-#define CLIP_SHADE_DEPART 144
-#define CLIP_SHADE_FIREBALL 145
-#define CLIP_SHADE_FIREBALL_END 146
-#define CLIP_SHADE_FLY 147
-#define CLIP_SHADE_IDLE 148
-#define CLIP_SHADE_RETREAT_END 149
-#define CLIP_SHADE_RETREAT_START 150
-#define CLIP_SHADE_SLASH 151
-#define CLIP_SHADE_SLASH_ANTIC 152
-#define CLIP_SHADE_SLASH_CD 153
-#define CLIP_SHADE_SLASH_EFFECT 154
-#define CLIP_SHADE_STARTLE 155
-#define CLIP_SHADE_TURNTOFLY 156
-#define CLIP_SHADE_TURNTOIDLE 157
-#define CLIP_CRAWLER_WALK 158
-#define CLIP_CRAWLER_TURN 159
-#define CLIP_CRAWLER_IDLE 160
-#define CLIP_CRAWLER_DEATH_AIR 161
-#define CLIP_CRAWLER_DEATH_LAND 162
-#define CLIP_BUZZER_CHASE 163
-#define CLIP_BUZZER_IDLE 164
-#define CLIP_BUZZER_STARTLE 165
-#define CLIP_BUZZER_DEATH_AIR 166
-#define CLIP_BUZZER_DEATH_LAND 167
-#define CLIP_BUZZER_FLY 168
-#define CLIP_BUZZER_TURNTOFLY 169
-#define CLIP_BUZZER_TURNTOIDLE 170
-#define CLIP_TIKTIK_DEATH_AIR 171
-#define CLIP_TIKTIK_DEATH_LAND 172
-#define CLIP_TIKTIK_STUN 173
-#define CLIP_TIKTIK_WALK 174
-#define CLIP_GRUZZER_DEATH_AIR 175
-#define CLIP_GRUZZER_DEATH_LAND 176
-#define CLIP_GRUZZER_FLY 177
-#define CLIP_ASPID_DEATH_AIR 178
-#define CLIP_ASPID_FIRE_LONG 179
-#define CLIP_ASPID_FLY 180
-#define CLIP_ASPID_TURNTOFLY 181
-#define CLIP_BALDUR_DEATH_AIR 182
-#define CLIP_BALDUR_DEATH_LAND 183
-#define CLIP_BALDUR_IDLE 184
-#define CLIP_BALDUR_ROLL 185
-#define CLIP_BALDUR_START 186
-#define CLIP_BALDUR_STOP 187
-#define CLIP_ELDERBALDUR_CLOSE1 188
-#define CLIP_ELDERBALDUR_CLOSE2 189
-#define CLIP_ELDERBALDUR_CLOSED 190
-#define CLIP_ELDERBALDUR_DEATH 191
-#define CLIP_ELDERBALDUR_DEATH_STUN 192
-#define CLIP_ELDERBALDUR_HIT 193
-#define CLIP_ELDERBALDUR_IDLE 194
-#define CLIP_ELDERBALDUR_OPEN 195
-#define CLIP_ELDERBALDUR_SHOOT_ANTIC 196
-#define CLIP_ELDERBALDUR_SHOOT_CD 197
-#define CLIP_HUSK_ATTACK_ANTICIPATE 198
-#define CLIP_HUSK_ATTACK_COOLDOWN 199
-#define CLIP_HUSK_ATTACK_LUNGE 200
-#define CLIP_HUSK_DEATH_AIR 201
-#define CLIP_HUSK_DEATH_LAND 202
-#define CLIP_HUSK_IDLE 203
-#define CLIP_HUSK_TURN 204
-#define CLIP_HUSK_WALK 205
-#define CLIP_BARGER_ATTACK_ANTICIPATE 206
-#define CLIP_BARGER_ATTACK_COOLDOWN 207
-#define CLIP_BARGER_ATTACK_LUNGE 208
-#define CLIP_BARGER_DEATH_AIR 209
-#define CLIP_BARGER_DEATH_LAND 210
-#define CLIP_BARGER_IDLE 211
-#define CLIP_BARGER_TURN 212
-#define CLIP_BARGER_WALK 213
-#define CLIP_HORNHEAD_ATTACK_ANTICIPATE 214
-#define CLIP_HORNHEAD_ATTACK_COOLDOWN 215
-#define CLIP_HORNHEAD_ATTACK_LUNGE 216
-#define CLIP_HORNHEAD_DEATH_AIR 217
-#define CLIP_HORNHEAD_DEATH_LAND 218
-#define CLIP_HORNHEAD_IDLE 219
-#define CLIP_HORNHEAD_TURN 220
-#define CLIP_HORNHEAD_WALK 221
-#define CLIP_MOSSRUNNER_ATTACK_ANTICIPATE 222
-#define CLIP_MOSSRUNNER_ATTACK_COOLDOWN 223
-#define CLIP_MOSSRUNNER_ATTACK_LUNGE 224
-#define CLIP_MOSSRUNNER_DEATH_AIR 225
-#define CLIP_MOSSRUNNER_DEATH_LAND 226
-#define CLIP_MOSSRUNNER_IDLE 227
-#define CLIP_MOSSRUNNER_TURN 228
-#define CLIP_MOSSRUNNER_WALK 229
-#define CLIP_LEAPER_ATTACK 230
-#define CLIP_LEAPER_DEATH_AIR 231
-#define CLIP_LEAPER_DEATH_LAND 232
-#define CLIP_LEAPER_IDLE 233
-#define CLIP_LEAPER_LAND 234
-#define CLIP_LEAPER_TURN 235
-#define CLIP_LEAPER_WALK 236
-#define CLIP_GUARD_ANTICIPATE 237
-#define CLIP_GUARD_ATTACK2 238
-#define CLIP_GUARD_DEATH_AIR 239
-#define CLIP_GUARD_DEATH_LAND 240
-#define CLIP_GUARD_DORMANT 241
-#define CLIP_GUARD_IDLE 242
-#define CLIP_GUARD_RUN 243
-#define CLIP_GUARD_STARTLE 244
-#define CLIP_GUARD_STOMP_ANTIC 245
-#define CLIP_GUARD_STOMP_JUMP 246
-#define CLIP_GUARD_STOMP_LAND 247
-#define CLIP_GUARD_STOP_RUN 248
-#define CLIP_GUARD_STOP_WALK 249
-#define CLIP_GUARD_SWIPE 250
-#define CLIP_GUARD_TURN 251
-#define CLIP_GUARD_WAKE 252
-#define CLIP_GUARD_WALK 253
-#define CLIP_FK_ATTACK 254
-#define CLIP_FK_ATTACK_ANTIC 255
-#define CLIP_FK_ATTACK_RECOVER 256
-#define CLIP_FK_BLANK 257
-#define CLIP_FK_BODY 258
-#define CLIP_FK_DEATH_FALL 259
-#define CLIP_FK_DEATH_HEAD_1 260
-#define CLIP_FK_DEATH_HEAD_2 261
-#define CLIP_FK_DEATH_LAND 262
-#define CLIP_FK_DEATH_SPAZ 263
-#define CLIP_FK_IDLE 264
-#define CLIP_FK_JUMP 265
-#define CLIP_FK_JUMP_ANTIC 266
-#define CLIP_FK_JUMP_ATTACK_HIT_1 267
-#define CLIP_FK_JUMP_ATTACK_HIT_2 268
-#define CLIP_FK_JUMP_ATTACK_HIT_3 269
-#define CLIP_FK_JUMP_ATTACK_UP 270
-#define CLIP_FK_LAND 271
-#define CLIP_FK_RAGE 272
-#define CLIP_FK_RUN 273
-#define CLIP_FK_RUN_ANTIC 274
-#define CLIP_FK_STUN_HIT 275
-#define CLIP_FK_STUN_OPEN 276
-#define CLIP_FK_STUN_OPENED 277
-#define CLIP_FK_STUN_RECOVER 278
-#define CLIP_FK_STUN_ROLL 279
-#define CLIP_FK_STUN_ROLL_END 280
-#define CLIP_FK_TURN 281
-#define CLIP_FKHEAD_DEATH_LAND 282
-#define CLIP_FKHEAD_HEAD_HIT 283
-#define CLIP_FKHEAD_HEAD_IDLE 284
-#define CLIP_FKHEAD_HEAD_SPAZ 285
-#define CLIP_HATCHER_DEATH_AIR 286
-#define CLIP_HATCHER_DEATH_LAND 287
-#define CLIP_HATCHER_FIRE 288
-#define CLIP_HATCHER_FLY 289
-#define CLIP_HATCHLING_FLY 290
-#define CLIP_SLUG_BOUNCE 291
-#define CLIP_SLUG_DEATH_AIR 292
-#define CLIP_SLUG_DEATH_LAND 293
-#define CLIP_SLUG_IDLE_TODOWN 294
-#define CLIP_SLUG_IDLE_TOUP 295
-#define CLIP_SLUG_IDLE_UP 296
-#define CLIP_SLUG_RUN 297
-#define CLIP_SLUG_STARTLE 298
-#define CLIP_GFLY_BURST 299
-#define CLIP_GFLY_CHARGE 300
-#define CLIP_GFLY_CHARGE_ANTIC 301
-#define CLIP_GFLY_CHARGE_RECOVER 302
-#define CLIP_GFLY_DEATH 303
-#define CLIP_GFLY_FALL 304
-#define CLIP_GFLY_FLY 305
-#define CLIP_GFLY_GURGLE_LOOP 306
-#define CLIP_GFLY_GURGLE_ONCE 307
-#define CLIP_GFLY_SLAM_DOWN 308
-#define CLIP_GFLY_SLAM_END 309
-#define CLIP_GFLY_SLAM_UP 310
-#define CLIP_GFLY_SLEEP 311
-#define CLIP_GFLY_STOP 312
-#define CLIP_GFLY_WAKE 313
-#define CLIP_GFLY_WIGGLE 314
-#define CLIP_MOSSWALKER_APPEAR 315
-#define CLIP_MOSSWALKER_BURY 316
-#define CLIP_MOSSWALKER_DEATH_AIR 317
-#define CLIP_MOSSWALKER_DEATH_LAND 318
-#define CLIP_MOSSWALKER_SHAKE 319
-#define CLIP_MOSSWALKER_TURN 320
-#define CLIP_MOSSWALKER_WALK 321
-#define CLIP_PIGEON_FLY 322
-#define CLIP_PIGEON_IDLE_01 323
-#define CLIP_PIGEON_IDLE_02 324
-#define CLIP_PIGEON_IDLE_03 325
-#define CLIP_PLANTTRAP_DEATH 326
-#define CLIP_PLANTTRAP_IDLE 327
-#define CLIP_PLANTTRAP_RETRACT 328
-#define CLIP_PLANTTRAP_SNAP 329
-#define CLIP_PLANTTRAP_SNAP_READY 330
-#define CLIP_SHAKER_ATTACK 331
-#define CLIP_SHAKER_DEATH_AIR 332
-#define CLIP_SHAKER_DEATH_LAND 333
-#define CLIP_SHAKER_IDLE 334
-#define CLIP_SHAKER_TURN 335
-#define CLIP_SHAKER_WALK 336
-#define CLIP_MOSQUITO_ATTACK 337
-#define CLIP_MOSQUITO_ATTACK_ANTIC 338
-#define CLIP_MOSQUITO_DEATH_AIR 339
-#define CLIP_MOSQUITO_DEATH_LAND 340
-#define CLIP_MOSQUITO_IDLE 341
-#define CLIP_MOSQUITO_STARTLE 342
-#define CLIP_MOSQUITO_TURNTOIDLE 343
-#define CLIP_FATFLY_ATTACK 344
-#define CLIP_FATFLY_DEATH_AIR 345
-#define CLIP_FATFLY_DEATH_LAND 346
-#define CLIP_FATFLY_FLY 347
-#define CLIP_MOSSCHARGER_APPEAR 348
-#define CLIP_MOSSCHARGER_CHARGE 349
-#define CLIP_MOSSCHARGER_DEATH_AIR 350
-#define CLIP_MOSSCHARGER_DEATH_LAND 351
-#define CLIP_MOSSCHARGER_DISAPPEAR 352
-#define CLIP_MOSSCHARGER_ESCAPE 353
-#define CLIP_MOSSCHARGER_GET_UP 354
-#define CLIP_MOSSCHARGER_STUN 355
-#define CLIP_MOSSCHARGER_TURNRUN 356
-#define CLIP_MOSSKNIGHT_DEATH_AIR 357
-#define CLIP_MOSSKNIGHT_DEATH_LAND 358
-#define CLIP_MOSSKNIGHT_DORMANT_1 359
-#define CLIP_MOSSKNIGHT_DORMANT_2 360
-#define CLIP_MOSSKNIGHT_EVADE 361
-#define CLIP_MOSSKNIGHT_IDLE 362
-#define CLIP_MOSSKNIGHT_SHAKE 363
-#define CLIP_MOSSKNIGHT_SHIELD_FRONT 364
-#define CLIP_MOSSKNIGHT_SHIELD_FRONT_BUMP 365
-#define CLIP_MOSSKNIGHT_SHIELD_TOP 366
-#define CLIP_MOSSKNIGHT_SHIELD_TOP_BUMP 367
-#define CLIP_MOSSKNIGHT_SHOOT 368
-#define CLIP_MOSSKNIGHT_SHOOT_END 369
-#define CLIP_MOSSKNIGHT_SLASH 370
-#define CLIP_MOSSKNIGHT_SLASH_2 371
-#define CLIP_MOSSKNIGHT_SLASH_2_EFFECT 372
-#define CLIP_MOSSKNIGHT_SLASH_EFFECT 373
-#define CLIP_MOSSKNIGHT_SLASH_EFFECT_QUICK 374
-#define CLIP_MOSSKNIGHT_SLASH_END 375
-#define CLIP_MOSSKNIGHT_SLASH_QUICK 376
-#define CLIP_MOSSKNIGHT_TURN 377
-#define CLIP_MOSSKNIGHT_UNSHIELD_FRONT 378
-#define CLIP_MOSSKNIGHT_UNSHIELD_TOP 379
-#define CLIP_MOSSKNIGHT_WAKE 380
-#define CLIP_MOSSKNIGHT_WALK 381
-#define CLIP_HORNET_A_DASH 382
-#define CLIP_HORNET_A_DASH_ANTIC 383
-#define CLIP_HORNET_AIR_DASH_EFFECT 384
-#define CLIP_HORNET_DEATH_AIR 385
-#define CLIP_HORNET_EVADE 386
-#define CLIP_HORNET_EVADE_ANTIC 387
-#define CLIP_HORNET_FALL 388
-#define CLIP_HORNET_FLASH 389
-#define CLIP_HORNET_FLOURISH 390
-#define CLIP_HORNET_G_DASH 391
-#define CLIP_HORNET_G_DASH_ANTIC 392
-#define CLIP_HORNET_G_DASH_EFFECT 393
-#define CLIP_HORNET_G_DASH_RECOVER1 394
-#define CLIP_HORNET_G_DASH_RECOVER2 395
-#define CLIP_HORNET_HARD_LAND 396
-#define CLIP_HORNET_IDLE 397
-#define CLIP_HORNET_JUMP 398
-#define CLIP_HORNET_JUMP_ANTIC 399
-#define CLIP_HORNET_LAND 400
-#define CLIP_HORNET_NEEDLE 401
-#define CLIP_HORNET_NEEDLE_THREAD 402
-#define CLIP_HORNET_RUN 403
-#define CLIP_HORNET_SPHERE_ANTIC_A 404
-#define CLIP_HORNET_SPHERE_ANTIC_G 405
-#define CLIP_HORNET_SPHERE_ATTACK 406
-#define CLIP_HORNET_SPHERE_BALL 407
-#define CLIP_HORNET_SPHERE_RECOVER_A 408
-#define CLIP_HORNET_SPHERE_RECOVER_G 409
-#define CLIP_HORNET_STUN 410
-#define CLIP_HORNET_STUN_AIR 411
-#define CLIP_HORNET_THROW 412
-#define CLIP_HORNET_THROW_ANTIC 413
-#define CLIP_HORNET_THROW_EFFECT 414
-#define CLIP_HORNET_THROW_RECOVER 415
-#define CLIP_HORNET_WALL_IMPACT 416
-#define CLIP_HORNET_WOUNDED 417
-#define CLIP_BGATE_BG_OPENED 418
-#define CLIP_BGATE_BG_CLOSE_1 419
-#define CLIP_BGATE_BG_CLOSE_2 420
-#define CLIP_BGATE_BG_OPEN 421
-#define CLIP_BGATE_BG_CLOSED 422
-#define CLIP_BGATE_BONE_GATE_OPENED 423
-#define CLIP_BGATE_BONE_GATE_CLOSE 424
-#define CLIP_BGATE_BONE_GATE_CLOSED 425
-#define CLIP_BGATE_BONE_GATE_OPEN 426
-#define CLIP_COCOON_COCOON_IDLE 427
-#define CLIP_COCOON_COCOON_SWEAT 428
-#define CLIP_COCOON_SCUTTLER_LAND 429
-#define CLIP_COCOON_SCUTTLER_RUN 430
-#define CLIP_FX_SPLAT 431
-#define CLIP_FX_SPLAT2 432
-#define CLIP_FIREBALL_BLAST 433
-#define CLIP_FIREBALL_BALL 434
-#define CLIP_FIREBALL_BALL_END 435
-#define CLIP_FIREBALL_FIREBALL_WALL_IMPACT 436
-#define CLIP_DRIP_IDLE 437
-#define CLIP_DRIP_DRIP 438
-#define CLIP_DRIP_FALL 439
-#define CLIP_DRIP_IMPACT 440
-#define CLIP_HORNETCS_EVADE 441
-#define CLIP_HORNETCS_EVADE_ANTIC 442
-#define CLIP_HORNETCS_FALL 443
-#define CLIP_HORNETCS_HARPOON_SIDE 444
-#define CLIP_HORNETCS_IDLE 445
-#define CLIP_HORNETCS_JUMP_FULL 446
-#define CLIP_HORNETCS_POINT 447
-#define CLIP_HORNETCS_SOFT_LAND 448
-#define CLIP_HORNETCS_THREAD_1 449
-#define CLIP_HORNETCS_THROW_SIDE 450
-#define CLIP_HORNETCS_THROW_SIDE_START 451
-#define CLIP_HORNETCS_TURN 452
-#define CLIP_HORNETCS_TURNTOIDLE 453
-#define CLIP_BULLET_IDLE 454
-#define CLIP_BULLET_IMPACT 455
-#define CLIP_BULLET_SHOCKWAVE_SPURT 456
-#define CLIP_PROP0_WATERFALL_LOOP 457
-#define CLIP_PROP1_TORCH2 458
-#define CLIP_PROP1_TORCH3 459
-#define CLIP_VM0_FLOWER 460
-#define CLIP_VM0_IDLE 461
-#define CLIP_VM0_REACH 462
-#define CLIP_VM0_REACH_TO_IDLE 463
-#define CLIP_VM0_TALK_LEFT 464
-#define CLIP_VM0_TALK_RIGHT 465
-#define CLIP_VM0_TURN_LEFT 466
-#define CLIP_VM0_TURN_RIGHT 467
-#define CLIP_VM3_IDLE 468
-#define CLIP_VM3_SIT_IDLE 469
-#define CLIP_VM3_SIT_TALK 470
-#define CLIP_VM3_SIT_TALK_END 471
-#define CLIP_VM3_SUMMON 472
-#define CLIP_VM3_TALK 473
-#define CLIP_VM3_TALK_END 474
-#define CLIP_VM3_TURN 475
-#define CLIP_ANIM0_DASH_CLOAK_CORPSE000 476
-#define CLIP_ANIM1_GROUND_PLINK_0 477
-#define CLIP_ANIM2_FIREBALL_COLLECT_ANIM 478
-#define SPRITE_HERO_LIGHT 2057
-#define SPRITE_DIALOGUE_BACKBOARD 2058
-#define SPRITE_PROMPT_SHADOW 2059
-#define SPRITE_CORPSE_NAIL 2060
-#define SPRITE_FK_BARREL 2061
-#define SPRITE_FK_STAFF 2062
-#define SPRITE_DIGIT0 2265
+#define CLIP_KNIGHT_DREAMER_LAND 20
+#define CLIP_KNIGHT_ENTER 21
+#define CLIP_KNIGHT_EXIT 22
+#define CLIP_KNIGHT_EXIT_DOOR_TO_IDLE 23
+#define CLIP_KNIGHT_FALL 24
+#define CLIP_KNIGHT_FIREBALL_ANTIC 25
+#define CLIP_KNIGHT_FIREBALL1_CAST 26
+#define CLIP_KNIGHT_FOCUS 27
+#define CLIP_KNIGHT_FOCUS_END 28
+#define CLIP_KNIGHT_FOCUS_GET 29
+#define CLIP_KNIGHT_FOCUS_GET_ONCE 30
+#define CLIP_KNIGHT_GET_OFF 31
+#define CLIP_KNIGHT_GETUPTOIDLE 32
+#define CLIP_KNIGHT_HARDLAND 33
+#define CLIP_KNIGHT_HAZARD_RESPAWN 34
+#define CLIP_KNIGHT_IDLE 35
+#define CLIP_KNIGHT_IDLE_HURT 36
+#define CLIP_KNIGHT_IDLE_WIND 37
+#define CLIP_KNIGHT_LAND 38
+#define CLIP_KNIGHT_LOOKDOWN 39
+#define CLIP_KNIGHT_LOOKDOWNEND 40
+#define CLIP_KNIGHT_LOOKDOWNTOIDLE 41
+#define CLIP_KNIGHT_LOOKUP 42
+#define CLIP_KNIGHT_LOOKUPEND 43
+#define CLIP_KNIGHT_LOOKUPTOIDLE 44
+#define CLIP_KNIGHT_MAP_AWAY 45
+#define CLIP_KNIGHT_MAP_IDLE 46
+#define CLIP_KNIGHT_MAP_OPEN 47
+#define CLIP_KNIGHT_MAP_TURN 48
+#define CLIP_KNIGHT_MAP_UPDATE 49
+#define CLIP_KNIGHT_MAP_WALK 50
+#define CLIP_KNIGHT_PROSTRATE 51
+#define CLIP_KNIGHT_PROSTRATE_RISE 52
+#define CLIP_KNIGHT_RECOIL 53
+#define CLIP_KNIGHT_RESPAWN_WAKE 54
+#define CLIP_KNIGHT_ROAR_LOCK 55
+#define CLIP_KNIGHT_RUN 56
+#define CLIP_KNIGHT_RUN_TO_IDLE 57
+#define CLIP_KNIGHT_SIT 58
+#define CLIP_KNIGHT_SIT_FALL_ASLEEP 59
+#define CLIP_KNIGHT_SIT_IDLE 60
+#define CLIP_KNIGHT_SIT_LEAN 61
+#define CLIP_KNIGHT_SIT_MAP_CLOSE 62
+#define CLIP_KNIGHT_SIT_MAP_OPEN 63
+#define CLIP_KNIGHT_SITTING_ASLEEP 64
+#define CLIP_KNIGHT_SLASH 65
+#define CLIP_KNIGHT_SLASHALT 66
+#define CLIP_KNIGHT_SLASHEFFECT 67
+#define CLIP_KNIGHT_SLASHEFFECTALT 68
+#define CLIP_KNIGHT_SPIKE_DEATH 69
+#define CLIP_KNIGHT_SPIKE_DEATH_ANTIC 70
+#define CLIP_KNIGHT_STUN 71
+#define CLIP_KNIGHT_TURN 72
+#define CLIP_KNIGHT_TURNFROMBG 73
+#define CLIP_KNIGHT_TURNTOBG 74
+#define CLIP_KNIGHT_TURNTOIDLE 75
+#define CLIP_KNIGHT_UPSLASH 76
+#define CLIP_KNIGHT_UPSLASHEFFECT 77
+#define CLIP_KNIGHT_WAKE 78
+#define CLIP_KNIGHT_WAKE_TO_SIT 79
+#define CLIP_KNIGHT_WAKE_UP_GROUND 80
+#define CLIP_KNIGHT_WALK 81
+#define CLIP_GEOROCK_IDLE_1 82
+#define CLIP_GEOROCK_GLEAM_1 83
+#define CLIP_GEOROCK_BROKEN_1 84
+#define CLIP_GEOROCK_IDLE_2 85
+#define CLIP_GEOROCK_GLEAM_2 86
+#define CLIP_GEOROCK_BROKEN_2 87
+#define CLIP_CHEST_IDLE 88
+#define CLIP_CHEST_OPEN 89
+#define CLIP_CHEST_BURST 90
+#define CLIP_CHEST_OPENED 91
+#define CLIP_HUD_HEALTH_EMPTY 92
+#define CLIP_HUD_HEALTH_IDLE 93
+#define CLIP_HUD_HEALTH_BREAK 94
+#define CLIP_HUD_HEALTH_REFILL 95
+#define CLIP_HUD_HEALTH_APPEAR 96
+#define CLIP_HUD_BLUE_APPEAR 97
+#define CLIP_HUD_BLUE_IDLE 98
+#define CLIP_HUD_BLUE_BREAK 99
+#define CLIP_HUD_BLUE_BREAK_FAST 100
+#define CLIP_HUD_HUD_FRAME 101
+#define CLIP_HUD_HUD_FRAME_IDLE 102
+#define CLIP_HUD_HUD_FRAME_CRACKAPPEAR 103
+#define CLIP_HUD_HUD_FRAME_CRACKED 104
+#define CLIP_HUD_COIN_APPEAR 105
+#define CLIP_HUD_COIN_IDLE 106
+#define CLIP_HUD_COIN_GET 107
+#define CLIP_HUD_SOUL_BURST 108
+#define CLIP_LIQUID_FILL 109
+#define CLIP_LIQUID_IDLE 110
+#define CLIP_LIQUID_SHRINK 111
+#define CLIP_LIQUID_DRAIN 112
+#define CLIP_GEO_SMALL_IDLE 113
+#define CLIP_GEO_SMALL_AIR 114
+#define CLIP_GEO_MED_IDLE 115
+#define CLIP_GEO_MED_AIR 116
+#define CLIP_GEO_LARGE_IDLE 117
+#define CLIP_GEO_LARGE_AIR 118
+#define CLIP_DIALOGUE_ARROW_UP 119
+#define CLIP_DIALOGUE_ARROW_DOWN 120
+#define CLIP_DIALOGUE_STOP_UP 121
+#define CLIP_DIALOGUE_STOP_DOWN 122
+#define CLIP_DIALOGUE_FLEUR_TOP_UP 123
+#define CLIP_DIALOGUE_FLEUR_TOP_DOWN 124
+#define CLIP_DIALOGUE_FLEUR_BOT_UP 125
+#define CLIP_DIALOGUE_FLEUR_BOT_DOWN 126
+#define CLIP_DIALOGUE_DREAM_UP 127
+#define CLIP_DIALOGUE_DREAM_DOWN 128
+#define CLIP_PROMPT_BLANK 129
+#define CLIP_PROMPT_DOWN 130
+#define CLIP_PROMPT_ENTER_DOWN 131
+#define CLIP_PROMPT_ENTER_IDLE 132
+#define CLIP_PROMPT_ENTER_UP 133
+#define CLIP_PROMPT_IDLE 134
+#define CLIP_PROMPT_LISTEN_DOWN 135
+#define CLIP_PROMPT_LISTEN_IDLE 136
+#define CLIP_PROMPT_LISTEN_UP 137
+#define CLIP_PROMPT_UP 138
+#define CLIP_SHADE_APPEAR 139
+#define CLIP_SHADE_CAST 140
+#define CLIP_SHADE_CAST_ANTIC 141
+#define CLIP_SHADE_CAST_CHARGE 142
+#define CLIP_SHADE_CAST_RING 143
+#define CLIP_SHADE_DEATH 144
+#define CLIP_SHADE_DEATH_GLOW 145
+#define CLIP_SHADE_DEATH_START 146
+#define CLIP_SHADE_DEPART 147
+#define CLIP_SHADE_FIREBALL 148
+#define CLIP_SHADE_FIREBALL_END 149
+#define CLIP_SHADE_FLY 150
+#define CLIP_SHADE_IDLE 151
+#define CLIP_SHADE_RETREAT_END 152
+#define CLIP_SHADE_RETREAT_START 153
+#define CLIP_SHADE_SLASH 154
+#define CLIP_SHADE_SLASH_ANTIC 155
+#define CLIP_SHADE_SLASH_CD 156
+#define CLIP_SHADE_SLASH_EFFECT 157
+#define CLIP_SHADE_STARTLE 158
+#define CLIP_SHADE_TURNTOFLY 159
+#define CLIP_SHADE_TURNTOIDLE 160
+#define CLIP_CRAWLER_WALK 161
+#define CLIP_CRAWLER_TURN 162
+#define CLIP_CRAWLER_IDLE 163
+#define CLIP_CRAWLER_DEATH_AIR 164
+#define CLIP_CRAWLER_DEATH_LAND 165
+#define CLIP_BUZZER_CHASE 166
+#define CLIP_BUZZER_IDLE 167
+#define CLIP_BUZZER_STARTLE 168
+#define CLIP_BUZZER_DEATH_AIR 169
+#define CLIP_BUZZER_DEATH_LAND 170
+#define CLIP_BUZZER_FLY 171
+#define CLIP_BUZZER_TURNTOFLY 172
+#define CLIP_BUZZER_TURNTOIDLE 173
+#define CLIP_TIKTIK_DEATH_AIR 174
+#define CLIP_TIKTIK_DEATH_LAND 175
+#define CLIP_TIKTIK_STUN 176
+#define CLIP_TIKTIK_WALK 177
+#define CLIP_GRUZZER_DEATH_AIR 178
+#define CLIP_GRUZZER_DEATH_LAND 179
+#define CLIP_GRUZZER_FLY 180
+#define CLIP_ASPID_DEATH_AIR 181
+#define CLIP_ASPID_FIRE_LONG 182
+#define CLIP_ASPID_FLY 183
+#define CLIP_ASPID_TURNTOFLY 184
+#define CLIP_BALDUR_DEATH_AIR 185
+#define CLIP_BALDUR_DEATH_LAND 186
+#define CLIP_BALDUR_IDLE 187
+#define CLIP_BALDUR_ROLL 188
+#define CLIP_BALDUR_START 189
+#define CLIP_BALDUR_STOP 190
+#define CLIP_ELDERBALDUR_CLOSE1 191
+#define CLIP_ELDERBALDUR_CLOSE2 192
+#define CLIP_ELDERBALDUR_CLOSED 193
+#define CLIP_ELDERBALDUR_DEATH 194
+#define CLIP_ELDERBALDUR_DEATH_STUN 195
+#define CLIP_ELDERBALDUR_HIT 196
+#define CLIP_ELDERBALDUR_IDLE 197
+#define CLIP_ELDERBALDUR_OPEN 198
+#define CLIP_ELDERBALDUR_SHOOT_ANTIC 199
+#define CLIP_ELDERBALDUR_SHOOT_CD 200
+#define CLIP_HUSK_ATTACK_ANTICIPATE 201
+#define CLIP_HUSK_ATTACK_COOLDOWN 202
+#define CLIP_HUSK_ATTACK_LUNGE 203
+#define CLIP_HUSK_DEATH_AIR 204
+#define CLIP_HUSK_DEATH_LAND 205
+#define CLIP_HUSK_IDLE 206
+#define CLIP_HUSK_TURN 207
+#define CLIP_HUSK_WALK 208
+#define CLIP_BARGER_ATTACK_ANTICIPATE 209
+#define CLIP_BARGER_ATTACK_COOLDOWN 210
+#define CLIP_BARGER_ATTACK_LUNGE 211
+#define CLIP_BARGER_DEATH_AIR 212
+#define CLIP_BARGER_DEATH_LAND 213
+#define CLIP_BARGER_IDLE 214
+#define CLIP_BARGER_TURN 215
+#define CLIP_BARGER_WALK 216
+#define CLIP_HORNHEAD_ATTACK_ANTICIPATE 217
+#define CLIP_HORNHEAD_ATTACK_COOLDOWN 218
+#define CLIP_HORNHEAD_ATTACK_LUNGE 219
+#define CLIP_HORNHEAD_DEATH_AIR 220
+#define CLIP_HORNHEAD_DEATH_LAND 221
+#define CLIP_HORNHEAD_IDLE 222
+#define CLIP_HORNHEAD_TURN 223
+#define CLIP_HORNHEAD_WALK 224
+#define CLIP_MOSSRUNNER_ATTACK_ANTICIPATE 225
+#define CLIP_MOSSRUNNER_ATTACK_COOLDOWN 226
+#define CLIP_MOSSRUNNER_ATTACK_LUNGE 227
+#define CLIP_MOSSRUNNER_DEATH_AIR 228
+#define CLIP_MOSSRUNNER_DEATH_LAND 229
+#define CLIP_MOSSRUNNER_IDLE 230
+#define CLIP_MOSSRUNNER_TURN 231
+#define CLIP_MOSSRUNNER_WALK 232
+#define CLIP_LEAPER_ATTACK 233
+#define CLIP_LEAPER_DEATH_AIR 234
+#define CLIP_LEAPER_DEATH_LAND 235
+#define CLIP_LEAPER_IDLE 236
+#define CLIP_LEAPER_LAND 237
+#define CLIP_LEAPER_TURN 238
+#define CLIP_LEAPER_WALK 239
+#define CLIP_GUARD_ANTICIPATE 240
+#define CLIP_GUARD_ATTACK2 241
+#define CLIP_GUARD_DEATH_AIR 242
+#define CLIP_GUARD_DEATH_LAND 243
+#define CLIP_GUARD_DORMANT 244
+#define CLIP_GUARD_IDLE 245
+#define CLIP_GUARD_RUN 246
+#define CLIP_GUARD_STARTLE 247
+#define CLIP_GUARD_STOMP_ANTIC 248
+#define CLIP_GUARD_STOMP_JUMP 249
+#define CLIP_GUARD_STOMP_LAND 250
+#define CLIP_GUARD_STOP_RUN 251
+#define CLIP_GUARD_STOP_WALK 252
+#define CLIP_GUARD_SWIPE 253
+#define CLIP_GUARD_TURN 254
+#define CLIP_GUARD_WAKE 255
+#define CLIP_GUARD_WALK 256
+#define CLIP_FK_ATTACK 257
+#define CLIP_FK_ATTACK_ANTIC 258
+#define CLIP_FK_ATTACK_RECOVER 259
+#define CLIP_FK_BLANK 260
+#define CLIP_FK_BODY 261
+#define CLIP_FK_DEATH_FALL 262
+#define CLIP_FK_DEATH_HEAD_1 263
+#define CLIP_FK_DEATH_HEAD_2 264
+#define CLIP_FK_DEATH_LAND 265
+#define CLIP_FK_DEATH_SPAZ 266
+#define CLIP_FK_IDLE 267
+#define CLIP_FK_JUMP 268
+#define CLIP_FK_JUMP_ANTIC 269
+#define CLIP_FK_JUMP_ATTACK_HIT_1 270
+#define CLIP_FK_JUMP_ATTACK_HIT_2 271
+#define CLIP_FK_JUMP_ATTACK_HIT_3 272
+#define CLIP_FK_JUMP_ATTACK_UP 273
+#define CLIP_FK_LAND 274
+#define CLIP_FK_RAGE 275
+#define CLIP_FK_RUN 276
+#define CLIP_FK_RUN_ANTIC 277
+#define CLIP_FK_STUN_HIT 278
+#define CLIP_FK_STUN_OPEN 279
+#define CLIP_FK_STUN_OPENED 280
+#define CLIP_FK_STUN_RECOVER 281
+#define CLIP_FK_STUN_ROLL 282
+#define CLIP_FK_STUN_ROLL_END 283
+#define CLIP_FK_TURN 284
+#define CLIP_FKHEAD_DEATH_LAND 285
+#define CLIP_FKHEAD_HEAD_HIT 286
+#define CLIP_FKHEAD_HEAD_IDLE 287
+#define CLIP_FKHEAD_HEAD_SPAZ 288
+#define CLIP_HATCHER_DEATH_AIR 289
+#define CLIP_HATCHER_DEATH_LAND 290
+#define CLIP_HATCHER_FIRE 291
+#define CLIP_HATCHER_FLY 292
+#define CLIP_HATCHLING_FLY 293
+#define CLIP_SLUG_BOUNCE 294
+#define CLIP_SLUG_DEATH_AIR 295
+#define CLIP_SLUG_DEATH_LAND 296
+#define CLIP_SLUG_IDLE_TODOWN 297
+#define CLIP_SLUG_IDLE_TOUP 298
+#define CLIP_SLUG_IDLE_UP 299
+#define CLIP_SLUG_RUN 300
+#define CLIP_SLUG_STARTLE 301
+#define CLIP_GFLY_BURST 302
+#define CLIP_GFLY_CHARGE 303
+#define CLIP_GFLY_CHARGE_ANTIC 304
+#define CLIP_GFLY_CHARGE_RECOVER 305
+#define CLIP_GFLY_DEATH 306
+#define CLIP_GFLY_FALL 307
+#define CLIP_GFLY_FLY 308
+#define CLIP_GFLY_GURGLE_LOOP 309
+#define CLIP_GFLY_GURGLE_ONCE 310
+#define CLIP_GFLY_SLAM_DOWN 311
+#define CLIP_GFLY_SLAM_END 312
+#define CLIP_GFLY_SLAM_UP 313
+#define CLIP_GFLY_SLEEP 314
+#define CLIP_GFLY_STOP 315
+#define CLIP_GFLY_WAKE 316
+#define CLIP_GFLY_WIGGLE 317
+#define CLIP_MOSSWALKER_APPEAR 318
+#define CLIP_MOSSWALKER_BURY 319
+#define CLIP_MOSSWALKER_DEATH_AIR 320
+#define CLIP_MOSSWALKER_DEATH_LAND 321
+#define CLIP_MOSSWALKER_SHAKE 322
+#define CLIP_MOSSWALKER_TURN 323
+#define CLIP_MOSSWALKER_WALK 324
+#define CLIP_PIGEON_FLY 325
+#define CLIP_PIGEON_IDLE_01 326
+#define CLIP_PIGEON_IDLE_02 327
+#define CLIP_PIGEON_IDLE_03 328
+#define CLIP_PLANTTRAP_DEATH 329
+#define CLIP_PLANTTRAP_IDLE 330
+#define CLIP_PLANTTRAP_RETRACT 331
+#define CLIP_PLANTTRAP_SNAP 332
+#define CLIP_PLANTTRAP_SNAP_READY 333
+#define CLIP_SHAKER_ATTACK 334
+#define CLIP_SHAKER_DEATH_AIR 335
+#define CLIP_SHAKER_DEATH_LAND 336
+#define CLIP_SHAKER_IDLE 337
+#define CLIP_SHAKER_TURN 338
+#define CLIP_SHAKER_WALK 339
+#define CLIP_MOSQUITO_ATTACK 340
+#define CLIP_MOSQUITO_ATTACK_ANTIC 341
+#define CLIP_MOSQUITO_DEATH_AIR 342
+#define CLIP_MOSQUITO_DEATH_LAND 343
+#define CLIP_MOSQUITO_IDLE 344
+#define CLIP_MOSQUITO_STARTLE 345
+#define CLIP_MOSQUITO_TURNTOIDLE 346
+#define CLIP_FATFLY_ATTACK 347
+#define CLIP_FATFLY_DEATH_AIR 348
+#define CLIP_FATFLY_DEATH_LAND 349
+#define CLIP_FATFLY_FLY 350
+#define CLIP_MOSSCHARGER_APPEAR 351
+#define CLIP_MOSSCHARGER_CHARGE 352
+#define CLIP_MOSSCHARGER_DEATH_AIR 353
+#define CLIP_MOSSCHARGER_DEATH_LAND 354
+#define CLIP_MOSSCHARGER_DISAPPEAR 355
+#define CLIP_MOSSCHARGER_ESCAPE 356
+#define CLIP_MOSSCHARGER_GET_UP 357
+#define CLIP_MOSSCHARGER_STUN 358
+#define CLIP_MOSSCHARGER_TURNRUN 359
+#define CLIP_MOSSKNIGHT_DEATH_AIR 360
+#define CLIP_MOSSKNIGHT_DEATH_LAND 361
+#define CLIP_MOSSKNIGHT_DORMANT_1 362
+#define CLIP_MOSSKNIGHT_DORMANT_2 363
+#define CLIP_MOSSKNIGHT_EVADE 364
+#define CLIP_MOSSKNIGHT_IDLE 365
+#define CLIP_MOSSKNIGHT_SHAKE 366
+#define CLIP_MOSSKNIGHT_SHIELD_FRONT 367
+#define CLIP_MOSSKNIGHT_SHIELD_FRONT_BUMP 368
+#define CLIP_MOSSKNIGHT_SHIELD_TOP 369
+#define CLIP_MOSSKNIGHT_SHIELD_TOP_BUMP 370
+#define CLIP_MOSSKNIGHT_SHOOT 371
+#define CLIP_MOSSKNIGHT_SHOOT_END 372
+#define CLIP_MOSSKNIGHT_SLASH 373
+#define CLIP_MOSSKNIGHT_SLASH_2 374
+#define CLIP_MOSSKNIGHT_SLASH_2_EFFECT 375
+#define CLIP_MOSSKNIGHT_SLASH_EFFECT 376
+#define CLIP_MOSSKNIGHT_SLASH_EFFECT_QUICK 377
+#define CLIP_MOSSKNIGHT_SLASH_END 378
+#define CLIP_MOSSKNIGHT_SLASH_QUICK 379
+#define CLIP_MOSSKNIGHT_TURN 380
+#define CLIP_MOSSKNIGHT_UNSHIELD_FRONT 381
+#define CLIP_MOSSKNIGHT_UNSHIELD_TOP 382
+#define CLIP_MOSSKNIGHT_WAKE 383
+#define CLIP_MOSSKNIGHT_WALK 384
+#define CLIP_HORNET_A_DASH 385
+#define CLIP_HORNET_A_DASH_ANTIC 386
+#define CLIP_HORNET_AIR_DASH_EFFECT 387
+#define CLIP_HORNET_DEATH_AIR 388
+#define CLIP_HORNET_EVADE 389
+#define CLIP_HORNET_EVADE_ANTIC 390
+#define CLIP_HORNET_FALL 391
+#define CLIP_HORNET_FLASH 392
+#define CLIP_HORNET_FLOURISH 393
+#define CLIP_HORNET_G_DASH 394
+#define CLIP_HORNET_G_DASH_ANTIC 395
+#define CLIP_HORNET_G_DASH_EFFECT 396
+#define CLIP_HORNET_G_DASH_RECOVER1 397
+#define CLIP_HORNET_G_DASH_RECOVER2 398
+#define CLIP_HORNET_HARD_LAND 399
+#define CLIP_HORNET_IDLE 400
+#define CLIP_HORNET_JUMP 401
+#define CLIP_HORNET_JUMP_ANTIC 402
+#define CLIP_HORNET_LAND 403
+#define CLIP_HORNET_NEEDLE 404
+#define CLIP_HORNET_NEEDLE_THREAD 405
+#define CLIP_HORNET_RUN 406
+#define CLIP_HORNET_SPHERE_ANTIC_A 407
+#define CLIP_HORNET_SPHERE_ANTIC_G 408
+#define CLIP_HORNET_SPHERE_ATTACK 409
+#define CLIP_HORNET_SPHERE_BALL 410
+#define CLIP_HORNET_SPHERE_RECOVER_A 411
+#define CLIP_HORNET_SPHERE_RECOVER_G 412
+#define CLIP_HORNET_STUN 413
+#define CLIP_HORNET_STUN_AIR 414
+#define CLIP_HORNET_THROW 415
+#define CLIP_HORNET_THROW_ANTIC 416
+#define CLIP_HORNET_THROW_EFFECT 417
+#define CLIP_HORNET_THROW_RECOVER 418
+#define CLIP_HORNET_WALL_IMPACT 419
+#define CLIP_HORNET_WOUNDED 420
+#define CLIP_BGATE_BG_OPENED 421
+#define CLIP_BGATE_BG_CLOSE_1 422
+#define CLIP_BGATE_BG_CLOSE_2 423
+#define CLIP_BGATE_BG_OPEN 424
+#define CLIP_BGATE_BG_CLOSED 425
+#define CLIP_BGATE_BONE_GATE_OPENED 426
+#define CLIP_BGATE_BONE_GATE_CLOSE 427
+#define CLIP_BGATE_BONE_GATE_CLOSED 428
+#define CLIP_BGATE_BONE_GATE_OPEN 429
+#define CLIP_COCOON_COCOON_IDLE 430
+#define CLIP_COCOON_COCOON_SWEAT 431
+#define CLIP_COCOON_SCUTTLER_LAND 432
+#define CLIP_COCOON_SCUTTLER_RUN 433
+#define CLIP_FX_SPLAT 434
+#define CLIP_FX_SPLAT2 435
+#define CLIP_FIREBALL_BLAST 436
+#define CLIP_FIREBALL_BALL 437
+#define CLIP_FIREBALL_BALL_END 438
+#define CLIP_FIREBALL_FIREBALL_WALL_IMPACT 439
+#define CLIP_DRIP_IDLE 440
+#define CLIP_DRIP_DRIP 441
+#define CLIP_DRIP_FALL 442
+#define CLIP_DRIP_IMPACT 443
+#define CLIP_HORNETCS_EVADE 444
+#define CLIP_HORNETCS_EVADE_ANTIC 445
+#define CLIP_HORNETCS_FALL 446
+#define CLIP_HORNETCS_HARPOON_SIDE 447
+#define CLIP_HORNETCS_IDLE 448
+#define CLIP_HORNETCS_JUMP_FULL 449
+#define CLIP_HORNETCS_POINT 450
+#define CLIP_HORNETCS_SOFT_LAND 451
+#define CLIP_HORNETCS_THREAD_1 452
+#define CLIP_HORNETCS_THROW_SIDE 453
+#define CLIP_HORNETCS_THROW_SIDE_START 454
+#define CLIP_HORNETCS_TURN 455
+#define CLIP_HORNETCS_TURNTOIDLE 456
+#define CLIP_BULLET_IDLE 457
+#define CLIP_BULLET_IMPACT 458
+#define CLIP_BULLET_SHOCKWAVE_SPURT 459
+#define CLIP_PROP0_WATERFALL_LOOP 460
+#define CLIP_PROP1_TORCH2 461
+#define CLIP_PROP1_TORCH3 462
+#define CLIP_VM0_FLOWER 463
+#define CLIP_VM0_IDLE 464
+#define CLIP_VM0_REACH 465
+#define CLIP_VM0_REACH_TO_IDLE 466
+#define CLIP_VM0_TALK_LEFT 467
+#define CLIP_VM0_TALK_RIGHT 468
+#define CLIP_VM0_TURN_LEFT 469
+#define CLIP_VM0_TURN_RIGHT 470
+#define CLIP_VM4_HEGEMOL_CAST 471
+#define CLIP_VM4_HEGEMOL_IDLE 472
+#define CLIP_VM4_LURIEN_CAST 473
+#define CLIP_VM4_LURIEN_IDLE 474
+#define CLIP_VM4_MONOMON_CAST 475
+#define CLIP_VM4_MONOMON_IDLE 476
+#define CLIP_VM5_IDLE 477
+#define CLIP_VM5_SIT_IDLE 478
+#define CLIP_VM5_SIT_TALK 479
+#define CLIP_VM5_SIT_TALK_END 480
+#define CLIP_VM5_SUMMON 481
+#define CLIP_VM5_TALK 482
+#define CLIP_VM5_TALK_END 483
+#define CLIP_VM5_TURN 484
+#define CLIP_ANIM0_DASH_CLOAK_CORPSE000 485
+#define CLIP_ANIM1_GROUND_PLINK_0 486
+#define CLIP_ANIM2_FIREBALL_COLLECT_ANIM 487
+#define SPRITE_HERO_LIGHT 2092
+#define SPRITE_DIALOGUE_BACKBOARD 2093
+#define SPRITE_PROMPT_SHADOW 2094
+#define SPRITE_CORPSE_NAIL 2095
+#define SPRITE_FK_BARREL 2096
+#define SPRITE_FK_STAFF 2097
+#define SPRITE_DIGIT0 2305
#define STYLE_DIALOGUE 0
#define STYLE_PROMPT 1
#define STYLE_TITLE_L 2
@@ -582,21 +591,21 @@
#define EK_MOSSKNIGHT 28
#define EK_HORNET 29
#define NUM_KINDS 30
-#define KIND_TABLE {{0}, {EF_CRAWLER, {-1, 159, 158, -1, -1, -1, -1, -1, -1, -1, -1, 161, 162}}, {EF_BUZZER, {164, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 166, 167}}, {EF_SHADE, {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, {EF_CLIMBER, {-1, -1, 174, 173, -1, -1, -1, -1, -1, -1, -1, 171, 172}}, {EF_BOUNCER, {-1, -1, -1, 177, -1, -1, -1, -1, -1, -1, -1, 175, 176}}, {EF_SPITTER, {-1, -1, -1, 180, 181, 179, -1, -1, -1, -1, -1, 178, -1}}, {EF_ROLLER, {184, -1, -1, 186, 185, 187, -1, -1, -1, -1, -1, 182, 183}}, {EF_BLOCKER, {194, -1, -1, 190, 195, 188, 189, 196, 197, 193, 192, -1, 191}}, {EF_HUSK, {203, 204, 205, 198, 200, 199, -1, -1, -1, -1, -1, 201, 202}}, {EF_HUSK, {211, 212, 213, 206, 208, 207, -1, -1, -1, -1, -1, 209, 210}}, {EF_HUSK, {219, 220, 221, 214, 216, 215, -1, -1, -1, -1, -1, 217, 218}}, {EF_HUSK, {227, 228, 229, 222, 224, 223, -1, -1, -1, -1, -1, 225, 226}}, {EF_LEAPER, {233, 235, 236, 230, 234, -1, -1, -1, -1, -1, -1, 231, 232}}, {EF_GUARD, {242, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, 240}}, {EF_FK, {264, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 262}}, {EF_FKHEAD, {284, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 282}}, {EF_HATCHER, {-1, -1, -1, 289, 288, -1, -1, -1, -1, -1, -1, 286, 287}}, {EF_HATCHLING, {-1, -1, -1, 290, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, {EF_SLUG, {296, -1, -1, 294, 295, 298, 297, 291, -1, -1, -1, 292, 293}}, {EF_GFLY, {311, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, {EF_MOSSWALKER, {-1, 320, 321, 319, 315, 316, -1, -1, -1, -1, -1, 317, 318}}, {EF_PIGEON, {-1, -1, -1, 323, 324, 325, 322, -1, -1, -1, -1, -1, -1}}, {EF_PLANTTRAP, {327, -1, -1, 330, 329, 328, -1, -1, -1, -1, -1, 326, -1}}, {EF_SHAKER, {334, 335, 336, 331, -1, -1, -1, -1, -1, -1, -1, 332, 333}}, {EF_MOSQUITO, {341, -1, -1, 343, 342, 338, 337, -1, -1, -1, -1, 339, 340}}, {EF_FATFLY, {347, -1, -1, 344, -1, -1, -1, -1, -1, -1, -1, 345, 346}}, {EF_MOSSCHARGER, {-1, -1, -1, 348, 349, 352, 355, 354, 356, 353, -1, 350, 351}}, {EF_MOSSKNIGHT, {362, 377, 381, -1, -1, -1, -1, -1, -1, -1, -1, 357, 358}}, {EF_HORNET, {397, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 385, -1}}}
-#define TXT_PROMPT_LISTEN 28
-#define TXT_PROMPT_REST 29
-#define TXT_PROMPT_INSPECT 30
-#define TXT_PROMPT_ENTER 31
-#define TXT_PROMPT_SIT 32
-#define TXT_PROMPT_SHOP 33
-#define TXT_PROMPT_TRAVEL 34
-#define TXT_PROMPT_ASCEND 35
-#define TXT_PROMPT_DESCEND 36
-#define TXT_PROMPT_EXIT 37
-#define TXT_PROMPT_ACCEPT 38
-#define TXT_PROMPT_TRADE 39
-#define TXT_PROMPT_WATCH 40
-#define TXT_PROMPT_CHALLENGE 41
+#define KIND_TABLE {{0}, {EF_CRAWLER, {-1, 162, 161, -1, -1, -1, -1, -1, -1, -1, -1, 164, 165}}, {EF_BUZZER, {167, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 169, 170}}, {EF_SHADE, {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, {EF_CLIMBER, {-1, -1, 177, 176, -1, -1, -1, -1, -1, -1, -1, 174, 175}}, {EF_BOUNCER, {-1, -1, -1, 180, -1, -1, -1, -1, -1, -1, -1, 178, 179}}, {EF_SPITTER, {-1, -1, -1, 183, 184, 182, -1, -1, -1, -1, -1, 181, -1}}, {EF_ROLLER, {187, -1, -1, 189, 188, 190, -1, -1, -1, -1, -1, 185, 186}}, {EF_BLOCKER, {197, -1, -1, 193, 198, 191, 192, 199, 200, 196, 195, -1, 194}}, {EF_HUSK, {206, 207, 208, 201, 203, 202, -1, -1, -1, -1, -1, 204, 205}}, {EF_HUSK, {214, 215, 216, 209, 211, 210, -1, -1, -1, -1, -1, 212, 213}}, {EF_HUSK, {222, 223, 224, 217, 219, 218, -1, -1, -1, -1, -1, 220, 221}}, {EF_HUSK, {230, 231, 232, 225, 227, 226, -1, -1, -1, -1, -1, 228, 229}}, {EF_LEAPER, {236, 238, 239, 233, 237, -1, -1, -1, -1, -1, -1, 234, 235}}, {EF_GUARD, {245, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 242, 243}}, {EF_FK, {267, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 265}}, {EF_FKHEAD, {287, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 285}}, {EF_HATCHER, {-1, -1, -1, 292, 291, -1, -1, -1, -1, -1, -1, 289, 290}}, {EF_HATCHLING, {-1, -1, -1, 293, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, {EF_SLUG, {299, -1, -1, 297, 298, 301, 300, 294, -1, -1, -1, 295, 296}}, {EF_GFLY, {314, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}, {EF_MOSSWALKER, {-1, 323, 324, 322, 318, 319, -1, -1, -1, -1, -1, 320, 321}}, {EF_PIGEON, {-1, -1, -1, 326, 327, 328, 325, -1, -1, -1, -1, -1, -1}}, {EF_PLANTTRAP, {330, -1, -1, 333, 332, 331, -1, -1, -1, -1, -1, 329, -1}}, {EF_SHAKER, {337, 338, 339, 334, -1, -1, -1, -1, -1, -1, -1, 335, 336}}, {EF_MOSQUITO, {344, -1, -1, 346, 345, 341, 340, -1, -1, -1, -1, 342, 343}}, {EF_FATFLY, {350, -1, -1, 347, -1, -1, -1, -1, -1, -1, -1, 348, 349}}, {EF_MOSSCHARGER, {-1, -1, -1, 351, 352, 355, 358, 357, 359, 356, -1, 353, 354}}, {EF_MOSSKNIGHT, {365, 380, 384, -1, -1, -1, -1, -1, -1, -1, -1, 360, 361}}, {EF_HORNET, {400, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 388, -1}}}
+#define TXT_PROMPT_LISTEN 32
+#define TXT_PROMPT_REST 33
+#define TXT_PROMPT_INSPECT 34
+#define TXT_PROMPT_ENTER 35
+#define TXT_PROMPT_SIT 36
+#define TXT_PROMPT_SHOP 37
+#define TXT_PROMPT_TRAVEL 38
+#define TXT_PROMPT_ASCEND 39
+#define TXT_PROMPT_DESCEND 40
+#define TXT_PROMPT_EXIT 41
+#define TXT_PROMPT_ACCEPT 42
+#define TXT_PROMPT_TRADE 43
+#define TXT_PROMPT_WATCH 44
+#define TXT_PROMPT_CHALLENGE 45
#define PROMPT_SORT 884737u
#define DIGIT_ADV {0.4182f, 0.4182f, 0.4182f, 0.4182f, 0.4182f, 0.4182f, 0.4182f, 0.4182f, 0.4182f, 0.4182f}
#define VMOP_NOP 1
@@ -685,6 +694,11 @@
#define VMOP_INTOP 84
#define VMOP_ACTIVATEALLCHILDREN 85
#define VMOP_ITWEENMOVEBY 86
+#define VMOP_SETFSMFLOAT 87
+#define VMOP_TEXTALIGN 88
+#define VMOP_OBJALPHA 89
+#define VMOP_BUILDSTRING 90
+#define VMOP_GETOBJALPHA 91
#define VMEV_FINISHED 0
#define VMEV_CONVO_FINISH 1
#define VMEV_CONVO_START 2
@@ -706,9 +720,14 @@
#define VMEV_BG_QUICK_OPEN 18
#define VMEV_BG_DESTROY 19
#define VMEV_WAKE 20
+#define VMEV_BOX_UP_DREAM 21
+#define VMEV_BOX_DOWN_DREAM 22
+#define VMEV_FADE_IN 23
+#define VMEV_FADE_OUT 24
+#define VMEV_FSM_CANCEL 25
#define VMSTR_NPC_TITLE 14
-#define VMSTR_VISITED 173
-#define VMSTR_DISPLAY_RIGHT 174
+#define VMSTR_VISITED 208
+#define VMSTR_DISPLAY_RIGHT 209
#define VMSTR_HORNET_SAVER 83
#define STR_ATTACK_RANGE 23
#define STR_EVADE_RANGE 50
@@ -737,20 +756,20 @@
#define TITLE_TISO_NC 18
#define TITLE_CHARM_SLUG 19
#define NUM_TITLES 20
-#define TITLE_TABLE {{42, 43, -1, -1}, {44, 45, 46, -1}, {47, 48, -1, 49}, {50, 51, -1, 52}, {53, 54, -1, 55}, {56, 57, -1, -1}, {58, 59, 60, -1}, {61, 62, -1, -1}, {63, 64, -1, -1}, {65, 66, -1, -1}, {67, 68, -1, -1}, {69, 70, -1, -1}, {71, 72, -1, -1}, {73, 74, -1, -1}, {75, 76, -1, 77}, {78, 79, -1, 80}, {78, 79, -1, 81}, {82, 83, 84, -1}, {82, 83, -1, -1}, {85, 86, -1, 87}}
-#define SPRITE_FLEUR_TOP 2063
+#define TITLE_TABLE {{46, 47, -1, -1}, {48, 49, 50, -1}, {51, 52, -1, 53}, {54, 55, -1, 56}, {57, 58, -1, 59}, {60, 61, -1, -1}, {62, 63, 64, -1}, {65, 66, -1, -1}, {67, 68, -1, -1}, {69, 70, -1, -1}, {71, 72, -1, -1}, {73, 74, -1, -1}, {75, 76, -1, -1}, {77, 78, -1, -1}, {79, 80, -1, 81}, {82, 83, -1, 84}, {82, 83, -1, 85}, {86, 87, 88, -1}, {86, 87, -1, -1}, {89, 90, -1, 91}}
+#define SPRITE_FLEUR_TOP 2098
#define FLEUR_TOP_RECTS {{0.781f, -0.844f, 0.953f, -0.688f}, {-1.078f, -0.984f, 1.141f, -0.531f}, {-1.281f, -1.016f, 1.313f, -0.484f}, {-1.359f, -1.016f, 1.969f, -0.141f}, {-2.141f, -1.031f, 2.531f, 0.047f}, {-2.250f, -1.078f, 2.766f, 0.266f}, {-2.797f, -1.203f, 3.094f, 0.578f}, {-2.938f, -1.219f, 3.219f, 0.859f}, {-3.203f, -1.234f, 3.469f, 1.141f}, {-3.312f, -1.234f, 3.766f, 1.281f}, {-3.547f, -1.250f, 4.000f, 1.328f}, {-3.844f, -1.250f, 4.016f, 1.328f}, {-4.016f, -1.250f, 4.031f, 1.344f}, {-4.031f, -1.250f, 4.031f, 1.344f}, {-4.047f, -1.250f, 4.031f, 1.359f}, {-4.047f, -1.250f, 4.031f, 1.359f}, {-4.047f, -1.266f, 4.031f, 1.359f}, {-4.047f, -1.266f, 4.031f, 1.359f}, {-4.062f, -1.266f, 4.047f, 1.375f}, {-4.062f, -1.266f, 4.047f, 1.375f}, {-4.062f, -1.266f, 4.047f, 1.375f}, {-4.062f, -1.266f, 4.047f, 1.375f}}
#define FLEUR_FRAMES 22
#define FLEUR_FPS 15.0f
-#define SPRITE_FLEUR_BOT 2064
+#define SPRITE_FLEUR_BOT 2099
#define FLEUR_BOT_RECTS {{0.000f, 0.000f, 0.016f, 0.016f}, {0.000f, 0.000f, 0.016f, 0.016f}, {0.391f, 0.406f, 0.828f, 0.844f}, {-1.063f, 0.281f, 1.516f, 1.016f}, {-1.594f, -0.047f, 2.109f, 1.031f}, {-1.984f, -0.156f, 2.375f, 1.047f}, {-2.531f, -0.438f, 2.719f, 1.172f}, {-2.688f, -0.594f, 2.766f, 1.188f}, {-2.797f, -0.797f, 3.156f, 1.219f}, {-3.078f, -0.938f, 3.219f, 1.219f}, {-3.250f, -1.156f, 3.438f, 1.219f}, {-3.250f, -1.172f, 3.828f, 1.219f}, {-3.781f, -1.188f, 4.203f, 1.234f}, {-3.984f, -1.188f, 4.344f, 1.234f}, {-4.281f, -1.203f, 4.562f, 1.234f}, {-4.406f, -1.203f, 4.641f, 1.234f}, {-4.578f, -1.219f, 4.719f, 1.234f}, {-4.656f, -1.219f, 4.719f, 1.234f}, {-4.734f, -1.219f, 4.734f, 1.234f}, {-4.750f, -1.234f, 4.734f, 1.234f}, {-4.766f, -1.234f, 4.734f, 1.250f}, {-4.766f, -1.234f, 4.734f, 1.250f}}
-#define SPRITE_MSG_BG 2065
-#define SPRITE_MSG_STOP 2066
-#define SPRITE_MSG_FLEUR 2067
-#define SPRITE_MSG_KEY 2068
-#define SPRITE_MSG_ICON_FIREBALL 2069
-#define SPRITE_MSG_ICON_DASH 2070
-#define SPRITE_GRASS_BALL 2071
-#define MSG_TABLE {{88, 89, 90, 91, 92, 93}, {94, 95, 96, 97, 98, 99}}
+#define SPRITE_MSG_BG 2100
+#define SPRITE_MSG_STOP 2101
+#define SPRITE_MSG_FLEUR 2102
+#define SPRITE_MSG_KEY 2103
+#define SPRITE_MSG_ICON_FIREBALL 2104
+#define SPRITE_MSG_ICON_DASH 2105
+#define SPRITE_GRASS_BALL 2106
+#define MSG_TABLE {{92, 93, 94, 95, 96, 97}, {98, 99, 100, 101, 102, 103}}
#define MSG_FIREBALL 0
#define MSG_DASH 1
diff --git a/games/hollowknight/src/game.c b/games/hollowknight/src/game.c
index d3e26eb0..6afc7c0a 100644
--- a/games/hollowknight/src/game.c
+++ b/games/hollowknight/src/game.c
@@ -28,6 +28,7 @@ void game_new(void) {
dialogue_reset();
prompts_reset();
death_reset();
+ white_blanker_reset();
}
bool game_enter(int room, float x, float y, bool facing_right) {
diff --git a/games/hollowknight/src/game.h b/games/hollowknight/src/game.h
index 8800f9a5..4ea1caed 100644
--- a/games/hollowknight/src/game.h
+++ b/games/hollowknight/src/game.h
@@ -288,6 +288,9 @@ bool msg_shown(void);
void msg_tick(void);
void msg_draw(void);
void blanker_set(float alpha, bool on);
+void white_blanker_fade(bool in); /* HUD Blanker White: FADE IN, FADE OUT (over its Fade Time) */
+void white_blanker_time(float t);
+void white_blanker_reset(void);
bool bench_respawn(const char *name); /* RESPAWN: the Knight asleep on the bench so named */
/* the Spell Control FSM (spell.c): focus, spells */
@@ -328,6 +331,8 @@ float text_width(int style, const uint8_t *s, int n);
void dialogue_reset(void);
void dialogue_box_up(void);
void dialogue_box_down(void);
+void dialogue_dream_box(bool up); /* Box Open Dream: BOX UP DREAM, BOX DOWN DREAM */
+void dialogue_centre(bool on); /* (SetTextMeshProAlignment: the text centred, or to the left) */
void dialogue_start(int text);
bool dialogue_finished(void);
bool dialogue_box_shown(void);
diff --git a/games/hollowknight/src/gfx.c b/games/hollowknight/src/gfx.c
index 31e20242..adad85c6 100644
--- a/games/hollowknight/src/gfx.c
+++ b/games/hollowknight/src/gfx.c
@@ -1256,12 +1256,13 @@ void gfx_frame(void) {
Item cur;
uint32_t group;
int na = 0;
+ /* (an actor behind the blur plane but in front of what is kept, by its sorting layer: kept too) */
while (room_next(&cur.in, &group)) {
while (na < nactors && (actors[na].group < group || (actors[na].group == group && actors[na].in.z > cur.in.z)))
- add_item(&actors[na++].in, blur_z);
+ add_item(&actors[na++].in, nitems ? 1e9f : blur_z);
add_item(&cur.in, blur_z);
}
- while (na < nactors) add_item(&actors[na++].in, blur_z);
+ while (na < nactors) add_item(&actors[na++].in, nitems ? 1e9f : blur_z);
nactors = 0;
/* the HUD's, in front (HUD units from the screen's center: where the camera is) */
int nscene = nitems;
diff --git a/games/hollowknight/src/msg.c b/games/hollowknight/src/msg.c
index 74b68326..ac652704 100644
--- a/games/hollowknight/src/msg.c
+++ b/games/hollowknight/src/msg.c
@@ -37,7 +37,31 @@ void msg_show(int item) {
bool msg_shown(void) { return m.st != MS_OFF; }
+/* the HUD Blanker White (Blanker Control): FADE IN to white, FADE OUT from it, linearly over its Fade Time */
+static struct {
+ float alpha, from, to, t, time;
+ bool on;
+} wb = {0, 0, 0, 0, 1, false};
+
+void white_blanker_time(float t) { wb.time = t; }
+
+void white_blanker_fade(bool in) {
+ wb.from = in ? 0 : 1, wb.to = in ? 1 : 0, wb.t = 0, wb.on = true;
+ wb.alpha = wb.from;
+}
+
+void white_blanker_reset(void) { wb.on = false, wb.alpha = 0, wb.time = 1; }
+
+static void white_blanker_tick(void) {
+ if (!wb.on) return;
+ wb.t += DT;
+ float k = wb.time > 0 ? wb.t / wb.time : 1;
+ wb.alpha = wb.from + (wb.to - wb.from) * (k > 1 ? 1 : k);
+ if (k >= 1 && wb.to == 0) wb.on = false;
+}
+
void msg_tick(void) {
+ white_blanker_tick();
if (m.st == MS_OFF) return;
uint32_t pressed = g_hero.keys & ~m.prev_keys;
m.prev_keys = g_hero.keys;
@@ -112,6 +136,8 @@ static bool blank_on;
void blanker_set(float alpha, bool on) { blank_alpha = alpha, blank_on = on; }
void msg_draw(void) {
+ if (wb.on && wb.alpha > 0)
+ gfx_hud_fill(-15, -9, 15, 9, gfx_dyn_tint(8, 255, 255, 255, (uint8_t)(wb.alpha * 255 + 0.5f)));
if (blank_on && blank_alpha > 0)
gfx_hud_fill(-15, -9, 15, 9, gfx_dyn_tint(27, 0, 0, 0, (uint8_t)(blank_alpha * 255 + 0.5f)));
if (m.st == MS_OFF) return;
diff --git a/games/hollowknight/src/text.c b/games/hollowknight/src/text.c
index d6ae1260..ec434b48 100644
--- a/games/hollowknight/src/text.c
+++ b/games/hollowknight/src/text.c
@@ -81,6 +81,10 @@ static struct {
bool arrow_on, stop_on;
bool finished; /* CONVO_FINISH, since dialogue_start */
uint32_t prev_keys;
+ /* Box Open Dream: the dream box (up, or going down a while), the text centred (SetTextMeshProAlignment) */
+ Anim dream;
+ bool dream_on, centre;
+ float dream_off;
} dl;
static float ease_sine(float t, bool out) { return out ? sinf(t * 1.5707964f) : 1 - cosf(t * 1.5707964f); }
@@ -110,6 +114,22 @@ void dialogue_box_down(void) {
anim_play_from_frame(&dl.fleur_bot, CLIP_DIALOGUE_FLEUR_BOT_DOWN, 0);
}
+void dialogue_dream_box(bool up) {
+ if (up) {
+ /* Box Up: Dream Up, the HUD out */
+ anim_play_from_frame(&dl.dream, CLIP_DIALOGUE_DREAM_UP, 0);
+ hud_slide(true);
+ dl.dream_on = true, dl.dream_off = 0;
+ } else if (dl.dream_on) {
+ /* Box Down: Dream Down, the HUD in; a quarter second, then gone (Stop Audio) */
+ anim_play_from_frame(&dl.dream, CLIP_DIALOGUE_DREAM_DOWN, 0);
+ hud_slide(false);
+ dl.dream_off = 0.25f;
+ }
+}
+
+void dialogue_centre(bool on) { dl.centre = on; }
+
static int lines_per_page(const uint8_t *st) {
float h = TEXT_H * HUD_PX * TEXT_K;
return 1 + (int)((h - font_asc(st) - font_desc(st)) / font_line(st));
@@ -193,6 +213,11 @@ void dialogue_tick(void) {
anim_update(&dl.fleur_bot, DT);
if (!dl.up && !dl.fleur_top.playing && !dl.fleur_bot.playing) dl.fleurs_on = false;
}
+ if (dl.dream_on) {
+ dl.dream.events = 0;
+ anim_update(&dl.dream, DT);
+ if (dl.dream_off > 0 && (dl.dream_off -= DT) <= 0) dl.dream_on = false;
+ }
if (dl.arrow_on) anim_update(&dl.arrow, DT);
if (dl.stop_on) anim_update(&dl.stop, DT);
if (!dl.text) return;
@@ -265,6 +290,13 @@ void dialogue_draw(void) {
}
}
uint8_t white = gfx_dyn_tint(20, 255, 255, 255, 255);
+ if (dl.dream_on && dl.dream.sprite >= 0) {
+ /* (Box Dream: its place and scale in the box's, with the text's) */
+ Inst in;
+ sprite_inst(dl.dream.sprite, BOX_X + (0.1f - BOX_X) * TEXT_K, BOX_Y + (4.46f - BOX_Y) * TEXT_K, 0, 1.0745f * TEXT_K,
+ 1.0745f * TEXT_K, white, &in);
+ gfx_hud(&in, 0);
+ }
if (dl.arrow_on && dl.arrow.sprite >= 0) box_sprite(dl.arrow.sprite, 0.0069f, 1.695f, MARKER_K, MARKER_K, white);
if (dl.stop_on && dl.stop.sprite >= 0) box_sprite(dl.stop.sprite, -0.0231f, 1.695f, MARKER_K, MARKER_K, white);
if (!dl.text) return;
@@ -277,7 +309,9 @@ void dialogue_draw(void) {
for (int l = 0; l < per && i < last; l++) {
int next, e = line_end(st, dl.text, i, w, &next);
int n = (e < dl.visible ? e : dl.visible) - i;
- if (n > 0) gfx_text(STYLE_DIALOGUE, left, y, dl.text + i, n, 0xFFFFFFFFu, 0);
+ /* (centred: the whole line's place, as it is typed) */
+ float x = dl.centre ? left + (w - text_width(STYLE_DIALOGUE, dl.text + i, e - i)) / 2 : left;
+ if (n > 0) gfx_text(STYLE_DIALOGUE, x, y, dl.text + i, n, 0xFFFFFFFFu, 0);
if (dl.visible <= e) break;
i = next, y += font_line(st);
}
@@ -286,7 +320,7 @@ void dialogue_draw(void) {
void dialogue_reset(void) {
memset(&dl, 0, sizeof dl);
dl.scale = 0.75f;
- dl.arrow.sprite = dl.stop.sprite = -1;
+ dl.arrow.sprite = dl.stop.sprite = dl.dream.sprite = -1;
}
/* ---------------------------------------------------------------- prompt markers */
diff --git a/games/hollowknight/src/vm.c b/games/hollowknight/src/vm.c
index 99b4e608..e72727fc 100644
--- a/games/hollowknight/src/vm.c
+++ b/games/hollowknight/src/vm.c
@@ -10,14 +10,14 @@
#endif
#define DT 0.02f
-#define MAX_VM_OBJS 28 /* (tools/vm.py: MAX_OBJS, MAX_FSMS, MAX_VARS) */
-#define MAX_VM_FSMS 20
+#define MAX_VM_OBJS 32 /* (tools/vm.py: MAX_OBJS, MAX_FSMS, MAX_VARS) */
+#define MAX_VM_FSMS 24
#define MAX_VM_VARS 256
-#define MAX_MOVERS 2
+#define MAX_MOVERS 4
#define NONE 0xFFFF
#define OWNER 0xFF0F
enum { O_HERO = 0xFF00, O_HERO_LIGHT, O_DIALOGUE_MANAGER, O_DIALOGUE_TEXT, O_AREA_TITLE, O_CAMERA_PARENT, O_MAIN_CAMERA,
- O_GAME_MANAGER, O_HUD_BLANKER, O_HORNET = 0xFF0C };
+ O_GAME_MANAGER, O_HUD_BLANKER, O_HORNET = 0xFF0C, O_WHITE_BLANKER };
#define O_GATE 0xFD00 /* (+ k: a battle gate, obj.c's) */
enum { OF_ACTIVE = 1, OF_RENDERER = 2, OF_ANIMATOR = 4, OF_TRIGGER = 8, OF_COLLIDER = 16,
OF_GONE = 32, OF_INSIDE = 64, OF_WAS_INSIDE = 128,
@@ -25,6 +25,7 @@ enum { OF_ACTIVE = 1, OF_RENDERER = 2, OF_ANIMATOR = 4, OF_TRIGGER = 8, OF_COLLI
OF_SPELL_HIT = 512, OF_SPELL_IN = 1024, OF_SPELL_WAS = 2048 }; /* (a spell in its trigger) */
#define OF_ANIM_OFF 32 /* (its record's: off once its clip is over, DeactivateAfter2dtkAnimation) */
#define OF_WAVE 64 /* (its record's: WaveEffectControl, grows and fades as it is on: bx its speed, by its scale) */
+#define OF_FADE 128 /* (its record's: SimpleSpriteFade, fades as it is on, then off: bx its time, by the alpha to) */
#define OF_STARTED 4 /* (its own: its animator started, the first time it was on) */
enum { M_ENTER, M_UPDATE, M_FIXED };
@@ -36,6 +37,7 @@ typedef struct {
int16_t order;
uint16_t blend; /* (its material's: BL_*) */
uint8_t col0, ncol; /* (the colliders it has: on as it is) */
+ uint8_t r, g, b, a; /* (its renderer's color) */
uint16_t pad;
} ObjRec;
@@ -43,13 +45,15 @@ typedef struct {
float x, y, sx, sy; /* its place and scale now */
Anim anim;
uint16_t flags;
+ uint8_t alpha; /* (its material's color's alpha: the scripts') */
} Obj;
typedef struct {
int16_t obj; /* (-1: none) */
float vx, vy, g; /* (one the scripts set moving: velocity, gravity scale) */
- /* (iTweenMoveBy: from, by, time so far, its time, ease; 1 going, 2 over) */
- float tx, ty, tdx, tdy, tt, ttime;
- uint8_t ease, tween;
+ /* (iTweenMoveBy: by, how much of it so far (eased), time so far, its time, ease; 1 going, 2 over; its loop: none,
+ * again, back and forth. It moves by steps, with what else moves it: Translate) */
+ float tdx, tdy, te, tt, ttime;
+ uint8_t ease, tween, loop;
} Mover;
typedef struct {
@@ -59,6 +63,7 @@ typedef struct {
bool on, finished;
uint64_t done; /* its state's actions that are over */
float t; /* time in its state */
+ bool started, pending; /* (started once; to start, the next frame: Start) */
} Fsm;
static struct {
@@ -214,7 +219,9 @@ static bool obj_active(int o) {
}
static void obj_pos(int o, float *x, float *y) {
- if (o == O_HERO) {
+ if (o == O_MAIN_CAMERA) {
+ *x = g_cam_x, *y = g_cam_y;
+ } else if (o == O_HERO) {
*x = g_hero.body.x, *y = g_hero.body.y;
} else if (obj_ok(o)) {
*x = vm.objs[o].x, *y = vm.objs[o].y;
@@ -308,12 +315,15 @@ static void obj_set_active(int o, bool on) {
if (on) vm.objs[o].flags |= OF_ACTIVE;
else vm.objs[o].flags &= (uint16_t)~OF_ACTIVE;
if (!was && on) anims_start();
- if (!was && on && (vm.rec[o].flags & OF_WAVE)) vm.objs[o].anim.time = 0; /* (its wave from the start) */
- /* (an FSM starts again as its object comes on: RestartOnEnable) */
+ if (!was && on && (vm.rec[o].flags & (OF_WAVE | OF_FADE))) vm.objs[o].anim.time = 0; /* (its wave, its fade, from the start) */
+ /* (an FSM starts again as its object comes on: RestartOnEnable; the first time, on its Start, the next frame) */
if (!was && on)
for (int i = 0; i < vm.nfsms; i++) {
Fsm *f = &vm.fsms[i];
- if (!f->on && obj_active(f->owner)) fsm_start(f);
+ if (!f->on && obj_active(f->owner)) {
+ if (f->started) fsm_start(f);
+ else f->pending = true;
+ }
}
if (was && !on)
for (int i = 0; i < vm.nfsms; i++)
@@ -354,7 +364,12 @@ static void run_switches(Fsm *f) {
}
static void fsm_event(Fsm *f, int ev) {
- if (!f->on || ev == 255) return;
+ if (ev == 255) return;
+ if (!f->on) {
+ /* (one not started yet starts as it hears one) */
+ if (!f->pending || !obj_active(f->owner)) return;
+ fsm_start(f);
+ }
int s = transition(f, ev);
if (s < 0) return;
f->next = (uint8_t)s;
@@ -376,9 +391,19 @@ static void obj_event(int o, int ev, uint16_t fsm_name) {
if (ev == VMEV_WAKE) enemies_hornet_wake();
return;
}
+ if (o == O_WHITE_BLANKER) {
+ if (ev == VMEV_FADE_IN || ev == VMEV_FADE_OUT) white_blanker_fade(ev == VMEV_FADE_IN);
+ return;
+ }
+ if (o == O_HERO) {
+ if (ev == VMEV_FSM_CANCEL) spell_cancel(); /* (its FSMs' FSM CANCEL: a spell, a focus, stopped) */
+ return;
+ }
if (o == O_DIALOGUE_MANAGER) {
if (ev == VMEV_BOX_UP) dialogue_box_up();
else if (ev == VMEV_BOX_DOWN) dialogue_box_down();
+ else if (ev == VMEV_BOX_UP_DREAM) dialogue_dream_box(true);
+ else if (ev == VMEV_BOX_DOWN_DREAM) dialogue_dream_box(false);
return;
}
for (int i = 0; i < vm.nfsms; i++)
@@ -971,8 +996,15 @@ static bool act(Fsm *f, const uint8_t *a, int mode) {
int o = oval(f, rv(&r));
uint16_t x = rv(&r), y = rv(&r);
uint8_t store = rb(&r);
+ uint16_t at = rv(&r);
if (obj_ok(o)) {
- if (has(x) && has(y)) obj_move(o, fval(f, x), fval(f, y));
+ if (has(at)) {
+ /* (at its spawn point, by an offset) */
+ float px, py;
+ obj_pos(oval(f, at), &px, &py);
+ obj_move(o, px + (has(x) ? fval(f, x) : 0), py + (has(y) ? fval(f, y) : 0));
+ } else if (has(x) && has(y))
+ obj_move(o, fval(f, x), fval(f, y));
vm.objs[o].flags &= (uint16_t)~OF_GONE;
obj_set_active(o, true);
}
@@ -991,13 +1023,12 @@ static bool act(Fsm *f, const uint8_t *a, int mode) {
int o = oval(f, rv(&r));
uint16_t vec = rv(&r);
float t = fval(f, rv(&r));
- int ease = rb(&r), ev = rb(&r);
+ int ease = rb(&r), loop = rb(&r), ev = rb(&r);
Mover *m = mover(o, enter);
if (enter) {
if (!m) return true;
- obj_pos(o, &m->tx, &m->ty);
m->tdx = has(vec) ? fval(f, vec) : 0, m->tdy = has(vec) ? fval(f, (uint16_t)(vec + 1)) : 0;
- m->tt = 0, m->ttime = t, m->ease = (uint8_t)ease, m->tween = 1;
+ m->te = 0, m->tt = 0, m->ttime = t, m->ease = (uint8_t)ease, m->tween = 1, m->loop = (uint8_t)loop;
return false;
}
if (mode == M_UPDATE && (!m || m->tween != 1)) {
@@ -1007,6 +1038,55 @@ static bool act(Fsm *f, const uint8_t *a, int mode) {
}
return false;
}
+ case VMOP_SETFSMFLOAT: {
+ int o = oval(f, rv(&r));
+ uint16_t fname = (uint16_t)val(f, rv(&r));
+ rv(&r);
+ uint32_t x = val(f, rv(&r));
+ uint8_t slot = rb(&r);
+ float v;
+ memcpy(&v, &x, 4);
+ if (o == O_WHITE_BLANKER) white_blanker_time(v); /* (its Fade Time) */
+ else if (obj_ok(o) && slot != 255)
+ for (int i = 0; i < vm.nfsms; i++)
+ if (vm.fsms[i].owner == o && vm.fsms[i].name == fname) set_var(&vm.fsms[i], slot, x);
+ return true;
+ }
+ case VMOP_TEXTALIGN:
+ dialogue_centre(rb(&r) != 0);
+ return true;
+ case VMOP_OBJALPHA: {
+ int o = oval(f, rv(&r));
+ float a = fval(f, rv(&r));
+ bool every = rb(&r);
+ if (obj_ok(o)) vm.objs[o].alpha = (uint8_t)(a <= 0 ? 0 : a >= 1 ? 255 : a * 255 + 0.5f);
+ return !every;
+ }
+ case VMOP_GETOBJALPHA: {
+ int o = oval(f, rv(&r));
+ set_f(f, rb(&r), obj_ok(o) ? vm.objs[o].alpha / 255.0f : 1);
+ return true;
+ }
+ case VMOP_BUILDSTRING: {
+ /* (the string its parts make now: one of those it can) */
+ int n = rb(&r);
+ uint16_t parts[4];
+ for (int k = 0; k < n; k++) {
+ uint16_t sl = rv(&r);
+ if (k < 4) parts[k] = (uint16_t)val(f, sl);
+ }
+ int rows = rb(&r);
+ uint32_t found = 0;
+ for (int j = 0; j < rows; j++) {
+ uint16_t res = rv(&r);
+ bool match = true;
+ for (int k = 0; k < n; k++)
+ if (rv(&r) != parts[k < 4 ? k : 3]) match = false;
+ if (match) found = res;
+ }
+ set_var(f, rb(&r), found);
+ return true;
+ }
default:
return true;
}
@@ -1076,7 +1156,7 @@ static void fsm_start(Fsm *f) {
/* (its variables as they start, its first state) */
const uint8_t *init = NULL;
(void)init;
- f->on = true, f->next = 255;
+ f->on = true, f->next = 255, f->started = true, f->pending = false;
vm.depth = 0;
enter_state(f, f->def[2]);
run_switches(f);
@@ -1131,6 +1211,7 @@ void vm_enter(void) {
/* (DeactivateIfPlayerdataTrue, False; or a scene loaded with the room's by a bool, not now) */
if (r->cond != NONE && pd_flag(r->cond & 0x7FFF) == ((r->cond & 0x8000) != 0)) o->flags = OF_COND_OFF;
o->anim.clip = -1, o->anim.sprite = -1;
+ o->alpha = 255;
}
const uint8_t *p = vm.map + 4 * nmap;
int nvars = 0;
@@ -1158,6 +1239,9 @@ void vm_enter(void) {
void vm_tick(void) {
if (!vm.nfsms) return;
+ /* (FSMs whose objects came on: their Start) */
+ for (int i = 0; i < vm.nfsms; i++)
+ if (vm.fsms[i].pending && !vm.fsms[i].on && obj_active(vm.fsms[i].owner)) fsm_start(&vm.fsms[i]);
/* the Knight in the objects' triggers */
for (int i = 0; i < vm.nobjs; i++) {
Obj *o = &vm.objs[i];
@@ -1172,6 +1256,11 @@ void vm_tick(void) {
if (obj_active(i) && (o->anim.time += DT * vm.rec[i].bx) > 1) obj_set_active(i, false);
continue;
}
+ if (vm.rec[i].flags & OF_FADE) {
+ /* (SimpleSpriteFade: over its time; then off) */
+ if (obj_active(i) && (o->anim.time += DT / vm.rec[i].bx) >= 1) obj_set_active(i, false);
+ continue;
+ }
o->anim.events = 0;
anim_update(&o->anim, DT);
if ((vm.rec[i].flags & OF_ANIM_OFF) && (o->anim.events & ANIM_DONE)) obj_set_active(i, false);
@@ -1199,9 +1288,17 @@ void vm_tick(void) {
if (m->obj < 0 || m->tween != 1) continue;
m->tt += DT;
float q = m->ttime > 0 ? m->tt / m->ttime : 1;
- if (q >= 1) q = 1, m->tween = 2;
- float e = ease(m->ease, q);
- obj_move(m->obj, m->tx + m->tdx * e, m->ty + m->tdy * e);
+ if (m->loop && m->ttime > 0) {
+ /* (looping: never over; back and forth, the way back eased as the way there) */
+ float span = m->loop == 2 ? 2 * m->ttime : m->ttime;
+ while (m->tt >= span) m->tt -= span;
+ q = m->tt / m->ttime;
+ if (q > 1) q = 2 - q;
+ } else if (q >= 1) q = 1, m->tween = 2;
+ float e = ease(m->ease, q), x, y;
+ obj_pos(m->obj, &x, &y);
+ obj_move(m->obj, x + m->tdx * (e - m->te), y + m->tdy * (e - m->te));
+ m->te = e;
}
for (int i = 0; i < vm.nfsms; i++) fsm_step(&vm.fsms[i], M_UPDATE);
vm.prev_keys = g_hero.keys;
@@ -1213,7 +1310,23 @@ void vm_tick(void) {
}
}
+/* (a colour for an object this frame: the same colour, the same slot; slots no one else uses) */
+static const uint8_t tint_slots[] = {28, 29, 30, 31, 9, 12, 13, 14};
+static uint32_t tint_used[sizeof tint_slots];
+static uint8_t obj_tint(int *n, uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
+ uint32_t c = (uint32_t)r | (uint32_t)g << 8 | (uint32_t)b << 16 | (uint32_t)a << 24;
+ int k = 0;
+ while (k < *n && tint_used[k] != c) k++;
+ if (k == *n) {
+ if (*n < (int)sizeof tint_slots) (*n)++;
+ else k = *n - 1; /* (more than there are: the last one's) */
+ tint_used[k] = c;
+ }
+ return gfx_dyn_tint(tint_slots[k], r, g, b, a);
+}
+
void vm_draw(void) {
+ int ntint = 0;
for (int i = 0; i < vm.nobjs; i++) {
const Obj *o = &vm.objs[i];
const ObjRec *r = &vm.rec[i];
@@ -1221,12 +1334,14 @@ void vm_draw(void) {
int sprite = (r->flags & OF_ANIMATOR) ? o->anim.sprite : (r->sprite == NONE ? -1 : r->sprite);
if (sprite < 0) continue;
Inst in;
- if (r->flags & OF_WAVE) {
- /* (its scale 1 + 4 t, its alpha 1 - t) */
- float t = o->anim.time, k = (1 + 4 * t) * r->by;
- sprite_inst(sprite, o->x, o->y, r->z, k, k, gfx_dyn_tint(28, 255, 255, 255, (uint8_t)(255 * (1 - t))), &in);
- } else
- sprite_inst(sprite, o->x, o->y, r->z, o->sx, o->sy, 0, &in);
+ /* (its color: its renderer's, its alpha the scripts' too; a wave's, a fade's as they go) */
+ float a = r->a / 255.0f * o->alpha / 255.0f, t = o->anim.time, sx = o->sx, sy = o->sy;
+ if (r->flags & OF_WAVE) a *= 1 - t, sx = sy = (1 + 4 * t) * r->by;
+ else if (r->flags & OF_FADE) a = a + (r->by - a) * (t > 1 ? 1 : t);
+ uint8_t al = (uint8_t)(a <= 0 ? 0 : a >= 1 ? 255 : a * 255 + 0.5f), tint = 0;
+ if (al != 255 || (r->r & r->g & r->b) != 255) tint = obj_tint(&ntint, r->r, r->g, r->b, al);
+ if (!al) continue;
+ sprite_inst(sprite, o->x, o->y, r->z, sx, sy, tint, &in);
in.flags = (uint8_t)((in.flags & ~F_BLEND) | r->blend);
gfx_actor(&in, SORT_KEY(r->layer, r->order));
}
@@ -1243,7 +1358,8 @@ void vm_debug(void) {
printf("\n");
if (getenv("VMOBJ"))
for (int i = 0; i < vm.nobjs; i++)
- printf(" obj %d name %d flags %d active %d cols %d+%d at %.2f,%.2f clip %d sprite %d\n", i, vm.rec[i].name, vm.objs[i].flags,
- obj_active(i), vm.rec[i].col0, vm.rec[i].ncol, vm.objs[i].x, vm.objs[i].y, vm.objs[i].anim.clip, vm.objs[i].anim.sprite);
+ printf(" obj %d name %d flags %d active %d cols %d+%d at %.2f,%.2f clip %d sprite %d/%d alpha %d scale %.2f,%.2f\n", i,
+ vm.rec[i].name, vm.objs[i].flags, obj_active(i), vm.rec[i].col0, vm.rec[i].ncol, vm.objs[i].x, vm.objs[i].y,
+ vm.objs[i].anim.clip, vm.objs[i].anim.sprite, vm.rec[i].sprite, vm.objs[i].alpha, vm.objs[i].sx, vm.objs[i].sy);
}
#endif
diff --git a/games/hollowknight/tools/actors.py b/games/hollowknight/tools/actors.py
index fe94b045..a467245f 100644
--- a/games/hollowknight/tools/actors.py
+++ b/games/hollowknight/tools/actors.py
@@ -18,6 +18,7 @@ KNIGHT = ("resources.assets", 20600, [
"Prostrate", "Prostrate Rise", "Wake Up Ground", "Collect Normal 1", "Collect Normal 2", "Collect Normal 3",
"Collect Magical 1", "Collect Magical 2", "Collect Magical 3", "Collect Magical Fall", "Collect Magical Land",
"Collect Heart Piece", "Collect Heart Piece End", "Collect StandToIdle", "GetUpToIdle", "Death Head Cracked",
+ "Dreamer Land",
])
# enemy kinds: name, the FSM (or component) that runs them, their library, the C code for that FSM, and the clips each
@@ -135,7 +136,7 @@ ACTORS = {"knight": KNIGHT,
"geo": ("resources.assets", 23266, ["Small Idle", "Small Air", "Med Idle", "Med Air", "Large Idle", "Large Air"]),
# the dialogue box (on the HUD, a third bigger with its text) and the prompt markers
"dialogue": ("resources.assets", 20724, ["Arrow Up", "Arrow Down", "Stop Up", "Stop Down", "Fleur Top Up",
- "Fleur Top Down", "Fleur Bot Up", "Fleur Bot Down"]),
+ "Fleur Top Down", "Fleur Bot Up", "Fleur Bot Down", "Dream Up", "Dream Down"]),
"prompt": ("resources.assets", 23333, ["Up", "Down", "Blank"]),
# the shade (Hollow Shade, and the Hero Death's rising one)
"shade": ("resources.assets", 22801, ["Idle", "Startle", "Fly", "TurnToFly", "TurnToIdle", "Slash Antic", "Slash",
@@ -206,7 +207,7 @@ def named_sprites(sprites):
out[name] = sprites.id(d, v["m_Sprite"], k, HUD_K / K0 if res == "hud" else res)
return out
# clips drawn bigger than their sprites (the object's scale): their frames are kept that much finer
-DRAWN_SCALE = {"Arrow Up": 1.3, "Arrow Down": 1.3, "Stop Up": 1.3, "Stop Down": 1.3, "SlashEffect": 1.645, "SlashEffectAlt": 1.422, "UpSlashEffect": 1.4, "DownSlashEffect": 1.28,
+DRAWN_SCALE = {"Arrow Up": 1.3, "Arrow Down": 1.3, "Stop Up": 1.3, "Stop Down": 1.3, "Dream Up": 1.0745, "Dream Down": 1.0745, "SlashEffect": 1.645, "SlashEffectAlt": 1.422, "UpSlashEffect": 1.4, "DownSlashEffect": 1.28,
"Blast": 1.4, "Ball": 1.45, "Ball End": 1.45, "Fireball Wall Impact": 2.0,
"Small Idle": 1.5, "Small Air": 1.5, "Med Idle": 1.5, "Med Air": 1.5, "Large Idle": 1.5, "Large Air": 1.5}
K0 = scene.FOCAL / (0.004 - scene.CAMZ) # screen pixels a unit, where actors are (z near 0)
@@ -349,6 +350,9 @@ def unity_sprites(keys):
img = unity.sprite_image(s)
wu, hu = s.w / s.ppu * scale, s.h / s.ppu * scale
w, h = max(1, round(wu * K0 * res)), max(1, round(hu * K0 * res))
+ if w > 2 * img.width or h > 2 * img.height:
+ # (drawn far bigger than it is, a glow: kept at its own size, stretched as it is drawn)
+ w, h = img.width, img.height
arr = np.asarray(img.resize((w, h), Image.BOX)).copy()
out.append({"key": (level, fid, pid), "job": art.ImageJob(arr, "piece/%s" % s.name),
"lx": -s.px * wu, "ty": (1 - s.py) * hu, "tu": wu / w, "tv": hu / h})
diff --git a/games/hollowknight/tools/ents.py b/games/hollowknight/tools/ents.py
index 7b1c5664..59e9cb83 100644
--- a/games/hollowknight/tools/ents.py
+++ b/games/hollowknight/tools/ents.py
@@ -718,7 +718,8 @@ def prop(d, o, by_id):
def _sorting(o):
"""Its renderer's sorting layer (index) and order."""
import scene
- mr = next((c.get("v") for c in o["c"] if c["type"] == "MeshRenderer" and isinstance(c.get("v"), dict)), {}) or {}
+ mr = next((c.get("v") for c in o["c"] if c["type"] in ("MeshRenderer", "SpriteRenderer") and isinstance(c.get("v"), dict)),
+ {}) or {}
return scene.layer_index(mr.get("m_SortingLayerID", 0)), mr.get("m_SortingOrder", 0)
diff --git a/games/hollowknight/tools/pack.py b/games/hollowknight/tools/pack.py
index cc03949f..af82ee69 100644
--- a/games/hollowknight/tools/pack.py
+++ b/games/hollowknight/tools/pack.py
@@ -394,6 +394,7 @@ def tile_map(t):
if all(c == 1 for row in codes for c in row):
return b"", TEX_FULL
wide = t.ntiles > 255
+ assert t.ntiles < 65536, ("too many tiles", t.w, t.h, getattr(t, "name", None), getattr(t, "key", None))
m = bytearray()
rank = 0
for row in codes:
@@ -510,7 +511,11 @@ def main():
jobs += [sp["job"] for sp in sprites]
with mp.get_context("spawn").Pool(min(4, os.cpu_count() or 1)) as pool:
texs = pool.map(art.encode_job, jobs, chunksize=4)
- # (the actors' textures come after the scenery's)
+ # (the actors' textures come after the scenery's; a smooth one kept smaller: units a texel of what is kept)
+ for sp, t in zip(sprites, texs[len(texs) - len(sprites):]):
+ h, w = sp["job"].arr.shape[:2]
+ if (t.w, t.h) != (w, h):
+ sp["tu"], sp["tv"] = sp["tu"] * w / t.w, sp["tv"] * h / t.h
variants = variants + [sp["job"] for sp in sprites]
print("textures %.0fs" % (time.time() - t0), flush=True)
blocks = []
diff --git a/games/hollowknight/tools/vm.py b/games/hollowknight/tools/vm.py
index 3cb49c35..7b98dea7 100644
--- a/games/hollowknight/tools/vm.py
+++ b/games/hollowknight/tools/vm.py
@@ -11,21 +11,24 @@ import unity, text, state
# rooms -> the objects whose scripts run here (and all under them)
ROOMS = {
"Town": ["_NPCs/Elderbug"],
- "Fungus1_04": ["Hornet Infected Knight Encounter", "Hornet Saver", "Cloak Corpse"],
+ "Fungus1_04": ["Hornet Infected Knight Encounter", "Hornet Saver", "Cloak Corpse", "Dream Scene Activate",
+ "Dreamer Scene 1"],
"Crossroads_ShamanTemple": ["_Props/Shaman Meeting", "_Props/Shaman Trapped", "_Props/Shaman Killed Blocker",
"_Props/Knight Get Fireball", "Battle Scene/Reminder Cast"],
}
# FSMs left out (what this port does not have: the dream nail, sounds...)
-SKIP_FSMS = {"npc_dream_dialogue", "Dream Dialogue", "Rotate", "fade and destroy", "Shop Open Voice"}
-# objects left out (effects drawn by the C code, or nothing at all; the dream nail's)
-SKIP_CLASSES = {"SpellGetOrb", "ParticleSystem", "SimpleSpriteFade"}
-SKIP_NAMES = {"Dream Dialogue", "Dream Dialogue Flower", "Flower", "Flower Give", "white_light", "white_light 1"}
-MAX_OBJS, MAX_FSMS, MAX_VARS = 28, 20, 256 # (src/vm.c)
+SKIP_FSMS = {"npc_dream_dialogue", "Dream Dialogue", "Rotate", "Shop Open Voice"}
+# objects left out (effects drawn by the C code, or nothing at all; the dream nail's; Dreamer Scene 1's Knight Lift,
+# which nothing turns on)
+SKIP_CLASSES = {"SpellGetOrb", "ParticleSystem"}
+SKIP_NAMES = {"Dream Dialogue", "Dream Dialogue Flower", "Flower", "Flower Give", "white_light", "white_light 1",
+ "Knight Lift"}
+MAX_OBJS, MAX_FSMS, MAX_VARS = 32, 24, 256 # (src/vm.c)
# the game's own objects
SPECIAL = {"Hero": 0xFF00, "HeroLight": 0xFF01, "DialogueManager": 0xFF02, "DialogueText": 0xFF03, "AreaTitle": 0xFF04,
"CameraParent": 0xFF05, "MainCamera": 0xFF06, "GameManager": 0xFF07, "HUD Blanker": 0xFF08,
- "DialogueTextYN": 0xFF09, "UIManager": 0xFF0A, "Enemy Dream Msg": 0xFF0B}
+ "DialogueTextYN": 0xFF09, "UIManager": 0xFF0A, "Enemy Dream Msg": 0xFF0B, "HUD Blanker White": 0xFF0D}
O_NONE = 0xFFFF
# PlayerData ints (src/vm.c: pd_int)
PD_INTS = ["MPCharge", "health", "maxHealth", "geo", "fireballLevel", "quakeLevel", "screamLevel", "shaman", "elderbug",
@@ -63,7 +66,8 @@ STR = Strings()
EVENTS = Strings()
for e in ("FINISHED", "CONVO_FINISH", "CONVO START", "CONVO END", "BIG TITLE START", "BIG TITLE END", "HERO DAMAGED",
"NPC TITLE DOWN", "NPC CONVO START", "BOX UP", "BOX DOWN", "LEAVING SCENE", "TAKE DAMAGE", "GET ITEM MSG END",
- "HORNET LEAVE", "BG CLOSE", "BG QUICK CLOSE", "BG OPEN", "BG QUICK OPEN", "BG DESTROY", "WAKE"):
+ "HORNET LEAVE", "BG CLOSE", "BG QUICK CLOSE", "BG OPEN", "BG QUICK OPEN", "BG DESTROY", "WAKE", "BOX UP DREAM",
+ "BOX DOWN DREAM", "FADE IN", "FADE OUT", "FSM CANCEL"):
EVENTS.id(e)
FIXED_EVENTS = len(EVENTS.list) # (src/data.h: VMEV_*)
@@ -169,7 +173,7 @@ op("EaseFloat", ("fromValue", "f"), ("toValue", "f"), ("floatVariable", "F"), ("
op("CameraZoom", ("z", "f"), ("time", "f"), ("delay", "f"))
op("Collision2dEvent", ("sendEvent", "e"))
op("HudBlanker", ("alpha", "f"), ("time", "f"), ("on", "n"))
-op("CreateObject", ("gameObject", "o"), ("x", "f"), ("y", "f"), ("storeObject", "O"))
+op("CreateObject", ("gameObject", "o"), ("x", "f"), ("y", "f"), ("storeObject", "O"), ("spawnPoint", "o"))
op("GetItemMsg", ("item", "n"))
op("Blanker", ("alpha", "f"), ("everyFrame", "n"))
op("BlankerOn", ("on", "b"))
@@ -177,7 +181,13 @@ op("FindGameObject", ("objectName", "s"), ("store", "O"))
op("SetParent", ("gameObject", "o"))
op("IntOp", ("intVariable", "I"), ("value", "i"))
op("ActivateAllChildren", ("gameObject", "o"), ("activate", "b"))
-op("iTweenMoveBy", ("gameObject", "o"), ("vector", "v3"), ("time", "f"), ("easeType", "n"), ("finishEvent", "e"))
+op("iTweenMoveBy", ("gameObject", "o"), ("vector", "v3"), ("time", "f"), ("easeType", "n"), ("loopType", "n"),
+ ("finishEvent", "e"))
+op("SetFsmFloat", ("gameObject", "o"), ("fsmName", "s"), ("variableName", "s"), ("setValue", "f"), ("slot", "n"))
+op("TextAlign", ("centre", "n"))
+op("ObjAlpha", ("gameObject", "o"), ("alpha", "f"), ("everyFrame", "n"))
+op("BuildString") # (custom: its parts, the strings they can make, where it keeps it)
+op("GetObjAlpha", ("gameObject", "o"), ("store", "F"))
# HeroController's methods the scripts call (HeroCall's method)
HERO_METHODS = ["RelinquishControl", "RegainControl", "StopAnimationControl", "StartAnimationControl", "FaceLeft",
@@ -187,7 +197,9 @@ HERO_METHODS = ["RelinquishControl", "RegainControl", "StopAnimationControl", "S
# the prompt marker the pool gives (Arrow Prompt New): a script's own, shown and hidden as ShowPromptMarker's
PROMPT_PREFAB = ("resources.assets", 6142)
# prefabs CreateObject makes that the scripts go on with (made beforehand, off): (file, path id)
-PREFAB_SPAWNS = {("sharedassets76.assets", 69)}
+PREFAB_SPAWNS = {("sharedassets76.assets", 69), ("sharedassets133.assets", 23), ("sharedassets6.assets", 509)}
+# prefabs the pool gives (SpawnObjectFromGlobalPool) that the scripts show (made beforehand, off)
+POOL_SPAWNS = {("resources.assets", 5267)}
# the game's objects the scripts find by name that are not theirs (enemies): what they are to them
GAME_OBJECTS = {"Hornet Boss 1": 0xFF0C}
# what a trigger's Trigger2dEvent hears, by collideTag: the Knight (any), a spell
@@ -264,14 +276,14 @@ class Room:
self.objs.append(o)
return self.obj_index[o["id"]]
- def add_prefab(self, f, pid):
- """A prefab's objects, made beforehand (off): its root's VM object."""
- key = ("pf", f, pid)
+ def add_prefab(self, f, pid, site=None):
+ """A prefab's objects, made beforehand (off): its root's VM object (one for each site that makes it)."""
+ key = ("pf", f, pid, site)
if key in self.obj_index:
return self.obj_index[key]
d2 = unity.prefab(f, pid)
ids = {q["id"] for q in d2["objects"]}
- k = lambda i: ("pf", f, pid, i)
+ k = lambda i: ("pf", f, pid, site, i)
root = None
for q in d2["objects"]:
c = dict(q)
@@ -351,6 +363,44 @@ class Compiler:
if a["name"] == "SetFsmString" and P.get("gameObject") == self.prompt[1] and P.get("variableName") == "Prompt Name":
self.prompt[2] = P.get("setValue")
+ def alpha(self, c):
+ """a color operand's alpha -> its value slot, None if not one"""
+ if isinstance(c, str) and c[1:] in self.slots and self.slots[c[1:]][1] == "color":
+ return self.slots[c[1:]][0] + 3
+ if isinstance(c, (list, tuple)) and len(c) == 4:
+ return self.value(float(c[3]), "f")
+ return None
+
+ def string_values(self, v):
+ """the strings a string operand can be (constants: itself; a variable: as it starts and as it is set)"""
+ if not (isinstance(v, str) and v.startswith("$")):
+ return [v or ""]
+ n = v[1:]
+ out = [self.f["vars"].get(n, ["string", ""])[1] or ""]
+ for o in list(self.rm.by_id.values()):
+ for c in o["c"]:
+ for st in (c.get("fsm") or {}).get("states", []):
+ for a in st["actions"]:
+ P = dict(a["params"])
+ if a["name"] == "SetFsmString" and P.get("fsmName") == self.f["name"] and P.get("variableName") == n:
+ out.append(P.get("setValue") or "")
+ return sorted(set(out))
+
+ def build_string(self, P):
+ """BuildString: each way its parts can be, the string they make (with its separator)"""
+ import itertools
+ parts = P.get("stringParts") or []
+ sep = P.get("separator") or ""
+ store = self.store(P.get("storeResult"))
+ rows = list(itertools.product(*[self.string_values(q) for q in parts]))
+ assert len(rows) < 64, rows
+ body = bytes([len(parts)]) + b"".join(struct.pack("<H", self.value(q, "s")) for q in parts) + bytes([len(rows)])
+ for r in rows:
+ body += struct.pack("<H", STR.id(sep.join(r) + (sep if P.get("addToEnd") else "")))
+ body += b"".join(struct.pack("<H", STR.id(x)) for x in r)
+ body += bytes([store])
+ return bytes([OPS["BuildString"][0], len(body)]) + body
+
def fsm_slot(self, fsm_name, var):
"""another FSM's variable, by its FSM's name and its own (one of the room's): its slot, 255 not known"""
for o in list(self.rm.by_id.values()):
@@ -513,7 +563,7 @@ class Compiler:
"ForceHeroFootstepSound", "SendEventToRegister", "AddTrackTrigger", "PlayVibration",
"VibrationPlayerStop", "TransitionToAudioSnapshot", "SetAudioPitch", "SetAudioVolume",
"AudioPlayInState", "FadeAudio", "PlayRandomSound", "SetRotation", "RandomFloat",
- "SpawnObjectFromGlobalPool", "GetLastEvent", "SetBoxCollider2DSize", "Tk2dSpriteSetColor"):
+ "GetLastEvent", "SetBoxCollider2DSize", "Tk2dSpriteSetColor", "SetTextMeshProColor"):
return None
if n in ("PlayerDataBoolTest",):
return self.emit(n, P)
@@ -531,19 +581,51 @@ class Compiler:
if n == "SetFsmString":
return self.emit(n, dict(P, slot=self.fsm_slot(P.get("fsmName"), P.get("variableName"))))
if n == "EaseColor":
+ # (colors: their alphas only, what the scripts change)
cv = P.get("colorVariable")
- if not (isinstance(cv, str) and cv[1:] in self.slots):
+ if not (isinstance(cv, str) and cv[1:] in self.slots) or (P.get("easeType") or 0) != 21:
self.problem("EaseColor to %r" % cv)
return None
slot = self.slots[cv[1:]][0] + 3
- fv, tv = P.get("fromValue"), P.get("toValue")
- if not isinstance(fv, (list, tuple)) or not isinstance(tv, (list, tuple)):
- self.problem("EaseColor from %r" % fv)
+ fv, tv = self.alpha(P.get("fromValue")), self.alpha(P.get("toValue"))
+ if fv is None or tv is None:
+ self.problem("EaseColor from %r" % P.get("fromValue"))
return None
code, schema = OPS["EaseFloat"]
- body = struct.pack("<HH", self.value(float(fv[3]), "f"), self.value(float(tv[3]), "f")) + bytes([slot]) + \
+ body = struct.pack("<HH", fv, tv) + bytes([slot]) + \
struct.pack("<H", self.value(P.get("time"), "f")) + bytes([self.event(P.get("finishEvent"))])
return bytes([code, len(body)]) + body
+ if n in ("SetColorValue", "GetColorRGBA"):
+ # (a color's alpha into another's, or a float)
+ src = self.alpha(P.get("color"))
+ dst = P.get("colorVariable") if n == "SetColorValue" else P.get("storeAlpha")
+ if src is None or not (isinstance(dst, str) and dst[1:] in self.slots):
+ return None
+ code, _ = OPS["SetFloatValue"]
+ body = bytes([self.slots[dst[1:]][0] + (3 if n == "SetColorValue" else 0)]) + struct.pack("<H", src) + \
+ bytes([int(P.get("everyFrame") or 0)])
+ return bytes([code, len(body)]) + body
+ if n == "GetMaterialColor" and isinstance(P.get("color"), str) and P.get("color")[1:] in self.slots:
+ # (its alpha into the color's)
+ body = struct.pack("<H", self.value(P.get("gameObject") or "Owner", "o")) + \
+ bytes([self.slots[P.get("color")[1:]][0] + 3])
+ return bytes([OPS["GetObjAlpha"][0], len(body)]) + body
+ if n == "SetMaterialColor" and P.get("gameObject") not in ("$HUD Blanker",):
+ a = self.alpha(P.get("color"))
+ if a is None:
+ self.problem("SetMaterialColor %r" % P.get("color"))
+ return None
+ code, _ = OPS["ObjAlpha"]
+ body = struct.pack("<HH", self.value(P.get("gameObject") or "Owner", "o"), a) + bytes([int(P.get("everyFrame") or 0)])
+ return bytes([code, len(body)]) + body
+ if n == "SetTextMeshProAlignment":
+ if P.get("gameObject") != "$DialogueText":
+ return None
+ return self.emit("TextAlign", {"centre": 1 if P.get("topCentre") else 0})
+ if n == "SetFsmFloat":
+ return self.emit(n, dict(P, slot=self.fsm_slot(P.get("fsmName"), P.get("variableName"))))
+ if n == "BuildString":
+ return self.build_string(P)
if n == "SetMaterialColor" and P.get("gameObject") == "$HUD Blanker":
c = P.get("color")
if isinstance(c, str) and c[1:] in self.slots:
@@ -572,10 +654,21 @@ class Compiler:
f, pid = ents._ref_file(self.o.get("_doc") or self.rm.d, [r[1], r[2]])
if (f, pid) in PREFAB_SPAWNS:
pos = P.get("position") or [None, None, None]
- obj = self.rm.add_prefab(f, pid)
+ obj = self.rm.add_prefab(f, pid, (self.o["id"], self.where, P.get("storeObject")))
return self.emit("CreateObject", {"gameObject": ("objindex", obj), "x": pos[0], "y": pos[1],
"storeObject": P.get("storeObject")})
return None # (effects)
+ if n == "SpawnObjectFromGlobalPool":
+ r = P.get("gameObject")
+ if isinstance(r, (list, tuple)) and r and r[0] == "ref":
+ import ents
+ f, pid = ents._ref_file(self.o.get("_doc") or self.rm.d, [r[1], r[2]])
+ if (f, pid) in POOL_SPAWNS:
+ pos = P.get("position") or [None, None, None]
+ obj = self.rm.add_prefab(f, pid, (self.o["id"], self.where, P.get("storeObject")))
+ return self.emit("CreateObject", {"gameObject": ("objindex", obj), "x": pos[0], "y": pos[1],
+ "storeObject": P.get("storeObject"), "spawnPoint": P.get("spawnPoint")})
+ return None
if n == "GetButtonDown":
m = {"Jump": "ListenForJump", "Attack": "ListenForAttack", "Cast": "ListenForCast"}.get(P.get("buttonName"))
return self.emit(m, {"wasPressed": P.get("sendEvent")}) if m else None
@@ -637,7 +730,7 @@ class Compiler:
if P.get("gameObject") == "$Main Camera Obj" or P.get("gameObject") == "$MainCamera":
vec = P.get("vector") or [0, 0, 0]
return self.emit("CameraZoom", {"z": vec[2], "time": P.get("time"), "delay": P.get("delay") or 0})
- if P.get("speed") is not None or P.get("loopType") or P.get("space") or P.get("delay") or \
+ if P.get("speed") is not None or (P.get("loopType") or 0) > 2 or P.get("space") or P.get("delay") or \
(P.get("easeType") or 0) > 21:
self.problem("iTweenMoveBy %r" % P)
return None
@@ -820,10 +913,10 @@ def _unity_animator(o):
return next((c.get("v") for c in o["c"] if c["type"] == "Animator" and c.get("v") and c["v"].get("m_Controller")), None)
-OBJ = "<fffffffffHHHHHBBHHhHBBH" # x y z, sx sy, its trigger (center from its place, half size), parent, name, sprite,
+OBJ = "<fffffffffHHHHHBBHHhHBBBBBBH" # x y z, sx sy, its trigger (center from its place, half size), parent, name, sprite,
# first clip, clip map, its count, flags, condition, sorting layer, order, blend, its
-# colliders (first, count)
-OF_ACTIVE, OF_RENDERER, OF_ANIMATOR, OF_TRIGGER, OF_COLLIDER, OF_ANIM_OFF, OF_WAVE = 1, 2, 4, 8, 16, 32, 64
+# colliders (first, count), its color (r g b a), (pad)
+OF_ACTIVE, OF_RENDERER, OF_ANIMATOR, OF_TRIGGER, OF_COLLIDER, OF_ANIM_OFF, OF_WAVE, OF_FADE = 1, 2, 4, 8, 16, 32, 64, 128
def room_blob(name, clip_index, sprites, owners=()):
@@ -861,6 +954,12 @@ def room_blob(name, clip_index, sprites, owners=()):
# (WaveEffectControl: it grows and fades as it is on; its speed, its scale)
fl |= OF_WAVE
bx, by = wv.get("accelStart", 5), wv.get("scaleMultiplier", 1) * abs(sx) / abs(o["lscale"][0] or 1)
+ sf = next((c.get("v") for c in o["c"] if c.get("class") == "SimpleSpriteFade" and c.get("v")), None)
+ if sf:
+ # (SimpleSpriteFade: from its color to the fade's as it is on, in its time; then off, or back in its pool)
+ assert sf.get("fadeInOnStart") and (sf.get("deactivateOnFadeIn") or sf.get("recycleOnFadeIn")), o["path"]
+ fl |= OF_FADE
+ bx, by = sf.get("fadeDuration", 1), (sf.get("fadeInColor") or {}).get("a", 0)
bhx, bhy = ((box[2] - box[0]) / 2, (box[3] - box[1]) / 2) if box else (0, 0)
sprite, first, start, count = 0xFFFF, 0xFFFF, nmap, 0
an = _animator(o)
@@ -890,7 +989,8 @@ def room_blob(name, clip_index, sprites, owners=()):
else:
sr = next((c.get("v") for c in o["c"] if c["type"] == "SpriteRenderer" and c.get("v")), None)
if sr and sr.get("m_Sprite"):
- sprite = sprites.id(o.get("_doc") or rm.d, sr["m_Sprite"], max(abs(sx), abs(sy)))
+ # (its own size, drawn at its scale: its texture as fine as it is drawn)
+ sprite = sprites.id(o.get("_doc") or rm.d, sr["m_Sprite"], 1.0, max(abs(sx), abs(sy)))
cond = 0xFFFF
for bn, off_if in state.conditions(o):
if bn in pdf:
@@ -913,9 +1013,11 @@ def room_blob(name, clip_index, sprites, owners=()):
doc = o.get("_doc") or rm.d
blend = {"alpha": 0, "add": 1, "screen": 2, "linearlight": 3, "overlay": 4, "multiply": 5}[
scene.blend_of(unity.material(unity.ref_path(doc, m0[0]), m0[1])[1])]
+ col = (mr or {}).get("m_Color") or {"r": 1, "g": 1, "b": 1, "a": 1}
+ rgba = [max(0, min(255, int(round(col[k] * 255)))) for k in "rgba"]
objs += struct.pack(OBJ, o["pos"][0], o["pos"][1], o["pos"][2], sx, sy, bx, by, bhx, bhy, parent,
STR.id(o["name"]), sprite, first, start, min(count, 255), fl, cond, layer, order, blend,
- cols[0] if cols else 0, len(cols), 0)
+ cols[0] if cols else 0, len(cols), *rgba, 0)
fsms = bytearray()
for di, owner, init, fname in rm.fsms:
fsms += struct.pack("<HHHH", di, owner, fname, len(init)) + b"".join(struct.pack("<I", v) for v in init)