Skip to content

Commit 78993f1

Browse files
authored
Update Server_NapCha_API
1 parent e282164 commit 78993f1

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

Server_NapCha_API

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ namespace Server_NapCha_ui_API
2424
return hint;
2525
}
2626

27-
//疑名制造的宇宙无敌,超级牛逼666的API
2827

2928
public void 提示服务0(Player 玩家, int 大小 = 25, int 时间 = 5, int 高度 = 100, string 内容 = "Server_NapCha_ui_API_FileName_null_text", HintAlignment 位置 = HintAlignment.Left)
3029
{
@@ -62,12 +61,12 @@ namespace Server_NapCha_ui_API
6261
{
6362
PlayerDisplay playerDisplay = PlayerDisplay.Get(player);
6463
HintServiceMeow.Core.Models.Hints.AbstractHint hint = playerDisplay.GetHint("your_hint_id");
65-
Timer lastCancelTimer = null; // 初始化为 null
64+
Timer lastCancelTimer = null;
6665
if (lastCancelTimer0.ContainsKey(player))
6766
{
6867
lastCancelTimer = lastCancelTimer0[player];
6968
}
70-
// 如果上一个提示已存在,先取消其定时器
69+
7170
if (lastCancelTimer != null)
7271
{
7372
lastCancelTimer.Dispose();
@@ -90,8 +89,8 @@ namespace Server_NapCha_ui_API
9089

9190
lastCancelTimer = new Timer((state) =>
9291
{
93-
playerDisplay.RemoveHint(hint); // 使用实际的Guid替换yourGuid
94-
}, null, 时间 * 1000, Timeout.Infinite); // 转换为毫秒
92+
playerDisplay.RemoveHint(hint);
93+
}, null, 时间 * 1000, Timeout.Infinite);
9594

9695
if (!lastCancelTimer0.ContainsKey(player))
9796
{
@@ -113,12 +112,12 @@ namespace Server_NapCha_ui_API
113112
{
114113
PlayerDisplay playerDisplay = PlayerDisplay.Get(player);
115114
HintServiceMeow.Core.Models.Hints.AbstractHint hint = playerDisplay.GetHint("your_hint_id");
116-
Timer lastCancelTimer = null; // 初始化为 null
115+
Timer lastCancelTimer = null;
117116
if (lastCancelTimer1.ContainsKey(player))
118117
{
119118
lastCancelTimer = lastCancelTimer0[player];
120119
}
121-
// 如果上一个提示已存在,先取消其定时器
120+
122121
if (lastCancelTimer != null)
123122
{
124123
lastCancelTimer.Dispose();
@@ -141,8 +140,8 @@ namespace Server_NapCha_ui_API
141140

142141
lastCancelTimer = new Timer((state) =>
143142
{
144-
playerDisplay.RemoveHint(hint); // 使用实际的Guid替换yourGuid
145-
}, null, 时间 * 1000, Timeout.Infinite); // 转换为毫秒
143+
playerDisplay.RemoveHint(hint);
144+
}, null, 时间 * 1000, Timeout.Infinite);
146145

147146
if (!lastCancelTimer1.ContainsKey(player))
148147
{
@@ -153,8 +152,6 @@ namespace Server_NapCha_ui_API
153152
}
154153

155154

156-
//疑名制造的宇宙无敌,超级牛逼666的API
157-
158155
public HintServiceMeow.Core.Models.Hints.Hint 更新提示(Player 玩家, HintServiceMeow.Core.Models.Hints.Hint existingHint = null, string newText = "Server_NapCha_ui_API_FileName_null_text")
159156
{
160157
if (existingHint != null)
@@ -166,7 +163,7 @@ namespace Server_NapCha_ui_API
166163
}
167164
else
168165
{
169-
// 如果没有找到现有提示,可以选择抛出异常或记录日志
166+
170167
Log.Error("Server_NapCha_ui_API_FileName 提示不存在,无法更新");
171168
return null;
172169
}
@@ -217,7 +214,7 @@ namespace Server_NapCha_ui_API
217214
}
218215

219216
}
220-
//疑名制造的宇宙无敌,超级牛逼666的API
217+
221218

222219
public void 清空阵营(Player 玩家)
223220
{
@@ -241,14 +238,14 @@ namespace Server_NapCha_ui_API
241238
{
242239
无伤害.Remove(玩家);
243240
}
244-
} //疑名制造的宇宙无敌,超级牛逼666的API
241+
}
245242

246243

247244
public System.TimeSpan 获取回合时间()
248245
{
249246
return Round.ElapsedTime;
250247
}
251-
//疑名制造的宇宙无敌,超级牛逼666的API
248+
252249

253250
public void 设置血量(Player ev = null, int 血量 = 100)
254251
{
@@ -265,7 +262,7 @@ namespace Server_NapCha_ui_API
265262
{
266263
return Player.List.Count;
267264
}
268-
//疑名制造的宇宙无敌,超级牛逼666的API
265+
269266

270267
public int 获取观察者人数()
271268
{
@@ -279,8 +276,7 @@ namespace Server_NapCha_ui_API
279276
}
280277
return s1;
281278
}
282-
//疑名制造的宇宙无敌,超级牛逼666的API
283-
279+
284280
public void 添加特殊角色列表(Player ev)
285281
{
286282
if (特殊角色列表.Contains(ev))
@@ -289,7 +285,7 @@ namespace Server_NapCha_ui_API
289285
}
290286
特殊角色列表.Add(ev);
291287
}
292-
//疑名制造的宇宙无敌,超级牛逼666的API
288+
293289

294290
public void 移除特殊角色列表(Player ev)
295291
{
@@ -298,7 +294,7 @@ namespace Server_NapCha_ui_API
298294
特殊角色列表.Remove(ev);
299295
}
300296
}
301-
//疑名制造的宇宙无敌,超级牛逼666的API
297+
302298

303299
public bool 检查角色是否在特殊角色列表中(Player ev)
304300
{
@@ -314,13 +310,13 @@ namespace Server_NapCha_ui_API
314310

315311
public float SCPs173()
316312
{
317-
float s173 = 0; // 或者根据需要给定合适的初始值
313+
float s173 = 0;
318314
foreach (Player player in Player.List)
319315
{
320316
if (player.Role.Type == PlayerRoles.RoleTypeId.Scp173)
321317
{
322318
s173 = player.Health;
323-
return s173; // 直接返回Scp173的血量
319+
return s173;
324320
}
325321
}
326322
return 0;

0 commit comments

Comments
 (0)