Пример #1
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);
 }
Пример #2
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();
        }
Пример #3
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);
 }
Пример #4
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);
        }
Пример #5
0
 private ChipEntry ChipEntryFromID(ChipFolder folder, int id)
 {
     return(this.ChipEntryFromChipBase(folder.ReturnChip(id), id));
 }