Skip to content
This repository was archived by the owner on Aug 11, 2025. It is now read-only.

Commit dd54383

Browse files
committed
Snapshot 24w42c
1 parent 652f56b commit dd54383

8 files changed

Lines changed: 52 additions & 34 deletions

File tree

NebulaPluginNova/Nebula.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ public class NebulaPlugin : BasePlugin
4242
public const string PluginVersion = "2.0.3";
4343

4444
//public const string VisualVersion = "v2.0.3";
45-
public const string VisualVersion = "Snapshot 24w42b";
45+
public const string VisualVersion = "Snapshot 24w42c";
4646

4747
public const string PluginEpochStr = "104";
48-
public const string PluginBuildNumStr = "1136";
48+
public const string PluginBuildNumStr = "1138";
4949
public static readonly int PluginEpoch = int.Parse(PluginEpochStr);
5050
public static readonly int PluginBuildNum = int.Parse(PluginBuildNumStr);
5151
public const bool GuardVanillaLangData = false;
17 Bytes
Binary file not shown.

NebulaPluginNova/Resources/Addons/NebulaRemakeLanguage/Language/SChinese.dat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@
221221
"role.spiritualist.blurb" : "你好啊 古老的亡魂"
222222
"options.role.spiritualist.detail" : "招魂师拥有和本轮被报告尸体对应玩家对话的能力。<br>被招魂玩家仅有一次回答机会。<br>根据设置限制回答。<br>若无可提取的回答内容,不算作回答。"
223223
"options.role.spiritualist.charCount" : "回答最大字符数"
224-
"options.role.spiritualist.onlyLetters" : "仅提取数字与拉丁字母"
224+
"options.role.spiritualist.onlyLetters" : "仅提取拉丁字母"
225+
"options.role.spiritualist.lettersEachMeeting" : "每轮会议获得的可用字符数"
225226
"role.spiritualist.seleted" : "招魂师在召唤你"
226227

227228
"role.swapper.name" : "换票师"

NebulaPluginNova/Roles/Abilities/TrackingArrowAbility.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ void Update(GameUpdateEvent ev)
5353
internal void Reset(Virial.Game.Player player, UnityEngine.Color color)
5454
{
5555
target = player;
56-
this.color = color;
56+
arrow.SetSmallColor(color);
5757
}
5858
}

NebulaPluginNova/Roles/Crewmate/Spiritualist.cs

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@
22
using Virial.Configuration;
33
using Virial.Events.Game.Meeting;
44
using Virial;
5-
using System.Text.RegularExpressions;
65
using Virial.Events.Game;
7-
using Nebula.Compat;
86

97
namespace Nebula.Roles.Crewmate;
108

