public TargetEntity(Region tregion) : base(tregion) { model = "players/human_male_004"; mod_zrot = 270; mod_scale = 1.5f; Damageable().SetMaxHealth(100); Damageable().SetHealth(100); SetMass(70); Items = new EntityInventory(tregion, this); // TODO: Better way to gather item details! Items.GiveItem(TheServer.Items.GetItem("weapons/rifles/m4")); Items.GiveItem(new ItemStack("bullet", "rifle_ammo", TheServer, 1000, "items/weapons/ammo/rifle_round_ico", "Assault Rifle Ammo", "Very rapid!", Color4F.White, "items/weapons/ammo/rifle_round", false, 0)); Items.cItem = 1; Items.Items[0].Info.PrepItem(this, Items.Items[0]); ShouldShine = true; Damageable().EffectiveDeathEvent.AddEvent((e) => { if (Removed) { return; } TheRegion.Explode(GetPosition(), 5); RemoveMe(); }, this, 0); }
public override void Die() { if (Removed) { return; } TheRegion.Explode(GetPosition(), 5); RemoveMe(); }
public override void Tick() { timer += TheRegion.Delta; if (timer > boomtime) { RemoveMe(); TheRegion.Explode(GetPosition()); // TODO: Damage settings, etc. } else { base.Tick(); } }