diff --git a/packages/engine-chronocat-api/src/api/message/create/messager.ts b/packages/engine-chronocat-api/src/api/message/create/messager.ts index 2586b07..5c2337f 100644 --- a/packages/engine-chronocat-api/src/api/message/create/messager.ts +++ b/packages/engine-chronocat-api/src/api/message/create/messager.ts @@ -254,20 +254,25 @@ export class Messager { } case `${this.ctx.chronocat.platform}:face`: { - const face = (await this.ctx.chronocat.api[ - 'chronocat.internal.qface.get' - ](`${attrs['id']}`))! + if (attrs['unsafeMarketEmoticon']) { + this.children.push(r.marketEmoticon(Number(attrs['id']))) + } else { + const face = (await this.ctx.chronocat.api[ + 'chronocat.internal.qface.get' + ](`${attrs['id']}`))! + + this.children.push( + r.face( + face, + attrs['unsafeSuper'] + ? FaceType.Super + : face.QSid === face.IQLid && face.QSid === face.AQLid + ? FaceType.Normal2 + : FaceType.Normal1, + ), + ) + } - this.children.push( - r.face( - face, - attrs['unsafeSuper'] - ? FaceType.Super - : face.QSid === face.IQLid && face.QSid === face.AQLid - ? FaceType.Normal2 - : FaceType.Normal1, - ), - ) this.isEndLine = false return } diff --git a/packages/engine-chronocat-api/src/api/message/create/r.ts b/packages/engine-chronocat-api/src/api/message/create/r.ts index bbfb296..852b119 100644 --- a/packages/engine-chronocat-api/src/api/message/create/r.ts +++ b/packages/engine-chronocat-api/src/api/message/create/r.ts @@ -103,6 +103,17 @@ const b = () => { }, }, + marketEmoticon: (faceIndex: number): O.Partial => ({ + elementType: 6, + elementId: '', + faceElement: { + faceIndex, + faceText: '\n', + faceType: FaceType.MarketEmoticon, + imageType: 1, + }, + }), + pcPoke: (pokeType: number): O.Partial => ({ elementId: '0', elementType: 6, diff --git a/packages/engine-chronocat-event/src/parser/index.ts b/packages/engine-chronocat-event/src/parser/index.ts index 3e1f2ba..6fad786 100644 --- a/packages/engine-chronocat-event/src/parser/index.ts +++ b/packages/engine-chronocat-event/src/parser/index.ts @@ -510,6 +510,17 @@ async function parseElements( ) break } + + case FaceType.MarketEmoticon: { + elements.push( + ctx.chronocat.h(`${ctx.chronocat.platform}:face`, { + id: m.faceElement!.faceIndex, + platform: ctx.chronocat.platform, + 'unsafe-market-emoticon': true, + }), + ) + break + } } break } diff --git a/packages/red/src/redEntity.ts b/packages/red/src/redEntity.ts index ca7addd..7218c01 100644 --- a/packages/red/src/redEntity.ts +++ b/packages/red/src/redEntity.ts @@ -369,6 +369,16 @@ export enum FaceType { */ Super = 3, + /** + * MarketEmoticon + * + * faceIndex 为 uint32 + * + * - epId (Emoticon Pack ID) : faceIndex >> 16 + * - eId (Emoticon ID) : faceIndex & 0xFFFF + */ + MarketEmoticon = 4, + /** * PC 戳一戳(窗口抖动) */