/*================================================================== * 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); }
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); } }
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); }
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(); }
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; }
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); }
/// <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}"); }
/// <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}"); }
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); }
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; } } }
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(); }
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(); }
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()); }
// 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); } }
/// <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()); }
private void Start() { Passive passive = FindObjectOfType <GameSelection>().FindPassiveByName(elementName); description = passive.description; GetComponent <Button>().onClick.AddListener(Select); }
internal HealthCheckOptions DeepClone() { return(new HealthCheckOptions { Passive = Passive?.DeepClone(), Active = Active?.DeepClone() }); }
public async Task <Passive> AddPassive(Passive passive) { var result = await passiveContext.Passives.AddAsync(passive); await passiveContext.SaveChangesAsync(); return(result.Entity); }
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); }
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, }; }
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()); }
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(); }
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; }
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; } }
public void RemovePassive(Passive passive) { foreach (Passive p in Passives) { if (p == passive) { passives.Remove(passive); } } }
private void PassiveIsFinished(Passive passive) { if (passive == null) { return; } _passives.Remove(passive); Destroy(passive.gameObject); OnInventoryChange(); }
//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; }
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); }
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))); }
/// <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(); }
public Task<PassiveProcessResponse> PassiveProcess(Passive passive) { RestRequest restRequest = GetRestRequest(ApiPaths.PassiveProcess, Method.POST, passive); return ProcessDefaultRequest<PassiveProcessResponse>(restRequest); }