コード例 #1
0
ファイル: Card.cs プロジェクト: jeffreyreading/mtco
        private string type; //General

        #endregion Fields

        #region Constructors

        //Pull values from xml.
        public Card()
        {
            name = xml.name;
            manaCost = xml.manaCost;
            illustration = xml.illustration;
            colorIndicator = xml.colorIndicator;
            type = xml.type;
            expansionSymbol = xml.expansionSymbol;
            rarity = xml.rarity;
            textbox = xml.textbox;
            loyalty = xml.loyalty;
            illustrateCredit = xml.illustrateCredit;
            legalText = xml.legalText;
            collectorNumber = xml.collectorNumber;
            isTapped = false;
            isUntapping = true;
            isDestroyed = false;
            isExiled = true;
            owner = xml.owner;   //Initial deck's player
            controller = xml.controller;   //Casting player
            numLoyaltyCounters = 0;
            isToken = false;
            isCopy = false;
            isMonocolor = false;
            isMulticolor = false;
            isColorless = false;
        }
コード例 #2
0
		public Card(string id, string playerClass, Rarity rarity, string type, string name, int cost, string localizedName, int inHandCount,
		            int count, string text, string englishText, int attack, int health, string race, string[] mechanics, int? durability,
		            string artist, string set, List<string> alternativeNames = null, List<string> alternativeTexts = null, HearthDb.Card dbCard = null)
		{
			Id = id;
			PlayerClass = playerClass;
			Rarity = rarity;
			Type = type;
			Name = name;
			Cost = cost;
			LocalizedName = localizedName;
			InHandCount = inHandCount;
			Count = count;
			Text = text;
			EnglishText = englishText;
			Attack = attack;
			Health = health;
			Race = race;
			Durability = durability;
			Mechanics = mechanics;
			Artist = artist;
			Set = set;
			if(alternativeNames != null)
				AlternativeNames = alternativeNames;
			if(alternativeTexts != null)
				AlternativeTexts = alternativeTexts;
			_dbCard = dbCard;
		}
コード例 #3
0
 public Items()
 {
     _name = "Need Name";
     _value = 0;
     _rarity = Rarity.common;
     _maxDur = 50;
     _curDur = _maxDur;
 }
コード例 #4
0
 public Items(string name,int value ,Rarity rare , int maxdur ,int curDur)
 {
     _name = name;
     _value = value;
     _rarity = rare;
     _maxDur = maxdur;
     _curDur = curDur;
 }
コード例 #5
0
ファイル: Item.cs プロジェクト: arlenner/EnterTheArena
 public Item(int id, string name, TypeTag Tag, Rarity rare)
 {
     Id = id;
     Name = name;
     Tags = new List<TypeTag>();
     Tags.Add(Tag);
     Rare = new List<Rarity>();
     Rare.Add(rare);
 }
コード例 #6
0
ファイル: Item.cs プロジェクト: Icy-Dragon/QuantumSmash
 public Item(string name, int id, string desc, ItemType type, Rarity rarity)
 {
     itemName = name;
     itemID = id;
     itemDesc = desc;
     itemType = type;
     itemIcon = Resources.Load<Texture2D>("Item Icons/" + name);
     this.rarity = rarity;
 }
コード例 #7
0
ファイル: BaseCard.cs プロジェクト: Zenayi/PokemonTCG
 public BaseCard(string name, string cardSet, Rarity cardRarity, string cardNumber, string illustrator, string cardUrl, string cardImagePath)
 {
     this.Name = name;
     this.CardSet = cardSet;
     this.CardRarity = cardRarity;
     this.CardNumber = cardNumber;
     this.Illustrator = illustrator;
     this.CardUrl = cardUrl;
     this.CardImagePath = cardImagePath;
 }
コード例 #8
0
ファイル: HudTexture.cs プロジェクト: benjy3gg/PoeHud
 public HudTexture(string fileName, Rarity rarity)
     : this(fileName, Color.White)
 {
     switch (rarity)
     {
         case Rarity.Magic: TintColor = HudSkin.MagicColor; break;
         case Rarity.Rare: TintColor = HudSkin.RareColor; break;
         case Rarity.Unique: TintColor = HudSkin.UniqueColor; break;
     }
 }
コード例 #9
0
ファイル: PlayerItem.cs プロジェクト: Kinderril/p3
 public PlayerItem(Dictionary<ParamType, float> pparams, Slot slot, Rarity rare, float totalPoints)
 {
     this.cost = Formuls.PlayerItemCost(totalPoints, rare);
     this.parameters = pparams;
     this.Slot = slot;
     this.Rare = rare;
     RenderCam.Instance.DoRender(slot,out icon);
     LoadTexture();
     Id = Utils.GetId();
     isEquped = false;
 }
コード例 #10
0
ファイル: Card.cs プロジェクト: esmayl/CardGameInterface
 public void SetAll(Card newCardInfo)
 {
     iconSmall = newCardInfo.iconSmall;
     iconMedium = newCardInfo.iconMedium;
     iconLarge = newCardInfo.iconLarge;
     cardElement = newCardInfo.cardElement;
     rarity = newCardInfo.rarity;
     cost = newCardInfo.cost;
     cardName = newCardInfo.cardName;
     cardDescription = newCardInfo.cardDescription;
     found = newCardInfo.found;
 }
