角色的美术表

您可以在这张表格中确认角色可用的CharacterState。注意这张表只维护原版游戏中的CharacterState。

可用的音效表

可用的文本样式

在目前,支持下列文本样式:
angry
sad
fear
excite
happy
ero
organsm
funny
suprise
confuse
shout
lag
strong

可用的结果标识

Yarn命令

统计口径

本页列出当前 C# 中带 [YarnCommand] 的项目命令。调用形式如:

<<CommandName 参数1 参数2>>

成就、HP 和动画

命令签名作用
AddAchievementvoid AddAchievement(string achievementTechName)添加成就。
Damagevoid Damage(int amount)对 Aistalt 造成伤害。
Defensevoid Defense(int amount)增加防御层数。
Healvoid Heal(int amount)恢复 Aistalt HP。
EndGamevoid EndGame(string caseName)设置结束游戏界面和结束案例。
PlayDialogueWithVoicevoid PlayDialogueWithVoice(string lineID, string characterName = "", float duration = 0f)已过时,当前实现没有实际播放逻辑。
StartGibberishvoid StartGibberish()开启 Gibberish。
StopGibberishvoid StopGibberish()关闭 Gibberish。
StopDialoguevoid StopDialogue()停止当前语音对话。
SwitchVoiceLanguagevoid SwitchVoiceLanguage(string languageCode)切换语音语言。
ApplyNPCStatevoid ApplyNPCState(string characterTechName, params string[] stateSelectors)按一个或多个状态选择器应用角色状态。
SetNPCStatevoid SetNPCState(string characterTechName, string stateName)直接应用一个 CharacterState。
SetCharacterSkinvoid SetCharacterSkin(string characterTechName, string skinTechName)修改角色 Body Skin。
CGAnimvoid CGAnim(string cgTechName, string animationName)在当前 CG 上播放 Spine 动画。
ClearSkinvoid ClearSkin(string characterTechName)恢复角色默认 Body Skin。
Shakevoid Shake(int speakerIndex, float intensity = 1f, float duration = -1f)震动直播角色;常用 speaker index 为 1 或 2。

示例:

<<SetNPCState Aistalt Sad>>
<<SetCharacterSkin Aistalt Normal>>
<<Shake 1 0.8 0.2>>

更完整的状态规则见 g.角色与动画。

音乐、通用、算力和过场

命令签名作用
UnlockSongvoid UnlockSong(string songTechName)解锁歌曲。
PlaySongvoid PlaySong(string songTechName)播放歌曲。
StopSongvoid StopSong()停止歌曲。
AddPrefixvoid AddPrefix(string textKey)设置下一条对话的文本前缀。
SpendCompuvoid SpendCompu(int amount)扣除算力。
AddCompuvoid AddCompu(int amount)增加算力。
StartCutsceneIEnumerator StartCutscene(string techName)启动过场并等待其完成。
StepIEnumerator Step(string stepName)播放过场步骤并等待完成。

弹幕与人气

命令签名作用
EnableAudiencevoid EnableAudience(string techName)启用观众类型。
DisableAudiencevoid DisableAudience(string techName)禁用观众类型。
StartDanmakuvoid StartDanmaku()开始弹幕发射并重置上下文。
StopDanmakuvoid StopDanmaku()停止弹幕发射。
DisableDanmakuvoid DisableDanmaku()关闭弹幕总开关。
EnableDanmakuvoid EnableDanmaku()开启弹幕总开关。
ClearDanmakuvoid ClearDanmaku()清除当前弹幕。
LoadDanmakuvoid LoadDanmaku()按当前天数加载弹幕库。
AllowDanmakuTypevoid AllowDanmakuType(string typeName)允许指定弹幕类型。
DisableDanmakuTypevoid DisableDanmakuType(string typeName)禁止指定弹幕类型。
ClearRecentCharacterDanmakuvoid ClearRecentCharacterDanmaku()清除最近加入的角色弹幕类型。
EmitDanmakuTypeBurstvoid EmitDanmakuTypeBurst(string typeName, float seconds)在指定时间内集中发射一种弹幕。
AddViewervoid AddViewer(float amount)调整观众数量。
AddPopularityvoid AddPopularity(float amount)调整人气。

日程、商品、装饰和硬件

命令签名作用
EndDayvoid Cmd_EndDay()结束一天、清理状态、推进日期并重新开始 Initial。
ActivateGoodsListvoid ActivateGoodsList(string goodsListTechName)激活商品列表。
AddDecorationvoid AddDecoration(string decorationTechName)将装饰加入库存。
EnableDecorationvoid EnableDecoration(string decorationTechName)将装饰加入库存并启用。
DisableDecorationvoid DisableDecoration(string decorationTechName)禁用并移除装饰。
UnlockHardwarevoid UnlockHardware(string hardwareTechName)解锁硬件。
GrantHardwarePartvoid GrantHardwarePart(string partTechName)授予硬件部件。
EquipHardwarePartvoid EquipHardwarePart(string hardwareTechName, string partTechName)装备部件。
UnequipHardwarePartvoid UnequipHardwarePart(string hardwareTechName, string partTypeTechName)卸下部件。
ShowHardwarevoid ShowHardware()显示硬件页面。
StopHardwarevoid StopHardware()关闭硬件页面。
ChangeResourcevoid ChangeResource(string hardwareTechName, string resourceTechName, int num)修改硬件资源。

Hex、协议和战斗

命令签名作用
AddHexProtocolvoid AddHexProtocol(string protocolTechName)将协议加入库存。
RemoveHexProtocolvoid RemoveHexProtocol(string protocolTechName)从库存移除协议。
StartCombatvoid StartCombat(string combatTechName = null)启动战斗。
EndTurnvoid EndTurn()结束战斗回合。
NewRoundvoid NewRound()当前实现直接结束当前回合。
EndCombatvoid EndCombat()结束战斗。
Advantagevoid Advantage(int delta)修改战斗优势值。
InstallHexProtocolvoid InstallHexProtocol(string protocolTechName)加入协议并随机放入合法位置。
InstallCoreProtocolvoid InstallCoreProtocol(string protocolTechName)将协议放入核心位置。
UninstallHexProtocolvoid UninstallHexProtocol(string protocolTechName)卸载协议并返回库存。
UnlockGridRadiusvoid UnlockGridRadius(int radius)解锁 Mind Map 网格半径。
ChangeHexProtocolvoid ChangeHexProtocol(string protocolTechName)替换中心协议。
Gottocolvoid Gottocol(string moduleKey)将 Module_ 前缀模块安装到空核心位置。

输入、直播和角色面板

命令签名作用
AskInputIEnumerator AskInput(string varName)打开文字输入,并将结果写入指定 Yarn 字符串变量。
AskInputNumIEnumerator AskInputNum()打开数字输入,并将结果写入 $InputNumber。
AddQuestionvoid AddQuestion(string textKey, string nodeName)将本地化问题加入直播选项。
ClearOptionsvoid ClearOptions()清空直播选项。
StartLiveStreamDialoguevoid StartLiveStreamDialogue(string nodeName)清理选项并启动直播对话节点。
StopLiveStreamDialoguevoid StopLiveStreamDialogue()清理上下文并停止直播对话。
StartLiveStatusvoid StartLiveStatus()设置内部直播状态为 active。
EndLiveStatusvoid EndLiveStatus()设置内部直播状态为 inactive。
CodeFlowvoid CodeFlow(string controllerName)切换直播窗口 CodeFlow 页面。
ShowLiveStreamWindowvoid ShowLiveStreamWindow()当前主要记录日志,真正打开窗口的调用已被注释。
HideLiveStreamWindowvoid HideLiveStreamWindow()当前主要清理选项并记录日志,真正关闭窗口的调用已被注释。
AddNPCIEnumerator AddNPC(string characterName)播放 NPC 入场并加入角色面板。
AddCGvoid AddCG(string cgTechName)加入 CG 角色面板。
RemoveCGvoid RemoveCG(string cgTechName)移除 CG。
RemoveNPCIEnumerator RemoveNPC(string characterName)播放 NPC 退场并移除。
RemoveNPCImmediatevoid RemoveNPCImmediate(string characterName)立即移除 NPC。
RemoveNPCClearvoid RemoveNPCClear(string characterName)当前实现与立即移除基本相同。
RemoveAllNPCvoid RemoveAllNPC()移除所有 NPC。
SoloIEnumerator Solo(string characterTechName)只保留目标角色;目标不在场时会先加入。
ShowHPBarvoid ShowHPBar(string characterName, int heartCount)显示角色 HP 条。
StopHPBarvoid StopHPBar(string characterName)停止角色 HP 条。
Gainvoid Gain(string characterName)恢复破碎的心。
Breakvoid Break(string characterName, int amount)破坏指定数量的心。
ShowImagevoid ShowImage(string attachmentTechName, string characterName)向角色图片列表加入附件图。
Lovevoid Love(string characterTechName, int amount)增加角色 Love 变量并刷新 UI。
Hatevoid Hate(string characterTechName, int amount)增加角色 Hate 变量并刷新 UI。

NPC 选项、姓名、新闻和邮件

命令签名作用
GenerateNPCOptionvoid GenerateNPCOption(string baseNodeName, int optionsCount)生成满足条件的 NPC 选项。
PublicNPCInfovoid PublicNPCInfo(string npcTechName, string infoType, bool isPublic)修改 NPC 信息公开状态。
EnableNameTablevoid EnableNameTable(string tableTechName)启用姓名表。
DisableNameTablevoid DisableNameTable(string tableTechName)禁用姓名表。
AddNewsvoid AddNews(string newsTechName)将新闻加入报纸队列。
SendNewspapervoid SendNewspaper()发布报纸队列。
AddEmailvoid AddEmail(string emailTechName)将邮件加入发送队列。
SendEmailvoid SendEmail()发送全部邮件队列。
AddTrashEmailvoid AddTrashEmail(string emailTechName)将邮件加入垃圾邮件队列。

OS、快捷方式和交互物品

命令签名作用
OS_Add_Shortcutvoid AddShortcut(string techName)添加桌面快捷方式。
OS_Remove_Shortcutvoid RemoveShortcut(string techName)移除桌面快捷方式。
OS_Clear_Shortcutsvoid ClearAllShortcuts()当前没有实际调用清空逻辑。
OS_Test_Add_Shortcutvoid TestAddShortcut()测试添加快捷方式。
OS_Test_Remove_Shortcutvoid TestRemoveShortcut()测试移除快捷方式。
HintShortcutvoid HintShortcut(string shortcutTechName)提示快捷方式。
HintProtocolvoid HintProtocol(string protocolTechName)提示协议。
OpenWindowvoid OpenWindow(string windowTechName)打开 OS 窗口。
CloseWindowvoid CloseWindow(string windowTechName)关闭 OS 窗口。
ChangeControllervoid ChangeController(string targetName, string controllerName, string controllerState)切换 FairyGUI Controller 页面。
GenerateInteractvoid GenerateInteract(string techName)激活交互物品。
DeleteInteractvoid DeleteInteract(string techName)停用交互物品。
LoadWorldCasevoid LoadWorldCase(string caseControllerName)切换世界空间 Case 页面。

宠物、维护、Review 和局势

命令签名作用
SendPetEventvoid SendPetEvent(string petEventTypeName)向宠物调度器发送事件。
StartMaintainIEnumerator StartMaintain()启动协议维护流程。
FakeMaintainvoid FakeMaintain(string protocolName1, string protocolName2, string protocolName3)用指定协议打开维护选择界面。
Warnvoid Warn(string textKey)显示警告字幕。
AddReviewvoid AddReview(string reviewTechName)添加自定义评价。
StartSituationvoid Cmd_StartSituation(string situationTechName)启动局势。
ChangeSituationvoid Cmd_ChangeSituation(string situationTechName, int delta)修改局势值。
AddPlayerInfovoid Cmd_AddPlayerInfo(string infoKey)添加玩家信息。

检定、特效、时间、UI、地图和位置

命令签名作用
CheckIEnumerator Check(string attrTechName, int difficulty, string topicTechName = null)执行普通技能检定。
MultiCheckIEnumerator MultiCheck(params string[] checkSpecifications)依次执行多组检定,并把首个成功结果写入结果变量。
SecretCheckIEnumerator SecretCheck(string attrTechName, int difficulty, string topicTechName = null)执行隐藏技能检定。
ApplySEvoid ApplySE(string seTechName)添加特殊效果。
RemoveSEvoid RemoveSE(string seTechName)移除命令来源的特殊效果。
AdvanceTimevoid AdvanceTime(int minutes)推进游戏时间。
PlayUIAnimationvoid PlayUIAnimation(string uiAnimationTechName)播放 UI 动画。
Volume_SetStatevoid VolumeSetState(string stateName)切换 Volume 状态。
StartFXvoid StartFX(string techName)启动 PostFX。
StopFXvoid StopFX(string techName)停止 PostFX。
PlaceHardwareAtLocationvoid PlaceHardwareAtLocation(string hardwareTechName, string locationTechName)在地图地点放置硬件。
MoveHardwareToLocationvoid MoveHardwareToLocation(string hardwareTechName, string targetLocationTechName)移动硬件到相邻地点。
MoveHardwareToLocationInMapvoid MoveHardwareToLocationInMap(string hardwareTechName, string targetLocationTechName, string mapTechName)在指定地图移动硬件。
EnterChildMapByLocationvoid EnterChildMapByLocation(string locationTechName)从地点进入子地图。
ReturnToParentMapvoid ReturnToParentMap()返回父地图。
SetLocationvoid SetLocation(string locationName)设置世界空间位置。

Yarn函数

统计口径

本页列出当前 C# 中带 [YarnFunction] 的项目函数。函数用于 Yarn 表达式,例如:

<<if Tech() >= 1>>
    Aistalt: 这是一条技术路线。
<<endif>>

成就、HP、动画和声音

函数签名作用
HasAchievementbool HasAchievement(string achievementTechName)查询成就是否解锁。
GetCurrentHPint GetCurrentHP()读取 Aistalt 当前 HP。
IsPlayingDialoguebool IsPlayingDialogue()查询当前语音对话是否播放中。
GetCurrentVoiceLanguagestring GetCurrentVoiceLanguage()返回当前语音语言代码。
IsSongUnlockedbool IsSongUnlocked(string songTechName)查询歌曲是否解锁。
GetCurrentSongTechNamestring GetCurrentSongTechName()返回当前歌曲 TechName。
IsAnySongPlayingbool IsAnySongPlaying()查询是否有歌曲播放。
GetPlayListCountint GetPlayListCount()返回播放列表数量。

通用、算力、弹幕、商品和硬件

函数签名作用
IsStreamerModebool IsStreamerMode()查询主播模式是否开启。
GetLocalizedNamestring GetLocalizedName(string textKeyPrefix, int textKeyIndex, string customName)当索引为 0 时返回自定义名称,否则查找 <prefix>_<index>。
CountAvailableint CountAvailable(string nodeName)统计节点或节点组当前满足条件的内容数量。
GetCompuint GetCompu()返回当前算力。
GetPopLevelint GetPopLevel()返回当前人气等级。
GetCurrentPopularityint GetCurrentPopularity()当前实现与 GetPopLevel 读取同一个人气等级字段。
GetAvailableGoodsCountint GetAvailableGoodsCount()返回当前可购买商品数量。
IsGoodsPurchasedbool IsGoodsPurchased(string goodsId)查询商品是否已经购买。
HasInteractItembool HasInteractItem(string techName)查询交互物品是否激活。
GetResourceint GetResource(string hardwareTechName, string resourceTechName)读取硬件资源数量。
HasHardwareUnlockedbool HasHardwareUnlocked(string hardwareTechName)查询硬件是否解锁。
HasHardwarePartbool HasHardwarePart(string partTechName)查询硬件部件是否拥有。

属性、Topic、协议和战斗

函数签名作用
GetAttributeValueint GetAttributeValue(string attrTechName)查询指定属性值。
Empathyint Empathy()查询 Empathy 属性。
Techint Tech()查询 Tech 属性。
Trollint Troll()查询 Troll 属性。
Kitschint Kitsch()查询 Kitsch 属性。
GetTopicint GetTopic(string topicTechName)查询 Topic 值;实现会先结束当前战斗,因此不是完全无副作用的纯查询。
GetTopicLevelint GetTopicLevel(string topicTechName)根据 Topic 当前值计算已达到的等级数。
IsTopicBannedbool IsTopicBanned(string topicTechName)查询 Topic 是否被禁用。
HasHexProtocolbool HasHexProtocol(string protocolTechName)查询协议是否在库存中。
IsProtocolEquippedbool IsProtocolEquipped(string protocolTechName)查询协议是否已放置到 Mind Map。
GetInstalledProtocolint GetInstalledProtocol()返回已放置协议的去重数量。
InCombatbool InCombat()查询是否处于战斗中。
InAttackTurnbool InAttackTurn()查询是否处于攻击回合。
InDefenseTurnbool InDefenseTurn()查询是否处于防御回合。
HasHexModulebool HasHexModule(string moduleTechName)查询模块是否安装。

直播、NPC、OS 和 Review

函数签名作用
GetOptionCountint GetOptionCount()返回当前有效直播选项数量。
HasOptionsbool HasOptions()查询是否存在有效直播选项。
GetHeartint GetHeart()返回当前对话 HP 条的心数。
CountNPCOptionint CountNPCOption(string baseNodeName)统计 NPC 选项节点中当前可用的节点数量。
OS_Has_Shortcutbool HasShortcut(string techName)查询桌面快捷方式是否存在。
OS_Shortcut_Countint GetShortcutCount()返回快捷方式数量。
TotalWarnint TotalWarn()返回累计警告数。
WarnGainint WarnGain()返回当天获得的警告数。
CompuGainint CompuGain()返回直播期间获得的算力。
CompuMultifloat CompuMulti()返回弹幕特殊逻辑产生的算力倍率。
CompuMultiGainint CompuMultiGain()计算直播算力收益乘倍率后的整数结果,并限制不小于 0。
GetCheckProbabilityfloat GetCheckProbability(string attrTechName, int difficulty)计算技能检定成功率。
HasSEbool HasSE(string seTechName)查询特殊效果是否存在。

时间、地图、邮件

函数签名作用
GetCurrentTimestring GetCurrentTime()返回格式化后的当前时间。
GetCurrentHourint GetCurrentHour()返回当前小时。
GetCurrentMinuteint GetCurrentMinute()返回当前分钟。
GetCurrentDayint GetCurrentDay()返回当前天数。
IsWorkHoursbool IsWorkHours()查询是否在工作时间。
IsDaybool IsDay()查询是否为白天。
IsNightbool IsNight()查询是否为夜晚。
CountHwInLocationint CountHwInLocation(string locationTechName)统计地点中的硬件数量。
HasHwInLocationbool HasHwInLocation(string locationTechName, string hardwareTechName)查询地点是否有指定硬件。
GetCurrentMapTechNamestring GetCurrentMapTechName()返回当前地图 TechName。
GetEmailQueueCountint GetEmailQueueCount()返回待发送邮件数量。
GetTodayEmailCountint GetTodayEmailCount()返回当天邮件数量。
GetTrashEmailCountint GetTrashEmailCount()返回垃圾邮件数量。
GetNewEmailCountint GetNewEmailCount()返回新邮件数量。
WasVisitedbool WasVisited()当前是占位函数,始终返回 false,不要依赖它判断节点访问状态。

常用示例

<<if GetCurrentHour() >= 18>>
    Aistalt: 已经到下班时间了。
<<endif>>
 
<<if CountAvailable("Entry_NoBody") > 0>>
    <<GenerateNPCOption Entry_NoBody 1>>
<<endif>>
 
<<if GetTopicLevel("Topic_Insight") >= 1 and Tech() >= 1>>
    -> 进行一次技术路线的询问
<<endif>>