コード例 #1
0
    /*==================================================================
    *  PASSIVES
    * ================================================================*/

    public void EquipPassive(Passive passive, int index = -1)
    {
        // Find first empty slot
        if (index == -1)
        {
            for (int i = 0; i < passives.Length; i++)
            {
                if (passives[i] == null)
                {
                    index = i;
                    break;
                }
            }
        }

        // Check that index is legal
        if (index == -1 || index >= passives.Length)
        {
            return;
        }

        //Remove old passive
        RemovePassive(index);

        // Set new passive
        passives[index] = passive;
        passive.owner   = this;

        // Equipping trigger
        passive.Tick(Trigger.Equip);
    }
コード例 #2
0
        public override void PreAttack(IPlayer player, RoundResult rr)
        {
            // Only on first activation
            if (!_init)
            {
                _init = true;

                _fastAndFurious   = player.GetPassive(nameof(FastAndFurious));
                _hasLetLoose      = player.HasPassive(nameof(LetLoose));
                _hasAnnihilate    = player.HasPassive(nameof(Annihilate));
                _hasPneumaticMaul = player.Settings.PrimaryWeaponProc == WeaponProc.PneumaticMaul;

                if (_hasPneumaticMaul)
                {
                    var demolishRage = player.Spells.Find(s => s.GetType() == typeof(DemolishRage));
                    var eruptionRage = player.Spells.Find(s => s.GetType() == typeof(EruptionRage));

                    _demolishOriginalCost = demolishRage?.PrimaryGimmickCost ?? 50;
                    _eruptionOriginalCost = eruptionRage?.PrimaryGimmickCost ?? 50;
                }
            }

            if (_hasPneumaticMaul)
            {
                PneumaticMaulActive(player, _pneumaticStamp >= player.CurrentTimeSec && PneumaticAvailable);
            }
        }
コード例 #3
0
ファイル: TenseManager.cs プロジェクト: GailBowen/Daruma_Doll
        public Inflection CreateInflection(decimal conjugation, string mood, string tense, bool isPassive)
        {
            Inflection inflection = new Inflection();


            if ((tense == "Perfect" || tense == "Pluperfect" || tense == "Future Perfect") && isPassive)
            {
                Passive passive = _passives.Where(p => p.Tense == tense && p.Mood == mood).FirstOrDefault();

                if (passive != null)
                {
                    inflection.singular_first  = $"{passive.singular_first} {_supineStem}us";
                    inflection.singular_second = $"{passive.singular_second} {_supineStem}us";
                    inflection.singular_third  = $"{passive.singular_third} {_supineStem}us";

                    inflection.plural_first  = $"{passive.plural_first} {_supineStem}i";
                    inflection.plural_second = $"{passive.plural_second} {_supineStem}i";
                    inflection.plural_third  = $"{passive.plural_third} {_supineStem}i";
                }
            }
            else
            {
                Suffix suffix = _suffixes.Where(s => s.Conjugation == conjugation && s.Mood == mood && s.Passive == isPassive && s.Tense == tense).FirstOrDefault();

                inflection.singular_first  = SplitSuffix(suffix.singular_first);
                inflection.singular_second = SplitSuffix(suffix.singular_second);
                inflection.singular_third  = SplitSuffix(suffix.singular_third);

                inflection.plural_first  = SplitSuffix(suffix.plural_first);
                inflection.plural_second = SplitSuffix(suffix.plural_second);
                inflection.plural_third  = SplitSuffix(suffix.plural_third);
            }

            return(inflection);
        }
コード例 #4
0
 public Chef()
 {
     health       = 25; maxHP = 25; strength = 4; power = 0; charge = 0; defense = 0; guard = 0;
     baseAccuracy = 11; accuracy = 11; dexterity = 2; evasion = 0; type = "Chef"; passive = new Passive(this);
     quirk        = Quirk.GetQuirk(this); special = null; player = false; champion = false; recruitable = false;
     cycle        = 0; CreateDrops();
 }