コード例 #11
0
ファイル: Gene.cs プロジェクト: mcdonnellv/BlobsPrototype
	static float RevealChanceForRarity(Rarity r)
	{
		switch (r)
		{
		case Rarity.Standard:  return 0f;
		case Rarity.Common:    return 0.07000f;
		case Rarity.Rare:      return 0.02140f;
		case Rarity.Epic:      return 0.00428f;
		case Rarity.Legendary: return 0.00108f;
		}
		return 0f;
	}
コード例 #12
0
 public GearItem(string name, string description, Rarity rarity, GearType type, int health, int speed, int attack)
     : base(name, description, rarity)
 {
     if (type < 0 || type >= GearType.OneAboveMax)
     {
         throw new ArgumentOutOfRangeException();
     }
     this.type = type;
     this.health = health;
     this.speed = speed;
     this.attack = attack;
 }
コード例 #13
0
ファイル: Item.cs プロジェクト: jonnelfernandez/GTARPG
 public Item(string name, string desc,int cost, int initialQuantity, ItemType type, Rarity rarity, Action onUse)
 {
     Name = name;
     Description = desc;
     Cost = cost;
     Rarity = rarity;
     Quantity = initialQuantity;
     Type = type;
     OnUse = onUse;
     CanBuy = true;
     CoolDownTimer = new CoolDown(0);
 }
コード例 #14
0
ファイル: Rarity.cs プロジェクト: discomethod/Norem
 public static string ToString(Rarity rarity)
 {
     switch (rarity)
     {
         case Rarity.Common: return Resources.RarityCommon;
         case Rarity.Uncommon: return Resources.RarityUncommon;
         case Rarity.Rare: return Resources.RarityRare;
         case Rarity.Exotic: return Resources.RarityExotic;
         case Rarity.Legendary: return Resources.RarityLegendary;
         case Rarity.Limited: return Resources.RarityLimited;
         default: throw new InvalidEnumArgumentException("rarity", (int)rarity, typeof(Rarity));
     }
 }
コード例 #15
0
ファイル: Armor.cs プロジェクト: roeni1/KADC-1
 public Armor(string name, Rarity rarity, Type type, int maxLevel, int plusLevel, int feedCost, int craftCost, int materialCount, ArmorStats normalStats, ArmorStats plusStats, Element element1)
 {
     Name = name;
     Rarity = rarity;
     Type = type;
     MaxLevel = maxLevel;
     PlusLevel = plusLevel;
     FeedCost = feedCost;
     CraftCost = craftCost;
     MaterialCount = materialCount;
     NormalStats = normalStats;
     PlusStats = plusStats;
     Element1 = element1;
 }
コード例 #16
0
 public Color RarityColor(Rarity rarity)
 {
     switch (rarity)
     {
         case Rarity.SuperRare:
             return superRareColor;
         case Rarity.Rare:
             return rareColor;
         case Rarity.Uncommon:
             return uncommonColor;
         default:
             return commonColor;
     }
 }
コード例 #17
0
ファイル: Idol.cs プロジェクト: yowa/Cindeck
 public Idol(string label,string name,Rarity rarity, IdolCategory cat, int life,int dance,int vocal,int visual,DateTime implemented, ICenterEffect centerEffect,ISkill skill)
 {
     Label = label;
     Name = name;
     Rarity = rarity;
     Category = cat;
     Life = life;
     Dance = dance;
     Vocal = vocal;
     Visual = visual;
     CenterEffect = centerEffect;
     Skill = skill;
     ImplementationDate = implemented;
 }
コード例 #18
0
        public Spaceship(int level, Rarity rarity, bool loadPhysics = false, Mothership.Team team = Mothership.Team.green, Color?color = null) : base("")
        {
            this.team = team;

            this.rarity = rarity;

            load(level,
                 GameMath.randomBaseDamage(rarity),
                 GameMath.randomBaseLife(rarity),
                 GameMath.randomBaseSpeed(rarity),
                 GameMath.randomBaseRange(rarity),
                 random.Next(skins.Count()),
                 color ?? randomColor(),
                 loadPhysics);
        }
コード例 #19
0
        private void rarityComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (_item == null || !rarityComboBox.IsEnabled)
            {
                return;
            }
            Rarity rarity = rarityForIndex(rarityComboBox.SelectedIndex);

            EventLogger.logEvent("rarityComboBox_SelectionChanged", new Dictionary <string, object>()
            {
                { "rarity", rarity.ToString() }
            });
            _item.Rarity = rarity;
            this.saveChanges?.Execute(_item);
        }
コード例 #20
0
        protected Weapon(string rarity, string name, byte sockets, int minDamage, int maxDamage)
        {
            Rarity temp;

            if (!Enum.TryParse(rarity, true, out temp))
            {
                throw new ArgumentException("No such GemType!");
            }
            Rarity = temp;

            Name           = name;
            this.minDamage = minDamage;
            this.maxDamage = maxDamage;
            gems           = new IGem[sockets];
        }
