Esempio n. 1
0
 public bool method_82(GameClient Session, RoomItem RoomItem_0, bool bool_13, string string_10)
 {
     if (bool_13)
     {
         RoomItem_0.Interactor.OnPlace(Session, RoomItem_0);
         string text = RoomItem_0.GetBaseItem().InteractionType.ToLower();
         if (text != null && text == "dimmer" && this.MoodlightData == null)
         {
             this.MoodlightData = new MoodlightData(RoomItem_0.Id);
             RoomItem_0.ExtraData = this.MoodlightData.method_7();
         }
         if (!this.mAddedItems.ContainsKey(RoomItem_0.Id))
         {
             this.mAddedItems.Add(RoomItem_0.Id, RoomItem_0);
             if (RoomItem_0.IsFloorItem)
             {
                 this.mFloorItems.Add(RoomItem_0.Id, RoomItem_0);
             }
             else
             {
                 if (!this.mWallItems.Contains(RoomItem_0.Id))
                 {
                     this.mWallItems.Add(RoomItem_0.Id, RoomItem_0);
                 }
             }
         }
         ServerMessage Message5_ = new ServerMessage(83u);
         RoomItem_0.Serialize(Message5_);
         this.SendMessage(Message5_, null);
     }
     else
     {
         if (!this.mMovedItems.Contains(RoomItem_0.Id))
         {
             this.mMovedItems.Add(RoomItem_0.Id, RoomItem_0);
         }
     }
     if (!bool_13)
     {
         RoomItem_0.string_7 = string_10;
         ServerMessage Message5_ = new ServerMessage(85u);
         RoomItem_0.Serialize(Message5_);
         this.SendMessage(Message5_, null);
     }
     return true;
 }
