Ejemplo n.º 1
0
        public void ChargeVisionAbility()
        {
            Cell currentCell = ParentObject.CurrentCell;

            if (currentCell != null)
            {
                int radius = 7;
                foreach (GameObject item in currentCell.ParentZone.FastSquareSearch(currentCell.X, currentCell.Y, radius, "Combat"))
                {
                    if (ParentObject.DistanceTo(item) <= radius && !item.HasEffect("Electrovoyance") && (ParentObject.HasPart("Robot") ||
                                                                                                         ParentObject.HasPart("BaseRobot") ||
                                                                                                         ParentObject.HasPart("UniversalCharger") ||
                                                                                                         ParentObject.HasPart("ElectricalPowerTransmission")))
                    {
                        item.ApplyEffect(new Electravoyance(base.Level, ParentObject));
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public override bool FireEvent(Event E)
 {
     if (E.ID == "AIGetOffensiveMutationList")
     {
         int                  intParameter        = E.GetIntParameter("Distance");
         GameObject           gameObjectParameter = E.GetGameObjectParameter("Target");
         List <AICommandList> list = (List <AICommandList>)E.GetParameter("List");
         if (pActivatedAbility != null && !ParentObject.AreHostilesAdjacent() && pActivatedAbility.Cooldown <= 0 && intParameter > 3 && !ParentObject.AreHostilesAdjacent() && intParameter < 6 + ParentObject.GetIntProperty("LungeRangeModifier") && ParentObject.HasLOSTo(gameObjectParameter))
         {
             List <Cell> list2 = PickLine(2, AllowVis.OnlyVisible);
             if (list2 == null)
             {
                 return(true);
             }
             if (list2.Count != 2)
             {
                 return(true);
             }
             for (int i = 0; i < list2.Count; i++)
             {
                 foreach (GameObject item in list2[i].LoopObjectsWithPart("Combat"))
                 {
                     if (ParentObject.HasPart("Brain") && ParentObject.GetPart <Brain>().GetFeeling(item) >= 0)
                     {
                         return(true);
                     }
                 }
             }
             list.Add(new AICommandList("CommandAcegiakPolearmLunge", 1));
         }
         return(true);
     }
     if (E.ID == "CommandAcegiakPolearmLunge")
     {
         if (!IsPrimaryPolearmEquipped())
         {
             if (ParentObject.IsPlayer())
             {
                 Popup.Show("You must have a polearm equipped to Polearm Lunge.");
             }
             return(true);
         }
         if (ParentObject.OnWorldMap())
         {
             if (ParentObject.IsPlayer())
             {
                 Popup.Show("You cannot Lunge on the world map.");
             }
             return(true);
         }
         if (ParentObject.pPhysics != null && ParentObject.pPhysics.IsFrozen())
         {
             Popup.Show("You are frozen solid!");
             return(true);
         }
         List <Cell> list3 = PickLine(2, AllowVis.OnlyVisible, ValidLungeTarget);
         if (list3 == null)
         {
             return(true);
         }
         int num  = 3;
         int num2 = 2;
         if (list3.Count != num)
         {
             if (IsPlayer())
             {
                 Popup.Show("You must Lunge 2 spaces.");
             }
             return(false);
         }
         if (!list3[list3.Count - 1].HasObjectWithPart("Combat"))
         {
             if (IsPlayer())
             {
                 Popup.Show("You must Lunge at a target!");
             }
             return(false);
         }
         Physics pPhysics = ParentObject.pPhysics;
         string  text     = ParentObject.pRender.ColorString + ParentObject.pRender.RenderString;
         if (ParentObject.IsPlayer())
         {
             list3.RemoveAt(0);
         }
         int num3 = 10;
         foreach (Cell item2 in list3)
         {
             List <GameObject> objectsWithPart = item2.GetObjectsWithPart("Combat");
             if (objectsWithPart.Count > 0)
             {
                 if (objectsWithPart[0].IsPlayer())
                 {
                     IPart.AddPlayerMessage("&R" + ParentObject.The + ParentObject.DisplayName + " &R" + ParentObject.GetVerb("lunge", PrependSpace: false) + " you!");
                 }
                 if (ParentObject.DistanceTo(item2) == 2)
                 {
                     ParentObject.FireEvent(Event.New("CommandAttackCell", "Cell", item2, "Properties", "Lunging"));
                 }
                 pActivatedAbility.Cooldown = 0;
                 ParentObject.FireEvent(Event.New("LungedTarget", "Defender", objectsWithPart[0]));
                 objectsWithPart[0].FireEvent(Event.New("WasLunged", "Attacker", ParentObject));
                 return(true);
             }
         }
     }
     return(base.FireEvent(E));
 }
Ejemplo n.º 3
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));
        }