Ejemplo n.º 1
0
        public override bool FireEvent(Event E)
        {
            if (E.ID == "EndTurn" &&
                !ParentObject.AreHostilesNearby() &&
                ParentObject.CurrentCell.ParentZone.Z <= 10 &&
                string.IsNullOrEmpty(ParentObject.CurrentCell.GroundLiquid) &&
                Stat.Random(1, 20) == 20)
            {
                GameObject Water = GameObjectFactory.Factory.CreateObject("Water", Stat.Random(1, 4));
                ParentObject.CurrentCell.AddObject(Water);
            }

            return(base.FireEvent(E));
        }
Ejemplo n.º 2
0
        public override bool FireEvent(Event E)
        {
            if (E.ID == "CommandCustomsBusking")
            {
                if (ParentObject.pPhysics != null && ParentObject.pPhysics.IsFrozen())
                {
                    if (ParentObject.IsPlayer())
                    {
                        Popup.Show("You are frozen solid!", true);
                    }
                    return(true);
                }
                if (ParentObject.AreHostilesNearby())
                {
                    if (ParentObject.IsPlayer())
                    {
                        Popup.Show("You can't perform with enemies nearby!", true);
                    }
                    return(true);
                }
                int rand  = Stat.Roll("5d6");
                int dur   = 120 + rand;
                int range = 6;
                int count = 0;
                List <GameObject> effected = new List <GameObject>();
                Cell current = ParentObject.CurrentCell;

                if (current != null)
                {
                    if (ParentObject.IsPlayer())
                    {
                        MessageQueue.AddPlayerMessage("&gYou lay down a tin nearby and begin your performance. &y");
                    }

                    foreach (GameObject viewer in current.ParentZone.FastSquareSearch(current.X, current.Y, range, "Combat"))
                    {
                        if (viewer != ParentObject)
                        {
                            if (ParentObject.DistanceTo(viewer) <= range && viewer.HasPart("Brain") && !viewer.pBrain.IsHostileTowards(ParentObject) &&
                                !effected.Contains(viewer))
                            {
                                Cell target = viewer.CurrentCell;
                                if (target != null)
                                {
                                    effected.Add(viewer);
                                    BuskingEffect(target, viewer);
                                }
                            }
                        }
                    }

                    if (count > 1 && ParentObject.AreHostilesNearby())
                    {
                        count = dur;
                        if (ParentObject.IsPlayer())
                        {
                            Popup.Show("Your performance is interrupted! &y");
                        }
                    }
                    while (count < dur)
                    {
                        if (ParentObject.IsValid())
                        {
                            ParentObject.UseEnergy(1000, "Pass", null);
                            count = count + 1;
                        }
                    }
                    if (count == dur)
                    {
                        if (ParentObject.IsPlayer())
                        {
                            MessageQueue.AddPlayerMessage("&gYou wrap up your show. &y");
                        }

                        effected.Clear();
                    }
                }
            }

            return(base.FireEvent(E));
        }