コード例 #21
0
        public Weapon(string name, int minDamage, int maxDamage, int numberOfSockets, string rarity)
        {
            this.name            = name;
            this.minDamage       = minDamage;
            this.maxDamage       = maxDamage;
            this.numberOfSockets = numberOfSockets;

            this.rarity = Enum.Parse <Rarity>(rarity);
            this.gems   = new List <IGem>(numberOfSockets);

            for (int i = 0; i < numberOfSockets; i++)
            {
                this.gems.Add(null);
            }
        }
コード例 #22
0
ファイル: Card.cs プロジェクト: Coggroach/BinaryTree
 public Card(string c, string n, string cs, Rarity r, int a, int h, int co, int dur, Class ch, Type t, String txt, List<Object> m)
 {
     this.CardId = c;
     this.Name = n;
     this.CardSet = cs;
     this.Rarity = r;
     this.Attack = a;
     this.Health = h;
     this.Cost = co;
     this.Durability = dur;
     this.Character = ch;
     this.Type = t;
     this.Text = txt;
     this.Mechanics = m;
 }
コード例 #23
0
ファイル: Action.cs プロジェクト: jyllsarta/nekofade
    //2つ以上の効果を持つアクション
    public Action(string actionName, string descriptionText, int waitTime, int cost, List <Effect> effectList, Rarity rarity = Rarity.COMMON, BattleCharacter actor = null)
    {
        this.actionName      = actionName;
        this.descriptionText = descriptionText;
        this.waitTime        = waitTime;
        this.cost            = cost;
        this.effectList      = effectList;
        this.rarity          = rarity;

        //行動キャラが明示されている場合にはウェイトにそのキャラの速度Lvを反映
        if (actor != null)
        {
            this.waitTime = (int)(waitTime * actor.getWaitTimeCutRate());
        }
    }
コード例 #24
0
    public Upgrade GenerateUpgrade()
    {
        Rarity  rarity     = GenerateRarity(Player.Luck);
        Upgrade newUpgrade = new Upgrade("testUpgrade", EquipmentType.Upgrade, rarity, 100);
        Effect  newEffect;

        newEffect = EG.GenerateEffect(EquipmentType.Upgrade);
        newUpgrade.Effects.Add(newEffect);
        //temporarily for testing
        newUpgrade.UpgradeType  = EquipmentType.Weapon;
        newUpgrade.Description += newEffect.Description + " ";
        newUpgrade.Name         = newEffect.Name + " Module";
        AddStatFromEffectToUpgrade(newEffect, newUpgrade);
        return(newUpgrade);
    }
コード例 #25
0
    [ClientRpc] public void RpcAddCat(float CDefense, float CAttack, float CTorsoHP, float CMaxSpeed, string CName, float CTravel, int CStamina, int CAtSpeed, int CAtRecharge, string[] PackagedData, NetworkInstanceId netInstanceId, int AbilityCount, abilityHolder[] abilitys, attackHolder[] attacks)
    {
        GameObject           reciever          = ClientScene.FindLocalObject(netInstanceId);
        PlayerAssign         PlayerScript      = reciever.GetComponent <PlayerAssign> ();
        List <String>        ExtractedData     = PackagedData.ToList();
        List <abilityHolder> ExtractedAbilitys = abilitys.ToList();
        List <attackHolder>  ExtractedAttacks  = attacks.ToList();
        Rarity CatRarity = (Rarity)System.Enum.Parse(typeof(Rarity), ExtractedData.ElementAt(0));
        Cat    ThatCat   = (Cat)ScriptableObject.CreateInstance("Cat") as Cat;

        ThatCat.catRarity      = CatRarity;
        ThatCat.Defense        = CDefense;
        ThatCat.Attack         = CAttack;
        ThatCat.TorsoHP        = CTorsoHP;
        ThatCat.MaxSpeed       = CMaxSpeed;
        ThatCat.CatName        = CName;
        ThatCat.TravelSpeed    = CTravel;
        ThatCat.MaxStamina     = CStamina;
        ThatCat.AttackSpeed    = CAtSpeed;
        ThatCat.AttackRecharge = CAtRecharge;
        foreach (abilityHolder holder in ExtractedAbilitys)
        {
            Ability theAbility = (Ability)ScriptableObject.CreateInstance("Ability") as Ability;
            theAbility.name        = holder.FileName;
            theAbility.Name        = holder.Name;
            theAbility.AbilityID   = holder.AbilityID;
            theAbility.isDefault   = holder.isDefault;
            theAbility.AbilityType = holder.AbilityType;
            ThatCat.abilitys.Add(theAbility);
        }
        foreach (attackHolder holder in ExtractedAttacks)
        {
            Attack theAttack = (Attack)ScriptableObject.CreateInstance("Attack") as Attack;
            theAttack.name                  = holder.FileName;
            theAttack.Range                 = holder.Range;
            theAttack.DamageIncrease        = holder.DamageIncrease;
            theAttack.EnemyDefenseReduction = holder.EnemyDefenseReduction;
            theAttack.AttackName            = holder.AttackName;
            ThatCat.attacks.Add(theAttack);
        }
        //for (int i = 0; i < AttackCount; i++) {
        //	string ThatAttacksName = ExtractedData.ElementAt (i + AbilityCount);
        //	Attack ThatAttack = Resources.Load<Attack> ("Attacks/" + ThatAttacksName);
        //	ThatCat.attacks.Add (ThatAttack);
        //}
        PlayerScript.catToAdd = ThatCat;
        PlayerScript.catsToSpawn.Add(ThatCat);
    }
