Summary description for Utility
        public void testLandOn()
        {
            Utility util = new Utility();

            //Create two players
            Player p1 = new Player("Bill");
            Player p2 = new Player("Fred", 1500);

            string msg;

            //test landon normally with no rent payable
            msg = util.landOn(ref p1);
            Console.WriteLine(msg);

            //set owner to p1
            util.setOwner(ref p1);

            //move p2 so that utility rent can be calculated
            p2.move();

            //p2 lands on util and should pay rent
            msg = util.landOn(ref p2);
            Console.WriteLine(msg);

            //check that correct rent  has been paid
            decimal balance = 1500 - (6 * p2.getLastMove());
            Assert.AreEqual(balance, p2.getBalance());
        }
示例#2
0
        public void checkin()
        {
            Utility settings = new Utility();
            HttpContext postedContext = HttpContext.Current;
            HttpFileCollection Files = postedContext.Request.Files;
            string serverKey = settings.Decode((string)postedContext.Request.Form["serverKey"]);

            if (serverKey == settings.GetSettings("Server Key"))
            {
                 string mac = settings.Decode((string)postedContext.Request.Form["mac"]);
                 string result = null;
                 try
                 {
                      using (NpgsqlConnection conn = new NpgsqlConnection(Utility.DBString))
                      {
                           NpgsqlCommand cmd = new NpgsqlCommand("client_checkin", conn);
                           cmd.CommandType = CommandType.StoredProcedure;
                           cmd.Parameters.Add(new NpgsqlParameter("@mac", mac));
                           conn.Open();
                           result = cmd.ExecuteScalar() as string;
                      }
                 }
                 catch (Exception ex)
                 {
                      result = "Could Not Check In.  Check The Exception Log For More Info";
                      Logger.Log(ex.ToString());
                 }
                 HttpContext.Current.Response.Write(result);
            }
            else
            {
                 Logger.Log("Incorrect Key For Client Checkin Was Provided");
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        //Instantiate utility object
            Utility Util = new Utility();

            //Instantiate recipe of the day database field
            RecipeoftheDay Recipe = new RecipeoftheDay();

            Recipe.fillup();

            RanCat.NavigateUrl = "category.aspx?catid=" + Recipe.CatID;
            RanCat.Text = Recipe.Category;
            RanCat.ToolTip = "Browse " + Recipe.Category + " category";

            rdetails.NavigateUrl = "recipedetail.aspx?id=" + Recipe.ID;
            rdetails.Text = "Read more...";
            rdetails.ToolTip = "Read full details of " + Recipe.RecipeName + " recipe";

            lbrecname.Text = Recipe.RecipeName;
            lbingred.Text = Util.FormatText(Recipe.Ingredients);
            lbinstruct.Text = Util.FormatText(Recipe.Instructions);
            lbhits.Text = Recipe.Hits.ToString();
            lblrating.Text = Recipe.Rating;
            lbvotes.Text = Recipe.NoRates.ToString();

            rateimage.ImageUrl = Utility.GetStarImage(Recipe.Rating);

            //Release allocated memory
            Util = null;
            Recipe = null;
    }
示例#4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        FeedRepository feed = new FeedRepository();
        Utility Util = new Utility();
        //Page.Validate( = false;

        if (!Page.IsPostBack)
        {
            feed.FillUp((int)Util.Val(Request.QueryString["id"]));
            title.Value = feed.Title;
            Author.Value = feed.Author;
            Link.Value = feed.Link;
            Summary.Value = feed.Summary;
            Description.Value = feed.Description;
            GetDropdownCategoryList(feed.CategoryID);
            GetDropdownStateList(feed.isValid);
            GetCheckBoxDisplayInList(feed.DisplayIn);
            FeedID.Value = Util.Val(Request.QueryString["id"]).ToString();
            if (constant.FeedCategory[feed.CategoryID].Name == "JOBS")
            {
                isJob.Visible = false;
            }
        }
        feed = null;
        Util = null;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //Instantiate object
        Utility Util = new Utility();

        //Instantiate database field
        RecipeDetails Recipe = new RecipeDetails();

        Recipe.WhatPageID = constant.intRecipeDetails; //1 = we are dealing with print.aspx use the same as recipedetails.
        Recipe.ID = (int)Util.Val(Request.QueryString["id"]);

        //Fill up database fields
        Recipe.fillup();

        lblingredientsdis.Text = "Ingredients:";
        lblinstructionsdis.Text = "Instructions:";
        lblname.Text = Recipe.RecipeName;
        lblIngredients.Text = Util.FormatText(Recipe.Ingredients);
        lblInstructions.Text = Util.FormatText(Recipe.Instructions);

        strRName = "Printing" + Recipe.RecipeName + " Recipe";

        //Release allocated memory
        Util = null;
        Recipe = null;
    }
示例#6
0
 void Start()
 {
     if (!instance)
         instance = this;
     else
         Debug.LogError ("Utility not an instance");
 }
    //Handles search button click
    public void SearchButton_Click(Object s, EventArgs e)
    {
        //Instantiate validation object
        Utility Util = new Utility();

        //Check for minimum keyword character
        int MinuiumSearchWordLength = 2;
        int SearchWordLength;
        SearchWordLength = find.Value.Length;
        if (SearchWordLength <= MinuiumSearchWordLength)
        {
            //Redirect to keyword too short page
            Util.PageRedirect(10);
        }

        if (this.SelectedValue != null)
        {
            SDropName.SelectedValue = this.SelectedValue;
        }

        string targetUrl = "searcharticle.aspx";

        targetUrl += "?find=" + Util.FormatTextForInput(find.Value) + "&catid=" + SDropName.SelectedValue;

        //Redirect to the search page
        Response.Redirect(targetUrl);

        Util = null;
    }
示例#8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Utility utility = new Utility();
        WDSUser user = new WDSUser();
        user.ID = user.GetID(HttpContext.Current.User.Identity.Name);
        user = user.Read(user);

        if (utility.GetSettings("On Demand") == "Disabled")
        {
            secure.Visible = false;
            secureMsg.Text = "On Demand Mode Has Been Globally Disabled";
            secureMsg.Visible = true;
        }
        else if (user.OndAccess == "0")
        {
             secure.Visible = false;
             secureMsg.Text = "On Demand Mode Has Been Disabled For This Account";
             secureMsg.Visible = true;
        }
        else
        {
             secure.Visible = true;
             secureMsg.Visible = false;
        }
        if (!IsPostBack)
        {
            ddlImage.DataSource = Utility.PopulateImagesDdl();
            ddlImage.DataBind();
            ddlImage.Items.Insert(0, "Select Image");
        }
    }
示例#9
0
    protected void btnSignin_Click(object sender, ImageClickEventArgs e)
    {
        ////assign session value
        //Session["user"] = txtUser.Text;

        ////fill variable
        //string user = Session["user"].ToString();

        //if (txtUser.Text == "admin" || txtUser.Text == "school" || txtUser.Text == "parent")
        //{
        //    Response.Redirect("~/Logged_Pages/Home.aspx");
        //}

        //-------------------------------------------------------
        //create object Utility class
        Utility utl = new Utility();

        //get user level after compair passwords
        string userLevel=utl.checkLoggin(txtUser.Text, txtPass.Text);

        if (userLevel != "error")
         {
            //assign user level to the session
             Session["userLevel"] = userLevel;

             //assign session value
             Session["user"] = txtUser.Text;

            //go to Logged home page
             Response.Redirect("~/Logged_Pages/Home.aspx");
         }
    }
        public CommandExecutionResult Execute(OpenQA.Selenium.IWebDriver driver)
        {
            try
            {
                if (!string.IsNullOrEmpty(Value))
                {
                    Target = Target + "|text=" + Value;
                }
                IWebElement[] elements;
                try
                {
                    elements = new Utility(1).GetTargetElements(driver, Target);
                }
                catch (StaleElementReferenceException ex)
                {
                    //retrying
                    elements = new Utility(1).GetTargetElements(driver, Target);
                }
                if (elements.Length > 1)
                    return new CommandExecutionResult { CommandResult = CommandResult.ResultYieldedMoreThanOne, Message = string.Format("More than one element found for target:{0} value:{1}", Target, Value) };
                if (elements.Length == 1)
                    return new CommandExecutionResult { CommandResult = CommandResult.CannotFindElement, Message = string.Format("Cannot find target:{0} value:{1}", Target, Value) };
                return new CommandExecutionResult { CommandResult = CommandResult.Success, Message = string.Empty };
            }
            catch (TimeoutException ex)
            {
                return new CommandExecutionResult { CommandResult = CommandResult.TimedOut, Message = ex.Message };
            }

            catch (Exception ex)
            {
                return new CommandExecutionResult { CommandResult = CommandResult.Failed, Message = ex.Message };
            }
        }
示例#11
0
    public void Update_Article(Object s, EventArgs e)
    {
        ArticleRepository Article = new ArticleRepository();

        Article.ID = (int)Util.Val(Request.QueryString["aid"]);
        Article.UID = int.Parse(Request.Form["Userid"]);
        Article.Title = Request.Form["Title"];
        Article.Content = Request.Form["Content"];
        Article.CatID = int.Parse(Request.Form["ddlarticlecategory"]);
        Article.Keyword = Request.Form["Keyword"];
        Article.Summary = Request.Form["Summary"];

        //Refresh cache
        Caching.PurgeCacheItems("Newest_Articles");
        Caching.PurgeCacheItems("ArticleCategory_SideMenu");

        //Notify user if error occured.
        if (Article.Update(Article) != 0)
        {
            JSLiteral.Text = Util.JSProcessingErrorAlert;
            return;
        }

        //Release allocated memory
        Article = null;

        //If success, redirect to article update confirmation page.
        Util.PageRedirect(7);

        Util = null;
    }
示例#12
0
 public void AddFinalUpdateDelegate(Utility.BaseFunction x)
 {
     if (!this.lxFinalUpdateDelegates.Contains(x))
     {
         this.lxFinalUpdateDelegates.Add(x);
     }
 }
示例#13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Master.IsInMembership("User"))
                Response.Redirect("~/views/dashboard/dash.aspx?access=denied");

            ddlGroupImage.DataSource = Utility.PopulateImagesDdl();
            ddlGroupImage.DataBind();
            ddlGroupImage.Items.Insert(0, "Select Image");

            ddlGroupKernel.DataSource = Utility.GetKernels();
            ddlGroupKernel.DataBind();
            ListItem itemKernel = ddlGroupKernel.Items.FindByText("3.18.1-WDS");
            if (itemKernel != null)
                 ddlGroupKernel.SelectedValue = "3.18.1-WDS";
            else
                ddlGroupKernel.Items.Insert(0, "Select Kernel");

            ddlGroupBootImage.DataSource = Utility.GetBootImages();
            ddlGroupBootImage.DataBind();
            ListItem itemBootImage = ddlGroupBootImage.Items.FindByText("initrd.gz");
            if (itemBootImage != null)
                ddlGroupBootImage.SelectedValue = "initrd.gz";
            else
                ddlGroupBootImage.Items.Insert(0, "Select Boot Image");

            lbScripts.DataSource = Utility.GetScripts();
            lbScripts.DataBind();

            Utility utility = new Utility();
            if (utility.GetSettings("Default Host View") == "all")
                PopulateGrid();
        }
    }
示例#14
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        FeedRepository rfeed = new FeedRepository();
        Utility Util = new Utility();
        Feed feed = new Feed();

        feed.Author = Author.Value;
        feed.Title = title.Value;
        feed.Summary = Summary.Value;
        feed.Description = Description.Value;
        feed.Link = Link.Value;
        feed.CategoryID = Int16.Parse(CategoryName.SelectedValue);
        feed.FeedID = Int32.Parse(FeedID.Value);
        feed.isValid = Int16.Parse(FeedState.SelectedValue);
        feed.DisplayIn = "";
        for (int i = 0; i < CheckBoxDisplayIn.Items.Count; i++)
        {
            if (CheckBoxDisplayIn.Items[i].Selected)
            {
                if (feed.DisplayIn.Length > 0)
                    feed.DisplayIn += ",";
                feed.DisplayIn += CheckBoxDisplayIn.Items[i].Value;
            }
        }
        if (feed.DisplayIn.Length == 0)
            feed.DisplayIn = "-1";
        rfeed.Update(feed);

        feed = null;
        Util = null;
        rfeed = null;
    }
示例#15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Instantiate utility object
            Utility Util = new Utility();

            LyricoftheDay Lyric = LyricoftheDay.GetInstance();

            Lyric.FillUp();

            RanCat.NavigateUrl = "~/category.aspx?catid=" + Lyric.CatID;
            RanCat.Text = Lyric.Category;
            RanCat.ToolTip = "Xem danh mục " + Lyric.Category;

            rdetails.NavigateUrl = "~/lyricdetail.aspx?id=" + Lyric.ID;
            rdetails.Text = "Đọc thêm...";
            rdetails.ToolTip = "Chi tiêt hợp âm " + Lyric.LyricName;

            lbrecname.Text = Lyric.LyricName;
            lbingred.Text = Util.FormatText(Lyric.Ingredients);
            lbinstruct.Text = Util.FormatText(Lyric.Instructions);
            lbhits.Text = Lyric.Hits.ToString();
            lblrating.Text = Lyric.Rating;
            lbvotes.Text = Lyric.NoRates.ToString();

            rateimage.ImageUrl = Utility.GetStarImage(Lyric.Rating);

            Util = null;
    }
