示例#1
0
        /// <summary>
        /// Excel处理
        /// </summary>
        /// <param name="excelGlobalDTO"></param>
        public void ExcelHandle(ExcelGlobalDTO <TEntity> excelGlobalDTO)
        {
            //执行处理前扩展
            ExcelHandleBefore(excelGlobalDTO);

            //设置区块
            AreaBlock <TEntity> areaBlock = new AreaBlock <TEntity>();

            areaBlock.SetAreaBlock(excelGlobalDTO);

            //设置头部颜色
            HeadColor <TEntity> headColor = new HeadColor <TEntity>();

            headColor.SetHeadColor(excelGlobalDTO);

            excelGlobalDTO.PerformanceMonitoring.Start("SetRowColor");
            //设置行颜色
            RowColor <TEntity> rowColor = new RowColor <TEntity>();

            rowColor.SetRowColor(excelGlobalDTO);
            excelGlobalDTO.PerformanceMonitoring.Stop();

            //设置锁定
            SheetLocked <TEntity> sheetLocked = new SheetLocked <TEntity>();

            sheetLocked.SetSheetLocked(excelGlobalDTO);

            //设置列隐藏
            SheetColumnHidden <TEntity> sheetColumnHidden = new SheetColumnHidden <TEntity>();

            sheetColumnHidden.SetSheetColumnHidden(excelGlobalDTO);

            //批注
            Comment <TEntity> comment = new Comment <TEntity>();

            //清空批注
            comment.ClearComment(excelGlobalDTO);

            //设置批注
            comment.SetComment(excelGlobalDTO);

            //设置列类型
            SheetColumnType <TEntity> sheetColumnType = new SheetColumnType <TEntity>();

            sheetColumnType.SetSheetColumnType(excelGlobalDTO);

            //从Excel处理
            SlaveExcel <TEntity> slaveExcel = new SlaveExcel <TEntity>();

            slaveExcel.SlaveExcelHandle(excelGlobalDTO);

            //执行处理后扩展
            ExcelHandleAfter(excelGlobalDTO);
        }
示例#2
0
 public new void Setup()
 {
     base.Setup();
     defaultFont = CreateFont(DefaultFontStr, DefaultFontSize);
     areaBrush   = AreaColor.GetSolidBrush(this);
     textBrush   = TextColor.GetSolidBrush(this);
     blueBrush   = CreateSolidBrush(Color.Blue);
     redBrush    = CreateSolidBrush(Color.Red);
     headBrush   = HeadColor.GetSolidBrush(this);
     bodyBrush   = BodyColor.GetSolidBrush(this);
 }
示例#3
0
        new public void  Setup()
        {
            base.Setup();

            DefaultFont = CreateFont(DefaultFontstr, DefaultFontSize);
            acb         = AreaColor.getSolidBrush(this);
            tfb         = TextColor.getSolidBrush(this);
            csb         = CreateSolidBrush(Color.Blue);
            csfmb       = CreateSolidBrush(Color.Red);
            hcb         = HeadColor.getSolidBrush(this);
            bcb         = BodyColor.getSolidBrush(this);
        }
示例#4
0
        public override void AI()
        {
            npc.velocity   *= 0.96f;
            npc.velocity.Y *= 0.96f;

            if (!initialized)
            {
                initialized = true;
                headColor   = (HeadColor)Main.rand.Next(3);

                rotation = Main.rand.NextFloat(6.28f);
                sway     = Main.rand.NextFloat(6.28f);

                centralDistance = Main.rand.Next(75, 125);
                rotationSpeed   = Main.rand.NextFloat(0.03f, 0.05f);
                orbitRange      = Main.rand.NextVector2Circular(70, 30);
                swaySpeed       = Main.rand.NextFloat(0.015f, 0.035f);
            }

            if (!Parent.active)
            {
                npc.active = false;
                return;
            }

            RotateToPlayer();

            if (!attacking)
            {
                frameCounter++;
                if (frameCounter % 5 == 0)
                {
                    frameY++;
                }
                frameY            %= NumFrames();
                headRotationOffset = 0f;
                rotation          += rotationSpeed;
                sway += swaySpeed;

                headRotationOffset = npc.DirectionTo(Main.player[Parent.target].Center).ToRotation();
            }
            else
            {
                AttackBehavior();
            }

            npc.spriteDirection = npc.direction = Parent.direction;
            centralRotation     = 0.3f * ((float)Math.Sin(sway) + (npc.direction * 1.5f));
            posToBe             = DecidePosition();

            MoveToPosition();

            if (headColor == HeadColor.Red)
            {
                npc.buffImmune[BuffID.OnFire]   = true;
                npc.buffImmune[BuffID.Confused] = true;
            }
            if (headColor == HeadColor.Green)
            {
                npc.buffImmune[BuffID.Poisoned] = true;
                npc.buffImmune[BuffID.Confused] = true;
            }
            if (headColor == HeadColor.Purple)
            {
                npc.buffImmune[BuffID.Venom]    = true;
                npc.buffImmune[BuffID.Confused] = true;
            }

            if (!Parent.active)
            {
                npc.active = false;
            }
        }