コード例 #5
0
    private void SetupPlayer2()
    {
        var player2 = Instantiate(player2Prefab, new Vector3(35f, 0f, 0f), player2Prefab.transform.rotation);

        // Set health, gasoline, mana bar, power slider
        player2.GetComponent <Health>().healthBarImg  = GameObject.Find("Health Bar Image 2").GetComponent <Image>();
        player2.GetComponent <Move>().gasolineBarImg  = GameObject.Find("Gasoline Bar Image 2").GetComponent <Image>();
        player2.GetComponent <Inventory>().manaBarImg = GameObject.Find("Mana Bar Image 2").GetComponent <Image>();
        player2.GetComponent <Cannon>().powerSlider   = GameObject.Find("Power Slider 2").GetComponent <Slider>();

        // Set up player 2 passive
        Passive player2Passive          = gameSelection.FindPassiveByName(gameSelection.player2PassiveName);
        var     player2PassiveComponent = player2.GetComponent <PlayerPassive>();

        player2PassiveComponent.passivePrefab = player2Passive.passivePrefab;
        player2PassiveComponent.R             = player2Passive.R;
        player2PassiveComponent.G             = player2Passive.G;
        player2PassiveComponent.B             = player2Passive.B;

        // Set up player 2 items
        var player2ItemPrefabs = player2.GetComponent <Inventory>().itemPrefabs;

        foreach (string itemName in gameSelection.player2ItemNames)
        {
            Item item = gameSelection.FindItemByName(itemName);
            player2ItemPrefabs.Add(item.itemPrefab);
        }

        // Set up game phase
        gamePhase.player2 = player2;
    }
コード例 #6
0
ファイル: BasicCard.cs プロジェクト: TheTechBandit/Osiris
        public int ApplyDamageBuffs(int damage)
        {
            double perc = 0;
            int    stat = 0;

            foreach (BuffDebuff eff in Effects)
            {
                perc += eff.DamagePercentBuff;
                perc -= eff.DamagePercentDebuff;
                stat += eff.DamageStaticBuff;
                stat -= eff.DamageStaticDebuff;
                if (eff.BleedAttackDamage > 0)
                {
                    TakeDebuffDamage(eff.BleedAttackDamage);
                }
                eff.AttackTick();
            }

            if (HasPassive)
            {
                perc = Passive.PassiveDamagePercentCalculation(perc);
                stat = Passive.PassiveDamageStaticCalculation(stat);
            }

            EffectCleanup();

            return(damage + (int)((double)damage * perc) + stat);
        }
コード例 #7
0
        /// <summary>
        /// Post a new passive to the database
        /// </summary>
        /// <param name="passive"></param>
        /// <returns>string with name of new passive</returns>
        public async Task <string> AddNewPassive(Passive passive)
        {
            _context.Passives.Add(passive);
            await _context.SaveChangesAsync();

            return($"Created passive {passive.PassiveName}");
        }
コード例 #8
0
        /// <summary>
        /// Deletes a single passive from database if found
        /// </summary>
        /// <param name="passiveName"></param>
        /// <returns>string telling whether or not passive was deleted</returns>
        public async Task <string> DeletePassive(string passiveName)
        {
            var transaction = await _context.Database.BeginTransactionAsync();

            //delete from join table
            foreach (var i in _context.CharactersPassives)
            {
                if (i.PassiveName != passiveName)
                {
                    continue;
                }

                _context.CharactersPassives.Remove(i);
            }
            await _context.SaveChangesAsync();

            Passive passive = await _context.Passives.FindAsync(passiveName);

            if (passive == null)
            {
                return("No item found");
            }


            _context.Passives.Remove(passive);
            await _context.SaveChangesAsync();

            await transaction.CommitAsync();

            return($"Deleted {passive.PassiveName}");
        }
コード例 #9
0
ファイル: PassiveProvider.cs プロジェクト: b-a-x/CashFlow
        public async Task <PassiveDto> CreatePassiveForUserAsync(PassiveDto passive, string userId)
        {
            //TODO: бизенс логику убрать в menager, сделать в одной транзакции
            var orderNumber = _context.Expenses
                              .Where(x => x.UserId == userId)
                              .OrderByDescending(x => x.OrderNumber).FirstOrDefault()?.OrderNumber + 1 ?? 1;
            var newExpense = new Expense {
                Name = passive.Name, OrderNumber = orderNumber, Price = 0, UserId = userId
            };
            await _context.Expenses.AddAsync(newExpense);

            var newPassive = new Passive
            {
                Name        = passive.Name,
                OrderNumber = passive.OrderNumber,
                Price       = passive.Price,
                UserId      = userId,
                ExpenseId   = newExpense.Id
            };
            await _context.Passives.AddAsync(newPassive);

            await _context.SaveChangesAsync();

            passive.Id          = newPassive.Id;
            passive.Name        = newPassive.Name;
            passive.OrderNumber = newPassive.OrderNumber;
            passive.Price       = newPassive.Price;

            return(passive);
        }
