Example #1
0
        public bool FolderCheck(int checkFolder)
        {
            int        num1       = 0;
            int        num2       = 0;
            ChipFolder chipFolder = new ChipFolder(this.sound);

            for (int index = 0; index < 30; ++index)
            {
                if (this.main.chipfolder[checkFolder, index].chip.navi)
                {
                    ++num1;
                }
                if (this.main.chipfolder[checkFolder, index].chip.dark)
                {
                    ++num2;
                }
                chipFolder.SettingChip(this.main.chipfolder[checkFolder, index].chip.number);
                if (chipFolder.chip is DammyChip)
                {
                    return(false);
                }
                int num3 = this.Manychip(chipFolder.chip.number, checkFolder);
                if (chipFolder.chip.regsize <= 19 && num3 > 5 + this.savedata.plusFolder || chipFolder.chip.regsize > 19 && chipFolder.chip.regsize <= 29 && num3 > 4 + this.savedata.plusFolder || (chipFolder.chip.regsize > 29 && chipFolder.chip.regsize <= 39 && num3 > 3 + this.savedata.plusFolder || chipFolder.chip.regsize > 39 && chipFolder.chip.regsize <= 49 && num3 > 2 + this.savedata.plusFolder) || (chipFolder.chip.regsize > 49 && num3 > 1 + this.savedata.plusFolder || num1 > this.savedata.NaviFolder || num2 > this.savedata.darkFolder))
                {
                    return(false);
                }
            }
            return(true);
        }
Example #2
0
 public override bool HitEvent(Player p)
 {
     if (!base.HitEvent(p))
     {
         return(false);
     }
     if (this.effect)
     {
         this.parent.effects.Add(new Elementhit(this.sound, this.parent, p.position.X, p.position.Y, 1, this.element));
     }
     if (this.character is Player)
     {
         Player     character  = (Player)this.character;
         ChipFolder chipFolder = new ChipFolder(this.sound);
         if (p.haveChip[0] != null)
         {
             character.haveChip.Insert(0, chipFolder.ReturnChip(p.haveChip[0].number));
             ++character.numOfChips;
             character.haveChip.RemoveAll(a => a == null);
         }
     }
     p.LossChip();
     this.get = true;
     return(true);
 }
Example #3
0
        private void SetDroppedChips()
        {
            ChipFolder chipFolder1 = new ChipFolder(this.sound);

            chipFolder1.SettingChip(this.InitialChips[0]);
            chipFolder1.codeNo = this.Random.Next(4);
            this.dropchips[0]  = chipFolder1;
            ChipFolder chipFolder2 = new ChipFolder(this.sound);

            chipFolder2.SettingChip(this.InitialChips[1]);
            chipFolder2.codeNo = this.Random.Next(4);
            this.dropchips[1]  = chipFolder2;
            ChipFolder chipFolder3 = new ChipFolder(this.sound);

            chipFolder3.SettingChip(this.InitialChips[2]);
            chipFolder3.codeNo = this.Random.Next(4);
            this.dropchips[2]  = chipFolder3;
            ChipFolder chipFolder4 = new ChipFolder(this.sound);

            chipFolder4.SettingChip(this.InitialChips[1]);
            chipFolder4.codeNo = this.Random.Next(4);
            this.dropchips[3]  = chipFolder4;
            ChipFolder chipFolder5 = new ChipFolder(this.sound);

            chipFolder5.SettingChip(this.InitialChips[0]);
            chipFolder5.codeNo = this.Random.Next(4);
            this.dropchips[4]  = chipFolder5;
        }
Example #4
0
        private ChipFolder SetChip()
        {
            ChipFolder chipFolder = new ChipFolder(null);

            chipFolder.SettingChip(this.number);
            chipFolder.codeNo = this.code;
            return(chipFolder);
        }
Example #5
0
        private void SetDroppedChips()
        {
            ChipFolder chipFolder1 = new ChipFolder(this.sound);

            chipFolder1.SettingChip(1);
            chipFolder1.codeNo = this.Random.Next(4);
            this.dropchips[0]  = chipFolder1;
            this.dropchips[1]  = chipFolder1;
            this.dropchips[2]  = chipFolder1;
            this.dropchips[3]  = chipFolder1;
            this.dropchips[4]  = chipFolder1;
        }
Example #6
0
        public int CodeCheck(int chipno, int chipcode)
        {
            ChipFolder chipFolder = new ChipFolder(null);

            chipFolder.SettingChip(chipno);
            for (int index = 0; index < 4; ++index)
            {
                if (chipFolder.chip.code[chipcode] == chipFolder.chip.code[index])
                {
                    chipcode = index;
                    break;
                }
            }
            return(chipcode);
        }
