feat(node-groups): 그룹별 슬롯 좌표 플러밍 (SlotPos/ActiveSlotPos)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -73,6 +73,9 @@ function luaCardsTable(cards) {
|
|||||||
function luaDeckTable(deck) {
|
function luaDeckTable(deck) {
|
||||||
return `self.DrawPile = { ${deck.map(luaStr).join(', ')} }`;
|
return `self.DrawPile = { ${deck.map(luaStr).join(', ')} }`;
|
||||||
}
|
}
|
||||||
|
function luaSlotGroup(arr) {
|
||||||
|
return '{ ' + arr.map((s) => `{ x = ${s.x}, y = ${s.y} }`).join(', ') + ' }';
|
||||||
|
}
|
||||||
|
|
||||||
const UI_FILE = 'ui/DefaultGroup.ui';
|
const UI_FILE = 'ui/DefaultGroup.ui';
|
||||||
const COMMON_FILE = 'Global/common.gamelogic';
|
const COMMON_FILE = 'Global/common.gamelogic';
|
||||||
@@ -308,8 +311,10 @@ function entity({ id, path, modelId, entryId, componentNames, components, displa
|
|||||||
}
|
}
|
||||||
|
|
||||||
function upsertUi() {
|
function upsertUi() {
|
||||||
if (SLOTS.length < MAX_MONSTERS) {
|
for (const g of ['combat', 'elite', 'boss']) {
|
||||||
throw new Error(`[gen-slaydeck] monster-slots.json 항목(${SLOTS.length}) < MAX_MONSTERS(${MAX_MONSTERS})`);
|
if (!Array.isArray(SLOTS[g]) || SLOTS[g].length < 1) {
|
||||||
|
throw new Error(`[gen-slaydeck] monster-slots.json 의 "${g}" 그룹 좌표가 없습니다`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const ui = JSON.parse(readFileSync(UI_FILE, 'utf8'));
|
const ui = JSON.parse(readFileSync(UI_FILE, 'utf8'));
|
||||||
const E = ui.ContentProto.Entities;
|
const E = ui.ContentProto.Entities;
|
||||||
@@ -1560,6 +1565,7 @@ function writeCodeblocks() {
|
|||||||
prop('any', 'Registered'),
|
prop('any', 'Registered'),
|
||||||
prop('number', 'TargetIndex', '1'),
|
prop('number', 'TargetIndex', '1'),
|
||||||
prop('any', 'SlotPos'),
|
prop('any', 'SlotPos'),
|
||||||
|
prop('any', 'ActiveSlotPos'),
|
||||||
prop('any', 'RunDeck'),
|
prop('any', 'RunDeck'),
|
||||||
prop('number', 'Gold', '0'),
|
prop('number', 'Gold', '0'),
|
||||||
prop('number', 'Floor', '0'),
|
prop('number', 'Floor', '0'),
|
||||||
@@ -1671,7 +1677,7 @@ self.RelicPool = { ${RELICS.relicPool.map(luaStr).join(', ')} }
|
|||||||
${luaEnemiesTable(ENEMIES.enemies)}
|
${luaEnemiesTable(ENEMIES.enemies)}
|
||||||
${luaMapNodesTable(MAP.nodes)}
|
${luaMapNodesTable(MAP.nodes)}
|
||||||
${luaStartArray(MAP.start)}
|
${luaStartArray(MAP.start)}
|
||||||
self.SlotPos = { ${SLOTS.map((s) => `{ x = ${s.x}, y = ${s.y} }`).join(', ')} }
|
self.SlotPos = { combat = ${luaSlotGroup(SLOTS.combat)}, elite = ${luaSlotGroup(SLOTS.elite)}, boss = ${luaSlotGroup(SLOTS.boss)} }
|
||||||
self.CurrentNodeId = ""
|
self.CurrentNodeId = ""
|
||||||
self.CurrentEnemyId = ""
|
self.CurrentEnemyId = ""
|
||||||
self:BindButtons()
|
self:BindButtons()
|
||||||
@@ -2267,7 +2273,7 @@ e.UITransformComponent.RectSize = Vector2(w, 14)`, [
|
|||||||
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'hp' },
|
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'hp' },
|
||||||
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'maxHp' },
|
{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'maxHp' },
|
||||||
]),
|
]),
|
||||||
method('PositionMonsterSlot', `local sp = self.SlotPos
|
method('PositionMonsterSlot', `local sp = self.ActiveSlotPos
|
||||||
if sp == nil or sp[slot] == nil then
|
if sp == nil or sp[slot] == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user