-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFileName0
57 lines (54 loc) · 2.44 KB
/
FileName0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using Exiled.Events.EventArgs.Player;
using PlayerRoles;
using System.Collections.Generic;
namespace Server_NapCha_ui_API
{
// 处理伤害事件的类
public class FileName0
{
// 处理伤害的具体方法
public void 伤害处理程序(HurtingEventArgs hut) // 伤害处理程序
{
if (hut.Attacker == null || hut.Player == null)
{
return;
}
bool isAttackerSCP = Server_NapCha_API.Server_NapCha_API.SCPs.Contains(hut.Attacker);
bool isPlayerSCP = Server_NapCha_API.Server_NapCha_API.SCPs.Contains(hut.Player);
bool isAttackerNTF = Server_NapCha_API.Server_NapCha_API.ntf.Contains(hut.Attacker);
bool isPlayerNTF = Server_NapCha_API.Server_NapCha_API.ntf.Contains(hut.Player);
bool isAttackerCS = Server_NapCha_API.Server_NapCha_API.cs.Contains(hut.Attacker);
bool isPlayerCS = Server_NapCha_API.Server_NapCha_API.cs.Contains(hut.Player);
bool isAttackerZL = Server_NapCha_API.Server_NapCha_API.zl.Contains(hut.Attacker);
bool isPlayerZL = Server_NapCha_API.Server_NapCha_API.zl.Contains(hut.Player);
bool isAttackerNoDamage = Server_NapCha_API.Server_NapCha_API.无伤害.Contains(hut.Attacker);
// 根据不同团队的攻击者和玩家的角色决定是否允许伤害
if ((isPlayerSCP && hut.Attacker.Role.Team == Team.SCPs) ||
(isAttackerSCP && hut.Player.Role.Team == Team.SCPs) ||
(isAttackerSCP && isPlayerSCP))
{
hut.IsAllowed = false;
}
else if ((isPlayerNTF && hut.Attacker.Role.Team == Team.FoundationForces) ||
(isAttackerNTF && hut.Player.Role.Team == Team.FoundationForces) ||
(isAttackerNTF && isPlayerNTF))
{
hut.IsAllowed = false;
}
else if ((isPlayerCS && hut.Attacker.Role.Team == Team.ChaosInsurgency) ||
(isAttackerCS && hut.Player.Role.Team == Team.ChaosInsurgency) ||
(isAttackerCS && isPlayerCS))
{
hut.IsAllowed = false;
}
else if ((isPlayerZL && hut.Attacker != null) || isAttackerZL)
{
hut.IsAllowed = false;
}
else if (isAttackerNoDamage)
{
hut.IsAllowed = true;
}
}
}
}