示例#16
0
        public Window_Edit(object Id, Utility.EditMode mode)
        {
            this.Id = Id;
            this.mode = mode;
            InitializeComponent();

            switch (mode)
            {
                case Utility.EditMode.CUSTOMER:
                    foreach (GetCustomerFromIdResult it in Utility.database.GetCustomerFromId((string)Id))
                    {
                        TextBox_Name.Text = it.Name;
                        TextBox_Description.Text = it.Description;
                    }
                    break;
                case Utility.EditMode.MODEL:
                    foreach (GetModelFromIdResult it in Utility.database.GetModelFromId((string)Id))
                    {
                        TextBox_Name.Text = it.Name;
                        TextBox_Description.Text = it.Description;
                    }
                    break;
                case Utility.EditMode.COMPONENT:
                    foreach (GetComponentFromComponentIdResult it in Utility.database.GetComponentFromComponentId((string) Id))
                    {
                        TextBox_Name.Text = it.Name;
                        TextBox_Description.Text = it.Description;
                    }
                    break;
            }
        }
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         LoanDSTableAdapters.FinancialsTableAdapter financials = new LoanDSTableAdapters.FinancialsTableAdapter();
         if (!(type == "update"))
         {
             financials.InsertFinancials(MySessionManager.ClientID,
                                         MySessionManager.AppID,
                                         ddMonth.Text,
                                         ddlYear.Text,
                                         txtSales.Text,
                                         txtCostOfSales.Text,
                                         txtGrossProfit.Text,
                                         txtAdminCost.Text,
                                         txtNetProfit.Text,
                                         MySessionManager.CurrentUser.UserID);
         }
         else if (type == "update")
         {
             financials.UpdateFinancials(ddMonth.Text,
                                         ddlYear.Text,
                                         txtSales.Text,
                                         txtCostOfSales.Text,
                                         txtGrossProfit.Text,
                                         txtAdminCost.Text,
                                         txtNetProfit.Text,
                                         MySessionManager.CurrentUser.UserID,
                                         id);
         }
         Utility util = new Utility();
         Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "fiedit"));
     }
 }
        /// <summary>
        /// Prevents a default instance of the <see cref="WeaponCreator"/> class from being created.
        /// </summary>
        public WeaponCreator()
        {
            this.weaponIndication = new Utility();
            this.smithRegister = new Dictionary<int, IWeaponCreator>();

            PrepareFactoryForProduction();
        }
示例#19
0
        void IUtilityCommand.Run(Utility utility, string[] args)
        {
            var modData = Game.ModData = utility.ModData;
            map = new Map(modData, modData.ModFiles.OpenPackage(args[1], new Folder(".")));
            Console.WriteLine("Resizing map {0} from {1} to {2},{3}", map.Title, map.MapSize, width, height);
            map.Resize(width, height);

            var forRemoval = new List<MiniYamlNode>();

            foreach (var kv in map.ActorDefinitions)
            {
                var actor = new ActorReference(kv.Value.Value, kv.Value.ToDictionary());
                var location = actor.InitDict.Get<LocationInit>().Value(null);
                if (!map.Contains(location))
                {
                    Console.WriteLine("Removing actor {0} located at {1} due being outside of the new map boundaries.".F(actor.Type, location));
                    forRemoval.Add(kv);
                }
            }

            foreach (var kv in forRemoval)
                map.ActorDefinitions.Remove(kv);

            map.Save((IReadWritePackage)map.Package);
        }
示例#20
0
        public void Run(Utility.ScheduleItem sched)
        {
            clicked = false;
            scroll = false;
            scheduled = true;
            if (File.Exists(sched.ScriptPath))
            {
                try
                {
                    ListViewItem lvw = new ListViewItem();
                    lvw.Text = "Scheduled Script: " + sched.ScriptName;
                    lvw.SubItems.Add("Running...");
                    lvw.ImageIndex = 4;

                    ps.ParentForm = frm;
                    ps.Script = sched.ScriptPath;
                    ps.IsCommand = false;
                    ps.Clicked = false;
                    ps.IsScheduled = true;
                    ps.ScriptListView = lvw;
                    ps.Parameters = sched.Parameters.Properties;

                    Thread thd = new Thread(ps.RunScript);
                    thd.SetApartmentState(ApartmentState.STA);
                    lvw.Tag = thd;

                    frm.AddActiveScript(lvw);
                    thd.Start();
                }
                catch (Exception e)
                {
                    MessageBox.Show(StringValue.UnhandledException + Environment.NewLine + e.Message + Environment.NewLine + "Stack Trace:" + Environment.NewLine + e.StackTrace);
                }
            }
        }
 public static string GenMutiLang2JSON(System.Resources.ResourceManager[] resources, string[] keys, Utility.MutiLanguage.Languages lang)
 {
     string itemFmt = "[\"{0}\",\"{1}\"],";
     StringBuilder sb = new StringBuilder();
     Dictionary<string, string> d = new Dictionary<string, string>();
     if (keys != null && keys.Length > 0)
     {
         string langStr = Utility.MutiLanguage.EnumToString(lang);
         foreach (string key in keys)
         {
             if (!string.IsNullOrEmpty(key) && !d.ContainsKey(key))
             {
                 string text = key;
                 string value = string.Empty;
                 if (resources != null && resources.Length > 0)
                 {
                     foreach (System.Resources.ResourceManager t in resources)
                     {
                         text = t.GetString(key, new System.Globalization.CultureInfo(Utility.MutiLanguage.EnumToString(lang)));
                         if (!string.IsNullOrEmpty(text))
                             value = text;
                     }
                 }
                 d.Add(key, value);
                 sb.AppendFormat(itemFmt, key, ReplaceSpecailChars(value, true));
             }
         }
     }
     return string.Format("var mtls = [{0}]", sb.ToString().TrimEnd(','));
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            int ID =int.Parse(Request.QueryString["SID"].ToString());
            var Sdetail = SRepo.GetSchedulePromotionById(ID);
            if (Sdetail != null)
            {
                lblUPI.Text = Sdetail.UpiCode;
                lbltitle.Text = Sdetail.Title;
                lblSMSContent.Text = Sdetail.SMSContent;
                ltrWebContent.Text = Sdetail.WebContent;
                lblStartDate.Text = string.Format("{0:d}", Sdetail.StartDate);
                lblEndDate.Text = string.Format("{0:d}",Sdetail.EndDate);
                lblAdmin.Text = SRepo.GetAdministratorName(Sdetail.AdministratorId);

                string phoneList = SRepo.GetSchedulePromotionById(ID).PhoneNumbers;
                phoneList = string.Format("'{0}'", phoneList);
                phoneList = phoneList.Replace(",", "','");
                string sql = "SELECT a.FullName as CustomerName,a.UpiCode, a.Phone, b.FullName,s.PositionName FROM [Customer] as a LEFT JOIN [CustomerSupervisor] as b on a.Id=b.CustomerId left join [SupervisorPosition] as s on b.PositionId=s.Id where a.Phone in (" + phoneList + ")";
                Utility utility = new Utility();
                SchedulePhoneNumbers.DataSource = utility.GetList(sql);

                Utility.SetCurrentMenu("mPromotion");
            }
       }
    }
示例#23
0
        public void Start( Utility.Threading.Action action, Control invoker )
        {
            if( action == null )
            {
                throw new ArgumentNullException( "action" );
            }
            if( invoker == null )
            {
                throw new ArgumentNullException( "invoker" );
            }

            lock( _lock )
            {
                if( _action != null )
                {
                    throw new InvalidOperationException( "Already processing." );
                }

                _action = action;
                _invoker = invoker;
                _progress = new Utility.Threading.Progress();

                OnProcessingBegin( EventArgs.Empty );

                ThreadStart ts = new ThreadStart( ThreadFunc );
                Thread thread = new Thread( ts );

                thread.Start();
            }
        }
示例#24
0
        void IUtilityCommand.Run(Utility utility, string[] args)
        {
            // HACK: The engine code assumes that Game.modData is set.
            var modData = Game.ModData = utility.ModData;

            var actorType = args[1];
            string mapPath = null;

            Map map = null;
            if (args.Length == 3)
            {
                try
                {
                    mapPath = args[2];
                    map = new Map(modData, modData.ModFiles.OpenPackage(mapPath, new Folder(".")));
                }
                catch (InvalidDataException)
                {
                    Console.WriteLine("Could not load map '{0}'.", mapPath);
                    Environment.Exit(2);
                }
            }

            var fs = map ?? modData.DefaultFileSystem;
            var topLevelNodes = MiniYaml.Load(fs, modData.Manifest.Rules, map == null ? null : map.RuleDefinitions);

            var result = topLevelNodes.FirstOrDefault(n => n.Key == actorType);
            if (result == null)
            {
                Console.WriteLine("Could not find actor '{0}' (name is case-sensitive).", actorType);
                Environment.Exit(1);
            }

            Console.WriteLine(result.Value.Nodes.WriteToString());
        }
        public CommandExecutionResult Execute(OpenQA.Selenium.IWebDriver driver)
        {
            try
            {
                int timeout = 10;
                bool isFound = false;
                if (!string.IsNullOrEmpty(Value))
                {
                    Target = Target + "|text=" + Value;
                }
                IWebElement[] elements;
                try
                {
                    isFound= new Utility().WaitingForElement(driver, Target, timeout);
                }
                catch (StaleElementReferenceException ex)
                {
                    //retrying
                    isFound = new Utility().WaitingForElement(driver, Target, timeout);
                }
                if (!isFound)
                    return new CommandExecutionResult { CommandResult = CommandResult.CannotFindElement, Message = string.Format("Cannot find target:{0} value:{1}", Target, Value) };

                return new CommandExecutionResult { CommandResult = CommandResult.Success, Message = string.Empty };
            }
            catch (TimeoutException ex)
            {
                return new CommandExecutionResult { CommandResult = CommandResult.TimedOut, Message = ex.Message };
            }
            catch (Exception ex)
            {
                return new CommandExecutionResult { CommandResult = CommandResult.Failed, Message = ex.Message };
            }
        }
示例#26
0
    protected void btnChange_Click(object sender, EventArgs e)
    {
        Utility utl = new Utility();

        //get user level after compair passwords
        string userLevel = utl.checkLoggin(Session["user"].ToString(), txtCurPas.Text);

        if (userLevel != "error")
        {

            if (txtNewPass.Text == txtConfPass.Text)
            {

                //assigning encripted password form text box & Encript
                Encriptor enc = new Encriptor();
                string password = enc.encript(txtConfPass.Text.ToString());

                //DB_Connect.InsertQuery("UPDATE users_mast SET USER_PASSWORD='******' WHERE USER_USERNAME='******'");
                DB_Connect.InsertQuery("UPDATE users_mast SET USER_PASSWORD='******' WHERE USER_USERNAME='******'");

                lblstatus.Text = "Password Changed.";
            }
            else
            {
                lblstatus.Text = "Passwords Doesnt Match";
            }

        }
        else
        {
            lblstatus.Text = "Current Password Invalid";
        }
    }
示例#27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["access"] as string == "denied")
            lblDenied.Text = "You Are Not Authorized To View That Page";

        Utility utility = new Utility();
    }
示例#28
0
 /// <summary>
 /// Constructor for an ActiveUtility object
 /// </summary>
 /// <param name="utility">A VTankObject Utility</param>
 public ActiveUtility(Utility utility)
 {
     this.utility = utility;
     this.duration = (int)utility.duration;
     this.creationTime = Clock.GetTimeMilliseconds();
     this.expirationTime = this.creationTime + this.duration*1000;
 }
示例#29
0
 void i_PrivmsgEvent( Utility.Net.Chat.IRC.User source, string destination, string message )
 {
     if( message.ToLower( ).StartsWith( ".bopr" ) )
     {
         i.IrcPrivmsg( destination, source.Nickname + ": I have checked " + pos + " / " + total + " blocked IP addresses so far." );
     }
 }
    //Handles insert article
    public void Add_Article(Object s, EventArgs e)
    {
        //Instantiate article information object.
        ArticleInfo AddArticle = new ArticleInfo();

        AddArticle.Title = Request.Form["Title"];
        AddArticle.Content = Request.Form["Content"];
        AddArticle.Author = Request.Form["Author"];
        AddArticle.CatID = (int)Util.Val(Request.QueryString["catid"]);
        AddArticle.Keyword = Request.Form["Keyword"];
        AddArticle.Summary = Request.Form["Summary"];

        //Notify user if error occured.
        if (AddArticle.Add() != 0)
        {
            JSLiteral.Text = "Error occured while processing your submit.";
            return;
        }

        //Release allocated memory
        AddArticle = null;
        Util = null;

        int getlastID;
        getlastID = int.Parse(Label1.Text) + 1;

        //If success, redirect to confirmation and thank you page.
        Response.Redirect("articlepreview.aspx?aid=" + getlastID);
    }
        public EnslavedGreenGoblinAlchemist()
            : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
        {
            this.Name = "Green Goblin Alchemist";
            this.Body = 723;
            this.BaseSoundID = 0x45A;

            this.SetStr(289, 289);
            this.SetDex(72, 72);
            this.SetInt(113, 113);

            this.SetHits(196, 196);
            this.SetStam(72, 72);
            this.SetMana(113, 113);

            this.SetDamage(5, 7);

            this.SetDamageType(ResistanceType.Physical, 100);

            this.SetResistance(ResistanceType.Physical, 45, 49);
            this.SetResistance(ResistanceType.Fire, 50, 53);
            this.SetResistance(ResistanceType.Cold, 25, 30);
            this.SetResistance(ResistanceType.Poison, 40, 42);
            this.SetResistance(ResistanceType.Energy, 15, 18);

            this.SetSkill(SkillName.MagicResist, 124.1, 126.2);
            this.SetSkill(SkillName.Tactics, 75.3, 83.6);
            this.SetSkill(SkillName.Anatomy, 0.0, 0.0);
            this.SetSkill(SkillName.Wrestling, 90.4, 94.7);

            this.Fame = 1500;
            this.Karma = -1500;

            this.VirtualArmor = 28;

            // loot 30-40 gold, magic item, gem, essence control,gob blood
            switch ( Utility.Random(20) )
            {
                case 0:
                    this.PackItem(new Scimitar());
                    break;
                case 1:
                    this.PackItem(new Katana());
                    break;
                case 2:
                    this.PackItem(new WarMace());
                    break;
                case 3:
                    this.PackItem(new WarHammer());
                    break;
                case 4:
                    this.PackItem(new Kryss());
                    break;
                case 5:
                    this.PackItem(new Pitchfork());
                    break;
            }

            this.PackItem(new ThighBoots());

            switch ( Utility.Random(3) )
            {
                case 0:
                    this.PackItem(new Ribs());
                    break;
                case 1:
                    this.PackItem(new Shaft());
                    break;
                case 2:
                    this.PackItem(new Candle());
                    break;
            }

            if (0.2 > Utility.RandomDouble())
                this.PackItem(new BolaBall());
        }