コード例 #26
0
        public static float GetRarityDamageBoost(Rarity rarity)
        {
            if (!Config.gpConfig.ItemRarity)
            {
                return(0);
            }
            float value = 0;

            switch (rarity)
            {
            case (Rarity.Broken):
                value = -20;
                break;

            case (Rarity.Imperfect):
                value = -5;
                break;

            case (Rarity.Inferior):
                value = 4;
                break;

            case (Rarity.Superior):
                value = 8;
                break;

            case (Rarity.Rare):
                value = 12;
                break;

            case (Rarity.MasterPiece):
                value = 16;
                break;

            case (Rarity.Epic):
                value = 20;
                break;

            case (Rarity.Legendary):
                value = 25;
                break;

            case (Rarity.Mythical):
                value = 30;
                break;
            }
            return(value);
        }
コード例 #27
0
 public ArmorItem(string name, string itemdescribe, int ac, ArmorType armor, int price, bool buyable, int itemvalue, bool questitem, bool craftable, List <CraftingItemInItem> craftingItems, Rarity rare, Armorpiece armorpos, List <ItemType> itemDefine)
 {
     MyRare        = rare;
     Buyable       = buyable;
     Name          = name;
     ItemDescribe  = itemdescribe;
     AC            = ac;
     MyArmorType   = armor;
     Price         = price;
     ItemValue     = itemvalue;
     QuestItem     = questitem;
     Crafable      = craftable;
     CraftingItems = craftingItems;
     ArmorPos      = armorpos;
     MyItemType    = itemDefine;
 }
コード例 #28
0
ファイル: Armor.cs プロジェクト: roeni1/KADC-1
 public Armor(string name, Rarity rarity, bool isCraftable, int maxLevel, int plusLevel, int feedCost, int craftCost, int materialCount, int craftTime, bool isFusionResult, ArmorStats normalStats, ArmorStats plusStats, Element element1)
 {
     Name = name;
     Rarity = rarity;
     IsCraftable = isCraftable;
     MaxLevel = maxLevel;
     PlusLevel = plusLevel;
     FeedCost = feedCost;
     CraftCost = craftCost;
     MaterialCount = materialCount;
     CraftTime = craftTime;
     IsFusionResult = isFusionResult;
     NormalStats = normalStats;
     PlusStats = plusStats;
     Element1 = element1;
 }
コード例 #29
0
        // CONSRUCTORS

        public Item(byte graphic, ItemType itemType, double volume, bool hollow, DamageType damageType, BlockType type = BlockType.Item, bool solid = false,
                    bool opaque = false, bool interactive = true, bool enterable = false, string name = "")
            : base(graphic, name, type, solid, opaque, interactive, enterable)
        {
            ForeColor       = Color.White;
            BackColor       = Color.Pink;
            this.itemType   = itemType;
            this.volume     = volume;
            this.hollow     = hollow;
            this.damageType = damageType;
            Material        = DetermineMaterial();
            rarity          = DetermineRarity();
            DetermineDurability();

            blockPlacedOn = null;
        }
コード例 #30
0
        /// <summary>
        /// Creates a new instance of the <see cref="MmoItem"/> class from <see cref="GameItemData"/>.
        /// </summary>
        public MmoItem(GameItemData itemData)
        {
            this.id       = itemData.ItemId;
            this.type     = (MmoItemType)itemData.ItemType;
            this.level    = itemData.Level;
            this.rareness = (Rarity)itemData.Rarity;

            this.sellPrice   = itemData.SellPrice;
            this.buyoutPrice = itemData.BuyoutPrice;

            this.maxStack = itemData.MaxStack;
            this.useLimit = (UseLimit)itemData.UseLimit;
            this.spellId  = itemData.UseSpellId;

            this.count = 1;
        }
コード例 #31
0
 public Item(string name, string description, int value, int weight, int id, Rarity r)
 {
     if (!name.Equals(null) && !description.Equals(null) && value >= 0 && weight >= 0 && !r.Equals(null))
     {
         Name        = name;
         Description = description;
         Value       = value;
         Weight      = weight;
         ID          = id;
         Rarity      = r;
     }
     else
     {
         throw new System.ArgumentException("An Item can't be constructed by null arguments or negative integers");
     }
 }