Example #7
0
        private List <ChipS> GetListMake(int many)
        {
            List <ChipS> chipSList1 = new List <ChipS>();
            List <ChipS> chipSList2 = new List <ChipS>();
            List <ChipS> chipSList3 = new List <ChipS>();

            for (int index = 1; index < byte.MaxValue; ++index)
            {
                ChipFolder chipFolder = new ChipFolder(this.sound);
                chipFolder.SettingChip(index);
                if (!(chipFolder.chip is DammyChip))
                {
                    if (this.savedata.datelist[index - 1])
                    {
                        chipSList2.Add(new ChipS(index, 0));
                    }
                    else
                    {
                        chipSList3.Add(new ChipS(index, 0));
                    }
                }
            }
            for (int index = 0; index < many; ++index)
            {
                int          num1       = this.Random.Next(1000) / 10;
                int          num2       = this.treader != Chiptreader.Treader.Normal ? (num1 >= 40 ? (num1 >= 70 ? (num1 >= 90 ? (num1 >= 99 ? 5 : 4) : 3) : 2) : 1) : (num1 >= 60 ? (num1 >= 90 ? 3 : 2) : 1);
                List <ChipS> chipSList4 = new List <ChipS>();
                List <ChipS> chipSList5 = new List <ChipS>();
                foreach (ChipS chipS in chipSList3)
                {
                    if (num2 == chipS.Reality)
                    {
                        chipSList4.Add(chipS);
                    }
                }
                foreach (ChipS chipS in chipSList2)
                {
                    if (num2 == chipS.Reality)
                    {
                        chipSList5.Add(chipS);
                    }
                }
                ChipS chipS1 = (this.Random.Next(100) >= 25 || chipSList4.Count <= 0) && chipSList5.Count > 0 ? chipSList5[this.Random.Next(chipSList5.Count)] : chipSList4[this.Random.Next(chipSList4.Count)];
                chipS1.code = this.Random.Next(4);
                chipSList1.Add(chipS1);
            }
            return(chipSList1);
        }
Example #8
0
        private void ChipNames()
        {
            this.codes = new string[450, 4];
            this.names = new string[450];
            List <string> stringList = new List <string>();

            for (int key = 0; key < 450; ++key)
            {
                ChipFolder chipFolder = new ChipFolder(null);
                chipFolder.chip = chipFolder.ReturnChip(key);
                stringList.Add(chipFolder.chip.name);
                for (int index = 0; index < 4; ++index)
                {
                    this.codes[key, index] = chipFolder.chip.code[index].ToString();
                }
            }
            this.names = stringList.ToArray();
        }
Example #9
0
        protected override void InitializeChips()
        {
            this.SetDroppedChips();

            ChipFolder chrgCan = new ChipFolder(this.sound);

            chrgCan.SettingChip(9);
            ChipFolder fireArm = new ChipFolder(this.sound);

            fireArm.SettingChip(16);
            ChipFolder sqAnchr = new ChipFolder(this.sound);

            sqAnchr.SettingChip(48);
            ChipFolder seedCan = new ChipFolder(this.sound);

            seedCan.SettingChip(6);
            this.chips = new[] { chrgCan, fireArm, sqAnchr, seedCan };
        }
Example #10
0
        public static ChipDefinition GetChipDefinition(int id)
        {
            var definition = new ChipDefinition();

            var chipFolder = new ChipFolder(null);
            var chipMade   = chipFolder.ReturnChip(id);

            var type = typeof(ChipFolder).Assembly.GetType("NSChip.DammyChip");

            if (chipMade.GetType() == type)
            {
                return(null);
            }

            definition.ID      = chipMade.number;
            definition.Name    = chipMade.name;
            definition.NameKey = Constants.TranslationCallKeys[definition.Name];
            definition.Codes   = chipMade.code;
            Constants.TranslationCallKeys.Clear();

            return(definition);
        }
Example #11
0
 private void GetChip()
 {
     if (this.lost)
     {
         return;
     }
     foreach (ChipS setchip in this.setchips)
     {
         this.savedata.LosChip(setchip.number, setchip.code);
     }
     this.getchips = this.GetListMake(this.setchips.Count / this.MaxSet);
     foreach (ChipS getchip in this.getchips)
     {
         this.savedata.AddChip(getchip.number, getchip.code, true);
         ChipFolder chipFolder = new ChipFolder(this.sound);
         chipFolder.SettingChip(getchip.number);
         chipFolder.codeNo = getchip.code;
         this.rendChip.Add(chipFolder);
     }
     this.lost   = true;
     this.getend = true;
 }
Example #12
0
 public override bool HitEvent(EnemyBase e)
 {
     if (!base.HitEvent(e))
     {
         return(false);
     }
     if (this.effect)
     {
         this.parent.effects.Add(new Elementhit(this.sound, this.parent, e.position.X, e.position.Y, 1, this.element));
     }
     if (this.character is Player)
     {
         Player     character  = (Player)this.character;
         ChipFolder chipFolder = new ChipFolder(this.sound);
         int        index      = this.Random.Next(5);
         character.haveChip.Insert(0, chipFolder.ReturnChip(e.dropchips[index].chip.number));
         ++character.numOfChips;
         character.haveChip.RemoveAll(a => a == null);
     }
     this.get = true;
     return(true);
 }