119
public class Spiritualist : DefinedRoleTemplate, DefinedRole
1210
{
13-
private Spiritualist() : base("spiritualist", new(200, 191, 231), RoleCategory.CrewmateRole, Crewmate.MyTeam, [CharCountOption, OnlyLettersOption]) { }
11+
private Spiritualist() : base("spiritualist", new(200, 191, 231), RoleCategory.CrewmateRole, Crewmate.MyTeam, [CharCountOption, LettersEachMeetingOption]) { }
1412

1513
RuntimeRole RuntimeAssignableGenerator<RuntimeRole>.CreateInstance(GamePlayer player, int[] arguments) => new Instance(player);
1614

1715
private static IntegerConfiguration CharCountOption = NebulaAPI.Configurations.Configuration("options.role.spiritualist.charCount", (1, 100), 5);
18-
private static BoolConfiguration OnlyLettersOption = NebulaAPI.Configurations.Configuration("options.role.spiritualist.onlyLetters", true);
16+
private static IntegerConfiguration LettersEachMeetingOption = NebulaAPI.Configurations.Configuration("options.role.spiritualist.lettersEachMeeting", (1, 36), 5);
1917

2018
static public Spiritualist MyRole = new Spiritualist();
2119
[NebulaRPCHolder]
2220
public class Instance : RuntimeAssignableTemplate, RuntimeRole
2321
{
22+
const string letterTab = "qwertyuiopasdfghjklzxcvbnm1234567890";
2423
DefinedRole RuntimeRole.Role => MyRole;
2524
public Instance(GamePlayer player) : base(player) { }
2625

2726
void RuntimeAssignable.OnActivated() { }
2827

2928
GamePlayer? lastReported = null;
29+
string subTab = string.Empty;
3030

3131
void OnMeetingEnd(MeetingEndEvent ev) => lastReported = null;
3232

@@ -38,7 +38,16 @@ void OnReportDeadBody(ReportDeadBodyEvent ev)
3838
if (ev.Reported != null)
3939
{
4040
lastReported = ev.Reported;
41-
RpcNoticeSeleted.Invoke(ev.Reported.PlayerId);
41+
var tab = letterTab.ToList();
42+
while (subTab.Length < LettersEachMeetingOption)
43+
{
44+
char c = tab.Random();
45+
subTab += c;
46+
tab.Remove(c);
47+
}
48+
var tmp = subTab.OrderBy(x => x).ToList();
49+
subTab = tmp.Join();
50+
RpcNoticeSeleted.Invoke((ev.Reported.PlayerId, subTab));
4251
}
4352
}
4453

@@ -50,7 +59,9 @@ void CheckAddChat(PlayerAddChatEvent ev)
5059
if (lastReported != null && ev.source.PlayerId == lastReported.PlayerId)
5160
{
5261
//Debug.LogError(1);
53-
if (OnlyLettersOption) ev.chatText = Regex.Replace(ev.chatText, "[^0-9A-Za-z]", "", RegexOptions.IgnoreCase);
62+
ev.chatText = ev.chatText.ToLower();
63+
//ev.chatText = Regex.Replace(ev.chatText, subTab, "", RegexOptions.IgnoreCase);
64+
ev.chatText = ev.chatText.RemoveAll(letterTab.RemoveAll(subTab.ToCharArray()).ToCharArray());
5465
ev.chatText = ev.chatText.Substring(0, Math.Min(CharCountOption, ev.chatText.Length));
5566
if (ev.chatText == string.Empty) return;
5667
ev.SetExtraShow();
@@ -66,23 +77,37 @@ void CheckCanSeeAllInfo(RequestEvent ev)
6677
}
6778
*/
6879

69-
private static readonly RemoteProcess<byte> RpcNoticeSeleted = new(
80+
private static readonly RemoteProcess<(byte, string)> RpcNoticeSeleted = new(
7081
"NoticeSeleted",
7182
(message, _) =>
7283
{
73-
if (message == PlayerControl.LocalPlayer.PlayerId)
84+
if (message.Item1 == PlayerControl.LocalPlayer.PlayerId)
7485
{
7586
var Message = GameObject.Instantiate(VanillaAsset.StandardTextPrefab, HudManager.Instance.transform);
7687
new TextAttributeOld(TextAttributeOld.NormalAttr) { Size = new Vector2(4f, 0.72f) }.EditFontSize(2.7f, 2.7f, 2.7f).Reflect(Message);
7788
Message.transform.localPosition = new Vector3(0, -1.5f, -5f);
7889
Message.color = MyRole.UnityColor;
7990
Message.text = Language.Translate("role.spiritualist.seleted");
8091
float duration = 5f;
81-
var timer = new FunctionalLifespan(() => duration > 0);
92+
bool flag = true;
93+
var timer = new GameObjectLifespan(Message.gameObject);
8294
GameOperatorManager.Instance?.Register<GameUpdateEvent>(ev =>
8395
{
8496
duration -= Time.deltaTime;
85-
if (duration < 0f) UnityEngine.GameObject.Destroy(Message);
97+
if (flag && duration <= 0f)
98+
{
99+
Message.text = message.Item2;
100+
flag = false;
101+
}
102+
//if (duration <= 0f) UnityEngine.GameObject.Destroy(Message);
103+
}, timer);
104+
GameOperatorManager.Instance?.Register<MeetingVoteEndEvent>(ev =>
105+
{
106+
if(Message != null)
107+
{
108+
UnityEngine.GameObject.Destroy(Message);
109+
Message = null;
110+
}
86111
}, timer);
87112
}
88113
});

NebulaPluginNova/Roles/Impostor/Assassin.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ void RuntimeAssignable.OnActivated()
136136
}
137137

138138
[Local]
139-
void OnMeetingStart(MeetingStartEvent ev) => Target = null;
139+
void OnMeetingStart(MeetingStartEvent ev)
140+
{
141+
Target = null;
142+
AmongUsUtil.SetCamTarget();
143+
}
140144

141145
[Local]
142146
void OnDied(PlayerDieEvent ev)

NebulaPluginNova/Roles/Neutral/Pavlov.cs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@ void RuntimeAssignable.OnActivated()
7272
}
7373
}
7474