コード例 #32
0
 private void MadeView()
 {
     labelWord.Text = word.Content;
     foreach (string code in word.TresomesKeys)
     {
         Color color     = Rarity.WhatRarity(dane.treesome[code].words.Count);
         Label tempLabel = new Label
         {
             Text      = code.Replace("Q", ""),
             BackColor = color,
             Font      = new Font("Arial", 6f),
             AutoSize  = true
         };
         panelFonems.Controls.Add(tempLabel);
     }
 }
コード例 #33
0
ファイル: Looting.cs プロジェクト: zachary-kaelan/CSharp
        public void LoadCondensed(string condensed)
        {
            int[] numbers = condensed.Take(8).Select(
                c => Convert.ToInt32(
                    Char.GetNumericValue(c)
                    )
                ).ToArray();

            Plunderers   = numbers[0];
            AceInTheHole = numbers[1];
            Luck         = (numbers[6] * 16) + Convert.ToInt32(condensed.Last().ToString(), 16);
            ItemRarity   = (Rarity)numbers[2];
            ItemType     = (ItemType)numbers[3];
            AddonRarity  = (Rarity)numbers[4];
            Addon2Rarity = (Rarity)numbers[5];
        }
コード例 #34
0
    private static Rarity RandomT3Rarity()
    {
        Rarity rarity     = default;
        double randChoice = Random.Range(0.0f, 1.0f);

        if (randChoice < .85f)
        {
            rarity = Rarity.Legendary;
        }
        else
        {
            rarity = Rarity.Ancient;
        }

        return(rarity);
    }
コード例 #35
0
 public int RarityMultiplier(Rarity rarity)
 {
     if (rarity == Rarity.Common)
     {
         return(20);
     }
     if (rarity == Rarity.Uncommon)
     {
         return(15);
     }
     if (rarity == Rarity.Rare)
     {
         return(10);
     }
     return(5);
 }
コード例 #36
0
ファイル: BasePokemon.cs プロジェクト: Ricky7/Unity_Pokemon
 public void AddMember(BasePokemon bp)
 {
     this.PName = bp.PName;
     this.image = bp.image;
     this.biomeFound = bp.biomeFound;
     this.type = bp.type;
     this.rarity = bp.rarity;
     this.HP = bp.HP;
     this.maxHP = bp.maxHP;
     this.AttackStat = bp.AttackStat;
     this.DefenceStat = bp.DefenceStat;
     this.pokemonStats = bp.pokemonStats;
     this.canEvolve = bp.canEvolve;
     this.evolveTo = bp.evolveTo;
     this.level = bp.level;
 }
コード例 #37
0
ファイル: Item.cs プロジェクト: brudi07/lc_unity
 // Decrement rarity of the item one level lower
 private Rarity DecrementRarity(Rarity rarity)
 {
     // Upgrade rarity if it's not legendary or set rarity
     if (rarity != Rarity.Legendary && rarity != Rarity.Set)
     {
         // Get rarity index
         int rarityIndex = (int)rarity;
         // Decrement rarity
         rarityIndex--;
         return((Rarity)rarityIndex);
     }
     else
     {
         return(rarity);
     }
 }
コード例 #38
0
    private static Rarity RandomT2Rarity()
    {
        Rarity rarity     = default;
        double randChoice = Random.Range(0.0f, 1.0f);

        if (randChoice < .75f)
        {
            rarity = Rarity.Rare;
        }
        else
        {
            rarity = Rarity.VeryRare;
        }

        return(rarity);
    }
コード例 #39
0
    public Material GetRarityMaterial(Rarity r)
    {
        switch (r)
        {
        case Rarity.Common: return(matCommon);

        case Rarity.Uncommon: return(matUncommon);

        case Rarity.Rare: return(matRare);

        case Rarity.Epic: return(matEpic);

        case Rarity.Legendary: return(matLegendary);
        }
        return(matCommon);
    }
コード例 #40
0
ファイル: Card.cs プロジェクト: Adamoris/project-sigma
 //This method is for generating the total growth value that a unit will be able to achieve.
 public int GetGrowthValue(int growthRate, Rarity rarity)
 {
     if (rarity == Rarity.Bronze)
     {
         return((int)Mathf.Floor(levelingRange * 0.01f * Mathf.Floor(growthRate * (1f - rarityFactor + (rarityFactor * 1)))));
     }
     if (rarity == Rarity.Silver)
     {
         return((int)Mathf.Floor(levelingRange * 0.01f * Mathf.Floor(growthRate * (1f - rarityFactor + (rarityFactor * 2)))));
     }
     if (rarity == Rarity.Gold)
     {
         return((int)Mathf.Floor(levelingRange * 0.01f * Mathf.Floor(growthRate * (1f - rarityFactor + (rarityFactor * 3)))));
     }
     return(0);
 }
コード例 #41
0
    public float GetRarityHealth(Rarity r)
    {
        switch (r)
        {
        default:
        case Rarity.Common: return(healthRarity[0]);

        case Rarity.Uncommon: return(healthRarity[1]);

        case Rarity.Rare: return(healthRarity[2]);

        case Rarity.Epic: return(healthRarity[3]);

        case Rarity.Legendary: return(healthRarity[4]);
        }
    }