Example #13
0
        private void EventMake()
        {
            this.eventmanager.parent = this.manager.parent;
            this.eventmanager.events.Clear();
            this.eventmanager.AddEvent(new OpenMassageWindow(this.sound, this.eventmanager));
            var dialogue = ShanghaiEXE.Translate("ChipTrader.TradeDialogue1");

            this.eventmanager.AddEvent(new CommandMessage(this.sound, this.eventmanager, dialogue[0], dialogue[1], dialogue[2], false, this.savedata));
            this.eventmanager.AddEvent(new SEmon(this.sound, this.eventmanager, "getchip", 0, this.savedata));
            dialogue = ShanghaiEXE.Translate("ChipTrader.TradeDialogue2");
            this.eventmanager.AddEvent(new CommandMessage(this.sound, this.eventmanager, dialogue[0], dialogue[1], dialogue[2], false, this.savedata));
            this.eventmanager.AddEvent(new SEmon(this.sound, this.eventmanager, "treader", 0, this.savedata));
            dialogue = ShanghaiEXE.Translate("ChipTrader.TradeDialogue3");
            this.eventmanager.AddEvent(new CommandMessage(this.sound, this.eventmanager, dialogue[0], dialogue[1], dialogue[2], false, this.savedata));
            this.eventmanager.AddEvent(new EditValue(this.sound, this.eventmanager, 15, false, 0, 0, "0", this.manager.parent.Player, this.savedata));
            foreach (ChipS getchip in this.getchips)
            {
                ChipFolder chipFolder = new ChipFolder(this.sound);
                chipFolder.SettingChip(getchip.number);
                chipFolder.codeNo = getchip.code;
                string chipCode = chipFolder.chip.code[chipFolder.codeNo] == ChipFolder.CODE.asterisk ? "*" : chipFolder.chip.code[chipFolder.codeNo].ToString();
                this.eventmanager.AddEvent(new EditValue(this.sound, this.eventmanager, 21, false, 0, 0, "-96", this.manager.parent.Player, this.savedata));
                this.eventmanager.AddEvent(new SEmon(this.sound, this.eventmanager, "get", 0, this.savedata));
                this.eventmanager.AddEvent(new EditValue(this.sound, this.eventmanager, 0, false, 0, 5, "0", this.manager.parent.Player, this.savedata));
                this.eventmanager.AddEvent(new EditValue(this.sound, this.eventmanager, 1, false, 0, 5, "1", this.manager.parent.Player, this.savedata));
                this.eventmanager.AddEvent(new EditValue(this.sound, this.eventmanager, 2, false, 0, 5, "2", this.manager.parent.Player, this.savedata));
                this.eventmanager.AddEvent(new EffectMake(this.sound, this.eventmanager, 4, "get", 0, 1, 2, 1, -1, 0, 1, "none", this.manager.parent, this.manager.parent.Field, null, this.savedata));
                this.eventmanager.AddEvent(new PlayerHide(this.sound, this.eventmanager, true, this.manager.parent.Player, this.savedata));
                string receiver = this.savedata.isJackedIn ? ShanghaiEXE.Translate("ChipTrader.ResultRecipientShanghai") : ShanghaiEXE.Translate("ChipTrader.ResultRecipientAlice");
                dialogue = ShanghaiEXE.Translate("ChipTrader.ResultDialogue1Format").Format(receiver, chipFolder.chip.name, chipCode);
                this.eventmanager.AddEvent(new CommandMessage(this.sound, this.eventmanager, dialogue[0], dialogue[1], dialogue[2], true, this.savedata));
                this.eventmanager.AddEvent(new PlayerHide(this.sound, this.eventmanager, false, this.manager.parent.Player, this.savedata));
                this.eventmanager.AddEvent(new EffectEnd(this.sound, this.eventmanager, this.manager.parent.Field, this.savedata));
                this.eventmanager.AddEvent(new EditValue(this.sound, this.eventmanager, 15, false, 1, 0, "1", this.manager.parent.Player, this.savedata));
            }
            this.eventmanager.AddEvent(new CloseMassageWindow(this.sound, this.eventmanager));
        }