Esempio n. 2
0
        public bool method_79(GameClient Session, RoomItem RoomItem_0, int int_17, int int_18, int int_19, bool bool_13, bool bool_14, bool bool_15)
        {
            Dictionary<int, AffectedTile> dictionary = this.GetAffectedTiles(RoomItem_0.GetBaseItem().Length, RoomItem_0.GetBaseItem().Width, int_17, int_18, int_19);
            bool result;
            if (!this.ValidTile(int_17, int_18))
            {
                result = false;
            }
            else
            {
                foreach (AffectedTile current in dictionary.Values)
                {
                    if (!this.ValidTile(current.X, current.Y))
                    {
                        result = false;
                        return result;
                    }
                }
                double num = this.Model.SqFloorHeight[int_17, int_18];
                if (!bool_14)
                {
                    if (RoomItem_0.Rot == int_19 && RoomItem_0.GetX == int_17 && RoomItem_0.GetY == int_18 && RoomItem_0.GetZ != num)
                    {
                        result = false;
                        return result;
                    }
                    if (this.Model.SqState[int_17, int_18] != SquareState.OPEN)
                    {
                        result = false;
                        return result;
                    }
                    foreach (AffectedTile current in dictionary.Values)
                    {
                        if (this.Model.SqState[current.X, current.Y] != SquareState.OPEN)
                        {
                            result = false;
                            return result;
                        }
                    }
                    if (RoomItem_0.GetBaseItem().IsSeat || RoomItem_0.IsRoller)
                    {
                        goto IL_1FE;
                    }
                    if (this.method_97(int_17, int_18))
                    {
                        result = false;
                        return result;
                    }
                    using (Dictionary<int, AffectedTile>.ValueCollection.Enumerator enumerator = dictionary.Values.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            AffectedTile current = enumerator.Current;
                            if (this.method_97(current.X, current.Y))
                            {
                                result = false;
                                return result;
                            }
                        }
                        goto IL_1FE;
                    }
                }
                if (this.Model.SqState[int_17, int_18] != SquareState.OPEN)
                {
                    result = false;
                    return result;
                }
                if (!bool_15 && this.method_97(int_17, int_18))
                {
                    result = false;
                    return result;
                }
            IL_1FE:
                List<RoomItem> list = this.method_93(int_17, int_18);
                List<RoomItem> list2 = new List<RoomItem>();
                List<RoomItem> list3 = new List<RoomItem>();
                foreach (AffectedTile current in dictionary.Values)
                {
                    List<RoomItem> list4 = this.method_93(current.X, current.Y);
                    if (list4 != null)
                    {
                        list2.AddRange(list4);
                    }
                }
                if (list == null)
                {
                    list = new List<RoomItem>();
                }
                list3.AddRange(list);
                list3.AddRange(list2);
                int num2 = 0;
                foreach (RoomItem current2 in list3)
                {
                    if (current2 != null && current2.Id != RoomItem_0.Id && current2.GetBaseItem() != null)
                    {
                        if (!current2.GetBaseItem().Stackable)
                        {
                            result = false;
                            return result;
                        }
                        if (RoomItem_0.GetBaseItem().InteractionType.ToLower() == "wf_trg_timer" && current2.GetBaseItem().InteractionType.ToLower() == "wf_trg_timer")
                        {
                            result = false;
                            return result;
                        }
                        if (RoomItem_0.GetBaseItem().InteractionType.ToLower() == "ball")
                        {
                            if (current2.GetBaseItem().InteractionType.ToLower() == "blue_goal")
                            {
                                num2 = 11;
                            }
                            if (current2.GetBaseItem().InteractionType.ToLower() == "red_goal")
                            {
                                num2 = 5;
                            }
                            if (current2.GetBaseItem().InteractionType.ToLower() == "yellow_goal")
                            {
                                num2 = 14;
                            }
                            if (current2.GetBaseItem().InteractionType.ToLower() == "green_goal")
                            {
                                num2 = 8;
                            }
                        }
                    }
                }
                if (num2 > 0)
                {
                    this.method_89(num2, RoomItem_0, false);
                }
                if (!RoomItem_0.IsRoller)
                {
                    if (RoomItem_0.Rot != int_19 && RoomItem_0.GetX == int_17 && RoomItem_0.GetY == int_18)
                    {
                        num = RoomItem_0.GetZ;
                    }
                    foreach (RoomItem current2 in list3)
                    {
                        if (current2.Id != RoomItem_0.Id && current2.TotalHeight > num)
                        {
                            num = current2.TotalHeight;
                        }
                    }
                }
                if (int_19 != 0 && int_19 != 2 && int_19 != 4 && int_19 != 6 && int_19 != 8)
                {
                    int_19 = 0;
                }
                Dictionary<int, AffectedTile> dictionary2 = new Dictionary<int, AffectedTile>();
                dictionary2 = this.GetAffectedTiles(RoomItem_0.GetBaseItem().Length, RoomItem_0.GetBaseItem().Width, RoomItem_0.GetX, RoomItem_0.GetY, RoomItem_0.Rot);
                int num3 = 0;
                int num4 = 0;
                if (!bool_13)
                {
                    num3 = RoomItem_0.GetX;
                    num4 = RoomItem_0.GetY;
                }
                RoomItem_0.Rot = int_19;
                RoomItem_0.method_0(int_17, int_18, num);
                if (!bool_14 && Session != null)
                {
                    RoomItem_0.Interactor.OnPlace(Session, RoomItem_0);
                }
                if (bool_13)
                {
                    if (this.mRemovedItems.Contains(RoomItem_0.Id))
                    {
                        this.mRemovedItems.Remove(RoomItem_0.Id);
                    }
                    if (this.mAddedItems.Contains(RoomItem_0.Id))
                    {
                        result = false;
                        return result;
                    }
                    this.mAddedItems.Add(RoomItem_0.Id, RoomItem_0);
                    if (RoomItem_0.IsFloorItem)
                    {
                        if (this.mFloorItems.Contains(RoomItem_0.Id))
                        {
                            this.mFloorItems.Remove(RoomItem_0.Id);
                        }
                        this.mFloorItems.Add(RoomItem_0.Id, RoomItem_0);
                    }
                    else
                    {
                        if (this.mWallItems.Contains(RoomItem_0.Id))
                        {
                            this.mWallItems.Remove(RoomItem_0.Id);
                        }
                        this.mWallItems.Add(RoomItem_0.Id, RoomItem_0);
                    }
                    ServerMessage Message5_ = new ServerMessage(93u);
                    RoomItem_0.Serialize(Message5_);
                    this.SendMessage(Message5_, null);
                    string text = RoomItem_0.GetBaseItem().InteractionType.ToLower();
                    switch (text)
                    {
                        case "bb_patch":
                            this.bbTiles.Add(RoomItem_0);
                            if (RoomItem_0.ExtraData == "5")
                            {
                                this.bbrTiles.Add(RoomItem_0);
                            }
                            else
                            {
                                if (RoomItem_0.ExtraData == "8")
                                {
                                    this.bbgTiles.Add(RoomItem_0);
                                }
                                else
                                {
                                    if (RoomItem_0.ExtraData == "11")
                                    {
                                        this.bbbTiles.Add(RoomItem_0);
                                    }
                                    else
                                    {
                                        if (RoomItem_0.ExtraData == "14")
                                        {
                                            this.bbyTiles.Add(RoomItem_0);
                                        }
                                    }
                                }
                            }
                            break;
                        case "blue_score":
                            this.BlueScoreboards.Add(RoomItem_0);
                            break;
                        case "green_score":
                            this.GreenScoreboards.Add(RoomItem_0);
                            break;
                        case "red_score":
                            this.RedScoreboards.Add(RoomItem_0);
                            break;
                        case "yellow_score":
                            this.YellowScoreboards.Add(RoomItem_0);
                            break;
                        case "stickiepole":
                            this.StickiePoles.Add(RoomItem_0);
                            break;
                        case "wf_trg_onsay":
                        case "wf_trg_enterroom":
                        case "wf_trg_furnistate":
                        case "wf_trg_onfurni":
                        case "wf_trg_offfurni":
                        case "wf_trg_gameend":
                        case "wf_trg_gamestart":
                        case "wf_trg_attime":
                        case "wf_trg_atscore":
                            if (!this.WF_Triggers.Contains(RoomItem_0))
                            {
                                this.WF_Triggers.Add(RoomItem_0);
                            }
                            break;
                        case "wf_trg_timer":
                            if (RoomItem_0.Extra1.Length <= 0)
                            {
                                RoomItem_0.Extra1 = "10";
                            }
                            if (!this.WF_Triggers.Contains(RoomItem_0))
                            {
                                this.WF_Triggers.Add(RoomItem_0);
                            }
                            RoomItem_0.TimerRunning = true;
                            RoomItem_0.ReqUpdate(1);
                            break;
                        case "wf_act_saymsg":
                        case "wf_act_moveuser":
                        case "wf_act_togglefurni":
                        case "wf_act_givepoints":
                        case "wf_act_moverotate":
                        case "wf_act_matchfurni":
                        case "wf_act_give_phx":
                            if (!this.WF_Effects.Contains(RoomItem_0))
                            {
                                this.WF_Effects.Add(RoomItem_0);
                            }
                            break;
                        case "wf_cnd_trggrer_on_frn":
                        case "wf_cnd_furnis_hv_avtrs":
                        case "wf_cnd_has_furni_on":
                        case "wf_cnd_phx":
                            if (!this.WF_Conditions.Contains(RoomItem_0))
                            {
                                this.WF_Conditions.Add(RoomItem_0);
                            }
                            break;
                    }
                }
                else
                {
                    if (!this.mMovedItems.Contains(RoomItem_0.Id) && !this.mAddedItems.ContainsKey(RoomItem_0.Id))
                    {
                        this.mMovedItems.Add(RoomItem_0.Id, RoomItem_0);
                    }
                    if (RoomItem_0.GetBaseItem().InteractionType.ToLower() == "wf_act_give_phx" && Session != null)
                    {
                        string text2 = RoomItem_0.Extra1.Split(new char[]
						{
							':'
						})[0].ToLower();
                        if (!PhoenixEnvironment.GetGame().GetRoleManager().HasWiredEffectRole(text2, Session))
                        {
                            RoomItem_0.Extra1 = "";
                        }
                    }
                    if (RoomItem_0.GetBaseItem().InteractionType.ToLower() == "wf_cnd_phx" && Session != null)
                    {
                        string text2 = RoomItem_0.Extra1.Split(new char[]
						{
							':'
						})[0].ToLower();
                        if (!PhoenixEnvironment.GetGame().GetRoleManager().HasWiredConditionRole(text2, Session))
                        {
                            RoomItem_0.Extra1 = "";
                        }
                    }
                    ServerMessage Message5_ = new ServerMessage(95u);
                    RoomItem_0.Serialize(Message5_);
                    this.SendMessage(Message5_, null);
                }
                this.GenerateMaps();
                if (!bool_14)
                {
                    this.UpdateUserStatus(this.GetUserForSquare(int_17, int_18), true, true);
                    foreach (AffectedTile current in dictionary.Values)
                    {
                        this.UpdateUserStatus(this.GetUserForSquare(current.X, current.Y), true, true);
                    }
                    if (num3 > 0 || num4 > 0)
                    {
                        this.UpdateUserStatus(this.GetUserForSquare(num3, num4), true, true);
                    }
                    foreach (AffectedTile current in dictionary2.Values)
                    {
                        this.UpdateUserStatus(this.GetUserForSquare(current.X, current.Y), true, true);
                    }
                }
                result = true;
            }
            return result;
        }