示例#32
0
        public virtual void OnShipHit(object obj)
        {
            object[] list   = (object[])obj;
            BaseBoat target = list[0] as BaseBoat;
            Point3D  pnt    = (Point3D)list[1];

            AmmoInfo ammoInfo = AmmoInfo.GetAmmoInfo((AmmunitionType)list[2]);

            if (ammoInfo != null && target != null)
            {
                int damage = (Utility.RandomMinMax(ammoInfo.MinDamage, ammoInfo.MaxDamage));
                damage /= 7;
                target.OnTakenDamage(Operator, damage);

                int z = target.ZSurface;

                if (target.TillerMan != null && target.TillerMan is IEntity)
                {
                    z = ((IEntity)target.TillerMan).Z;
                }

                Direction d       = Utility.GetDirection(this, pnt);
                int       xOffset = 0;
                int       yOffset = 0;
                Point3D   hit     = pnt;

                if (!ammoInfo.RequiresSurface)
                {
                    switch (d)
                    {
                    default:
                    case Direction.North:
                        xOffset = Utility.RandomMinMax(-1, 1);
                        yOffset = Utility.RandomMinMax(-2, 0);
                        hit     = new Point3D(pnt.X + xOffset, pnt.Y + yOffset, z);
                        break;

                    case Direction.South:
                        xOffset = Utility.RandomMinMax(-1, 1);
                        yOffset = Utility.RandomMinMax(0, 2);
                        hit     = new Point3D(pnt.X + xOffset, pnt.Y + yOffset, z);
                        break;

                    case Direction.East:
                        xOffset = Utility.RandomMinMax(0, 2);
                        yOffset = Utility.RandomMinMax(-1, 1);
                        hit     = new Point3D(pnt.X + xOffset, pnt.Y + yOffset, z);
                        break;

                    case Direction.West:
                        xOffset = Utility.RandomMinMax(-2, 0);
                        yOffset = Utility.RandomMinMax(-1, 1);
                        hit     = new Point3D(pnt.X + xOffset, pnt.Y + yOffset, z);
                        break;
                    }
                }

                Effects.SendLocationEffect(hit, target.Map, Utility.RandomBool() ? 14000 : 14013, 15, 10);
                Effects.PlaySound(hit, target.Map, 0x207);

                if (Operator != null && (!Operator.Deleted || CanFireUnmanned))
                {
                    Mobile victim = target.Owner;

                    if (victim != null && target.Contains(victim) && Operator.CanBeHarmful(victim, false))
                    {
                        Operator.DoHarmful(victim);
                    }
                    else
                    {
                        List <Mobile> candidates = new List <Mobile>();
                        SecurityLevel highest    = SecurityLevel.Passenger;

                        foreach (PlayerMobile mob in target.MobilesOnBoard.OfType <PlayerMobile>().Where(pm => Operator.CanBeHarmful(pm, false)))
                        {
                            if (target is BaseGalleon && ((BaseGalleon)target).GetSecurityLevel(mob) > highest)
                            {
                                candidates.Insert(0, mob);
                            }
                            else
                            {
                                candidates.Add(mob);
                            }
                        }

                        if (candidates.Count > 0)
                        {
                            Operator.DoHarmful(candidates[0]);
                        }
                        else if (victim != null && Operator.IsHarmfulCriminal(victim))
                        {
                            Operator.CriminalAction(false);
                        }

                        ColUtility.Free(candidates);
                    }
                }
            }
        }
示例#33
0
        public Target[] AcquireTarget()
        {
            AmmoInfo ammo = AmmoInfo.GetAmmoInfo(AmmoType);

            int     xOffset = 0; int yOffset = 0;
            int     currentRange = 0;
            Point3D pnt          = Location;
            Map     map          = Map;

            switch (GetFacing())
            {
            case Direction.North:
                xOffset = 0; yOffset = -1; break;

            case Direction.South:
                xOffset = 0; yOffset = 1; break;

            case Direction.West:
                xOffset = -1; yOffset = 0; break;

            case Direction.East:
                xOffset = 1; yOffset = 0; break;
            }

            int xo            = xOffset;
            int yo            = yOffset;
            int lateralOffset = 1;

            while (currentRange++ <= Range)
            {
                xOffset = xo;
                yOffset = yo;

                if (LateralOffset > 1 && currentRange % LateralOffset == 0)
                {
                    lateralOffset++;
                }

                TimeSpan delay = TimeSpan.FromSeconds(currentRange / 10.0);

                switch (AmmoType)
                {
                case AmmunitionType.Empty: break;

                case AmmunitionType.Cannonball:
                case AmmunitionType.FrostCannonball:
                case AmmunitionType.FlameCannonball:
                {
                    Point3D newPoint = pnt;
                    //List<IEntity> list = new List<IEntity>();

                    for (int i = -lateralOffset; i <= lateralOffset; i++)
                    {
                        if (xOffset == 0)
                        {
                            newPoint = new Point3D(pnt.X + (xOffset + i), pnt.Y + (yOffset * currentRange), pnt.Z);
                        }
                        else
                        {
                            newPoint = new Point3D(pnt.X + (xOffset * currentRange), pnt.Y + (yOffset + i), pnt.Z);
                        }

                        BaseGalleon g = FindValidBoatTarget(newPoint, map, ammo);

                        if (g != null && g.DamageTaken < DamageLevel.Severely && g.Owner is PlayerMobile)
                        {
                            Target target = new Target
                            {
                                Entity   = g,
                                Location = newPoint,
                                Range    = currentRange
                            };

                            return(new Target[] { target });
                        }
                    }
                }
                break;

                case AmmunitionType.Grapeshot:
                {
                    Point3D       newPoint = pnt;
                    List <Target> mobiles  = new List <Target>();

                    for (int i = -lateralOffset; i <= lateralOffset; i++)
                    {
                        if (xOffset == 0)
                        {
                            newPoint = new Point3D(pnt.X + (xOffset + i), pnt.Y + (yOffset * currentRange), pnt.Z);
                        }
                        else
                        {
                            newPoint = new Point3D(pnt.X + (xOffset * currentRange), pnt.Y + (yOffset + i), pnt.Z);
                        }

                        foreach (Mobile m in GetTargets(newPoint, map))
                        {
                            Target target = new Target
                            {
                                Entity   = m,
                                Location = newPoint,
                                Range    = currentRange
                            };

                            mobiles.Add(target);
                        }

                        if (mobiles.Count > 0 && ammo.SingleTarget)
                        {
                            Target toHit = mobiles[Utility.Random(mobiles.Count)];
                            ColUtility.Free(mobiles);
                            return(new Target[] { toHit });
                        }
                    }

                    if (mobiles.Count > 0)
                    {
                        return(mobiles.ToArray());
                    }
                }
                break;
                }
            }

            return(null);
        }
示例#34
0
        public static int BuildObjects(Mobile from, Type type, Point3D start, Point3D end, string[] args, string[,] props, List <Container> packs, bool outline, bool mapAvg)
        {
            Utility.FixPoints(ref start, ref end);

            PropertyInfo[] realProps = null;

            if (props != null)
            {
                realProps = new PropertyInfo[props.GetLength(0)];

                PropertyInfo[] allProps = type.GetProperties(BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public);

                for (int i = 0; i < realProps.Length; ++i)
                {
                    PropertyInfo thisProp = null;

                    string propName = props[i, 0];

                    for (int j = 0; thisProp == null && j < allProps.Length; ++j)
                    {
                        if (Insensitive.Equals(propName, allProps[j].Name))
                        {
                            thisProp = allProps[j];
                        }
                    }

                    if (thisProp == null)
                    {
                        from.SendMessage("Property not found: {0}", propName);
                    }
                    else
                    {
                        CPA attr = Properties.GetCPA(thisProp);

                        if (attr == null)
                        {
                            from.SendMessage("Property ({0}) not found.", propName);
                        }
                        else if (from.AccessLevel < attr.WriteLevel)
                        {
                            from.SendMessage("Setting this property ({0}) requires at least {1} access level.", propName, Mobile.GetAccessLevelName(attr.WriteLevel));
                        }
                        else if (!thisProp.CanWrite || attr.ReadOnly)
                        {
                            from.SendMessage("Property ({0}) is read only.", propName);
                        }
                        else
                        {
                            realProps[i] = thisProp;
                        }
                    }
                }
            }

            ConstructorInfo[] ctors = type.GetConstructors();

            for (int i = 0; i < ctors.Length; ++i)
            {
                ConstructorInfo ctor = ctors[i];

                if (!IsConstructible(ctor, from.AccessLevel))
                {
                    continue;
                }

                ParameterInfo[] paramList = ctor.GetParameters();

                if (args.Length == paramList.Length)
                {
                    object[] paramValues = ParseValues(paramList, args);

                    if (paramValues == null)
                    {
                        continue;
                    }

                    int built = Build(from, start, end, ctor, paramValues, props, realProps, packs, outline, mapAvg);

                    if (built > 0)
                    {
                        return(built);
                    }
                }
            }

            return(0);
        }