示例#5
0
        public static int Main(string[] args)
        {
            Console.Title = "RBXLegacy - Body Color Generator";

            // Test if input arguments were supplied:
            if (args.Length == 0)
            {
                Console.WriteLine("Usage: BodyColorGen <number>");
                Console.WriteLine("Number Values:");
                Console.WriteLine("0 = All possible combos");
                Console.WriteLine("1 = 2006 style patterns");
                Console.WriteLine("2 = Shirt and Pants");
                return(1);
            }

            int  num;
            bool test = int.TryParse(args[0], out num);

            if (test == false)
            {
                Console.WriteLine("Usage: BodyColorGen <number>");
                Console.WriteLine("Number Values:");
                Console.WriteLine("0 = All possible combos");
                Console.WriteLine("1 = 2006 style patterns");
                Console.WriteLine("2 = Shirt and Pants");
                return(1);
            }

            int[] colorArray = new int[32] {
                1, 208, 194, 199, 26, 21, 24, 226, 23, 107, 102, 11, 45, 135, 106, 105, 141, 28, 37, 119, 29, 151, 38, 192, 104, 9, 101, 5, 153, 217, 18, 125
            };
            int HeadColor, TorsoColor, LArmColor, RArmColor, LLegColor, RLegColor;
            int FleshColor, ShirtColor, PantsColor;

            while (true)
            {
                Random rand = new Random();
                if (num == 1)
                {
                    FleshColor = rand.Next(colorArray.Length);
                    ShirtColor = rand.Next(colorArray.Length);
                    PantsColor = rand.Next(colorArray.Length);
                    HeadColor  = colorArray[FleshColor];
                    TorsoColor = colorArray[ShirtColor];
                    LArmColor  = colorArray[FleshColor];
                    RArmColor  = colorArray[FleshColor];
                    LLegColor  = colorArray[PantsColor];
                    RLegColor  = colorArray[PantsColor];
                }
                else if (num == 2)
                {
                    FleshColor = rand.Next(colorArray.Length);
                    ShirtColor = rand.Next(colorArray.Length);
                    PantsColor = rand.Next(colorArray.Length);
                    HeadColor  = colorArray[FleshColor];
                    TorsoColor = colorArray[ShirtColor];
                    LArmColor  = colorArray[ShirtColor];
                    RArmColor  = colorArray[ShirtColor];
                    LLegColor  = colorArray[PantsColor];
                    RLegColor  = colorArray[PantsColor];
                }
                else
                {
                    HeadColor  = colorArray[rand.Next(colorArray.Length)];
                    TorsoColor = colorArray[rand.Next(colorArray.Length)];
                    LArmColor  = colorArray[rand.Next(colorArray.Length)];
                    RArmColor  = colorArray[rand.Next(colorArray.Length)];
                    LLegColor  = colorArray[rand.Next(colorArray.Length)];
                    RLegColor  = colorArray[rand.Next(colorArray.Length)];
                }
                string dirname = "bodycolors/";
                if (!Directory.Exists(dirname))
                {
                    System.IO.Directory.CreateDirectory(dirname);
                }
                string filename = dirname + HeadColor + "-" + TorsoColor + "-" + LArmColor + "-" + RArmColor + "-" + LLegColor + "-" + RLegColor + ".rbxm";
                if (!File.Exists(filename))
                {
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.WriteLine("Writing " + filename);
                    XmlTextWriter writer = new XmlTextWriter(filename, System.Text.Encoding.UTF8);
                    writer.Formatting  = Formatting.Indented;
                    writer.Indentation = 3;
                    writer.WriteStartDocument(true);
                    writer.WriteStartElement("roblox");
                    writer.WriteAttributeString("xmlns:xmime", "http://www.w3.org/2005/05/xmlmime");
                    writer.WriteAttributeString("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
                    writer.WriteAttributeString("xsi:noNamespaceSchemaLocation", "http://www.roblox.com/roblox.xsd");
                    writer.WriteAttributeString("version", "4");
                    writer.WriteStartElement("External");
                    writer.WriteString("null");
                    writer.WriteEndElement();
                    writer.WriteStartElement("External");
                    writer.WriteString("nil");
                    writer.WriteEndElement();
                    writer.WriteStartElement("Item");
                    writer.WriteAttributeString("class", "BodyColors");
                    writer.WriteStartElement("Properties");
                    writer.WriteStartElement("int");
                    writer.WriteAttributeString("name", "HeadColor");
                    writer.WriteString(HeadColor.ToString());
                    writer.WriteEndElement();
                    writer.WriteStartElement("int");
                    writer.WriteAttributeString("name", "LeftArmColor");
                    writer.WriteString(LArmColor.ToString());
                    writer.WriteEndElement();
                    writer.WriteStartElement("int");
                    writer.WriteAttributeString("name", "LeftLegColor");
                    writer.WriteString(LLegColor.ToString());
                    writer.WriteEndElement();
                    writer.WriteStartElement("string");
                    writer.WriteAttributeString("name", "Name");
                    writer.WriteString("Body Colors");
                    writer.WriteEndElement();
                    writer.WriteStartElement("int");
                    writer.WriteAttributeString("name", "RightArmColor");
                    writer.WriteString(RArmColor.ToString());
                    writer.WriteEndElement();
                    writer.WriteStartElement("int");
                    writer.WriteAttributeString("name", "RightLegColor");
                    writer.WriteString(RLegColor.ToString());
                    writer.WriteEndElement();
                    writer.WriteStartElement("int");
                    writer.WriteAttributeString("name", "TorsoColor");
                    writer.WriteString(TorsoColor.ToString());
                    writer.WriteEndElement();
                    writer.WriteStartElement("bool");
                    writer.WriteAttributeString("name", "archivable");
                    writer.WriteString("true");
                    writer.WriteEndElement();
                    writer.WriteEndElement();
                    writer.WriteEndElement();
                    writer.WriteEndElement();
                    writer.WriteEndDocument();
                    writer.Close();
                }
            }
        }