Example #14
0
        public override void Render(IRenderer dg)
        {
            if (this.shopmode)
            {
                this.field.back.Render(dg);
                this._rect     = new Rectangle(656, 0, 160, 104);
                this._position = new Vector2(0.0f, 0.0f);
                dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                Vector2 point;
                for (int index = 0; index < Math.Min(5, this.goods.Length); ++index)
                {
                    int   num   = 0;
                    Color color = Color.White;
                    if (this.goods[this.top + index].stock > 0 && this.savedata.ShopCount[this.shopNo, this.top + index] >= this.goods[this.top + index].stock)
                    {
                        color = Color.Gray;
                    }
                    switch (this.shopType)
                    {
                    case 0:
                        if (this.goods[this.top + index].numberNo > 0)
                        {
                            ChipS          chipS     = new ChipS(this.goods[this.top + index].numberNo, this.goods[this.top + index].numberSub);
                            AllBase.NAME[] nameArray = this.Nametodata(chipS.Name);
                            point          = new Vector2(16f, 12 + index * 16);
                            this._position = new Vector2(point.X, point.Y);
                            DrawBlockCharacters(dg, nameArray, 16, this._position, color, out this._rect, out this._position);
                            this._position = new Vector2(88f, 12 + 16 * index);
                            this._rect     = new Rectangle(chipS.Code * 8, 32, 8, 16);
                            dg.DrawImage(dg, "font", this._rect, true, this._position, color);
                            num = this.goods[this.top + index].price;
                            break;
                        }
                        AllBase.NAME[] nameArray1 = this.Nametodata(ShanghaiEXE.Translate("Shop.HPMemory"));
                        point          = new Vector2(16f, 12 + index * 16);
                        this._position = new Vector2(point.X, point.Y);
                        DrawBlockCharacters(dg, nameArray1, 16, this._position, color, out this._rect, out this._position);
                        num = this.goods[this.top + index].price + this.goods[this.top + index].numberSub * this.savedata.ShopCount[this.shopNo, index];
                        if (this.savedata.ShopCount[this.shopNo, this.top + index] >= this.goods[this.top + index].stock)
                        {
                            num -= this.goods[this.top + index].numberSub;
                        }
                        break;

                    case 1:
                        AllBase.NAME[] nameArray2 = this.Nametodata(SubChip.NameSet(this.goods[this.top + index].numberNo));
                        point          = new Vector2(16f, 12 + index * 16);
                        this._position = new Vector2(point.X, point.Y);
                        DrawBlockCharacters(dg, nameArray2, 16, this._position, color, out this._rect, out this._position);
                        num = SubChip.PriceSet(this.goods[this.top + index].numberNo) - this.goods[this.top + index].numberSub;
                        break;

                    case 2:
                        AllBase.NAME[] nameArray3 = this.Nametodata(AddOnBase.AddOnSet(this.goods[this.top + index].numberNo, this.goods[this.top + index].numberSub).name);
                        point          = new Vector2(16f, 12 + index * 16);
                        this._position = new Vector2(point.X, point.Y);
                        DrawBlockCharacters(dg, nameArray3, 16, this._position, color, out this._rect, out this._position);
                        AllBase.NAME[] nameArray4 = this.Nametodata(AddOnBase.ColorToAlphabet(this.goods[this.top + index].numberSub));
                        point          = new Vector2(88f, 12 + index * 16);
                        this._position = new Vector2(point.X, point.Y);
                        DrawBlockCharacters(dg, nameArray4, 16, this._position, color, out this._rect, out this._position);
                        num = this.goods[this.top + index].price;
                        break;

                    case 3:
                        point = new Vector2(16f, 14 + index * 16);
                        ++point.X;
                        ++point.Y;
                        dg.DrawMiniText(Shop.INTERIOR.GetItem(this.goods[this.top + index].numberNo), point, Color.FromArgb(32, 32, 32));
                        --point.X;
                        --point.Y;
                        dg.DrawMiniText(Shop.INTERIOR.GetItem(this.goods[this.top + index].numberNo), point, Color.White);
                        num = this.goods[this.top + index].price;
                        break;
                    }
                    this._position = new Vector2(8f, 12 + 16 * index);
                    AllBase.NAME[] nameArray5 = this.moneyType != 0 ? this.Nametodata(num.ToString()) : this.Nametodata(num.ToString() + "Z");
                    point = new Vector2(152 - nameArray5.Length * 8, 12 + index * 16);
                    foreach (var data in ((IEnumerable <AllBase.NAME>)nameArray5).Select((v, j) => new
                    {
                        v,
                        j
                    }))
                    {
                        this._rect     = new Rectangle((int)data.v * 8, 16, 8, 16);
                        this._position = new Vector2(point.X + 8 * data.j, point.Y);
                        dg.DrawImage(dg, "font", this._rect, true, this._position, color);
                    }
                }
                this._rect     = new Rectangle(240 + 16 * this.cursolanime, 48, 16, 16);
                this._position = new Vector2(0.0f, 12 + this.cursol * 16);
                dg.DrawImage(dg, "window", this._rect, true, this._position, Color.White);
                float num1 = this.overTop != 0 && this.top != 0 ? 80f / overTop * top : 0.0f;
                this._rect     = new Rectangle(176, 168, 8, 8);
                this._position = new Vector2(152f, 8f + num1);
                dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                if (this.top > 0)
                {
                    this._rect     = new Rectangle(160 + 8 * this.cursolanime, 208, 8, 8);
                    this._position = new Vector2(84f, 4f);
                    dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                }
                if (this.top < this.overTop)
                {
                    this._rect     = new Rectangle(184 + 8 * this.cursolanime, 208, 8, 8);
                    this._position = new Vector2(84f, 92f);
                    dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                }
                this._rect     = new Rectangle(0, 0, 240, 56);
                this._position = new Vector2(0.0f, 104f);
                dg.DrawImage(dg, "window", this._rect, true, this._position, Color.White);
                if (!this.help)
                {
                    this._position = new Vector2(5f, 108f);
                    this._rect     = new Rectangle(0, faceNo * 48, 40, 48);
                    string te = "Face" + this.faceSeet.ToString();
                    dg.DrawImage(dg, te, this._rect, true, this._position, Color.White);
                    if (!this.eventmanager.playevent)
                    {
                        for (int index = 0; index < this.massage.Length; ++index)
                        {
                            this._position = new Vector2(48f, 108 + 16 * index);
                            dg.DrawText(this.massage[index], this._position, this.savedata);
                        }
                    }
                }
                else
                {
                    string[] strArray = new string[3] {
                        "", "", ""
                    };
                    switch (this.shopType)
                    {
                    case 0:
                        if ((uint)this.goods[this.Select].numberNo > 0U)
                        {
                            ChipFolder chipFolder = new ChipFolder(null);
                            chipFolder.SettingChip(this.goods[this.Select].numberNo);
                            this._position = new Vector2(80f, 8f);
                            if (chipFolder.chip.dark)
                            {
                                this._rect = new Rectangle(848, 216, 80, 96);
                            }
                            else if (chipFolder.chip.navi)
                            {
                                this._rect = new Rectangle(848, 120, 80, 96);
                            }
                            else
                            {
                                this._rect = new Rectangle(680, 120, 80, 96);
                            }
                            dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                            this._position = new Vector2(89f, 25f);
                            chipFolder.chip.GraphicsRender(dg, this._position, this.goods[this.Select].numberSub, true, true);
                            strArray = chipFolder.chip.information;
                            break;
                        }
                        var dialogue = ShanghaiEXE.Translate("Shop.HPMemoryDescriptionDialogue1");
                        strArray[0] = dialogue[0];
                        strArray[1] = dialogue[1];
                        break;

                    case 1:
                        strArray = SubChip.InfoSet(this.goods[this.Select].numberNo);
                        break;

                    case 2:
                        AddOnBase addOnBase = AddOnBase.AddOnSet(this.goods[this.Select].numberNo, this.goods[this.Select].numberSub);
                        addOnBase.Render(dg, false, false, new Vector2(72f, 40f), this);
                        strArray = addOnBase.infomasion;
                        break;
                    }
                    for (int index = 0; index < strArray.Length; ++index)
                    {
                        this._position = new Vector2(48f, 108 + 16 * index);
                        dg.DrawText(strArray[index], this._position, this.savedata);
                    }
                }
                switch (this.moneyType)
                {
                case 0:
                    this._rect     = new Rectangle(488, 232, 80, 40);
                    this._position = new Vector2(160f, 0.0f);
                    dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                    break;

                case 1:
                    this._rect = ShanghaiEXE.language == 1
                            ? new Rectangle(800, 712, 80, 40)
                            : new Rectangle(712, 712, 80, 40);
                    this._position = new Vector2(160f, 0.0f);
                    dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                    break;

                case 2:
                    this._rect = ShanghaiEXE.language == 1
                            ? new Rectangle(800, 752, 80, 40)
                            : new Rectangle(720, 752, 80, 40);
                    this._position = new Vector2(160f, 0.0f);
                    dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                    break;

                case 3:
                    this._rect = ShanghaiEXE.language == 1
                            ? new Rectangle(800, 792, 80, 40)
                            : new Rectangle(720, 792, 80, 40);
                    this._position = new Vector2(160f, 0.0f);
                    dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                    break;
                }
                if (this.moneyType == 0)
                {
                    if (this.savedata.Money < this.savedata.moneyover)
                    {
                        AllBase.NAME[] nameArray = this.Nametodata(this.savedata.Money.ToString() + "Z");
                        point = new Vector2(232 - nameArray.Length * 8, 16f);
                        foreach (var data in ((IEnumerable <AllBase.NAME>)nameArray).Select((v, j) => new
                        {
                            v,
                            j
                        }))
                        {
                            this._rect     = new Rectangle((int)data.v * 8, 88, 8, 16);
                            this._position = new Vector2(point.X + 8 * data.j, point.Y);
                            dg.DrawImage(dg, "font", this._rect, true, this._position, Color.White);
                        }
                    }
                    else
                    {
                        this._position = new Vector2(164f, 16f);
                        this.TextRender(dg, ShanghaiEXE.Translate("Shop.Billionaire"), false, this._position, false);
                    }
                }
                else if (this.savedata.havePeace[this.moneyType - 1] < this.savedata.moneyover)
                {
                    AllBase.NAME[] nameArray = this.Nametodata(string.Format(ShanghaiEXE.Translate("Shop.ZennyFormat"), this.savedata.havePeace[this.moneyType - 1]));
                    point          = new Vector2(232 - nameArray.Length * 8, 16f);
                    this._position = new Vector2(point.X, point.Y);
                    DrawBlockCharacters(dg, nameArray, 88, this._position, Color.White, out this._rect, out this._position);
                }
                else
                {
                    this._position = new Vector2(164f, 16f);
                    this.TextRender(dg, ShanghaiEXE.Translate("Shop.Billionaire"), false, this._position, false);
                }
                this._rect     = new Rectangle(432, 232, 56, 40);
                this._position = new Vector2(176f, 56f);
                dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
            }
            if (this.eventmanager.playevent)
            {
                this.eventmanager.Render(dg);
            }
            if (this.alpha <= 0)
            {
                return;
            }
            Color     color1 = Color.FromArgb(alpha, Color.Black);
            Rectangle _rect  = new Rectangle(0, 0, 240, 160);
            Vector2   _point = new Vector2(0.0f, 0.0f);

            dg.DrawImage(dg, "fadescreen", _rect, true, _point, color1);
        }