示例#35
0
        void IUtilityCommand.Run(Utility utility, string[] args)
        {
            // HACK: The engine code assumes that Game.modData is set.
            Game.ModData = utility.ModData;

            Console.WriteLine("This is an automatically generated listing of the new Lua map scripting API, generated for {0} of OpenRA.", Game.ModData.Manifest.Metadata.Version);
            Console.WriteLine();
            Console.WriteLine("OpenRA allows custom maps and missions to be scripted using Lua 5.1.\n" +
                              "These scripts run in a sandbox that prevents access to unsafe functions (e.g. OS or file access), " +
                              "and limits the memory and CPU usage of the scripts.");
            Console.WriteLine();
            Console.WriteLine("You can access this interface by adding the [LuaScript](Traits#luascript) trait to the world actor in your map rules " +
                              "(note, you must replace the spaces in the snippet below with a single tab for each level of indentation):");
            Console.WriteLine("```\nRules:\n\tWorld:\n\t\tLuaScript:\n\t\t\tScripts: myscript.lua\n```");
            Console.WriteLine();
            Console.WriteLine("Map scripts can interact with the game engine in three ways:\n" +
                              "* Global tables provide functions for interacting with the global world state, or performing general helper tasks.\n" +
                              "They exist in the global namespace, and can be called directly using ```<table name>.<function name>```.\n" +
                              "* Individual actors expose a collection of properties and commands that query information or modify their state.\n" +
                              "  * Some commands, marked as <em>queued activity</em>, are asynchronous. Activities are queued on the actor, and will run in " +
                              "sequence until the queue is empty or the Stop command is called. Actors that are not performing an activity are Idle " +
                              "(actor.IsIdle will return true). The properties and commands available on each actor depends on the traits that the actor " +
                              "specifies in its rule definitions.\n" +
                              "* Individual players expose a collection of properties and commands that query information or modify their state.\n" +
                              "The properties and commands available on each actor depends on the traits that the actor specifies in its rule definitions.\n");
            Console.WriteLine();
            Console.WriteLine("For a basic guide about map scripts see the [`Map Scripting` wiki page](https://github.com/OpenRA/OpenRA/wiki/Map-scripting).");
            Console.WriteLine();

            var tables = utility.ModData.ObjectCreator.GetTypesImplementing <ScriptGlobal>()
                         .OrderBy(t => t.Name);

            Console.WriteLine("<h3>Global Tables</h3>");

            foreach (var t in tables)
            {
                var name    = t.GetCustomAttributes <ScriptGlobalAttribute>(true).First().Name;
                var members = ScriptMemberWrapper.WrappableMembers(t);

                Console.WriteLine("<table align=\"center\" width=\"1024\"><tr><th colspan=\"2\" width=\"1024\">{0}</th></tr>", name);
                foreach (var m in members.OrderBy(m => m.Name))
                {
                    var desc = m.HasAttribute <DescAttribute>() ? m.GetCustomAttributes <DescAttribute>(true).First().Lines.JoinWith("\n") : "";
                    Console.WriteLine("<tr><td align=\"right\" width=\"50%\"><strong>{0}</strong></td><td>{1}</td></tr>".F(m.LuaDocString(), desc));
                }

                Console.WriteLine("</table>");
            }

            Console.WriteLine("<h3>Actor Properties / Commands</h3>");

            var actorCategories = utility.ModData.ObjectCreator.GetTypesImplementing <ScriptActorProperties>().SelectMany(cg =>
            {
                var catAttr  = cg.GetCustomAttributes <ScriptPropertyGroupAttribute>(false).FirstOrDefault();
                var category = catAttr != null ? catAttr.Category : "Unsorted";

                var required = RequiredTraitNames(cg);
                return(ScriptMemberWrapper.WrappableMembers(cg).Select(mi => Tuple.Create(category, mi, required)));
            }).GroupBy(g => g.Item1).OrderBy(g => g.Key);

            foreach (var kv in actorCategories)
            {
                Console.WriteLine("<table align=\"center\" width=\"1024\"><tr><th colspan=\"2\" width=\"1024\">{0}</th></tr>", kv.Key);

                foreach (var property in kv.OrderBy(p => p.Item2.Name))
                {
                    var mi          = property.Item2;
                    var required    = property.Item3;
                    var hasDesc     = mi.HasAttribute <DescAttribute>();
                    var hasRequires = required.Any();
                    var isActivity  = mi.HasAttribute <ScriptActorPropertyActivityAttribute>();

                    Console.WriteLine("<tr><td width=\"50%\" align=\"right\"><strong>{0}</strong>", mi.LuaDocString());

                    if (isActivity)
                    {
                        Console.WriteLine("<br /><em>Queued Activity</em>");
                    }

                    Console.WriteLine("</td><td>");

                    if (hasDesc)
                    {
                        Console.WriteLine(mi.GetCustomAttributes <DescAttribute>(false).First().Lines.JoinWith("\n"));
                    }

                    if (hasDesc && hasRequires)
                    {
                        Console.WriteLine("<br />");
                    }

                    if (hasRequires)
                    {
                        Console.WriteLine("<b>Requires {1}:</b> {0}".F(required.JoinWith(", "), required.Length == 1 ? "Trait" : "Traits"));
                    }

                    Console.WriteLine("</td></tr>");
                }

                Console.WriteLine("</table>");
            }

            Console.WriteLine("<h3>Player Properties / Commands</h3>");

            var playerCategories = utility.ModData.ObjectCreator.GetTypesImplementing <ScriptPlayerProperties>().SelectMany(cg =>
            {
                var catAttr  = cg.GetCustomAttributes <ScriptPropertyGroupAttribute>(false).FirstOrDefault();
                var category = catAttr != null ? catAttr.Category : "Unsorted";

                var required = RequiredTraitNames(cg);
                return(ScriptMemberWrapper.WrappableMembers(cg).Select(mi => Tuple.Create(category, mi, required)));
            }).GroupBy(g => g.Item1).OrderBy(g => g.Key);

            foreach (var kv in playerCategories)
            {
                Console.WriteLine("<table align=\"center\" width=\"1024\"><tr><th colspan=\"2\" width=\"1024\">{0}</th></tr>", kv.Key);

                foreach (var property in kv.OrderBy(p => p.Item2.Name))
                {
                    var mi          = property.Item2;
                    var required    = property.Item3;
                    var hasDesc     = mi.HasAttribute <DescAttribute>();
                    var hasRequires = required.Any();
                    var isActivity  = mi.HasAttribute <ScriptActorPropertyActivityAttribute>();

                    Console.WriteLine("<tr><td width=\"50%\" align=\"right\"><strong>{0}</strong>", mi.LuaDocString());

                    if (isActivity)
                    {
                        Console.WriteLine("<br /><em>Queued Activity</em>");
                    }

                    Console.WriteLine("</td><td>");

                    if (hasDesc)
                    {
                        Console.WriteLine(mi.GetCustomAttributes <DescAttribute>(false).First().Lines.JoinWith("\n"));
                    }

                    if (hasDesc && hasRequires)
                    {
                        Console.WriteLine("<br />");
                    }

                    if (hasRequires)
                    {
                        Console.WriteLine("<b>Requires {1}:</b> {0}".F(required.JoinWith(", "), required.Length == 1 ? "Trait" : "Traits"));
                    }

                    Console.WriteLine("</td></tr>");
                }

                Console.WriteLine("</table>");
            }
        }
示例#36
0
 void workerCordManager_WorkerCordAddCompleted(object sender, WorkerCordAddCompletedEventArgs e)
 {
     RefreshUI(RefreshedTypes.HideProgressBar);
     try
     {
         if (e.Error != null && e.Error.Message != "")
         {
             Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(e.Error.Message));
             return;
         }
         if (e.Result > 0)
         {
             if (GlobalFunction.IsSaveAndClose(refreshType))
             {
                 RefreshUI(refreshType);
             }
             else
             {
                 editStates = "update";
                 Utility.ShowMessageBox("ADD", false, true);
             }
         }
         else
         {
             Utility.ShowMessageBox("ADD", false, false);
         }
     }
     catch (Exception ex)
     {
         Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.ToString());
         RefreshUI(RefreshedTypes.HideProgressBar);
     }
 }
示例#37
0
        public void DoAction(string actionType)
        {
            string errorString = Check();

            if (errorString != null)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(errorString));
                return;
            }

            List <SMT.SaaS.FrameworkUI.Validator.ValidatorBase> validators = Group1.ValidateAll();

            foreach (var h in validators)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(h.ErrorMessage));
                return;
            }

            RefreshUI(RefreshedTypes.ShowProgressBar);
            switch (actionType)
            {
            case "0":
                refreshType = RefreshedTypes.All;
                Save();
                break;

            case "1": refreshType = RefreshedTypes.CloseAndReloadData;
                Save();
                break;
            }
        }
示例#38
0
 public string GetTitle()
 {
     return(Utility.GetResourceStr("WorkerCord"));
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Utility.BindDataToDropdown(ddlMachiningStatus, Utility.GetMachiningStatusList());
                Utility.BindDataToDropdown(ddlMachCreateMan, Utility.GetUserList2(true));
                Utility.BindDataToDropdown(ddlMachTableMan, Utility.GetUserList2(true));
                Utility.BindDataToDropdown(ddlSalesMan, Utility.GetUserList2(true));
                Utility.BindDataToDropdown(ddlRefineMan, Utility.GetUserList2(true));
                Utility.BindDataToDropdown(ddlSurveyMan, Utility.GetUserList2(true));
                Utility.BindDataToDropdown(ddlMachProcessor, Utility.GetUserList2(true));

                if (!string.IsNullOrWhiteSpace(MachNo))
                {
                    MachiningDAL dal  = new MachiningDAL();
                    var          mach = dal.GetMachByNo(MachNo);

                    OrderDAL sDAL  = new OrderDAL();
                    var      order = sDAL.GetOrderByNo(SourceNo);
                    lnkSource.NavigateUrl = Page.ResolveUrl(string.Format("~/OrderForm.aspx?ordno={0}&ordid={1}&sourceno={2}&sourcetype={3}", order.Order_No, order.Order_Id, order.SourceNo, order.SourceType));
                    lnkSource.Text        = SourceNo;

                    txtCreatedDate.Text            = mach.CreatedDate.ToString("yyyy-MM-dd");
                    ddlMachCreateMan.SelectedValue = mach.MachCreateMan;
                    ddlMachTableMan.SelectedValue  = mach.ProcessCreateMan;
                    ddlSalesMan.SelectedValue      = mach.SalesMan;
                    ddlRefineMan.SelectedValue     = mach.RefineMan;
                    ddlSurveyMan.SelectedValue     = mach.SurveyMan;
                    ddlMachProcessor.SelectedValue = mach.MachMan;
                    txtApplyDate.Text             = mach.ApplyDate.HasValue ? mach.ApplyDate.Value.ToString("yyyy-MM-dd") : string.Empty;
                    txtExpectedCompletedDate.Text = mach.ExpectedCompleteDate.HasValue ? mach.ExpectedCompleteDate.Value.ToString("yyyy-MM-dd") : string.Empty;
                    txtCompletedDate.Text         = mach.CompleteDate.HasValue ? mach.CompleteDate.Value.ToString("yyyy-MM-dd") : string.Empty;
                    txtExpectedDeliveryDate.Text  = mach.ExpectedDeliveryDate.HasValue ? mach.ExpectedDeliveryDate.Value.ToString("yyyy-MM-dd") : string.Empty;
                    txtExpectedInstallDate.Text   = mach.ExpectedInstallDate.HasValue ? mach.ExpectedInstallDate.Value.ToString("yyyy-MM-dd") : string.Empty;
                    txtMachiningSummary.Text      = mach.MachIntro;

                    //customer info
                    this.customerInfoControl.SetValue(
                        mach.CustomerCompanyName,
                        mach.CustomerContactName,
                        mach.CustomerAddress,
                        mach.CustomerEmail,
                        mach.CustomerQQ,
                        mach.CustomerPhone1,
                        mach.CustomerPhone2,
                        mach.CustomerOthers);
                    //history refine
                    UIUtility.BindUserControl(cADRefinementControl, SysConst.SourceTypeOrder, SourceNo);
                    //customer drawing
                    customerDrawingControl.IsCustomerProvideImage = order.IsCustomerProvideImage;
                    UIUtility.BindUserControl(customerDrawingControl, SysConst.SourceTypeOrder, order.Order_No);
                    //survey
                    UIUtility.BindUserControl(surveyControl, SysConst.SourceTypeOrder, SourceNo);
                    //purchase
                    UIUtility.BindUserControl(PurchaseControl1, SysConst.SourceTypeMaching, mach.Mach_No);
                    //machining table
                    MachiningLineItem1.IsRefineInstead = mach.IsRefineInstead;
                    MachiningLineItem1.RefineNo        = mach.RefineNo;
                    MachiningLineItem1.RefineIntro     = mach.InsteadIntro;
                    MachiningLineItem1.OrderNo         = order.Order_No;
                    MachiningLineItem1.MachId          = mach.Mach_Id;
                    UIUtility.BindUserControl(MachiningLineItem1, SysConst.SourceTypeMaching, mach.Mach_No);

                    //maching summary
                    MachiningSummaryControl1.MachId = mach.Mach_Id;
                    UIUtility.BindUserControl(MachiningSummaryControl1, SysConst.SourceTypeMaching, mach.Mach_No);
                    //status
                    ddlMachiningStatus.SelectedValue = mach.Status;
                    //followup
                    UIUtility.BindUserControl(followUpControl, SysConst.SourceTypeOrder, order.Order_No);
                }
            }
        }
示例#40
0
 public override void OnCombatantChange()
 {
     if (Combatant == null && !IsBodyMod && !Controlled && m_DisguiseTimer == null && Utility.RandomBool())
     {
         m_DisguiseTimer = Timer.DelayCall(TimeSpan.FromSeconds(Utility.RandomMinMax(15, 30)), new TimerCallback(Disguise));
     }
 }
示例#41
0
 public bool CheckRange(Point3D loc, int range)
 {
     return(Z + 8 >= loc.Z && loc.Z + 16 > Z &&
            Utility.InRange(GetWorldLocation(), loc, range));
 }
示例#42
0
        public override void InitOutfit()
        {
            base.InitOutfit();

            AddItem(Utility.RandomBool() ? (Item) new QuarterStaff() : (Item) new ShepherdsCrook());
        }
示例#43
0
		public override void OnThink()
		{
			base.OnThink();
			
			if ( HasFireRing && Combatant != null && Alive && Hits > 0.8 * HitsMax && m_NextFireRing < DateTime.Now && Utility.RandomDouble() < FireRingChance )
				FireRing();
				
			if ( CanSpawnHelpers && Combatant != null && Alive && CanSpawnWave() )
				SpawnHelpers();
		}
示例#44
0
        public Gualichu() : base(AIType.AI_Melee, FightMode.Closest, 5, 1, 0.175, 0.350)
        {
            Name        = "a gualichu";
            Body        = Utility.RandomList(50, 56);
            BaseSoundID = 0x48D;
            Hue         = 1237;

            if (Body == 56)               //Hatchet
            {
                DamageMin += 5;
                DamageMax += 8;
                RawStr    += 100;
                RawDex    -= 25;
                Skills.Lumberjacking.Base += 55;
            }

            SetStr(61, 76);
            SetDex(56, 73);
            SetInt(16, 37);

            SetHits(68, 96);

            SetDamage(1, 2);

            SetDamageType(ResistanceType.Physical, 100);

            SetResistance(ResistanceType.Physical, 16);
            SetResistance(ResistanceType.Fire, 0);
            SetResistance(ResistanceType.Cold, 25);
            SetResistance(ResistanceType.Poison, 25);
            SetResistance(ResistanceType.Energy, -25);

            SetSkill(SkillName.MagicResist, 45.4, 58.2);
            SetSkill(SkillName.Tactics, 45.1, 59.2);
            SetSkill(SkillName.Wrestling, 49.4, 57.5);

            Fame  = 450;
            Karma = -450;

            PackGold(50, 100);

            switch (Utility.Random(9))
            {
            case 0: PackItem(new Agate()); break;

            case 1: PackItem(new Beryl()); break;

            case 2: PackItem(new ChromeDiopside()); break;

            case 3: PackItem(new FireOpal()); break;

            case 4: PackItem(new MoonstoneCustom()); break;

            case 5: PackItem(new Onyx()); break;

            case 6: PackItem(new Opal()); break;

            case 7: PackItem(new Pearl()); break;

            case 8: PackItem(new TurquoiseCustom()); break;
            }
        }
示例#45
0
		public override void GenerateLoot()
		{
			PackItem( new SulfurousAsh( Utility.RandomMinMax( 151, 300 ) ) );
			PackItem( new Ruby( Utility.RandomMinMax( 16, 30 ) ) );
		}
示例#46
0
        private void CreateOpenGLContext(IntPtr hwnd)
        {
            this.hwnd = hwnd;

            this.hDC = GetDC(hwnd);

            var pixelformatdescriptor = new PIXELFORMATDESCRIPTOR();

            pixelformatdescriptor.Init();

            if (!Application.EnableMSAA)
            {
                int pixelFormat;
                pixelFormat = ChoosePixelFormat(this.hDC, ref pixelformatdescriptor);
                SetPixelFormat(this.hDC, pixelFormat, ref pixelformatdescriptor);

                this.hglrc = wglCreateContext(this.hDC);
                wglMakeCurrent(this.hDC, this.hglrc);
            }
            else
            {
                Wgl.Init(hwnd);

                int[] iPixAttribs =
                {
                    (int)WGL.WGL_SUPPORT_OPENGL_ARB, (int)GL.GL_TRUE,
                    (int)WGL.WGL_DRAW_TO_WINDOW_ARB, (int)GL.GL_TRUE,
                    (int)WGL.WGL_DOUBLE_BUFFER_ARB,  (int)GL.GL_TRUE,
                    (int)WGL.WGL_PIXEL_TYPE_ARB,     (int)WGL.WGL_TYPE_RGBA_ARB,
                    (int)WGL.WGL_ACCELERATION_ARB,   (int)WGL.WGL_FULL_ACCELERATION_ARB,
                    (int)WGL.WGL_COLOR_BITS_ARB,                                     24,
                    (int)WGL.WGL_ALPHA_BITS_ARB,                                      8,
                    (int)WGL.WGL_DEPTH_BITS_ARB,                                     24,
                    (int)WGL.WGL_STENCIL_BITS_ARB,                                    8,
                    (int)WGL.WGL_SWAP_METHOD_ARB,    (int)WGL.WGL_SWAP_EXCHANGE_ARB,
                    (int)WGL.WGL_SAMPLE_BUFFERS_ARB, (int)GL.GL_TRUE,//Enable MSAA
                    (int)WGL.WGL_SAMPLES_ARB,                                        16,
                    0
                };

                int  pixelFormat;
                uint numFormats;
                var  result = Wgl.ChoosePixelFormatARB(this.hDC, iPixAttribs, null, 1, out pixelFormat, out numFormats);
                if (result == false || numFormats == 0)
                {
                    throw new Exception(string.Format("wglChoosePixelFormatARB failed: error {0}", Marshal.GetLastWin32Error()));
                }

                if (!DescribePixelFormat(this.hDC, pixelFormat, (uint)Marshal.SizeOf <PIXELFORMATDESCRIPTOR>(), ref pixelformatdescriptor))
                {
                    throw new Exception(string.Format("DescribePixelFormat failed: error {0}", Marshal.GetLastWin32Error()));
                }

                if (!SetPixelFormat(this.hDC, pixelFormat, ref pixelformatdescriptor))
                {
                    throw new Exception(string.Format("SetPixelFormat failed: error {0}", Marshal.GetLastWin32Error()));
                }

                int[] attributes =
                {
                    (int)WGL.WGL_CONTEXT_MAJOR_VERSION_ARB, 4,
                    (int)WGL.WGL_CONTEXT_MINOR_VERSION_ARB, 5,
                    (int)WGL.WGL_CONTEXT_FLAGS_ARB,         0,
                    (int)WGL.WGL_CONTEXT_PROFILE_MASK_ARB,  (int)WGL.WGL_CONTEXT_CORE_PROFILE_BIT_ARB
                    , 0
                };

                if ((this.hglrc = Wgl.CreateContextAttribsARB(this.hDC, IntPtr.Zero, attributes)) == IntPtr.Zero)
                {
                    throw new Exception(string.Format("CreateContextAttribsARB failed: error {0}", Marshal.GetLastWin32Error()));
                }

                if (!Wgl.MakeCurrent(this.hDC, this.hglrc))
                {
                    throw new Exception(string.Format("Wgl.MakeCurrent failed: error {0}", Marshal.GetLastWin32Error()));
                }

                Utility.CheckGLError();
            }

            GL.GetFramebufferAttachmentParameteriv(GL.GL_DRAW_FRAMEBUFFER,
                                                   GL.GL_STENCIL, GL.GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, IntBuffer);
            Utility.CheckGLError();
            var stencilBits = IntBuffer[0];

            if (stencilBits != 8)
            {
                throw new Exception("Failed to set stencilBits to 8.");
            }

            PrintPixelFormat(hDC);
            PrintGraphicInfo();
        }
示例#47
0
    protected void bt_add_Click(object sender, EventArgs e)
    {
        if (this.tb_username.Text.Trim().Length == 0)
        {
            this.Page.ClientScript.RegisterStartupScript(base.GetType(), "Ok", "alert('用户名不能为空!');", true);
            return;
        }
        if (MemberInfo.ReadList(" where username='******'").Count > 0)
        {
            this.Page.ClientScript.RegisterStartupScript(base.GetType(), "Ok", "alert('用户名已经存在,请重新选择用户名!');", true);
            return;
        }
        MemberInfo memberInfo1 = MemberInfo.Read(int.Parse(this.Session["userId"].ToString()));


        if (this.tb_password.Text.Length == 0 || this.tb_passwordA.Text.Length == 0)
        {
            this.Page.ClientScript.RegisterStartupScript(base.GetType(), "Ok", "alert('一级密码与二级密码都不能为空!');", true);
            return;
        }
        if (this.tb_guanliRen.Text.Trim().Length > 0)
        {
            IList <MemberInfo> list = MemberInfo.ReadList(" where username='******'");
            if (list.Count == 1)
            {
                if (list[0].Status == 0 && MemberInfo.ReadList(" where guanliRen='" + Utility.SQLString(this.tb_guanliRen.Text) + "'").Count > 0)
                {
                    this.Page.ClientScript.RegisterStartupScript(base.GetType(), "Ok", "alert('未审核会员只能发展一个分支!');", true);
                    return;
                }
                if (MemberInfo.ReadList(string.Concat(new object[]
                {
                    " where guanliRen='", Utility.SQLString(this.tb_guanliRen.Text), "' and fenzhi=", int.Parse(base.Request["fenzhi"])
                })).Count > 0)
                {
                    this.Page.ClientScript.RegisterStartupScript(base.GetType(), "Ok", "alert('此管理人的分支已存在!');", true);
                    return;
                }
                if (MemberInfo.ReadList(" where username='******'").Count == 1)
                {
                    MemberInfo memberInfo = new MemberInfo(
                        0, this.tb_username.Text,
                        FormsAuthentication.HashPasswordForStoringInConfigFile(this.tb_password.Text.Trim(), "md5"), FormsAuthentication.HashPasswordForStoringInConfigFile(this.tb_passwordA.Text, "md5"),
                        ((list[0].UserPath.Length > 0) ? (list[0].UserPath + ",") : "") + list[0].Id,
                        this.tb_tuijianren.Text,
                        this.tb_guanliRen.Text,
                        this.tb_agencyName.Text,
                        int.Parse(this.ddl_setMeal.SelectedValue),
                        this.tb_bankName.Text,
                        "",
                        this.ddl_bankType.SelectedValue,
                        "",
                        this.tb_bankAccount.Text,
                        this.tb_zfbName.Text,
                        this.tb_zfb.Text,
                        this.tb_mobile.Text,
                        this.tb_qq.Text,
                        int.Parse(base.Request["fenzhi"]),
                        DateTime.Now,
                        0,
                        0.0,
                        0,
                        0,
                        -20.0, 0);
                    this.ddlvalhidden.Style.Add("style", "display:none");
                    //this.tb_guanLiRen.Style.Add("style", "display:none");
                    strval1 = int.Parse(this.ddlvalhidden.Text);
                    double num = 0;
                    if (strval1 == 1)
                    {
                        num = 1200;
                    }
                    else if (strval1 == 2)
                    {
                        num = 3600;
                    }
                    else if (strval1 == 3)
                    {
                        num = 8400;
                    }


                    var list1 = MemberInfo.ReadList(" where userName='******'");
                    if (list1 != null && list.Count > 0)
                    {
                        list1[0].Money -= num;
                    }
                    list1[0].Update();
                    memberInfo.Money = num;
                    memberInfo.Insert();

                    base.Response.Redirect("NetworkList.aspx");
                    return;
                }
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "Ok", "alert('不存在此商务中心!');", true);
                return;
            }
            else
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "Ok", "alert('不存在此管理人!');", true);
            }
        }
        // if (this.tb_username.Text.Trim().Length>0 and this.tb_password.Text.Trim().Length>0 and this.tb_passwordA.Text.Trim().Length>0
        //   and this.tb_tuijianren.Text.Trim().Length>0 and this.tb_guanliRen.Text.Trim().Length>0)
        //{
        //    this.Page.ClientScript.RegisterStartupScript(base.GetType(), "Ok", "alert('是否要消耗积分为此用户注册!');", true);
        //     return;
        //}
    }
示例#48
0
        public override void InitOutfit()
        {
            base.InitOutfit();

            AddItem(new Server.Items.Robe(Utility.RandomNeutralHue()));
        }
