y
This commit is contained in:
parent
61718e2981
commit
f657b6a4a4
94 changed files with 3970 additions and 1241 deletions
|
|
@ -370,8 +370,8 @@ if (!placementResult || placementResult.removed || placementItem.dead) throw new
|
|||
click_section = placement.find("const itemType = toolItemType(tool)")
|
||||
click_direct = placement.find("const directTarget =", click_section)
|
||||
duplicator_set = placement.find("this.directSetDuplicatorAt?.", click_section)
|
||||
if min(click_section, click_direct, duplicator_set) < 0 or click_direct > duplicator_set:
|
||||
fail("Tarinai direct feeding must take precedence over duplicator loading at the same point")
|
||||
if min(click_section, click_direct, duplicator_set) < 0 or duplicator_set > click_direct:
|
||||
fail("Duplicator loading must take precedence over Tarinai direct feeding at the same point")
|
||||
required_ui = ["directFeedTargetAt", 'source: "pinch"', "setGiveHover", "hoverGiveTarget"]
|
||||
if any(token not in ui for token in required_ui):
|
||||
fail("pinch direct-feeding input bridge is incomplete")
|
||||
|
|
@ -1389,6 +1389,7 @@ context.window = context;
|
|||
context.isServingFoodType = (type) => type === 'food';
|
||||
context.passiveFoodDecayInterval = () => 0.5;
|
||||
context.passiveFoodDecayRate = () => 0.1;
|
||||
context.updateServingFoodVisualSize = (item) => {{ item.r = (item.r || 12) - 0.1; return true; }};
|
||||
context.TarinaiItemRegistry = {{ food: {{ }} }};
|
||||
context.isPinType = (type) => type === 'pushpin';
|
||||
context.normalizeGrassStage = (item) => {{ item.normalized = true; }};
|
||||
|
|
@ -1401,11 +1402,13 @@ const events = [];
|
|||
const world = {{
|
||||
itemDropImpact(item) {{ events.push(['drop', item.type]); }},
|
||||
markTerrainDirty(reason) {{ events.push(['terrain', reason]); }},
|
||||
markItemBucketsDirty(reason) {{ events.push(['buckets', reason]); }},
|
||||
markSpatialDirty(reason) {{ events.push(['spatial', reason]); }},
|
||||
emit(type, payload) {{ events.push(['emit', type, payload.type]); }},
|
||||
}};
|
||||
const food = {{ type: 'food', dead: false, age: 0, dropTimer: 0.1, dropImpactDone: false, foodServingsRemaining: 1, amount: 1, passiveFoodDecayTimer: 0 }};
|
||||
if (!context.TarinaiItemLifecyclePipeline.updateOne(food, 0.6, world, {{ legacyUpdate() {{ throw new Error('legacy should not run'); }} }})) throw new Error('food update failed');
|
||||
if (food.age !== 0.6 || !food.dropImpactDone || !(food.foodServingsRemaining < 1) || !events.some(([kind, value]) => kind === 'terrain' && value === 'food-passive-decay')) throw new Error('frame/decay step did not run');
|
||||
if (food.age !== 0.6 || !food.dropImpactDone || !(food.foodServingsRemaining < 1) || !events.some(([kind, value]) => kind === 'buckets' && value === 'food-passive-resize') || !events.some(([kind, value]) => kind === 'spatial' && value === 'food-passive-resize')) throw new Error('frame/decay step did not run');
|
||||
context.CONFIG = {{ worldPadding: 30 }};
|
||||
context.clamp = (v, min, max) => Math.max(min, Math.min(max, v));
|
||||
context.distXY = (ax, ay, bx, by) => Math.hypot(ax - bx, ay - by);
|
||||
|
|
@ -2755,7 +2758,7 @@ vm.createContext(collisionContext);
|
|||
vm.runInContext({collisions!r}, collisionContext, {{ filename: 'collision_response_system.js' }});
|
||||
const ball = {{ id: 'ball', type: 'ball', x: 9, y: 0, prevX: -9, prevY: 0, r: 10, vx: 100, vy: 0, spinVelocity: 0, dead: false }};
|
||||
const sleeper = {{ id: 'sleeper', name: 'sleeper', x: 20, y: 0, radius: 20, vx: 0, vy: 0, state: 'sleep', sleeping: true, dead: false, energy: 100 }};
|
||||
const collisionWorld = {{ time: 1, w: 500, h: 500, itemCounts: {{ ball: 1, balloon: 0 }}, items: [ball], effects: [], itemsOfType(type) {{ return type === 'ball' ? [ball] : []; }}, nearbyTarinai() {{ return [sleeper]; }}, isTarinaiHiddenInNestBox() {{ return false; }}, markSpatialDirty() {{}}, relationNotice() {{ return false; }}, applyImpulse() {{}}, applyImpactDamage() {{}} }};
|
||||
const collisionWorld = {{ time: 1, w: 500, h: 500, itemCounts: {{ ball: 1, balloon: 0 }}, items: [ball], effects: [], spawnEffect() {{ return null; }}, itemsOfType(type) {{ return type === 'ball' ? [ball] : []; }}, nearbyTarinai() {{ return [sleeper]; }}, isTarinaiHiddenInNestBox() {{ return false; }}, markSpatialDirty() {{}}, relationNotice() {{ return false; }}, applyImpulse() {{}}, applyImpactDamage() {{}} }};
|
||||
collisionContext.TarinaiCollisionResponseSystem.resolveBallInteractions(collisionWorld, 0.016);
|
||||
if (!(ball.vx < 0) || !(sleeper.vx > 0) || sleepMotionMarks < 1) throw new Error('sleeping Tarinai did not physically collide with ball');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue