仅限巨魔字幕

仅限巨魔字幕

对于那些不擅长巨魔语的人。

游戏玩法变更

模组:巨魔专属字幕

我喜欢关闭字幕玩游戏,但有一半的巨魔台词我都听不懂。
等他们开始说话时再打开字幕已经来不及了,
而他们说的内容精彩到不容错过。

这个模组会动态地仅为巨魔开启字幕。

重要提示:
目前此功能仅限于对话,因此不会应用于背景中的闲聊。
该模组仅在志愿者支线任务中的巨魔角色上进行了测试。

安装

modTrollonlySubtitles 扩展至你的 \The Witcher 3 Wild Hunt\Mods\ 目录中。

本模组修改了以下文件

[1]

// HUD 界面脚本

[2]

/*
* 游戏平视显示器 (HUD) 控制
* 版本 1.2.3
*/

[3]

import class hud.HudElement;

[4]

import class hud.HealthBar;
import class hud.StaminaBar;
import class hud.ManaBar;
import class hud.QuestTracker;
import class hud.Minimap;

[5]

public class Hud
{

[6]

    // 主HUD元素数组
    private array<ref HudElement> hudElements;

[7]

    // 初始化HUD
    public void Initialize()
    {

[8]

        // 创建基础HUD元素
        hudElements.push(new HealthBar());
        hudElements.push(new StaminaBar());
        hudElements.push(new ManaBar());
        hudElements.push(new QuestTracker());
        hudElements.push(new Minimap());

[9]

        // 设置默认位置
        foreach(element in hudElements)
        {
            element.SetDefaultPosition();
        }
    }

[10]

    // 更新HUD
    public void Update(float deltaTime)
    {

[11]

        // 更新所有HUD元素
        foreach(element in hudElements)
        {
            element.Update(deltaTime);
        }
    }

[12]

    // 显示/隐藏HUD
    public void SetVisible(bool visible)
    {

[13]

        foreach(element in hudElements)
        {
            element.SetVisible(visible);
        }
    }

[14]

    // 调整HUD透明度
    public void SetOpacity(float opacity)
    {

[15]

        foreach(element in hudElements)
        {
            element.SetOpacity(opacity);
        }
    }
}

[16]

/*
* 注意:
* 此脚本控制游戏内HUD的核心功能
* 修改前请备份
*/

非玩家角色脚本

1| // 基础NPC类
2| class CNpc extends CGameEntity
3| {
4|     // 构造函数
5|     function CNpc()
6|     {
7|         super();
8|         m_bIsNpc = true;
9|     }
10|
11|     // 初始化NPC
12|     function Initialize()
13|     {
14|         super.Initialize();
15|         SetInteractionEnabled(true);
16|     }
17|
18|     // 更新函数
19|     function Update(deltaTime)
20|     {
21|         super.Update(deltaTime);
22|         UpdateAI();
23|     }
24|
25|     // AI更新
26|     function UpdateAI()
27|     {
28|         // 基础AI逻辑
29|         if(IsPlayerInRange(5.0))
30|         {
31|             FacePlayer();
32|         }
33|     }
34|
35|     // 与玩家交互
36|     function OnInteract(player)
37|     {
38|         if(!IsInteractionEnabled())
39|             return;
40|
41|         StartDialogue(player);
42|     }
43|
44|     // 开始对话
45|     function StartDialogue(player)
46|     {
47|         // 调用对话系统
48|         GetDialogueSystem().StartDialogue(this, player);
49|     }
50|
51|     // 检查玩家是否在范围内
52|     function IsPlayerInRange(range)
53|     {
54|         local player = GetNearestPlayer();
55|         if(!player)
56|             return false;
57|
58|         return GetDistanceTo(player) <= range;
59|     }
60|
61|     // 面向玩家
62|     function FacePlayer()
63|     {
64|         local player = GetNearestPlayer();
65|         if(player)
66|             LookAt(player.GetPosition());
67|     }
68| }
69|
70| // 商人NPC类
71| class CVendorNpc extends CNpc
72| {
73|     function CVendorNpc()
74|     {
75|         super();
76|         m_bIsVendor = true;
77|     }
78|
79|     function OnInteract(player)
80|     {
81|         if(!IsInteractionEnabled())
82|             return;
83|
84|         OpenShopMenu(player);
85|     }
86|
87|     function OpenShopMenu(player)
88|     {
89|         GetShopSystem().OpenShop(this, player);
90|     }
91| }
92|
93| // 任务NPC类
94| class CQuestNpc extends CNpc
95| {
96|     function CQuestNpc()
97|     {
98|         super();
99|         m_bHasQuests = true;
100|    }
101|
102|    function OnInteract(player)
103|    {
104|        if(!IsInteractionEnabled())
105|            return;
106|
107|        ShowQuestDialog(player);
108|    }
109|
110|    function ShowQuestDialog(player)
111|    {
112|        GetQuestSystem().ShowQuestDialog(this, player);
113|    }
114| }

scripts\game\player\player.ws