コード例 #42
0
    private static Rarity RandomT1Rarity()
    {
        Rarity rarity     = default;
        double randChoice = Random.Range(0.0f, 1.0f);

        if (randChoice < .55f)
        {
            rarity = Rarity.Common;
        }
        else
        {
            rarity = Rarity.Uncommon;
        }

        return(rarity);
    }
コード例 #43
0
        /// <summary>
        /// Makes a Potion
        /// </summary>
        /// <param name="name">Name of the Potion</param>
        /// <param name="price">Base Price of the Potion</param>
        /// <param name="rarity">Rarity of the Item</param>
        /// <param name="components">Ingredients used to make the Potion</param>
        /// <param name="effects">Effects from the Ingredients that make the Potion</param>

        public Potion(String name, String imagePath, int price, Rarity rarity, List <Ingredient> components, AlchymicEffect effects) : base(name, imagePath, price, rarity, effects)
        {
            if (name == null || name == "")
            {
                this.name = GenerateName();
            }
            else
            {
                this.name = name;
            }
            this.components = components;
            this.imagePath  = imagePath;
            this.price      = price;
            this.rarity     = rarity;
            this.effects    = effects;
        }
コード例 #44
0
        public WeaponSkin GetRandomWeaponSkin(Rarity rarity)
        {
            const string WeaponSkinsFilePath = @"Data\CSGO_WeaponSkins_v1.json";

            var path     = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), WeaponSkinsFilePath);
            var jsonFile = File.ReadAllText(path, Encoding.UTF8);

            var allSkins = JsonConvert.DeserializeObject <List <SkinInfo> >(jsonFile);

            var skinVariants = allSkins.Count(s => s.Rarity == rarity);
            var skinIndex    = new Random().Next(0, skinVariants);

            var skinInfo = allSkins.Where(s => s.Rarity == rarity).ElementAt(skinIndex);

            return(new WeaponSkin(skinInfo.Name, skinInfo.Rarity, skinInfo.ImageUrl, skinInfo.CaseName));
        }
コード例 #45
0
ファイル: DataCache.cs プロジェクト: Lajt/compare-eb-versions
 public int MobCount(Rarity rarity, int range)
 {
     if (_mobs == null)
     {
         _mobs = new List <MobData>();
         foreach (var obj in LokiPoe.ObjectManager.Objects)
         {
             var mob = obj as Monster;
             if (mob != null && mob.IsActive)
             {
                 _mobs.Add(new MobData(mob));
             }
         }
     }
     return(_mobs.Count(mob => mob.Rarity == rarity && mob.Distance <= range));
 }
コード例 #46
0
ファイル: BaseSpeculation.cs プロジェクト: nexaddo/GuildWars2
 protected Rarity GetPromotedRarity(Rarity rarity)
 {
     switch (rarity.Name)
     {
         case "Common":
             return GetRarity("Fine");
         case "Fine":
             return GetRarity("Masterwork");
         case "Masterwork":
             return GetRarity("Rare");
         case "Rare":
             return GetRarity("Exotic");
         default:
             return rarity;
     }
 }
コード例 #47
0
ファイル: BetterLoot.cs プロジェクト: Mixfair/Unit-Scripts
        static int RarityIndex(Rarity rarity)
        {
            switch (rarity)
            {
            case Rarity.None: return(0);

            case Rarity.Common: return(1);

            case Rarity.Uncommon: return(2);

            case Rarity.Rare: return(3);

            case Rarity.VeryRare: return(4);
            }
            return(-1);
        }
コード例 #48
0
        /// <summary>
        /// Initializes a new instance of <see cref="Item"/> from an existing entity.
        /// </summary>
        /// <param name="itemEntity">The entity containing the descriptors for the item.</param>
        internal Item(ItemEntity itemEntity)
        {
            this._icon         = new Uri(itemEntity.Icon);
            this._type         = Enum.TryParse(itemEntity.Type, out ItemType type) ? type : ItemType.Unknown;
            this._rarity       = Enum.TryParse(itemEntity.Rarity, out Rarity rarity) ? rarity : Rarity.Unknown;
            this._level        = itemEntity.Level;
            this._vendor_value = itemEntity.VendorValue;

            this.Name = itemEntity.Name;
            this.ID   = itemEntity.APIID;

            foreach (var flagEntity in itemEntity.Flags)
            {
                this.Flags.Add((Flag)Enum.Parse(typeof(Flag), flagEntity.Name));
            }
        }
コード例 #49
0
ファイル: BasePokemon.cs プロジェクト: crivero10/DarwinJuego
 public void AddMember(BasePokemon bp)
 {
     this.PName        = bp.PName;
     this.image        = bp.image;
     this.biomeFound   = bp.biomeFound;
     this.type         = bp.type;
     this.rarity       = bp.rarity;
     this.HP           = bp.HP;
     this.maxHP        = bp.maxHP;
     this.AttackStat   = bp.AttackStat;
     this.DefenceStat  = bp.DefenceStat;
     this.pokemonStats = bp.pokemonStats;
     this.canEvolve    = bp.canEvolve;
     this.evolveTo     = bp.evolveTo;
     this.level        = bp.level;
 }
