Ejemplo n.º 1
0
 public override void ServerInit()
 {
     this._collider     = ((Component)this).get_transform().GetComponentInChildrenIncludeDisabled <Collider>();
     this.propDirection = PrefabAttribute.server.FindAll <DirectionProperties>(this.prefabID);
     if (this.ResetLifeStateOnSpawn)
     {
         this.InitializeHealth(this.StartHealth(), this.StartMaxHealth());
         this.lifestate = BaseCombatEntity.LifeState.Alive;
     }
     base.ServerInit();
 }
Ejemplo n.º 2
0
 public override void Load(BaseNetworkable.LoadInfo info)
 {
     if (this.isServer)
     {
         this.lifestate = BaseCombatEntity.LifeState.Alive;
     }
     if (info.msg.baseCombat != null)
     {
         this.lifestate = (BaseCombatEntity.LifeState)((BaseCombat)info.msg.baseCombat).state;
         this._health   = (float)((BaseCombat)info.msg.baseCombat).health;
     }
     base.Load(info);
 }
Ejemplo n.º 3
0
 public void DieInstantly()
 {
     if (this.IsDead())
     {
         return;
     }
     if (Global.developer > 1)
     {
         Debug.Log((object)("[Combat]".PadRight(10) + ((Object)((Component)this).get_gameObject()).get_name() + " died"));
     }
     this.health    = 0.0f;
     this.lifestate = BaseCombatEntity.LifeState.Dead;
     this.OnKilled((HitInfo)null);
 }
 public void DieInstantly()
 {
     if (this.IsDead())
     {
         return;
     }
     if (ConVar.Global.developer > 1)
     {
         Debug.Log(string.Concat("[Combat]".PadRight(10), base.gameObject.name, " died"));
     }
     this.health    = 0f;
     this.lifestate = BaseCombatEntity.LifeState.Dead;
     this.OnKilled(null);
 }
Ejemplo n.º 5
0
 public virtual void Die(HitInfo info = null)
 {
     if (this.IsDead())
     {
         return;
     }
     Interface.CallHook("OnEntityDeath", (object)this, (object)info);
     if (Global.developer > 1)
     {
         Debug.Log((object)("[Combat]".PadRight(10) + ((Object)((Component)this).get_gameObject()).get_name() + " died"));
     }
     this.health    = 0.0f;
     this.lifestate = BaseCombatEntity.LifeState.Dead;
     using (TimeWarning.New("OnKilled", 0.1f))
         this.OnKilled(info);
 }
 public virtual void Die(HitInfo info = null)
 {
     if (this.IsDead())
     {
         return;
     }
     Interface.CallHook("OnEntityDeath", this, info);
     if (ConVar.Global.developer > 1)
     {
         Debug.Log(string.Concat("[Combat]".PadRight(10), base.gameObject.name, " died"));
     }
     this.health    = 0f;
     this.lifestate = BaseCombatEntity.LifeState.Dead;
     using (TimeWarning timeWarning = TimeWarning.New("OnKilled", 0.1f))
     {
         this.OnKilled(info);
     }
 }
Ejemplo n.º 7
0
 public virtual void InitializeHealth(float newhealth, float newmax)
 {
     this._maxHealth = newmax;
     this._health    = newhealth;
     this.lifestate  = BaseCombatEntity.LifeState.Alive;
 }