All objects are now correctly filtered based on area.

This commit is contained in:
Daan Vanden Bosch 2019-09-23 14:47:14 +02:00
parent 9859e15806
commit 1fe3015ce5
4 changed files with 850 additions and 340 deletions

View File

@ -27,7 +27,7 @@ export function get_area_variant(
const variant = area.area_variants[variant_id]; const variant = area.area_variants[variant_id];
if (!variant) throw new Error(`No area variant with id ${variant_id}.`); if (!variant) throw new Error(`No area variant with id ${variant_id}.`);
return Object.freeze(variant); return variant;
} }
const AREAS: { [episode: number]: Area[] } = []; const AREAS: { [episode: number]: Area[] } = [];
@ -36,7 +36,7 @@ function create_area(id: number, name: string, order: number, variants: number):
const area: Area = { id, name, order, area_variants: [] }; const area: Area = { id, name, order, area_variants: [] };
for (let id = 0; id < variants; id++) { for (let id = 0; id < variants; id++) {
area.area_variants.push({ id, area }); area.area_variants.push(Object.freeze({ id, area }));
} }
return Object.freeze(area); return Object.freeze(area);
@ -99,3 +99,5 @@ AREAS[Episode.IV] = [
create_area(8, "Subterranean Desert 3", order++, 3), create_area(8, "Subterranean Desert 3", order++, 3),
create_area(9, "Meteor Impact Site", order++, 1), create_area(9, "Meteor Impact Site", order++, 1),
]; ];
Object.freeze(AREAS);

View File

@ -2163,3 +2163,7 @@ define_npc_type_data(
0, 0,
false, false,
); );
Object.freeze(NPC_TYPES);
Object.freeze(ENEMY_NPC_TYPES);
Object.freeze(NPC_TYPE_DATA);

File diff suppressed because it is too large Load Diff

View File

@ -49,12 +49,24 @@ for (const type of [
ObjectType.Unknown, ObjectType.Unknown,
ObjectType.PlayerSet, ObjectType.PlayerSet,
ObjectType.Particle,
ObjectType.LightCollision,
ObjectType.EnvSound,
ObjectType.FogCollision, ObjectType.FogCollision,
ObjectType.EventCollision, ObjectType.EventCollision,
ObjectType.CharaCollision,
ObjectType.ObjRoomID, ObjectType.ObjRoomID,
ObjectType.LensFlare,
ObjectType.ScriptCollision, ObjectType.ScriptCollision,
ObjectType.MapCollision,
ObjectType.ScriptCollisionA,
ObjectType.ItemLight, ObjectType.ItemLight,
ObjectType.RadarCollision,
ObjectType.FogCollisionSW, ObjectType.FogCollisionSW,
ObjectType.ImageBoard,
ObjectType.UnknownItem29,
ObjectType.UnknownItem30,
ObjectType.UnknownItem31,
ObjectType.MenuActivation, ObjectType.MenuActivation,
ObjectType.BoxDetectObject, ObjectType.BoxDetectObject,
ObjectType.SymbolChatObject, ObjectType.SymbolChatObject,
@ -62,10 +74,40 @@ for (const type of [
ObjectType.TargetableObject, ObjectType.TargetableObject,
ObjectType.EffectObject, ObjectType.EffectObject,
ObjectType.CountDownObject, ObjectType.CountDownObject,
ObjectType.UnknownItem38,
ObjectType.UnknownItem39,
ObjectType.UnknownItem40,
ObjectType.UnknownItem41,
ObjectType.TelepipeLocation, ObjectType.TelepipeLocation,
ObjectType.BGMCollision,
ObjectType.Pioneer2InvisibleTouchplate, ObjectType.Pioneer2InvisibleTouchplate,
ObjectType.TempleMapDetect, ObjectType.TempleMapDetect,
ObjectType.Firework,
ObjectType.MainRagolTeleporterBattleInNextArea,
ObjectType.Rainbow,
ObjectType.FloatingBlueLight,
ObjectType.PopupTrapNoTech,
ObjectType.Poison,
ObjectType.EnemyTypeBoxYellow,
ObjectType.EnemyTypeBoxBlue,
ObjectType.EmptyTypeBoxBlue,
ObjectType.FloatingRocks,
ObjectType.FloatingSoul,
ObjectType.Butterfly,
ObjectType.UnknownItem400,
ObjectType.CCAAreaTeleporter,
ObjectType.UnknownItem523,
ObjectType.WhiteBird,
ObjectType.OrangeBird,
ObjectType.UnknownItem529,
ObjectType.UnknownItem530,
ObjectType.Seagull,
ObjectType.UnknownItem576,
ObjectType.WarpInBarbaRayRoom,
ObjectType.UnknownItem672,
ObjectType.InstaWarp,
ObjectType.LabInvisibleObject, ObjectType.LabInvisibleObject,
ObjectType.UnknownItem700,
]) { ]) {
geom_cache.set(type, DEFAULT_ENTITY_PROMISE); geom_cache.set(type, DEFAULT_ENTITY_PROMISE);
tex_cache.set(type, DEFAULT_ENTITY_TEX_PROMISE); tex_cache.set(type, DEFAULT_ENTITY_TEX_PROMISE);