コード例 #10
0
    void Start()
    {
        player      = GameObject.Find("Player");
        mscr        = player.GetComponent <MoveScript>();
        gamemanager = GameObject.Find("GameManager");
        itemList    = gamemanager.GetComponent <ItemScript>();
        //making items in shop random by taking them from the list


        weaponAvail  = itemList.Weapons[Random.Range(1, itemList.Weapons.Count)];
        passiveAvail = itemList.Passives[Random.Range(1, itemList.Passives.Count)];
        usableAvail  = itemList.Usables[Random.Range(1, itemList.Usables.Count)];
        bonusAvail   = itemList.Bonuses[Random.Range(1, itemList.Bonuses.Count)];
        //
        //just for indication ;)
        bonusname   = bonusAvail.Name;
        usablename  = usableAvail.Name;
        passivename = passiveAvail.Name;
        weaponame   = weaponAvail.Name;
        if (weaponAvail == mscr.primary || weaponAvail == mscr.secondary)
        {
            while (weaponAvail == mscr.primary || weaponAvail == mscr.secondary)
            {
                weaponAvail = itemList.Weapons[Random.Range(1, itemList.Weapons.Count)];
            }
        }
        if (usableAvail == mscr.activeusable)
        {
            while (usableAvail == mscr.activeusable)
            {
                usableAvail = itemList.Usables[Random.Range(1, itemList.Usables.Count)];
            }
        }
        for (int x = 0; x < itemontable.Length; x++)
        {
            //display sprites
            GameObject placeholder;
            placeholder = itemontable[x];
            if (wep == false)
            {
                placeholder.GetComponent <SpriteRenderer>().sprite = weaponAvail.Shopsprite;
                wep = true;
            }
            else if (pass == false)
            {
                placeholder.GetComponent <SpriteRenderer>().sprite = passiveAvail.Shopsprite;
                pass = true;
            }
            else if (use == false)
            {
                placeholder.GetComponent <SpriteRenderer>().sprite = usableAvail.Shopsprite;
                use = true;
            }
            else if (bonus == false)
            {
                placeholder.GetComponent <SpriteRenderer>().sprite = bonusAvail.Shopsprite;
                bonus = true;
            }
        }
    }
コード例 #11
0
 public Dummy()
 {
     health       = 100; maxHP = 100; strength = 1; power = 0; charge = 0; defense = 0; guard = 0;
     baseAccuracy = 0; accuracy = 0; dexterity = 0; evasion = 0; type = "Dummy"; passive = new Passive(this);
     quirk        = Quirk.GetQuirk(this); special = null; player = false; champion = false; recruitable = false; status.goopImmune = true;
     CreateDrops();
 }
コード例 #12
0
 public CEO()
 {
     health       = 100; maxHP = 100; strength = 5; power = 0; charge = 0; defense = 0; guard = 0;
     baseAccuracy = 14; accuracy = 14; dexterity = 2; evasion = 0; type = "CEO"; passive = new Passive(this);
     quirk        = Quirk.GetQuirk(this); special = null; player = false; champion = true; recruitable = false;
     cycle        = 0; summonCount = -1; monopoly = 0; horiz = false; vert = false; CreateDrops();
 }
コード例 #13
0
        private static StackPanel[] ConvertToolTips(Passive passive, Spell[] spells)
        {
            var list = new List <StackPanel>();

            var stackPanel2 = new StackPanel();

            stackPanel2.Children.Add(new TextBlock {
                Text = passive.Description
            });
            list.Add(stackPanel2);

            foreach (var spell in spells)
            {
                var stackPanel = new StackPanel
                {
                    Background = Brushes.DarkSlateBlue
                };

                var textBlock = new TextBlock
                {
                    Text       = spell.Tooltip,
                    Foreground = Brushes.Crimson
                };

                stackPanel.Children.Add(textBlock);
                list.Add(stackPanel);
            }

            return(list.ToArray());
        }
コード例 #14
0
        // Passives

        /// <summary>
        /// please use this when adding any type of passive
        /// </summary>
        /// <param name="passive"></param>
        public override void AddPassive(Passive passive)
        {
            if (initalized)
            {
                InitPassive(passive);
            }
            else
            {
                passive.PartialInit(this);
            }
            bool add = true;

            if (passive is Buff)
            {
                add = AddBuff((Buff)passive);
            }
            if (passive is TalentTrigger)
            {
                TalentTriggers.Add((TalentTrigger)passive);
            }
            if (passive is Talent)
            {
                Talents.Add((Talent)passive);
            }
            if (add)
            {
                passives.Add(passive);
            }
        }
コード例 #15
0
ファイル: MsgOperate.cs プロジェクト: YuChenDayCode/WeChatzz
        /// <summary>
        /// 被动回复
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="user"></param>
        /// <param name="msgType"></param>
        /// <returns></returns>
        public static string PassiveRecovery(XMLModel model)
        {
            Passive Reply = new Passive {
                Content = model.Content, FromUserName = model.ToUserName, ToUserName = model.FromUserName
            };

            return(Reply.ToString());
        }
