Пример #1
0
        public override bool FireEvent(Event E)
        {
            if (E.ID == "BeforeDeathRemoval")
            {
                Cell dropCell = ParentObject.GetDropCell();
                if (dropCell != null)
                {
                    if (Chance != 0 && Stat.Rnd2.NextDouble() < Chance / 100f)
                    {
                        dropCell.AddObject(CreateSeed());
                    }
                }
            }
            if (E.ID == "GetInventoryActions")
            {
                if (ParentObject.pPhysics.CurrentCell != null)
                {
                    E.GetParameter <EventParameterGetInventoryActions>("Actions").AddAction("CollectSeeds", 'C', false, "&WC&yollect seeds", "InvCommandCollectSeeds", 5);
                }
            }
            else if (E.ID == "InvCommandCollectSeeds")
            {
                CollectSeeds(E.GetParameter <GameObject>("Owner"));
                E.RequestInterfaceExit();
            }


            return(base.FireEvent(E));
        }