Example #15
0
        public static string ItemNameGet(int itemType, int itemNumber, int itemSub, string getInfo)
        {
            switch (itemType)
            {
            case 0:
                ChipFolder chipFolder = new ChipFolder(null);
                chipFolder.SettingChip(itemNumber + 1);
                if (chipFolder.chip.code[itemSub] == ChipFolder.CODE.asterisk)
                {
                    return(chipFolder.chip.name + " *");
                }
                return(chipFolder.chip.name + " " + chipFolder.chip.code[itemSub].ToString());

            case 1:
                switch (itemNumber)
                {
                case 0:
                    return(ShanghaiEXE.Translate("MysteryData.HalfEnrgText"));

                case 1:
                    return(ShanghaiEXE.Translate("MysteryData.FullEnrgText"));

                case 2:
                    return(ShanghaiEXE.Translate("MysteryData.FirewallText"));

                case 3:
                    return(ShanghaiEXE.Translate("MysteryData.OpenPortText"));

                case 4:
                    return(ShanghaiEXE.Translate("MysteryData.Anti-VrsText"));

                case 5:
                    return(ShanghaiEXE.Translate("MysteryData.VirusScnText"));

                case 6:
                    return(ShanghaiEXE.Translate("MysteryData.CrakToolText"));
                }
                break;

            case 2:
                return(AddOnBase.AddOnSet(itemNumber, 0).name);

            case 3:
                switch (itemNumber)
                {
                case 0:
                    return(ShanghaiEXE.Translate("MysteryData.HPMemoryText"));

                case 1:
                    return(string.Format(ShanghaiEXE.Translate("MysteryData.RegUpText"), itemSub));

                case 2:
                    return(ShanghaiEXE.Translate("MysteryData.SubMemoryText"));

                case 3:
                    return(ShanghaiEXE.Translate("MysteryData.CorePlusText"));

                case 4:
                    return(string.Format(ShanghaiEXE.Translate("MysteryData.HertzUpText"), itemSub));

                case 5:
                    var bugPlural       = itemSub > 1;
                    var bugGetStrFormat = bugPlural ? ShanghaiEXE.Translate("MysteryData.BugFragTextPlural") : ShanghaiEXE.Translate("MysteryData.BugFragText");
                    return(string.Format(bugGetStrFormat, itemSub));

                case 6:
                    var frzPlural       = itemSub > 1;
                    var frzGetStrFormat = frzPlural ? ShanghaiEXE.Translate("MysteryData.FreezeFragTextPlural") : ShanghaiEXE.Translate("MysteryData.FreezeFragText");
                    return(string.Format(frzGetStrFormat, itemSub));

                case 7:
                    var errPlural       = itemSub > 1;
                    var errGetStrFormat = errPlural ? ShanghaiEXE.Translate("MysteryData.ErrorFragTextPlural") : ShanghaiEXE.Translate("MysteryData.ErrorFragText");
                    return(string.Format(errGetStrFormat, itemSub));

                default:
                    if (itemSub > 0)
                    {
                        return(string.Format(ShanghaiEXE.Translate("MysteryData.ZennyText"), itemSub));
                    }
                    return(getInfo);

                case 9:
                    var interiorNumber = itemSub;
                    var interiorName   = Shop.INTERIOR.GetItem(itemSub);
                    return(interiorName);
                }
            }
            return("");
        }
