protected void SpawnMinion(GameObject prefab, Vector3 position, Minion.MinionEventHandler deathCallBack) { GameObject spawned = Instantiate(prefab, position, Quaternion.identity) as GameObject; spawned.SendMessage("SetWalkTarget", transform.position); Minion minionScript = spawned.GetComponent<Minion>(); minionScript.OnMinionDeath += deathCallBack; }
public static void Spawn(Minion prefab, bool toLeft, float pos) { Minion m = Instantiate(prefab); m.center = GameObject.FindGameObjectWithTag("Center").transform; m.DirectionIsToLeft = toLeft; m.Position = pos; }
public void Open(List<Minion> minions, List<Note> notes) { //Transform parent = this.transform.parent; this.minion = null; foreach (Minion m in minions) { if (m.gameObject.name == this.minionName) { this.minion = m; break; } } this.note = null; foreach (Note n in notes) { if (n.gameObject.name == this.noteName) { this.note = n; break; } } if (this.minion != null) { this.minion.EnableClicks(); this.minion.gameObject.GetComponent<SpriteRenderer>().color = Color.white; } if (this.note != null) { this.note.EnableClicks(); this.note.gameObject.GetComponent<SpriteRenderer>().color = Color.white; } }
public override void FightBack(Minion _me, Minion _target) { if (_target.ContainTag(Tag.CloseCombat)) { _target.BeingFightBack(_me); } }
public override void AfterMinionDied(Minion _me) { if (_me == null) return; Player tPlayer = GameManager.Instance.GetPlayerByType(_me.PlayerType); if (tPlayer == null) return; tPlayer.AddEnergy(HeroEnergyName.Death, deathEnergyAdd); }
public override BeingAttackedResult BeingAttacked(Minion _me, BeingAttackedResult _result) { if (_result.attackFrom.Position.MinionSlotPosition == MinionSlotPosition.Foreward) { _result.hurtVO *= 2; } return _result; }
public virtual void ReleaseMinion(Minion minion) { if (Minions.Contains(minion)) { RelativeStrength -= minion.RelativeStrength; Minions.Remove(minion); } }
public override void Excute(Minion _minion, PositionVO _target) { base.Excute(_minion, _target); Minion targetMinion = MinionManager.Instance.GetMinionByPosition(_target); if (targetMinion == null) return; targetMinion.BeingAttacked(_minion); }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { base.OnStateEnter(animator, stateInfo, layerIndex); mn = animator.GetComponent<Minion>(); mn.MyRgd.constraints = RigidbodyConstraints.None; elapsed = 0.0f; }
public override void PlayerTurnEnd(Minion _me) { base.PlayerTurnEnd(_me); --duration; if (duration <= 0) { _me.RemoveBuff(this); } }
public override MinionMovePositionResult MinionMovePosition(Minion _me, MinionMovePositionResult _result) { base.MinionMovePosition(_me, _result); if (_result.target.MinionSlotPosition == MinionSlotPosition.Backward) { _me.RemoveBuff(this); } return _result; }
public override void PlayerTurnStart(Minion _me) { base.PlayerTurnStart(_me); duration--; if (duration == 0) { _me.RemoveBuff(this); } }
public Minion[] Spawn(Vector3 position) { Minion[] minions = new Minion[Count]; for (int i = 0; i < Count; i++) { minions[i] = MinionManager.SpawnMinion(position, MinionType); } return minions; }
public void SetTarget(SelectionRegion Selected) { if (Selected == null || !Selected.Enabled || !typeof(SelectionRegion).IsAssignableFrom(Selected.GetType())) { return; } Morphid = Selected.Morphid; Lane = Selected.Lane; Minion = Selected.Minion; }
void Start() { parentMinion = transform.parent.gameObject.GetComponent<Minion>(); if (tag == "DetectCollider") { finalDestination = (parentMinion.team == 0) ? new Vector3(128, 14, 128) : new Vector3(-128, 14, -128); } }
public static int GetDurability(Minion minion) { Durability durability = new Durability() { MinionGuid = minion.GUID, Magnitude = minion.InitialDurability }; DurabilityBoost(durability); return durability.Magnitude; }
public override BeingHurtResult BeingHurt(Minion _me, BeingHurtResult _result) { if (_result.hurtVO.physicalDamage > 0) { _result.hurtVO.physicalDamage -= 1; if (_result.hurtVO.physicalDamage == 0) _result.hurtVO.physicalDamage = 1; } return _result; }
public override void PlayerTurnStart(Minion _me) { base.PlayerTurnStart(_me); duration--; _me.RealHurt(new HurtVO(hurtHealth, 0, 0)); if (duration == 0) { _me.RemoveBuff(this); } }
public static void healMinion(Minion targetMinion, int healAmount) { targetMinion.lifeTotal += healAmount; Console.WriteLine(GameEngine.getVillain().getMinions().ToString()); if (targetMinion.lifeTotal >= targetMinion.maxHealth) { //make sure target doesn't go over maxHealth targetMinion.lifeTotal = targetMinion.maxHealth; } }
public void PlayerTurnStart(Minion _me) { foreach (BuffUnit unit in buffUnits) { if (unit.BuffTime == BuffTime.PlayerTurnStart) { unit.Effect.Execute(buffedMinion); } } }
public override void PlayerTurnStart(Minion _me) { base.PlayerTurnStart(_me); --duration; if (duration <= 0) { _me.Hurt(new HurtVO(_me.Health, 0, 0)); MinionController.Instance.CheckResult(); } }
public override TargetResult Target(Minion _me, PositionVO _target) { if(false)// (_target.PlayerType == _me.PlayerType) { return TargetResult.SamePlayer; } else { Minion tMinion = MinionManager.Instance.GetMinionByPosition(_target); if (tMinion == null) { return TargetResult.InvalidTarget; } else { if(false) //(_me.MinionSlotPosition == MinionSlotPosition.Backward) { return TargetResult.OutOfRange; } else { if (false)//(_target.MinionSlotPosition == MinionSlotPosition.Foreward) { if(IsGuardOrNoOtherGuardInFrontline(_target)) { return TargetResult.ValidTarget; } else { return TargetResult.TargetGuarded; } } else { if(_me.ContainBuff(BuffName.Rooted) || _me.ContainBuff(BuffName.Slowed)) { return TargetResult.OutOfRange; } else { //if (NoOtherGuardInFrontline(_target)) if (NoOtherMinionInFrontline(_target)) { return TargetResult.CloseRangeTargetBack; } else { return TargetResult.TargetGuarded; } } } } } } }
public BeingHurtResult BeingHurt(Minion _me, BeingHurtResult _result) { foreach (BuffUnit unit in buffUnits) { if (unit.BuffTime == BuffTime.BeingHurt) { _result = unit.Effect.Execute(buffedMinion, _result); } } return _result; }
public override void WhenBuffApplied(Minion _me) { List<Minion> listOfMinions = MinionController.Instance.GetMinionsByPlayerType(_me.PlayerType); foreach (Minion minion in listOfMinions) { if (minion != _me) { minion.AddBuff(new StateOfDeathMinionBuff()); } } }
public virtual void AddMinion(Minion minion, bool force = false) { if (minion == null) return; if (Minions.Contains(minion)) return; Minions.Add(minion); minion.Owner = this; RelativeStrength += minion.RelativeStrength; }
public override Result CheckValid(Minion _minion, PositionVO _target) { Result result = new Result(true, ""); PositionVO minionPosition = _minion.Position; if (minionPosition.X == _target.X && minionPosition.Y == _target.Y) result.SetFailReason("Cant select self"); if (Mathf.Abs (_target.X - minionPosition.X) > 1 || Mathf.Abs (_target.Y - minionPosition.Y) > 1) { result.SetFailReason("Out of Range"); } return result; }
public override BeingAttackedResult BeingAttacked(Minion _me, BeingAttackedResult _result) { BeingAttackedResult result = base.BeingAttacked(_me, _result); Minion attackFrom = _result.attackFrom; if (attackFrom.Range == 1) { attackFrom.Hurt(new HurtVO(2, 0, 0)); } return result; }
public override TargetResult Target(Minion _me, PositionVO _target) { PositionVO myPosition = _me.Position; if ((myPosition.X == _target.X && Mathf.Abs(myPosition.Y - _target.Y) == 1) || (myPosition.Y == _target.Y && Mathf.Abs(myPosition.X - _target.X) == 1)) { return TargetResult.ValidTarget; } else { return TargetResult.OutOfRange; } }
public override void PlayerTurnEnd(Minion _me) { base.PlayerTurnEnd(_me); List<PositionVO> listofEmptyPositionFrontLineVO = MinionController.Instance.GetEmptyPositionsByLine(_me.PlayerType, MinionSlotPosition.Foreward); foreach(PositionVO emptyPositionFrontLine in listofEmptyPositionFrontLineVO) { MinionController.Instance.GenerateNewMinionByCardName("CardSkeleton", emptyPositionFrontLine); } List<PositionVO> listofEmptyPositionBackLineVO = MinionController.Instance.GetEmptyPositionsByLine(_me.PlayerType, MinionSlotPosition.Backward); foreach (PositionVO emptyPositionBackLine in listofEmptyPositionBackLineVO) { MinionController.Instance.GenerateNewMinionByCardName("CardSkeleton", emptyPositionBackLine); } }
public override void PlayerTurnStart(Minion _me) { base.PlayerTurnStart(_me); duration--; if (duration == 0) { if (_me.Health <= health) { _me.Heal(health - _me.Health + 1); } _me.RemoveBuff(this); } }
/// <summary> /// Whenever you play a minion, give a random minion in your hand +1/+1. /// 每当你使用一张随从牌,随机使你手牌中的一张随从牌获得+1/+1。 /// </summary> /// <param name="p"></param> /// <param name="triggerEffectMinion"></param> /// <param name="summonedMinion"></param> public override void onMinionWasSummoned(Playfield p, Minion triggerEffectMinion, Minion summonedMinion) { if (summonedMinion.playedFromHand && summonedMinion.own == triggerEffectMinion.own && summonedMinion.entitiyID != triggerEffectMinion.entitiyID) { if (triggerEffectMinion.own) { Handmanager.Handcard hc = p.searchRandomMinionInHand(p.owncards, searchmode.searchLowestCost, GAME_TAGs.Mob); if (hc != null) { hc.addattack++; hc.addHp++; p.anzOwnExtraAngrHp += 2; } } } }
// Deal $5 damage. public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice) { var dmg = ownplay ? p.getSpellDamageDamage(5) : p.getEnemySpellDamageDamage(5); p.minionGetDamageOrHeal(target, dmg); }
// Deal 5 damage to all characters. public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice) { int dmg = (ownplay) ? p.getSpellDamageDamage(5) : p.getEnemySpellDamageDamage(5); p.allCharsGetDamage(dmg); }
// Whenever you summon a minion, deal 5 damage to your Hero. public override void onMinionIsSummoned(Playfield p, Minion triggerEffectMinion, Minion summonedMinion) { if (triggerEffectMinion.own == summonedMinion.own) { p.minionGetDamageOrHeal(triggerEffectMinion.own ? p.ownHero : p.enemyHero, 5); } }
CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardIdEnum.KAR_030);//Cellar Spider public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice) { p.CallKid(kid, own.zonepos, own.own); }
public static void Obj_AI_Turret_OnBasicAttack2(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args) { if (sender is Obj_AI_Turret && sender.Distance(Player.Instance) < 800 && sender.IsAlly) { if (!(args.Target is AIHeroClient) && args.Target != null) { var Minions = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy, Player.Instance.Position, 150); foreach (var Minion in Minions) { if (Minion != null && args.Target == Minion && Orbwalker.CanAutoAttack) { var AMinions = EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Ally, Minion.Position, 300).ToList(); if (Q.IsReady() && Prediction.Health.GetPrediction(Minion, 930 * (int)(Minion.Distance(sender.Position) / 750)) > Player.Instance.TotalAttackDamage && Prediction.Health.GetPrediction(Minion, 930 * (int)(Minion.Distance(sender.Position) / 750)) + (int)(AMinions.Count * -2) <= sender.TotalAttackDamage * 1.25) { Orbwalker.DisableMovement = true; Core.DelayAction(() => Player.IssueOrder(GameObjectOrder.AttackUnit, args.Target), 0); Core.DelayAction(() => Q.Cast(Minion.ServerPosition), 291); Core.DelayAction(() => Orbwalker.DisableMovement = false, 300); Chat.Print("Last Hitting With AA-Q"); } else if (W.IsReady() && Prediction.Health.GetPrediction(Minion, 940 * (int)(Minion.Distance(sender.Position) / 750)) > Player.Instance.TotalAttackDamage && Prediction.Health.GetPrediction(Minion, 940 * (int)(Minion.Distance(sender.Position) / 750)) + (int)(AMinions.Count * -2) <= sender.TotalAttackDamage * 1.25) { Orbwalker.DisableMovement = true; Core.DelayAction(() => Player.IssueOrder(GameObjectOrder.AttackUnit, args.Target), 0); Core.DelayAction(() => Orbwalker.DisableMovement = false, 300); Chat.Print("Last Hitting With AA-w"); } } } } } }
public void StopSupporting(Minion other) { this.supporting.Remove(other); other.supporter = null; other.beingSupported = false; }
public void SelectRangedPriority(int iSelection) { Minion minion = Core.GetPlayerProfile().rosters [0].GetMinion(slot); minion.priority = (TargetPriority)iSelection; }
public void AssignMinion(Minion newMinion) { minion = newMinion; }
// kampfschrei:/ fügt allen anderen charakteren 1 schaden zu. public override int getPlayPenalty(Playfield p, Minion m, Minion target, int choice, bool isLethal) { return(0); }
CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.UNG_201t); //Primalfin public override void onDeathrattle(Playfield p, Minion m) { p.CallKid(kid, m.zonepos - 1, m.own); p.CallKid(kid, m.zonepos - 1, m.own); p.CallKid(kid, m.zonepos - 1, m.own); }
public void Enter(Minion owner) { this.Owner = owner; }
//Choose an enemy minion. Shuffle it into your deck. public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice) { p.minionReturnToDeck(target, ownplay); }
// Whenever a Secret: is played, gain +1/+1. public override void onCardIsGoingToBePlayed(Playfield p, Handmanager.Handcard hc, bool ownplay, Minion m) { if (hc.card.Secret) { p.minionGetBuffed(m, 1, 1); } }
public override int getEnemyMinionValue(Minion m, Playfield p) { int retval = 5; retval += m.Hp * 2; if (!m.frozen && !((m.name == CardDB.cardName.ancientwatcher || m.name == CardDB.cardName.ragnarosthefirelord) && !m.silenced)) { retval += m.Angr * 2; if (m.windfury) { retval += m.Angr * 2; } if (m.Angr >= 4) { retval += 10; } if (m.Angr >= 7) { //this might be faster, than creating new lists, use findall and loop over them int enemyAttackerscount = 0; int ownTauntCount = 0; int ownTauntHP = 0; int enemyTotalAttack = 0; foreach (Minion min in p.enemyMinions) { if (min.Angr >= 1) { enemyTotalAttack += min.Angr; enemyAttackerscount++; } } foreach (Minion min in p.ownMinions) { if (min.taunt) { ownTauntCount++; ownTauntHP += min.Hp; } } if (ownTauntCount < enemyAttackerscount && ownTauntHP <= enemyTotalAttack) { retval += 30; } } } if (m.Angr == 0) { retval -= 7; } retval += m.handcard.card.rarity; if (m.taunt) { retval += 5; } if (m.divineshild) { retval += m.Angr; } if (m.divineshild && m.taunt) { retval += 5; } if (m.stealth) { retval += 1; } if (m.poisonous) { retval += 4; } if (m.handcard.card.targetPriority >= 1 && !m.silenced) { retval += 5 + m.handcard.card.targetPriority; } if (m.name == CardDB.cardName.nerubianegg && m.Angr <= 3 && !m.taunt) { retval = 0; } return(retval); }
CardDB.Card wcard = CardDB.Instance.getCardDataFromID(CardIdEnum.EX1_398t); //battleaxe public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice) { p.equipWeapon(wcard, own.own); }
public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice) { p.equipWeapon(wcard, ownplay); }
//Battlecry: Reveal a minion in each deck.If yours costs more, gain Charge. public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice) { p.minionGetCharge(own); // optimistic }
//Deathrattle: Copy a card from your opponent's deck and add it to your hand. public override void onDeathrattle(Playfield p, Minion m) { p.drawACard(CardName.unknown, m.own, true); }
public SummonMinionAction(Minion minion) { this.minion = minion; }
//Change a minion's Attack to 1. public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice) { p.minionSetAngrToX(target, 1); }
public override void onDeathrattle(Playfield p, Minion m) { p.allMinionsGetDamage(1); p.doDmgTriggers(); }
public virtual float GetEnemyMinionValue(Minion m, Playfield p) { return(0); }
//Deathrattle: Restore 8 Health to the enemy hero. public override void onDeathrattle(Playfield p, Minion m) { var heal = m.own ? p.getMinionHeal(8) : p.getEnemyMinionHeal(8); p.minionGetDamageOrHeal(m.own ? p.enemyHero : p.ownHero, -heal); }
//Battlecry: Discover a spell. public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice) { p.drawACard(CardDB.cardName.thecoin, own.own, true); }
void BuildMinion(Minion minion) { int acum; int counter; int aux; switch (minion.colorComplexity) { case ColorComplexity.basic: acum = RandomInt(1, 4); if (acum == 1) { cyanQuantity = minion.size; } else if (acum == 2) { magentaQuantity = minion.size; } else { yellowQuantity = minion.size; } break; case ColorComplexity.medium: counter = RandomInt(1, minion.size); acum = RandomInt(1, 4); if (acum == 1) { cyanQuantity = counter; magentaQuantity = minion.size - counter; } else if (acum == 2) { yellowQuantity = counter; cyanQuantity = minion.size - counter; } else { magentaQuantity = counter; yellowQuantity = minion.size - counter; } break; case ColorComplexity.advanced: counter = RandomInt(1, minion.size - 1); aux = RandomInt(1, minion.size - counter); acum = RandomInt(1, 4); if (acum == 1) { cyanQuantity = counter; magentaQuantity = aux; yellowQuantity = minion.size - (aux + counter); } else if (acum == 2) { yellowQuantity = counter; cyanQuantity = aux; magentaQuantity = minion.size - (aux + counter); } else { magentaQuantity = counter; yellowQuantity = aux; cyanQuantity = minion.size - (aux + counter); } break; case (ColorComplexity)3: minion.colorComplexity = (ColorComplexity)RandomInt(1, 3); BuildMinion(minion); break; } }
//[x]<b>Hero Power</b>+1 Attack this turn. //<b>英雄技能</b>在本回合中获得+1攻击力。 public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice) { p.minionGetTempBuff(ownplay ? p.ownHero : p.enemyHero, 1, 0); }
// kampfschrei:/ stellt bei allen befreundeten charakteren 2 leben wieder her. public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice) { int heal = (own.own) ? p.getMinionHeal(2) : p.getEnemyMinionHeal(2); p.allCharsOfASideGetDamage(own.own, -heal); }
//[x]Give a minion +1 Attack.<b>Invoke</b> Galakrond. //使一个随从获得+1攻击力。<b>祈求</b>迦拉克隆。 public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice) { p.minionGetBuffed(target, 1, 0); }
/// <summary> /// Creates a zone for the opponent using the specified cards and zone. /// </summary> /// <param name="opponent">the controller of the opponent</param> /// <param name="predictedCards">the predicted cards the zone is populated with</param> /// <param name="zone">the zone who will be created</param> /// <param name="setasideZone">the setaside zone</param> /// <returns>the playables of the zone based on the cards</returns> private void createZone(Controller opponent, List <Card> predictedCards, IZone zone, ref SetasideZone setasideZone) { var deck = new List <IPlayable>(); foreach (Card card in predictedCards) { var tags = new Dictionary <GameTag, int> { [GameTag.ENTITY_ID] = opponent.Game.NextId, [GameTag.CONTROLLER] = opponent.PlayerId, [GameTag.ZONE] = (int)zone.Type }; IPlayable playable = null; switch (card.Type) { case CardType.MINION: playable = new Minion(opponent, card, tags); break; case CardType.SPELL: playable = new Spell(opponent, card, tags); break; case CardType.WEAPON: playable = new Weapon(opponent, card, tags); break; case CardType.HERO: tags[GameTag.ZONE] = (int)Zone.PLAY; tags[GameTag.CARDTYPE] = card[GameTag.CARDTYPE]; playable = new Hero(opponent, card, tags); break; case CardType.HERO_POWER: tags[GameTag.COST] = card[GameTag.COST]; tags[GameTag.ZONE] = (int)Zone.PLAY; tags[GameTag.CARDTYPE] = card[GameTag.CARDTYPE]; playable = new HeroPower(opponent, card, tags); break; default: throw new EntityException($"Couldn't create entity, because of an unknown cardType {card.Type}."); } opponent.Game.IdEntityDic.Add(playable.Id, playable); // add entity to the appropriate zone if it was given zone.Add(playable); if (playable.ChooseOne) { playable.ChooseOnePlayables[0] = Entity.FromCard(opponent, Cards.FromId(playable.Card.Id + "a"), new Dictionary <GameTag, int> { [GameTag.CREATOR] = playable.Id, [GameTag.PARENT_CARD] = playable.Id }, setasideZone); playable.ChooseOnePlayables[1] = Entity.FromCard(opponent, Cards.FromId(playable.Card.Id + "b"), new Dictionary <GameTag, int> { [GameTag.CREATOR] = playable.Id, [GameTag.PARENT_CARD] = playable.Id }, setasideZone); } deck.Add(playable); } }