Ejemplo n.º 1
0
        private void ActorState_Dead(object sender, EventArgs e)
        {
            var actor = _actorManager.Items.Single(x => x.Person.Survival == sender);

            Map.ReleaseNode(actor.Node, actor);
            _actorManager.Remove(actor);
            actor.Person.Survival.Dead -= ActorState_Dead;
            ProcessMonsterDeath(actor);
        }
Ejemplo n.º 2
0
        private void ActorState_Dead(object sender, EventArgs e)
        {
            var actor = _actorManager.Items.Single(x => x.State == sender);

            Map.ReleaseNode(actor.Node, actor);
            _actorManager.Remove(actor);
            actor.State.Dead -= ActorState_Dead;

            if (actor.Person is MonsterPerson monsterPerson)
            {
                var monsterScheme = monsterPerson.Scheme;

                var dropSchemes = GetMonsterDropTables(monsterScheme);

                var loot = new DropTableLoot(actor.Node, dropSchemes, _dropResolver);

                if (loot.Content.CalcActualItems().Any())
                {
                    _propContainerManager.Add(loot);
                }
            }
        }