Example #16
0
        public override void Render(IRenderer dg)
        {
            if (this.shopmode && this.nowscene != Chiptreader.SCENE.getting)
            {
                this._rect     = new Rectangle(480, 784, 240, 160);
                this._position = new Vector2(0.0f, 0.0f);
                dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                AllBase.NAME[] nameArray = this.Nametodata(ShanghaiEXE.Translate("ChipTrader.NameToData"));
                this._position = new Vector2(24, 8f);
                DrawBlockCharacters(dg, nameArray, 88, this._position, Color.White, out this._rect, out this._position);
                string[] strArray = new string[6];
                strArray[0] = (this.setchips.Count % this.MaxSet).ToString();
                strArray[1] = "/";
                strArray[2] = this.MaxSet.ToString();
                strArray[3] = ShanghaiEXE.Translate("ChipTrader.ChipNumberPrefix");
                strArray[4] = (this.setchips.Count / this.MaxSet).ToString();
                strArray[5] = ShanghaiEXE.Translate("ChipTrader.ChipNumberSuffix");
                var name = string.Concat(strArray);
                var nameBlockCharacters = this.Nametodata(name);
                this._position = new Vector2(160, 8f);
                DrawBlockCharacters(dg, nameBlockCharacters, 88, this._position, Color.White, out this._rect, out this._position);
                float num1 = this.overtop != 0 && this.Topchip != 0 ? 104f / overtop * Topchip : 0.0f;
                this._rect     = new Rectangle(176, 168, 8, 8);
                this._position = new Vector2(144f, 32f + num1);
                dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                if (this.havechips.Count > 0)
                {
                    for (int index1 = 0; index1 < 7 && this.Topchip + index1 < this.havechips.Count; ++index1)
                    {
                        ChipFolder chipFolder = new ChipFolder(this.sound);
                        chipFolder.SettingChip(this.havechips[this.Topchip + index1].number);
                        chipFolder.codeNo = this.havechips[this.Topchip + index1].code;
                        if (!(chipFolder.chip is DammyChip))
                        {
                            this._position = new Vector2(8f, 32 + 16 * index1);
                            chipFolder.chip.IconRender(dg, this._position, false, false, chipFolder.codeNo, false);
                            var chipNameBlockCharacters = this.Nametodata(chipFolder.chip.name);
                            this._position = new Vector2(24, 32 + 16 * index1);
                            DrawBlockCharacters(dg, chipNameBlockCharacters, 16, this._position, Color.White, out this._rect, out this._position);
                            this._rect     = new Rectangle(216 + (int)chipFolder.chip.element * 16, 88, 16, 16);
                            this._position = new Vector2(88f, 32 + index1 * 16);
                            dg.DrawImage(dg, "battleobjects", this._rect, true, this._position, Color.White);
                            this._rect     = new Rectangle((int)chipFolder.chip.code[chipFolder.codeNo] * 8, 32, 8, 16);
                            this._position = new Vector2(104f, 32 + index1 * 16);
                            dg.DrawImage(dg, "font", this._rect, true, this._position, Color.White);
                            this._rect     = new Rectangle(160, 160, 16, 16);
                            this._position = new Vector2(112f, 32 + index1 * 16);
                            dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                            int[]  numArray1 = this.ChangeCount(chipFolder.chip.regsize);
                            PointF pointF    = new PointF(120f, 32 + index1 * 16);
                            for (int index2 = 0; index2 < numArray1.Length; ++index2)
                            {
                                this._rect     = new Rectangle(numArray1[index2] * 8, 72, 8, 16);
                                this._position = new Vector2(pointF.X - index2 * 8, pointF.Y);
                                dg.DrawImage(dg, "font", this._rect, true, this._position, Color.Yellow);
                            }
                            int[] numArray2 = this.ChangeCount(this.havechip[chipFolder.chip.number, chipFolder.codeNo]);
                            pointF = new PointF(136f, 32 + index1 * 16);
                            for (int index2 = 0; index2 < numArray2.Length; ++index2)
                            {
                                this._rect     = new Rectangle(numArray2[index2] * 8, 0, 8, 16);
                                this._position = new Vector2(pointF.X - index2 * 8, pointF.Y);
                                dg.DrawImage(dg, "font", this._rect, true, this._position, Color.White);
                            }
                        }
                    }
                }
                int num2 = Math.Max(0, this.setchips.Count - 7);
                for (int index = 0; index < Math.Min(this.setchips.Count, 7); ++index)
                {
                    ChipFolder chipFolder = new ChipFolder(this.sound);
                    chipFolder.SettingChip(this.setchips[num2 + index].number);
                    chipFolder.codeNo = this.setchips[num2 + index].code;
                    var chipNameBlockCharacters = this.Nametodata(chipFolder.chip.name);
                    this._position = new Vector2(152, 32 + 16 * index);
                    DrawBlockCharacters(dg, chipNameBlockCharacters, 16, this._position, Color.White, out this._rect, out this._position);
                    this._rect     = new Rectangle((int)chipFolder.chip.code[chipFolder.codeNo] * 8, 32, 8, 16);
                    this._position = new Vector2(224f, 32 + index * 16);
                    dg.DrawImage(dg, "font", this._rect, true, this._position, Color.White);
                }
                this._rect     = new Rectangle(112 + 16 * this.cursolanime, 160, 16, 16);
                this._position = new Vector2(0.0f, 32 + this.cursol * 16);
                dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
            }
            if (this.eventmanager.playevent)
            {
                this.eventmanager.Render(dg);
            }
            if (this.nowscene == Chiptreader.SCENE.getting && this.savedata.ValList[15] >= 0 && this.savedata.ValList[15] < this.rendChip.Count)
            {
                this.seetX = this.savedata.ValList[21];
                if (this.seetX < 0)
                {
                    this.savedata.ValList[21] += 16;
                    if (this.seetX > 0)
                    {
                        this.savedata.ValList[21] = 0;
                    }
                }
                this._rect     = new Rectangle(760, 256, 88, 136);
                this._position = new Vector2(this.seetX + 8, 16f);
                dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                ChipFolder chipFolder = this.rendChip[this.savedata.ValList[15]];
                Vector2    p          = new Vector2(this.seetX + 24, 32f);
                chipFolder.chip.GraphicsRender(dg, p, chipFolder.codeNo, true, true);
                if (chipFolder.chip.dark)
                {
                    this._rect     = new Rectangle(272, 184, 88, 56);
                    this._position = new Vector2(this.seetX + 8, 96f);
                    dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                }
                else if (chipFolder.chip.navi)
                {
                    this._rect     = new Rectangle(272, 128, 88, 56);
                    this._position = new Vector2(this.seetX + 8, 96f);
                    dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White);
                }
                foreach (var data in ((IEnumerable <string>)chipFolder.chip.information).Select((v, i) => new
                {
                    v,
                    i
                }))
                {
                    string  v     = data.v;
                    Vector2 point = new Vector2(this.seetX + 10, 102 + 16 * data.i);
                    dg.DrawMiniText(v, point, Color.Black);
                }
            }
            if (this.alpha <= 0)
            {
                return;
            }
            Color color = Color.FromArgb(alpha, Color.Black);

            this._rect     = new Rectangle(0, 0, 240, 160);
            this._position = new Vector2(0.0f, 0.0f);
            dg.DrawImage(dg, "fadescreen", this._rect, true, this._position, color);
        }