コード例 #50
0
 public void Reset()
 {
     Name              = "";
     Description       = "";
     Sprite            = null;
     Mesh              = null;
     Mat               = null;
     BuffValueMaterial = 0;
     Type              = ItemType.eMaterial;
     CreaturePartType  = CreatureParts.eHead;
     Rarity            = Rarity.eCommon;
     BuffValuePart     = 0;
     BuffValuePart2    = 0;
     Duration          = 0;
     AspectMode        = false;
 }
コード例 #51
0
ファイル: Weapon.cs プロジェクト: GeorgiBarbutov/SoftUni
    protected Weapon(string name, Rarity rarity, int minDamage, int maxDamage, int socketNumber)
    {
        this.Name         = name;
        this.Rarity       = rarity;
        this.MinDamage    = minDamage;
        this.MaxDamage    = maxDamage;
        this.SocketNumber = socketNumber;

        this.Gems = new IGem[socketNumber];

        this.Strngth  = 0;
        this.Agility  = 0;
        this.Vitality = 0;

        IncreaseDamageInitial();
    }
コード例 #52
0
ファイル: Item.cs プロジェクト: ManChildMan/Crypt-of-Yrion
 public Item(string name, string description, Rarity rarity)
 {
     if (name == null)
     {
         throw new NullReferenceException();
     }
     if (description == null)
     {
         throw new NullReferenceException();
     }
     if (rarity < 0 || rarity >= Rarity.OneAboveMax)
     {
         throw new ArgumentOutOfRangeException();
     }
     this.name = name;
     this.description = description;
     this.rarity = rarity;
 }
コード例 #53
0
ファイル: Item.cs プロジェクト: mkstephenson/GW2-CSharp
 /// <summary>
 /// Represents a single skin.
 /// </summary>
 /// <param name="id">The item id.</param>
 /// <param name="chat_link">The chat link.</param>
 /// <param name="name">The item name.</param>
 /// <param name="icon">The full icon URL.</param>
 /// <param name="description">The item description.</param>
 /// <param name="type">The item type.</param>
 /// <param name="rarity">The item rarity.</param>
 /// <param name="level">The required level.</param>
 /// <param name="vendor_value">The value in coins when selling to a vendor. (Can be non-zero even when the item has the NoSell flag.)</param>
 /// <param name="default_skin">The default skin id.</param>
 /// <param name="flags">Flags applying to the item.</param>
 /// <param name="game_types">The game types in which the item is usable. At least one game type is specified.</param>
 /// <param name="restrictions">Restrictions applied to the item.</param>
 /// <param name="details">Additional item details if applicable, depending on the item type.</param>
 public Item(int id, string chat_link, string name, string icon, string description, ItemType type, Rarity rarity, int level, int vendor_value, 
     int default_skin, IEnumerable<ItemFlag> flags, IEnumerable<GameMode> game_types, IEnumerable<Restriction> restrictions, object details)
     : base(icon)
 {
     Id = id;
     ChatLink = chat_link;
     Name = name;
     Icon = icon;
     Description = description;
     Type = type;
     Rarity = rarity;
     Level = level;
     VendorValue = vendor_value;
     Skin = new SkinWrapper().GetById(default_skin);
     Flags = flags;
     GameTypes = game_types;
     Restrictions = restrictions;
     Details = details;
 }
コード例 #54
0
ファイル: Disciple.cs プロジェクト: szyuGH/playground
        public Disciple(long id, string name, int hp, int atk, int def, int spi, Rarity rarity, DiscipleType type, Skill skill, string bondsString, string sureBondsString, string traitsString)
        {
            Id = id;
            Name = name;
            Hp = hp;
            Attack = atk;
            Defense = def;
            Spirit = spi;
            Rarity = rarity;
            Type = type;
            Skill = skill;
            this.bondsString = bondsString;
            this.sureBondsString = sureBondsString;
            this.traitsString = traitsString;
            InitializeTraits();
            

            All.Add(this);
        }
コード例 #55
0
ファイル: PlayerItem.cs プロジェクト: Kinderril/p3
 public PlayerItem(Dictionary<ParamType, float> pparams, Slot slot, Rarity isRare, int cost,bool isEquiped,string name,string icon,int enchant,int id)
 {
     this.Id = id;
     Utils.SetId(Id);
     this.enchant = enchant;
     this.cost = cost;
     this.parameters = pparams;
     this.Slot = slot;
     this.name = name;
     this.Rare = isRare;
     this.isEquped = isEquiped;
     this.icon = icon;
     string p = "";
     p += "Slot:" + Slot;
     foreach (var pparam in pparams)
     {
         p += pparam.Key + "{" + pparam.Value + "}";
     }
     Debug.Log("Weapon loaded :  " + p);
 }