示例#49
0
        #pragma warning disable 1998
        public async override global::System.Threading.Tasks.Task ExecuteAsync()
        {
#line 5 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"

            ViewData["Title"] = "List";
            Layout            = "~/Views/Shared/_Layout.cshtml";

#line default
#line hidden
            BeginContext(209, 600, true);
            WriteLiteral(@"

<nav class=""breadcrumb""><i class=""Hui-iconfont"">&#xe67f;</i> 首页 <span class=""c-gray en"">&gt;</span> 公司管理 <span class=""c-gray en"">&gt;</span> 职位管理 <a id=""btn_refresh"" class=""btn btn-success radius r"" style=""line-height:1.6em;margin-top:3px"" href=""javascript:location.replace(location.href);"" title=""刷新""><i class=""Hui-iconfont"">&#xe68f;</i></a></nav>
<div class=""page-container"">
    <div class=""text-c"">
        日期范围:
        <input type=""text"" onfocus=""WdatePicker({ maxDate:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}' })"" id=""datemin"" name=""datemin"" class=""input-text Wdate"" style=""width:120px;""");
            EndContext();
            BeginWriteAttribute("value", " value=\"", 809, "\"", 833, 1);
#line 15 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
            WriteAttributeValue("", 817, ViewBag.datemin, 817, 16, false);

#line default
#line hidden
            EndWriteAttribute();
            BeginContext(834, 196, true);
            WriteLiteral(" />\r\n        -\r\n        <input type=\"text\" onfocus=\"WdatePicker({ minDate:\'#F{$dp.$D(\\\'datemin\\\')}\',maxDate:\'%y-%M-%d\' })\" id=\"datemax\" name=\"datemax\" class=\"input-text Wdate\" style=\"width:120px;\"");
            EndContext();
            BeginWriteAttribute("value", " value=\"", 1030, "\"", 1054, 1);
#line 17 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
            WriteAttributeValue("", 1038, ViewBag.datemax, 1038, 16, false);

#line default
#line hidden
            EndWriteAttribute();
            BeginContext(1055, 122, true);
            WriteLiteral(" />\r\n        <input type=\"text\" class=\"input-text\" style=\"width:350px\" placeholder=\"输入职位编号、名称\" id=\"keyword\" name=\"keyword\"");
            EndContext();
            BeginWriteAttribute("value", " value=\"", 1177, "\"", 1201, 1);
#line 18 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
            WriteAttributeValue("", 1185, ViewBag.keyword, 1185, 16, false);

#line default
#line hidden
            EndWriteAttribute();
            BeginContext(1202, 420, true);
            WriteLiteral(@" />
        <button type=""submit"" class=""btn btn-success radius"" id=""driversearch"" name=""driversearch"" onclick=""$.mainu.search()""><i class=""Hui-iconfont"">&#xe665;</i> 查找</button>
    </div>
    <div class=""cl pd-5 bg-1 bk-gray mt-20"">
        <span class=""l"">
            <a href=""javascript:;"" onclick=""$.mainu.delBatch()"" class=""btn btn-danger radius""><i class=""Hui-iconfont"">&#xe6e2;</i> 批量删除</a>
            <a");
            EndContext();
            BeginWriteAttribute("href", " href=\"", 1622, "\"", 1648, 1);
#line 24 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
            WriteAttributeValue("", 1629, Url.Action("list"), 1629, 19, false);

#line default
#line hidden
            EndWriteAttribute();
            BeginContext(1649, 144, true);
            WriteLiteral(" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\">&#xe667;</i> 职位列表</a>\r\n            <a href=\"javascript:;\" class=\"btn btn-primary radius\"");
            EndContext();
            BeginWriteAttribute("onclick", " onclick=\"", 1793, "\"", 1849, 3);
            WriteAttributeValue("", 1803, "$.mainu.add(\'新增职位\',\'", 1803, 20, true);
#line 25 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
            WriteAttributeValue("", 1823, Url.Action("add"), 1823, 18, false);

#line default
#line hidden
            WriteAttributeValue("", 1841, "\',\'\',\'\')", 1841, 8, true);
            EndWriteAttribute();
            BeginContext(1850, 102, true);
            WriteLiteral("><i class=\"Hui-iconfont\">&#xe600;</i> 新增职位</a>\r\n        </span>\r\n        <span class=\"r\">共有数据:<strong>");
            EndContext();
            BeginContext(1953, 13, false);
#line 27 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
            Write(ViewBag.Count);

#line default
#line hidden
            EndContext();
            BeginContext(1966, 669, true);
            WriteLiteral(@"</strong> 条</span>
    </div>
    <div class=""mt-20"">
        <table class=""table table-border table-bordered table-hover table-bg table-sort"">
            <thead>
                <tr class=""text-c"">
                    <th width=""25""><input type=""checkbox"" name="""" value=""""></th>
                    <th width=""80"">职位编号</th>
                    <th width=""120"">职位名称</th>
                    <th width="""">描述</th>
                    <th width=""80"">排序</th>
                    <th width=""80"">状态</th>
                    <th width=""120"">加入时间</th>
                    <th width=""120"">操作</th>
                </tr>
            </thead>
            <tbody>
");
            EndContext();
#line 44 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
            if (Model != null)
            {
                foreach (var m in Model)
                {
#line default
#line hidden
                    BeginContext(2760, 109, true);
                    WriteLiteral("                        <tr class=\"text-c\">\r\n                            <td><input type=\"checkbox\" name=\"id\"");
                    EndContext();
                    BeginWriteAttribute("value", " value=\"", 2869, "\"", 2890, 1);
#line 49 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                    WriteAttributeValue("", 2877, m.PositionID, 2877, 13, false);

#line default
#line hidden
                    EndWriteAttribute();
                    BeginContext(2891, 40, true);
                    WriteLiteral("></td>\r\n                            <td>");
                    EndContext();
                    BeginContext(2933, 58, false);
#line 50 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                    Write(Html.Raw(Utility.Highlight(m.PositionID, ViewBag.keyword)));

#line default
#line hidden
                    EndContext();
                    BeginContext(2992, 39, true);
                    WriteLiteral("</td>\r\n                            <td>");
                    EndContext();
                    BeginContext(3033, 60, false);
#line 51 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                    Write(Html.Raw(Utility.Highlight(m.PositionName, ViewBag.keyword)));

#line default
#line hidden
                    EndContext();
                    BeginContext(3094, 54, true);
                    WriteLiteral("</td>\r\n                            <td class=\"text-l\">");
                    EndContext();
                    BeginContext(3149, 13, false);
#line 52 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                    Write(m.Description);

#line default
#line hidden
                    EndContext();
                    BeginContext(3162, 39, true);
                    WriteLiteral("</td>\r\n                            <td>");
                    EndContext();
                    BeginContext(3202, 14, false);
#line 53 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                    Write(m.Sort.ToInt());

#line default
#line hidden
                    EndContext();
                    BeginContext(3216, 57, true);
                    WriteLiteral("</td>\r\n                            <td class=\"td-status\">");
                    EndContext();
                    BeginContext(3275, 148, false);
#line 54 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                    Write(m.State.ToBool() ? Html.Raw("<span class='label label-success radius'>已启用</span>") : Html.Raw("<span class='label label-defaunt radius'>已停用</span>"));

#line default
#line hidden
                    EndContext();
                    BeginContext(3424, 39, true);
                    WriteLiteral("</td>\r\n                            <td>");
                    EndContext();
                    BeginContext(3465, 77, false);
#line 55 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                    Write(m.CreateDate.HasValue ? m.CreateDate.Value.ToString("yyyy-MM-dd HH:mm") : "-");

#line default
#line hidden
                    EndContext();
                    BeginContext(3543, 59, true);
                    WriteLiteral("</td>\r\n                            <td class=\"td-manage\">\r\n");
                    EndContext();
#line 57 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                    if (m.State.ToBool())
                    {
#line default
#line hidden
                        BeginContext(3693, 111, true);
                        WriteLiteral("                                    <a title=\"停用\" href=\"javascript:;\" class=\"ml-5\" style=\"text-decoration:none\"");
                        EndContext();
                        BeginWriteAttribute("onClick", " onClick=\"", 3804, "\"", 3848, 3);
                        WriteAttributeValue("", 3814, "$.mainu.stop(this,\'", 3814, 19, true);
#line 59 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                        WriteAttributeValue("", 3833, m.PositionID, 3833, 13, false);

#line default
#line hidden
                        WriteAttributeValue("", 3846, "\')", 3846, 2, true);
                        EndWriteAttribute();
                        BeginContext(3849, 9, true);
                        WriteLiteral(">停用</a>\r\n");
                        EndContext();
#line 60 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                    }
                    else
                    {
#line default
#line hidden
                        BeginContext(3966, 111, true);
                        WriteLiteral("                                    <a title=\"启用\" href=\"javascript:;\" class=\"ml-5\" style=\"text-decoration:none\"");
                        EndContext();
                        BeginWriteAttribute("onClick", " onClick=\"", 4077, "\"", 4122, 3);
                        WriteAttributeValue("", 4087, "$.mainu.start(this,\'", 4087, 20, true);
#line 63 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                        WriteAttributeValue("", 4107, m.PositionID, 4107, 13, false);

#line default
#line hidden
                        WriteAttributeValue("", 4120, "\')", 4120, 2, true);
                        EndWriteAttribute();
                        BeginContext(4123, 9, true);
                        WriteLiteral(">启用</a>\r\n");
                        EndContext();
#line 64 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                    }

#line default
#line hidden
                    BeginContext(4167, 107, true);
                    WriteLiteral("                                <a title=\"编辑\" href=\"javascript:;\" class=\"ml-5\" style=\"text-decoration:none\"");
                    EndContext();
                    BeginWriteAttribute("onclick", " onclick=\"", 4274, "\"", 4364, 3);
                    WriteAttributeValue("", 4284, "$.mainu.edit(\'编辑\',\'", 4284, 19, true);
#line 65 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                    WriteAttributeValue("", 4303, Url.Action("add", new { positionid = m.PositionID }), 4303, 53, false);

#line default
#line hidden
                    WriteAttributeValue("", 4356, "\',\'\',\'\')", 4356, 8, true);
                    EndWriteAttribute();
                    BeginContext(4365, 116, true);
                    WriteLiteral(">编辑</a>\r\n                                <a title=\"删除\" href=\"javascript:;\" class=\"ml-5\" style=\"text-decoration:none\"");
                    EndContext();
                    BeginWriteAttribute("onclick", " onclick=\"", 4481, "\"", 4524, 3);
                    WriteAttributeValue("", 4491, "$.mainu.del(this,\'", 4491, 18, true);
#line 66 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                    WriteAttributeValue("", 4509, m.PositionID, 4509, 13, false);

#line default
#line hidden
                    WriteAttributeValue("", 4522, "\')", 4522, 2, true);
                    EndWriteAttribute();
                    BeginContext(4525, 75, true);
                    WriteLiteral(">删除</a>\r\n                            </td>\r\n                        </tr>\r\n");
                    EndContext();
#line 69 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                }
            }

#line default
#line hidden
            BeginContext(4642, 60, true);
            WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n</div>\r\n");
            EndContext();
            DefineSection("scripts", async() => {
                BeginContext(4781, 34, true);
                WriteLiteral("\r\n    <!--请在下方写此页面业务相关的脚本-->\r\n    ");
                EndContext();
                BeginContext(4815, 92, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "5167a9f06f844b448165b0308b34c34b", async() => {
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(4907, 6, true);
                WriteLiteral("\r\n    ");
                EndContext();
                BeginContext(4913, 101, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "dcf418cafc9a4a37a4853bc5448108e7", async() => {
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(5014, 6, true);
                WriteLiteral("\r\n    ");
                EndContext();
                BeginContext(5020, 81, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "2a6719b82481469d8512bbbaff1c196f", async() => {
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(5101, 6, true);
                WriteLiteral("\r\n    ");
                EndContext();
                BeginContext(5107, 96, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("script", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "5f74b76811f44da8837daa4562a326f0", async() => {
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(5203, 1626, true);
                WriteLiteral(@"
    <script type=""text/javascript"">
        (function ($) {
            $.mainu = {
                init: function () {
                    $('.table-sort').dataTable({
                        ""aaSorting"": [[6, ""desc""]],//默认第几个排序
                        ""bStateSave"": true,//状态保存
                        ""aoColumnDefs"": [
                          { ""orderable"": false, ""aTargets"": [0,7] }// 制定列不参与排序
                        ]
                    });
                },
                search: function () {
                    $dateMin = $(""input[name='datemin']"").val();
                    $dateMax = $(""input[name='datemax']"").val();
                    $keyword = $(""input[name='keyword']"").val();
                    if ($keyword == """") {
                        if ($dateMin == """" || $dateMax=="""") {
                            layer.alert('日期范围不能空', { icon: 5 });
                            return;
                        }
                    }
                    var url = ""?datemin="" + ");
                WriteLiteral(@"$dateMin + ""&datemax="" + $dateMax + ""&keyword="" + $keyword + """";
                    window.location.href = url;
                },
                add: function (title, url, w, h) {
                    layer_show(title, url, w, h);
                },
                edit: function (title, url, w, h) {
                    layer_show(title, url, w, h);
                },
                stop: function (obj, id) {
                    layer.confirm('确认要停用吗?', function (index) {
                        $.ajax({
                            type: 'POST',
                            url: '");
                EndContext();
                BeginContext(6830, 25, false);
#line 121 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                Write(Url.Action("UpdateState"));

#line default
#line hidden
                EndContext();
                BeginContext(6855, 1476, true);
                WriteLiteral(@"',
                            data: { positionid: id, state: false },
                            dataType: 'json',
                            success: function (result) {
                                var state = result.state;
                                var message = result.message;
                                if (state == ""success"") {
                                    $(obj).parents(""tr"").find("".td-manage"").prepend('<a title=""启用"" href=""javascript:;"" class=""ml-5"" style=""text-decoration:none"" onClick=""$.mainu.start(this,\'' + id + '\')"">启用</a>');
                                    $(obj).parents(""tr"").find("".td-status"").html('<span class=""label label-defaunt radius"">已停用</span>');
                                    $(obj).remove();
                                    layer.msg('已停用!', { icon: 5, time: 3000 });
                                } else {
                                    layer.msg(message, { icon: 5, time: 3000 });
                                }
                ");
                WriteLiteral(@"            },
                            error: function (data) {
                                console.log(data.msg);
                            }
                        });
                    });
                },
                start: function (obj, id) {
                    layer.confirm('确认要启用吗?', function (index) {
                        $.ajax({
                            type: 'POST',
                            url: '");
                EndContext();
                BeginContext(8332, 25, false);
#line 146 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                Write(Url.Action("UpdateState"));

#line default
#line hidden
                EndContext();
                BeginContext(8357, 1472, true);
                WriteLiteral(@"',
                            data: { positionid: id, state: true },
                            dataType: 'json',
                            success: function (result) {
                                var state = result.state;
                                var message = result.message;
                                if (state == ""success"") {
                                    $(obj).parents(""tr"").find("".td-manage"").prepend('<a title=""停用"" href=""javascript:;"" class=""ml-5"" style=""text-decoration:none"" onClick=""$.mainu.stop(this,\'' + id + '\')"">停用</a>');
                                    $(obj).parents(""tr"").find("".td-status"").html('<span class=""label label-success radius"">已启用</span>');
                                    $(obj).remove();
                                    layer.msg('已启用!', { icon: 6, time: 3000 });
                                } else {
                                    layer.msg(message, { icon: 5, time: 3000 });
                                }
                  ");
                WriteLiteral(@"          },
                            error: function (data) {
                                console.log(data.msg);
                            }
                        });
                    });
                },
                del: function (obj, id) {
                    layer.confirm('确认要删除吗?', function (index) {
                        $.ajax({
                            type: 'POST',
                            url: '");
                EndContext();
                BeginContext(9830, 20, false);
#line 171 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                Write(Url.Action("delete"));

#line default
#line hidden
                EndContext();
                BeginContext(9850, 1520, true);
                WriteLiteral(@"',
                            data: { positionid: id },
                            dataType: 'json',
                            success: function (result) {
                                var state = result.state;
                                var message = result.message;
                                if (state == ""success"") {
                                    $(obj).parents(""tr"").remove();
                                    layer.msg('已删除!', { icon: 1, time: 2000 });
                                } else {
                                    layer.msg(message, { icon: 5, time: 3000 });
                                }
                            },
                            error: function (data) {
                                console.log(data.msg);
                            },
                        });
                    });
                },
                delBatch: function () {
                    layer.confirm('确认要删除吗?', function (index) {
                 ");
                WriteLiteral(@"       var arrId = [];
                        $(""input:checkbox[name='id']:checked"").each(function () {
                            arrId.push($(this).val());
                        });
                        if (arrId.length == 0) {
                            layer.msg('请选择要删除的数据!', { icon: 5, time: 2000 });
                            return;
                        }
                        $.ajax({
                            type: 'POST',
                            url: '");
                EndContext();
                BeginContext(11371, 25, false);
#line 202 "E:\Projects\CTMS\CTMS.Web\Views\InstitutionPosition\List.cshtml"
                Write(Url.Action("deletebatch"));

#line default
#line hidden
                EndContext();
                BeginContext(11396, 957, true);
                WriteLiteral(@"',
                            data: { arrid: arrId },
                            dataType: 'json',
                            success: function (result) {
                                var state = result.state;
                                var message = result.message;
                                if (state == ""success"") {
                                    window.location.replace(location.href);
                                } else {
                                    layer.msg(message, { icon: 5, time: 1000 });
                                }
                            },
                            error: function (data) {
                                console.log(data.msg);
                            },
                        });
                    });
                }
            };
            $(function () {
                $.mainu.init();
            });
        })(jQuery);
    </script>
");
                EndContext();
            }
                          );
            BeginContext(12356, 2, true);
            WriteLiteral("\r\n");
            EndContext();
        }
示例#50
0
 private void dg_LoadingRow(object sender, DataGridRowEventArgs e)//点击回车新加载一行
 {
     T_OA_SATISFACTIONDETAIL temp = (T_OA_SATISFACTIONDETAIL)e.Row.DataContext;
     ImageButton MyButton_Delbaodao = dg.Columns[3].GetCellContent(e.Row).FindName("myDelete") as ImageButton;
     MyButton_Delbaodao.Margin = new Thickness(0);
     MyButton_Delbaodao.AddButtonAction("/SMT.SaaS.FrameworkUI;Component/Images/ToolBar/ico_16_delete.png", Utility.GetResourceStr("DELETE"));
     MyButton_Delbaodao.Tag = temp;
 }
示例#51
0
		public override void OnDeath( Container c )
		{
			base.OnDeath( c );
			RareMetals stones = new RareMetals( Utility.RandomMinMax( 5, 10 ), "jade stones" );
   			c.DropItem( stones );
		}
示例#52
0
        public ChaosDragoon() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.15, 0.4)
        {
            Name = "a chaos dragoon";
            Body = 0x190;
            Hue  = Utility.RandomSkinHue();

            SetStr(176, 225);
            SetDex(81, 95);
            SetInt(61, 85);

            SetHits(176, 225);

            SetDamage(24, 26);

            SetDamageType(ResistanceType.Physical, 25);
            SetDamageType(ResistanceType.Fire, 25);
            SetDamageType(ResistanceType.Cold, 25);
            SetDamageType(ResistanceType.Energy, 25);

            //SetResistance( ResistanceType.Physical, 25, 38 );
            //SetResistance( ResistanceType.Fire, 25, 38 );
            //SetResistance( ResistanceType.Cold, 25, 38 );
            //SetResistance( ResistanceType.Poison, 25, 38 );
            //SetResistance( ResistanceType.Energy, 25, 38 );

            SetSkill(SkillName.Fencing, 77.6, 92.5);
            SetSkill(SkillName.Healing, 60.3, 90.0);
            SetSkill(SkillName.Macing, 77.6, 92.5);
            SetSkill(SkillName.Anatomy, 77.6, 87.5);
            SetSkill(SkillName.MagicResist, 77.6, 97.5);
            SetSkill(SkillName.Swords, 77.6, 92.5);
            SetSkill(SkillName.Tactics, 77.6, 87.5);

            Fame  = 5000;
            Karma = -5000;

            CraftResource res = CraftResource.None;

            switch (Utility.Random(6))
            {
            case 0: res = CraftResource.BlackScales; break;

            case 1: res = CraftResource.RedScales; break;

            case 2: res = CraftResource.BlueScales; break;

            case 3: res = CraftResource.YellowScales; break;

            case 4: res = CraftResource.GreenScales; break;

            case 5: res = CraftResource.WhiteScales; break;
            }

            BaseWeapon melee = null;

            switch (Utility.Random(3))
            {
            case 0: melee = new Kryss(); break;

            case 1: melee = new Broadsword(); break;

            case 2: melee = new Katana(); break;
            }

            melee.Movable = false;
            AddItem(melee);

            DragonHelm helm = new DragonHelm
            {
                Resource = res,
                Movable  = false
            };

            AddItem(helm);

            DragonChest chest = new DragonChest
            {
                Resource = res,
                Movable  = false
            };

            AddItem(chest);

            DragonArms arms = new DragonArms
            {
                Resource = res,
                Movable  = false
            };

            AddItem(arms);

            DragonGloves gloves = new DragonGloves
            {
                Resource = res,
                Movable  = false
            };

            AddItem(gloves);

            DragonLegs legs = new DragonLegs
            {
                Resource = res,
                Movable  = false
            };

            AddItem(legs);

            ChaosShield shield = new ChaosShield
            {
                Movable = false
            };

            AddItem(shield);

            AddItem(new Shirt());
            AddItem(new Boots());

            int amount = Utility.RandomMinMax(1, 3);

            switch (res)
            {
            case CraftResource.BlackScales: AddItem(new BlackScales(amount)); break;

            case CraftResource.RedScales: AddItem(new RedScales(amount)); break;

            case CraftResource.BlueScales: AddItem(new BlueScales(amount)); break;

            case CraftResource.YellowScales: AddItem(new YellowScales(amount)); break;

            case CraftResource.GreenScales: AddItem(new GreenScales(amount)); break;

            case CraftResource.WhiteScales: AddItem(new WhiteScales(amount)); break;
            }

            new SwampDragon().Rider = this;
        }
示例#53
0
        /// <summary>This is code that will replace some game code, this is ran whenever the player is about to passout.</summary>
        /// <returns>This will always return false as this contains the game code as well as the patch.</returns>
        internal static bool PassOutFromTiredPrefix(Farmer who)
        {
            if (!who.IsLocalPlayer)
            {
                return false;
            }

            if (who.isRidingHorse())
            {
                who.mount.dismount();
            }

            if (Game1.activeClickableMenu != null)
            {
                Game1.activeClickableMenu.emergencyShutDown();
                Game1.exitActiveMenu();
            }

            who.completelyStopAnimatingOrDoingAction();
            if (who.bathingClothes.Value)
            {
                who.changeOutOfSwimSuit();
            }

            who.swimming.Value = false;
            who.CanMove = false;
            GameLocation passOutLocation = Game1.currentLocation;
            Vector2 bed = Utility.PointToVector2(Utility.getHomeOfFarmer(Game1.player).getBedSpot()) * 64f;
            bed.X -= 64f;

            LocationRequest.Callback callback = (LocationRequest.Callback)(() =>
            {
                who.Position = bed;
                who.currentLocation.lastTouchActionLocation = bed;
                if (!Game1.IsMultiplayer || Game1.timeOfDay >= 2600)
                {
                    Game1.PassOutNewDay();
                }

                Game1.changeMusicTrack("none");

                if (passOutLocation is FarmHouse || passOutLocation is Cellar)
                {
                    return;
                }

                // check if an NPC has picked up the player or if the game should handle the passout
                if (!ModEntry.HasPassoutBeenHandled)
                {
                    int num = Math.Min(1000, who.Money / 10);
                    who.Money -= num;
                    who.mailForTomorrow.Add("passedOut " + (object)num);
                }
            });
            
            if (!who.isInBed.Value)
            {
                LocationRequest locationRequest = Game1.getLocationRequest(who.homeLocation.Value, false);
                Game1.warpFarmer(locationRequest, (int)bed.X / 64, (int)bed.Y / 64, 2);
                locationRequest.OnWarp += callback;
                who.FarmerSprite.setCurrentSingleFrame(5, (short)3000, false, false);
                who.FarmerSprite.PauseForSingleAnimation = true;
            }
            else
            {
                callback();
            }

            return false;
        }
示例#54
0
        public void onEnabled()
        {
            var dsc = System.IO.Path.DirectorySeparatorChar;

            //assetBundle = AssetBundle.LoadFromFile(Path + dsc + "assetbundle" + dsc + "assetpack");
            //SideCrossBeamsGo = assetBundle.LoadAsset<GameObject>("21a3f09b79e34f147a2b6017d2b6c05b");
            assetBundle      = AssetBundle.LoadFromFile(Path + dsc + "assetbundle" + dsc + "corkscrewassetpack");
            SideCrossBeamsGo = assetBundle.LoadAsset <GameObject>("c184c4f392587465f9bf2c86e6615e78");
            FrontCartGo      = assetBundle.LoadAsset <GameObject>("01be2cec49bbb476381a537d75ad047e");
            CartGo           = assetBundle.LoadAsset <GameObject>("7c1045f838c59460db2bfebd3df04a47");

            binder = new TrackRiderBinder("kvwQwhKWWG");
            TrackedRide iboxCoaster =
                binder.RegisterTrackedRide <TrackedRide>("Floorless Coaster", "IboxCoaster", "Steel Hybrid Coaster");
            TrackedRide topperCoaster =
                binder.RegisterTrackedRide <TrackedRide>("Floorless Coaster", "TopperCoaster", "Wooden Hybrid Coaster");
            HybridCoasterMeshGenerator iboxTrackGenerator =
                binder.RegisterMeshGenerator <HybridCoasterMeshGenerator>(iboxCoaster);
            HybridCoasterMeshGenerator topperTrackGenerator =
                binder.RegisterMeshGenerator <HybridCoasterMeshGenerator>(topperCoaster);

            TrackRideHelper.PassMeshGeneratorProperties(TrackRideHelper.GetTrackedRide("Floorless Coaster").meshGenerator,
                                                        iboxCoaster.meshGenerator);
            TrackRideHelper.PassMeshGeneratorProperties(TrackRideHelper.GetTrackedRide("Floorless Coaster").meshGenerator,
                                                        topperCoaster.meshGenerator);

            HybridCoasterSupportInstantiator iboxSupportGenerator   = binder.RegisterSupportGenerator <HybridCoasterSupportInstantiator>(iboxCoaster);
            HybridCoasterSupportInstantiator topperSupportGenerator = binder.RegisterSupportGenerator <HybridCoasterSupportInstantiator>(topperCoaster);

            iboxCoaster.canCurveLifts        = true;
            topperCoaster.canCurveLifts      = true;
            iboxCoaster.description          = "A rollercoaster combining a steel track and a mix of wooden and steel supports to allow elements not normally found on wooden coasters.";
            topperCoaster.description        = "A rollercoaster combining a wooden track and a mix of wooden and steel supports to allow elements not normally found on wooden coasters.";
            iboxTrackGenerator.path          = Path;
            topperTrackGenerator.path        = Path;
            iboxTrackGenerator.crossBeamGO   = null;
            topperTrackGenerator.crossBeamGO = null;
            GameObject hybridSupportContainer = new GameObject("HybridCoasterSupports");
            GameObject hybridSupportLocation  = new GameObject("HybridCoasterSupportLocation");

            hybridSupportContainer.AddComponent <SupportHybridCoaster>();
            hybridSupportLocation.AddComponent <HybridSupportLocation>();
            SupportConfiguration hybridSupportConfiguration = new SupportConfiguration();

            hybridSupportConfiguration.supportLocationGO  = hybridSupportLocation.GetComponent <HybridSupportLocation>();
            hybridSupportConfiguration.supportSettings    = new SupportSettings[1];
            hybridSupportConfiguration.supportSettings[0] = new SupportSettings();
            hybridSupportConfiguration.supportSettings[0].minimumHeightAboveGround = 0.25f;
            hybridSupportConfiguration.supportSettings[0].supportGO = hybridSupportContainer.GetComponent <SupportHybridCoaster>();
            iboxCoaster.supportConfiguration = hybridSupportConfiguration;
            //iboxCoaster.supportConfiguration.supportSettings[0].supportGO = hybridSupportContainer.GetComponent<SupportHybridCoaster>();
            //iboxTrackGenerator.supportInstantiator = null;
            //topperTrackGenerator.supportInstantiator = null;
            iboxTrackGenerator.stationPlatformGO   = TrackRideHelper.GetTrackedRide("Spinning Coaster").meshGenerator.stationPlatformGO;
            topperTrackGenerator.stationPlatformGO = TrackRideHelper.GetTrackedRide("Spinning Coaster").meshGenerator.stationPlatformGO;
            iboxTrackGenerator.frictionWheelsGO    = TrackRideHelper.GetTrackedRide("Junior Coaster").meshGenerator.frictionWheelsGO;
            topperTrackGenerator.frictionWheelsGO  = TrackRideHelper.GetTrackedRide("Junior Coaster").meshGenerator.frictionWheelsGO;
            iboxTrackGenerator.material            = TrackRideHelper.GetTrackedRide("Wooden Coaster").meshGenerator.material;
            topperTrackGenerator.material          = TrackRideHelper.GetTrackedRide("Wooden Coaster").meshGenerator.material;
            iboxTrackGenerator.metalMaterial       = TrackRideHelper.GetTrackedRide("Steel Coaster").meshGenerator.material;
            topperTrackGenerator.metalMaterial     = TrackRideHelper.GetTrackedRide("Steel Coaster").meshGenerator.material;
            topperTrackGenerator.useTopperTrack    = true;

            iboxCoaster.price      = 1650;
            topperCoaster.price    = 1700;
            iboxCoaster.carTypes   = new CoasterCarInstantiator[] { };
            topperCoaster.carTypes = new CoasterCarInstantiator[] { };
            iboxCoaster.meshGenerator.customColors = new[]
            {
                new Color(132f / 255f, 40f / 255f, 137f / 255f, 1), new Color(23f / 255f, 133f / 255f, 30f / 255f, 1),
                new Color(180 / 255f, 180f / 255f, 180f / 255f, 1), new Color(108f / 255f, 70f / 255f, 23f / 255f, 1)
            };
            topperCoaster.meshGenerator.customColors = new[]
            {
                new Color(132f / 255f, 40f / 255f, 137f / 255f, 1), new Color(23f / 255f, 133f / 255f, 30f / 255f, 1),
                new Color(180 / 255f, 180f / 255f, 180f / 255f, 1), new Color(108f / 255f, 70f / 255f, 23f / 255f, 1)
            };
            iboxCoaster.dropsImportanceExcitement          = 0.665f;
            topperCoaster.dropsImportanceExcitement        = 0.665f;
            iboxCoaster.inversionsImportanceExcitement     = 0.673f;
            topperCoaster.inversionsImportanceExcitement   = 0.673f;
            iboxCoaster.averageLatGImportanceExcitement    = 0.121f;
            topperCoaster.averageLatGImportanceExcitement  = 0.121f;
            iboxCoaster.accelerationImportanceExcitement   = 0.525f;
            topperCoaster.accelerationImportanceExcitement = 0.525f;

            CoasterCarInstantiator iboxCoasterCarInstantiator =
                binder.RegisterCoasterCarInstaniator <CoasterCarInstantiator>(iboxCoaster, "RmcCoasterInsantiator",
                                                                              "Hybrid Coaster Cars", 1, 15, 6);
            CoasterCarInstantiator topperCoasterCarInstantiator =
                binder.RegisterCoasterCarInstaniator <CoasterCarInstantiator>(topperCoaster, "RmcCoasterInsantiator",
                                                                              "Hybrid Coaster Cars", 1, 15, 6);

            BaseCar frontCar = binder.RegisterCar <BaseCar>(Object.Instantiate(FrontCartGo), "RmcCoaster_Front_Car",
                                                            .35f, 0f, true, new[]
            {
                new Color(168f / 255, 14f / 255, 14f / 255), new Color(234f / 255, 227f / 255, 227f / 255),
                new Color(73f / 255, 73f / 255, 73f / 255)
            }
                                                            );

            iboxCoasterCarInstantiator.frontVehicleGO   = frontCar;
            topperCoasterCarInstantiator.frontVehicleGO = frontCar;
            iboxCoasterCarInstantiator.frontVehicleGO.gameObject.AddComponent <RestraintRotationController>().closedAngles =
                new Vector3(110, 0, 0);
            topperCoasterCarInstantiator.frontVehicleGO.gameObject.AddComponent <RestraintRotationController>().closedAngles =
                new Vector3(110, 0, 0);

            List <Transform> transforms = new List <Transform>();

            Utility.recursiveFindTransformsStartingWith("wheel", frontCar.transform, transforms);
            foreach (var transform in transforms)
            {
                transform.gameObject.AddComponent <FrictionWheelAnimator>();
            }

            BaseCar backCar = binder.RegisterCar <BaseCar>(Object.Instantiate(CartGo), "RmcCoaster_Back_Car", .35f,
                                                           -.3f, false, new[]
            {
                new Color(168f / 255, 14f / 255, 14f / 255), new Color(234f / 255, 227f / 255, 227f / 255),
                new Color(73f / 255, 73f / 255, 73f / 255)
            }
                                                           );

            iboxCoasterCarInstantiator.vehicleGO   = backCar;
            topperCoasterCarInstantiator.vehicleGO = backCar;
            iboxCoasterCarInstantiator.vehicleGO.gameObject.AddComponent <RestraintRotationController>().closedAngles =
                new Vector3(110, 0, 0);
            topperCoasterCarInstantiator.vehicleGO.gameObject.AddComponent <RestraintRotationController>().closedAngles =
                new Vector3(110, 0, 0);

            Utility.recursiveFindTransformsStartingWith("wheel", backCar.transform, transforms);
            foreach (var transform in transforms)
            {
                transform.gameObject.AddComponent <FrictionWheelAnimator>();
            }

            binder.Apply();
            assetBundle.Unload(false);
        }
示例#55
0
        public void Discord(Mobile target)
        {
            if (Utility.RandomDouble() < 0.9)
            {
                target.AddSkillMod(new TimedSkillMod(SkillName.Magery, true, this.Combatant.Skills.Magery.Base * this.DiscordModifier * -1, TimeSpan.FromSeconds(this.DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Necromancy, true, this.Combatant.Skills.Necromancy.Base * this.DiscordModifier * -1, TimeSpan.FromSeconds(this.DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Tactics, true, this.Combatant.Skills.Tactics.Base * this.DiscordModifier * -1, TimeSpan.FromSeconds(this.DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Swords, true, this.Combatant.Skills.Swords.Base * this.DiscordModifier * -1, TimeSpan.FromSeconds(this.DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Meditation, true, this.Combatant.Skills.Meditation.Base * this.DiscordModifier * -1, TimeSpan.FromSeconds(this.DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Focus, true, this.Combatant.Skills.Focus.Base * this.DiscordModifier * -1, TimeSpan.FromSeconds(this.DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Chivalry, true, this.Combatant.Skills.Chivalry.Base * this.DiscordModifier * -1, TimeSpan.FromSeconds(this.DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Wrestling, true, this.Combatant.Skills.Wrestling.Base * this.DiscordModifier * -1, TimeSpan.FromSeconds(this.DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Spellweaving, true, this.Combatant.Skills.Spellweaving.Base * this.DiscordModifier * -1, TimeSpan.FromSeconds(this.DiscordDuration)));

                Timer.DelayCall(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), (int)this.DiscordDuration, new TimerStateCallback(Animate), target);

                target.SendMessage("The Lich's touch weakens all of your fighting skills!");
                target.PlaySound(0x458);////
            }
            else
            {
                target.SendMessage("The Lich barely misses touching you, saving you from harm!"); 
                target.PlaySound(0x458);/////
            }

            this.m_NextDiscordTime = DateTime.Now + TimeSpan.FromSeconds(this.DiscordMinDelay + Utility.RandomDouble() * this.DiscordMaxDelay);
        }
        private static void EventSink_ClientVersionReceived(ClientVersionReceivedArgs e)
        {
            string        kickMessage = null;
            NetState      state       = e.State;
            ClientVersion version     = e.Version;

            if (state.Mobile.IsStaff())
            {
                return;
            }

            if (Required != null && version < Required && (m_OldClientResponse == OldClientResponse.Kick || (m_OldClientResponse == OldClientResponse.LenientKick && (DateTime.UtcNow - state.Mobile.CreationTime) > m_AgeLeniency && state.Mobile is PlayerMobile && ((PlayerMobile)state.Mobile).GameTime > m_GameTimeLeniency)))
            {
                kickMessage = String.Format("This server requires your client version be at least {0}.", Required);
            }
            else if (!AllowGod || !AllowRegular || !AllowUOTD)
            {
                if (!AllowGod && version.Type == ClientType.God)
                {
                    kickMessage = "This server does not allow god clients to connect.";
                }
                else if (!AllowRegular && version.Type == ClientType.Regular)
                {
                    kickMessage = "This server does not allow regular clients to connect.";
                }
                else if (!AllowUOTD && state.IsUOTDClient)
                {
                    kickMessage = "This server does not allow UO:TD clients to connect.";
                }

                if (!AllowGod && !AllowRegular && !AllowUOTD)
                {
                    kickMessage = "This server does not allow any clients to connect.";
                }
                else if (AllowGod && !AllowRegular && !AllowUOTD && version.Type != ClientType.God)
                {
                    kickMessage = "This server requires you to use the god client.";
                }
                else if (kickMessage != null)
                {
                    if (AllowRegular && AllowUOTD)
                    {
                        kickMessage += " You can use regular or UO:TD clients.";
                    }
                    else if (AllowRegular)
                    {
                        kickMessage += " You can use regular clients.";
                    }
                    else if (AllowUOTD)
                    {
                        kickMessage += " You can use UO:TD clients.";
                    }
                }
            }

            if (kickMessage != null)
            {
                state.Mobile.SendMessage(0x22, kickMessage);
                state.Mobile.SendMessage(0x22, "You will be disconnected in {0} seconds.", KickDelay.TotalSeconds);

                Timer.DelayCall(KickDelay, delegate
                {
                    if (state.Socket != null)
                    {
                        Utility.PushColor(ConsoleColor.DarkRed);
                        Console.WriteLine("Client: {0}: Disconnecting, bad version", state);
                        Utility.PopColor();
                        state.Dispose();
                    }
                });
            }
            else if (Required != null && version < Required)
            {
                switch (m_OldClientResponse)
                {
                case OldClientResponse.Warn:
                {
                    state.Mobile.SendMessage(0x22, "Your client is out of date. Please update your client.", Required);
                    state.Mobile.SendMessage(0x22, "This server recommends that your client version be at least {0}.", Required);
                    break;
                }

                case OldClientResponse.LenientKick:
                case OldClientResponse.Annoy:
                {
                    SendAnnoyGump(state.Mobile);
                    break;
                }
                }
            }
        }
示例#57
0
        public override void GenerateLoot()
        {
            if (Core.UOAI || Core.UOAR)
            {
                PackItem(new SulfurousAsh(Utility.RandomMinMax(6, 10)));
                PackItem(new MandrakeRoot(Utility.RandomMinMax(6, 10)));
                PackItem(new BlackPearl(Utility.RandomMinMax(6, 10)));
                PackItem(new MortarPestle());
                PackItem(new ExplosionPotion());

                PackGold(90, 120);

                if (0.2 > Utility.RandomDouble())
                {
                    PackItem(new BolaBall());
                }

                // Froste: 12% random IOB drop
                if (0.12 > Utility.RandomDouble())
                {
                    Item iob = Loot.RandomIOB();
                    PackItem(iob);
                }

                // Category 2 MID
                PackMagicItem(1, 1, 0.05);

                if (IOBRegions.GetIOBStronghold(this) == IOBAlignment)
                {
                    // 30% boost to gold
                    PackGold(base.GetGold() / 3);
                }
            }
            else
            {
                if (Core.UOSP || Core.UOMO)
                {                       // http://web.archive.org/web/20020405080756/uo.stratics.com/hunters/orcbomber.shtml
                                        //  200 Gold, reagents, purple potions, ingots, bola ball
                    if (Spawning)
                    {
                        PackGold(200);
                    }
                    else
                    {
                        PackItem(new SulfurousAsh(Utility.RandomMinMax(6, 10)));
                        PackItem(new MandrakeRoot(Utility.RandomMinMax(6, 10)));
                        PackItem(new BlackPearl(Utility.RandomMinMax(6, 10)));
                        PackItem(new LesserExplosionPotion());
                        PackItem(new IronIngot(Utility.RandomMinMax(1, 3)));

                        // http://www.uoguide.com/Savage_Empire
                        // http://uo.stratics.com/secrets/archive/orcsavage.shtml
                        // Bola balls have appeared as loot on Orc Bombers. Balls on Bombers are rather common, around a 50/50% chance of getting a ball or not. They are only appearing as loot on bombers.
                        if (Core.PublishDate >= Core.EraSAVE)
                        {
                            if (Utility.RandomBool())
                            {
                                PackItem(new BolaBall());
                            }
                        }
                    }
                }
                else
                {
                    if (Spawning)
                    {
                        PackItem(new SulfurousAsh(Utility.RandomMinMax(6, 10)));
                        PackItem(new MandrakeRoot(Utility.RandomMinMax(6, 10)));
                        PackItem(new BlackPearl(Utility.RandomMinMax(6, 10)));
                        PackItem(new MortarPestle());
                        PackItem(new LesserExplosionPotion());

                        // http://www.uoguide.com/Savage_Empire
                        // http://uo.stratics.com/secrets/archive/orcsavage.shtml
                        // Bola balls have appeared as loot on Orc Bombers. Balls on Bombers are rather common, around a 50/50% chance of getting a ball or not. They are only appearing as loot on bombers.
                        if (Core.PublishDate >= Core.EraSAVE)
                        {
                            if (Utility.RandomBool())
                            {
                                PackItem(new BolaBall());
                            }
                        }
                    }

                    AddLoot(LootPack.Average);
                    AddLoot(LootPack.Meager);
                }
            }
        }
示例#58
0
 public override void AlterDamageScalarFrom(Mobile caster, ref double scalar)
 {
     if (0.05 >= Utility.RandomDouble())
         this.SpawnShadowDwellers(caster);
 }
示例#59
0
 private int CheckInput()
 {
     if (txtTitle.Text.Trim() == string.Empty)
     {
         Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIRED", "WorkCordTitle"));
         return(-1);
     }
     if (dtiDateTime.DateTimeValue == new DateTime(1, 1, 1, 0, 0, 0))
     {
         Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIRED", "STARTTIME"));
         return(-1);
     }
     if (txtContent.Text.Trim() == string.Empty)
     {
         Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("REQUIRED", "WorkCordContent"));
         return(-1);
     }
     return(1);
 }
示例#60
0
		public override void CheckReflect( Mobile caster, ref bool reflect )
		{
			if ( Utility.RandomMinMax( 1, 2 ) == 1 ){ reflect = true; } // 50% spells are reflected back to the caster
			else { reflect = false; }
		}