Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
TypedInjury.cs
浏览该文件的文档.
1namespace Game {
2 public class AttackInjury : Injury {
3 public AttackInjury(float amount, Attackment attackment) : base(
4 amount,
5 attackment?.Attacker?.FindComponent<ComponentCreature>(),
6 false,
7 attackment.CauseOfDeath
8 ) => Attackment = attackment;
9 }
10
11 public class FireInjury : Injury {
12 public FireInjury(float amount, ComponentCreature attacker) : base(
13 amount,
14 attacker,
15 false,
16 LanguageControl.Get(typeof(ComponentHealth).Name, 5)
17 ) { }
18 }
19
20 public class ExplosionInjury : Injury {
21 public ExplosionInjury(float amount) : base(amount, null, false, LanguageControl.Get(typeof(ComponentHealth).Name, 8)) { }
22 }
23
24 public class BlockInjury : Injury {
26
27 protected int m_blockValue;
28
30
31 public int BlockValue {
32 get {
33 if (m_blockValue > 0) {
34 return m_blockValue;
35 }
36 if (SubsystemTerrain == null
37 || CellFace == null) {
38 return -1;
39 }
40 return SubsystemTerrain.Terrain.GetCellValue(CellFace.Value.X, CellFace.Value.Y, CellFace.Value.Z);
41 }
42 set => m_blockValue = value;
43 }
44
45 public BlockInjury(float amount, CellFace? cellFace, string cause, SubsystemTerrain subsystemTerrain) : base(amount, null, false, cause) {
46 CellFace = cellFace;
47 SubsystemTerrain = subsystemTerrain;
48 }
49 }
50
51 public class VitalStatsInjury : Injury {
52 public VitalStatsInjury(float amount, string cause) : base(amount, null, false, cause) { }
53 }
54
55 public class SuicideInjury : Injury {
56 public SuicideInjury(float amount) : base(amount, null, true, LanguageControl.GetContentWidgets(typeof(VitalStatsWidget).Name, "Choked")) { }
57 }
58}
BlockInjury(float amount, CellFace? cellFace, string cause, SubsystemTerrain subsystemTerrain)
SubsystemTerrain SubsystemTerrain
ExplosionInjury(float amount)
FireInjury(float amount, ComponentCreature attacker)
Attackment Attackment
ComponentHealth ComponentHealth
Injury(float amount, ComponentCreature attacker, bool ignoreInvulnerability, string cause)
virtual ComponentCreature Attacker
SuicideInjury(float amount)
VitalStatsInjury(float amount, string cause)