コード例 #16
0
    private void Start()
    {
        Passive passive = FindObjectOfType <GameSelection>().FindPassiveByName(elementName);

        description = passive.description;

        GetComponent <Button>().onClick.AddListener(Select);
    }
コード例 #17
0
 internal HealthCheckOptions DeepClone()
 {
     return(new HealthCheckOptions
     {
         Passive = Passive?.DeepClone(),
         Active = Active?.DeepClone()
     });
 }
コード例 #18
0
        public async Task <Passive> AddPassive(Passive passive)
        {
            var result = await passiveContext.Passives.AddAsync(passive);

            await passiveContext.SaveChangesAsync();

            return(result.Entity);
        }
コード例 #19
0
ファイル: Passive.cs プロジェクト: Cdrix/SM
    static public Passive Create(string root, Vector3 origen = new Vector3())
    {
        Passive obj = null;

        obj = (Passive)Resources.Load(root, typeof(Passive));
        obj = (Passive)Instantiate(obj, origen, Quaternion.identity);
        return(obj);
    }
コード例 #20
0
ファイル: PurpleViking.cs プロジェクト: JasonGras/GameServer
        public PurpleViking()
        {
            this.UnitName     = "PurpleViking";
            this.UnitQuality  = 3;
            this.UnitPower    = 35;
            this.UnitMaxHp    = 215;
            this.UnitHp       = UnitMaxHp;
            this.UnitLevel    = 1;
            this.UnitID       = "purple_viking_id";
            this.UnitVelocity = 300;
            this.UnitImage    = "purple_viking_img";
            this.UnitPrefab   = "purple_viking_01";
            this.UnitTribe    = "Viking";


            BasicAttack UnitBasicAttack = new BasicAttack(
                "purple_viking_basic_attack_id",
                "purple_viking_basic_attack_name",
                "purple_viking_basic_attack_img",
                1,
                UnitPower,
                1,
                SpellType.OFFENSE,
                SpellTarget.ENEMY,
                SpellTargetZone.ONE_UNIT,
                SpellTargetProperty.UNIT_HP);

            Passive UnitPassive = new Passive(
                "purple_viking_passive_id",
                "purple_viking_passive_name",
                "purple_viking_passive_img",
                1,
                0.2f,
                1,
                SpellType.PASSIVE,
                SpellTarget.ALLY,
                SpellTargetZone.ALL_UNITS,
                SpellTargetProperty.UNIT_VELOCITY);

            Heal UnitHeal = new Heal(
                "purple_viking_heal_id",
                "purple_viking_heal_name",
                "purple_viking_heal_img",
                1,
                UnitPower,
                1,
                SpellType.BUFF,
                SpellTarget.ALLY,
                SpellTargetZone.ONE_UNIT,
                SpellTargetProperty.UNIT_HP);

            this.spellList = new List <ISpell>()
            {
                UnitBasicAttack,
                UnitHeal,
                UnitPassive,
            };
        }
コード例 #21
0
        public string RenderPassive(Passive talent)
        {
            var sb = new StringBuilder();

            sb.AppendLine(Icons.SheetIcons[talent.Discipline] + " " + talent.Name);
            sb.Append("\n");
            sb.AppendLine(talent.Description);
            return(sb.ToString());
        }
コード例 #22
0
    public void PassiveHover(Passive passive)
    {
        hoverBox.SetActive(true);
        hoverBox.transform.position = Input.mousePosition + new Vector3(10, 0);
        hoverText.text  = "<u>" + passive.passiveName + "</u>\n";
        hoverText.text += passive.GetDescription();

        SetHoverBoxSize();
    }
コード例 #23
0
ファイル: Hero.cs プロジェクト: AtwoodDeng/SimpleBattle
    public virtual void Init()
    {
        if (m_info == null)
        {
            m_info = GetComponent <HeroInfo> ();
        }
        if (m_info != null)
        {
            m_info.Init(this);
        }
        if (m_strategy == null)
        {
            m_strategy = GetComponent <Strategy> ();
        }
        if (m_strategy != null)
        {
            m_strategy.Init(this);
        }
        if (m_move == null)
        {
            m_move = GetComponent <Move> ();
        }
        if (m_move != null)
        {
            m_move.Init(this);
        }
        if (m_attack == null)
        {
            m_attack = GetComponent <Attack> ();
        }
        if (m_attack != null)
        {
            m_attack.Init(this);
        }
        if (m_passive == null)
        {
            m_passive = GetComponent <Passive> ();
        }
        if (m_passive != null)
        {
            m_passive.Init(this);
        }
        if (m_heroAnim == null)
        {
            m_heroAnim = GetComponent <HeroAnim> ();
        }
        if (m_heroAnim != null)
        {
            m_heroAnim.Init(this);
        }

        GetHeroInfo().DeathFunc += delegate {
            TemBlock.isLock = false;
            TemBlock        = null;
        };
        m_IsInit = true;
    }