Example #17
0
        private void CreateLibraryPages()
        {
            var chipFolder = new ChipFolder(this.sound);
            var allChips   = ChipFolder.Chips.Select(kvp => this.ChipEntryFromChipBase(kvp.Value.Invoke(this.sound), kvp.Key)).ToList();

            this.LibraryPages[LibraryPageType.Normal] = new LibraryPage
            {
                Chips      = FillBlanks(allChips.Where(c => IsNormalChipPredicate(c.Chip))),
                Title      = ShanghaiEXE.Translate("DataList.Standard"),
                TitleColor = Color.White,
                LeftPage   = null,
                RightPage  = LibraryPageType.Navi
            };

            var hasDarkChips = allChips.Any(c => IsDarkChipPredicate(c.Chip) && c.IsSeen);

            this.LibraryPages[LibraryPageType.Navi] = new LibraryPage
            {
                Chips          = FillBlanks(allChips.Where(c => IsNaviChipPredicate(c.Chip))),
                Title          = ShanghaiEXE.Translate("DataList.Navi"),
                TitleColor     = Color.FromArgb(183, 231, 255),
                CustomTextArea = new TextArea {
                    Sprite = new Rectangle(272, 128, 88, 56), Position = new Vector2(8f, 96f)
                },
                LeftPage  = LibraryPageType.Normal,
                RightPage = hasDarkChips ? LibraryPageType.Dark : LibraryPageType.PA
            };

            this.LibraryPages[LibraryPageType.Dark] = new LibraryPage
            {
                Chips          = FillBlanks(allChips.Where(c => IsDarkChipPredicate(c.Chip))),
                Title          = ShanghaiEXE.Translate("DataList.Dark"),
                TitleColor     = Color.FromArgb(206, 111, 231),
                CustomTextArea = new TextArea {
                    Sprite = new Rectangle(272, 184, 88, 56), Position = new Vector2(8f, 96f)
                },
                LeftPage  = LibraryPageType.Navi,
                RightPage = LibraryPageType.PA
            };

            this.LibraryPages[LibraryPageType.PA] = new LibraryPage
            {
                Chips          = FillBlanks(allChips.Where(c => IsPAPredicate(c.Chip))),
                Title          = ShanghaiEXE.Translate("DataList.PAdvance"),
                TitleColor     = Color.White,
                CustomTextArea = new TextArea {
                    Sprite = new Rectangle(760, 120, 88, 136), Position = new Vector2(8f, 16)
                },
                LeftPage  = hasDarkChips ? LibraryPageType.Dark : LibraryPageType.Navi,
                RightPage = this.savedata.FlagList[800] ? (LibraryPageType?)LibraryPageType.Illegal : null
            };

            this.LibraryPages[LibraryPageType.Illegal] = new LibraryPage
            {
                Chips      = allChips.Where(c => IsIllegalPredicate(c.Chip)).OrderBy(c => c.Chip.sortNumber).ToList(),
                Title      = ShanghaiEXE.Translate("DataList.Illegal"),
                TitleColor = Color.DarkRed,
                LeftPage   = LibraryPageType.PA,
                RightPage  = null
            };
        }
Example #18
0
 private ChipEntry ChipEntryFromID(ChipFolder folder, int id)
 {
     return(this.ChipEntryFromChipBase(folder.ReturnChip(id), id));
 }