コード例 #56
0
    public void SetContent(Item item)
    {
        this.type = item.type;
        this.rarity = item.rarity;
        this.spriteNeutral = item.spriteNeutral;
        this.spriteHighlighted = item.spriteHighlighted;
        this.maxStackSize = item.maxStackSize;
        this.damage = item.damage;
        this.itemName = item.itemName;
        this.description = item.description;

        switch (type)
        {
            case ItemType.FISH:
                GetComponent<Renderer>().material.color = Color.cyan;
                break;
            case ItemType.BANDAGE:
                GetComponent<Renderer>().material.color = Color.red;
                break;
        }
    }
コード例 #57
0
ファイル: Level.cs プロジェクト: roeni1/KADC-1
 public int GetJump(Rarity rarity)
 {
     switch (rarity)
     {
         case Rarity.Common:
             return CommonJump;
         case Rarity.Uncommon:
             return UncommonJump;
         case Rarity.Rare:
             return RareJump;
         case Rarity.SuperRare:
             return SuperRareJump;
         case Rarity.UltraRare:
             return UltraRareJump;
         case Rarity.Legendary:
             return LegendaryJump;
         case Rarity.Epic:
             return EpicJump;
     }
     return 0;
 }
コード例 #58
0
ファイル: Card.cs プロジェクト: jeffreyreading/mtco
 public Card(Card copyCard)
 {
     name = copyCard.name;
     manaCost = copyCard.manaCost;
     illustration = copyCard.illustration;
     colorIndicator = copyCard.colorIndicator;
     type = copyCard.type;
     expansionSymbol = copyCard.expansionSymbol;
     rarity = copyCard.rarity;
     textbox = copyCard.textbox;
     basePower = copyCard.basePower;
     tempPower = 0;
     baseToughness = copyCard.baseToughness;
     tempToughness = 0;
     loyalty = copyCard.loyalty;
     illustrateCredit = copyCard.illustrateCredit;
     legalText = copyCard.legalText;
     collectorNumber = copyCard.collectorNumber;
     isTapped = copyCard.isTapped;
     isNewlyControlled = copyCard.isNewlyControlled;
     isAttacking = copyCard.isAttacking;
     isBlocking = copyCard.isBlocking;
     isBlocked = copyCard.isBlocked;
     damageMarked = copyCard.damageMarked;
     isUntapping = copyCard.isUntapping;
     isDestroyed = copyCard.isDestroyed;
     isExiled = copyCard.isExiled;
     owner = copyCard.owner;
     controller = copyCard.controller;   //Casting player
     numPlusPlusCounters = copyCard.numPlusPlusCounters;
     numMinusMinusCounters = copyCard.numMinusMinusCounters;
     numLoyaltyCounters = copyCard.numLoyaltyCounters;
     isToken = copyCard.isToken;
     isCopy = copyCard.isCopy;
     isMonocolor = copyCard.isMonocolor;
     isMulticolor = copyCard.isMulticolor;
     isColorless = copyCard.isColorless;
 }
コード例 #59
0
ファイル: PokemonCard.cs プロジェクト: Zenayi/PokemonTCG
 public PokemonCard(string name, string cardSet, Rarity cardRarity, string cardNumber, 
                    string illustrator, string hp, string stage, 
                    EnergyCard.EnergyType pokemonType,
                    string evolvedFrom, string abilityName, string abilityText,
                    List<Move> moveData, EnergyCard.EnergyType weaknessType,
                    string weaknessAmount, EnergyCard.EnergyType resistanceType,
                    string resistanceAmount, int retreatCost, string cardUrl, string cardImagePath)
     : base(name, cardSet, cardRarity, cardNumber, illustrator, cardUrl, cardImagePath)
 {
     this.HP = hp;
     this.Stage = stage;
     this.PokemonType = pokemonType;
     this.EvolvedFrom = evolvedFrom;
     this.AbilityName = abilityName;
     this.AbilityText = abilityText;
     this.MoveData = moveData;
     this.WeaknessType = weaknessType;
     this.WeaknessAmount = weaknessAmount;
     this.ResistanceType = resistanceType;
     this.ResistanceAmount = resistanceAmount;
     this.RetreatCost = retreatCost;
     this.CardPrice = CardDownloader.GetPriceOfCard(cardSet, cardNumber);
 }
コード例 #60
0
        public static PetStruct GetPetStruct(RealmManager manager, Family? petFamily, Rarity rarity)
        {
            Random rand = new Random((int)DateTime.Now.Ticks);
            List<PetStruct> structs = new List<PetStruct>();

            Rarity petRarity = rarity;

            if (rarity == Rarity.Uncommon)
                petRarity = Rarity.Common;
            else if (rarity == Rarity.Legendary)
                petRarity = Rarity.Rare;

            foreach (var x in manager.GameData.TypeToPet)
            {
                if (petFamily == null && x.Value.PetRarity == petRarity)
                {
                    structs.Add(x.Value);
                    continue;
                }
                if (x.Value.PetFamily == petFamily && x.Value.PetRarity == petRarity)
                    structs.Add(x.Value);
            }

            PetStruct petStruct = structs[rand.Next(structs.Count)];
            return petStruct;
        }