コード例 #24
0
    void CreatCard()
    {
        XMLDataSerializer.LoadCards("Assets/Data/Cards.xml");
        //CardList cl = new CardList("main");

        switch (cardTypeInt)
        {
        case 0:
            Action act = new Action();

            act.type                = NSGameplay.Cards.ECardType.Instant;
            act.cost                = utilityCost;
            act.name                = cardName;
            act.tooltip             = new NSGameplay.Cards.Tooltip();
            act.tooltip.description = cardDescription;
            act.tooltip.title       = cardDescTitle;
            act.tooltip.image_Path  = "path of an image";
            act.damageOut           = damageOut;
            act.damageIn            = damageIn;
            act.healOut             = healOut;
            act.healIn              = healIn;
            act.armorUpIn           = armorUpIn;
            act.armorUpOut          = armorUpOut;
            act.armorDownIn         = armorDownIn;
            act.armorDownOut        = armorDownOut;

            Libraries.instance.Save_Card_Local(act);
            Libraries.instance.Save_Cards_To_File();
            break;

        case 1:
            Minion min = new Minion();

            min.type                = NSGameplay.Cards.ECardType.Minion;
            min.cost                = 2;
            min.name                = cardName;
            min.tooltip             = new NSGameplay.Cards.Tooltip();
            min.tooltip.description = cardDescription;
            min.tooltip.title       = cardDescTitle;
            min.tooltip.image_Path  = "path of an image";
            min.attack              = minionAttack;
            min.baseDefence         = minionBaseDefense;
            min.defence             = minionBaseDefense;
            min.health              = minionHealth;

            Libraries.instance.Save_Card_Local(min);
            Libraries.instance.Save_Cards_To_File();
            break;

        case 2:
            Passive pas = new Passive();


            break;
        }
    }
コード例 #25
0
 public void RemovePassive(Passive passive)
 {
     foreach (Passive p in Passives)
     {
         if (p == passive)
         {
             passives.Remove(passive);
         }
     }
 }
コード例 #26
0
 private void PassiveIsFinished(Passive passive)
 {
     if (passive == null)
     {
         return;
     }
     _passives.Remove(passive);
     Destroy(passive.gameObject);
     OnInventoryChange();
 }
コード例 #27
0
 //This constructor is usually unused
 public Character(int health, int maxHP, int strength, int accuracy,
                  int dexterity, string name, Quirk quirk, bool player, bool champion,
                  bool recruitable)
 {
     this.health    = health; this.maxHP = maxHP; this.strength = strength;
     power          = 0; charge = 0; defense = 0; guard = 0; baseAccuracy = accuracy; this.accuracy = accuracy;
     this.dexterity = dexterity; evasion = 0; this.name = name;
     this.quirk     = quirk; this.special = new Rally(); this.player = player;
     this.champion  = champion; this.recruitable = recruitable;
 }
コード例 #28
0
    public bool AddPassive(Passive passive, int?playerId = null)
    {
        var activePlayer = GameManager.instance.GetPlayer(playerId);

        var success = activePlayer.AddPassive(passive);

        GameManager.instance.uiManager.RefreshUI();

        return(success);
    }
コード例 #29
0
ファイル: Turn.cs プロジェクト: dopeldead/Fingergame
        public bool Equals(Turn t)
        {
            // If parameter is null return false:
            if ((object)t == null)
            {
                return(false);
            }

            // Return true if the fields match:
            return((Active.Equals(t.Active)) && (Passive.Equals(t.Passive)));
        }
コード例 #30
0
 /// <summary>
 /// Add passive
 /// </summary>
 /// <param name="passive">Passive to add</param>
 public void AddPassive(Passive passive)
 {
     if (passive == null)
     {
         return;
     }
     _passives.Add(passive);
     passive.PassiveIsFinished += PassiveIsFinished;
     passive.Active();
     OnInventoryChange();
 }
コード例 #31
0
 public Task<PassiveProcessResponse> PassiveProcess(Passive passive)
 {
     RestRequest restRequest = GetRestRequest(ApiPaths.PassiveProcess, Method.POST, passive);
     return ProcessDefaultRequest<PassiveProcessResponse>(restRequest);
 }