75-
void RuntimeAssignable.OnInactivated()
76-
{
77-
PavlovsDog.Instance.RpcSetOwnerDied.Invoke(hasDog);
78-
}
79-
8075
[OnlyMyPlayer]
8176
void CheckWins(PlayerCheckWinEvent ev) => ev.SetWinIf(ev.GameEnd == NebulaGameEnd.PavlovWin
8277
&& NebulaGameManager.Instance!.AllPlayerInfo().Any(p => !p.IsDead && IsSameTeam(p)));
@@ -104,20 +99,13 @@ void OnGameEnd(PlayerCheckWinEvent ev)
10499
}
105100

106101
[Local]
107-
void OnDied(PlayerDieEvent ev)
108-
{
109-
if (ev.Player.PlayerId == MyPlayer.PlayerId)
110-
PavlovsDog.Instance.RpcSetOwnerDied.Invoke(hasDog);
111-
}
112-
113-
[Local]
114-
void DecorateSidekickColor(PlayerDecorateNameEvent ev)
102+
void DecorateDogColor(PlayerDecorateNameEvent ev)
115103
{
116104
if (IsSameTeam(ev.Player)) ev.Color = MyRole.RoleColor;
117105
}
118106

119107
[OnlyMyPlayer]
120-
void DecorateJackalColor(PlayerDecorateNameEvent ev)
108+
void DecoratePavlovColor(PlayerDecorateNameEvent ev)
121109
{
122110
var myInfo = PlayerControl.LocalPlayer.GetModInfo();
123111
if (myInfo == null) return;

NebulaPluginNova/Roles/Neutral/Spectre.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ private void UpdateArrows()
102102
Virial.Game.Player[] players = NebulaGameManager.Instance?.AllPlayerInfo().Where(p =>
103103
!p.IsDead &&
104104
!p.AmOwner &&
105-
p.IsImpostor ||
106-
p.Role.Role == Crewmate.Sheriff.MyRole ||
107-
p.Role.Role == Jackal.MyRole ||
108-
p.Role.Role == PavlovsDog.MyRole ||
105+
(p.IsImpostor ||
106+
p.Role.Role == Crewmate.Sheriff.MyRole ||
107+
p.Role.Role == Jackal.MyRole ||
108+
p.Role.Role == PavlovsDog.MyRole ||
109109
p.Role.Role == Moriarty.MyRole ||
110-
p.Role.Role == Moran.MyRole).ToArray() ?? new Virial.Game.Player[0];
110+
p.Role.Role == Moran.MyRole)).ToArray() ?? new Virial.Game.Player[0];
111111
for(int i = 0;i < Math.Min(players.Length, arrows.Count); i++)
112112
arrows[i].Reset(players[i], players[i].Role.Role.Color.ToUnityColor());
113113
for (int i = players.Length; i < arrows.Count; i++)

0 commit comments

Comments
 (0)