public void minionLostCharge(Minion m) { m.charge--; m.updateReadyness(); }
public void minionGetCharge(Minion m) { m.charge++; m.updateReadyness(); }
public void minionGetWindfurry(Minion m) { if (m.windfury) return; m.windfury = true; m.updateReadyness(); }
public void minionGetControlled(Minion m, bool newOwner, bool canAttack) { List<Minion> newOwnerList = (newOwner) ? this.playerFirst.ownMinions : this.playerSecond.ownMinions; List<Minion> oldOwnerList = (newOwner) ? this.playerSecond.ownMinions : this.playerFirst.ownMinions; if (newOwnerList.Count >= 7) return; this.tempTrigger.ownMinionsChanged = true; this.tempTrigger.enemyMininsChanged = true; //if (m.taunt && newOwner) this.playerFirst.anzEnemyTaunt--; //end buffs/aura m.handcard.card.sim_card.onAuraEnds(this, m); this.minionGetOrEraseAllAreaBuffs(m, false); //remove minion from list oldOwnerList.Remove(m); //change site (and minion is played in this turn) m.playedThisTurn = true; m.own = !m.own; // add minion to new list + new buffs newOwnerList.Add(m); m.handcard.card.sim_card.onAuraStarts(this, m); this.minionGetOrEraseAllAreaBuffs(m, true); if (m.charge >= 1 || canAttack) // minion can attack if its shadowmadnessed (canAttack = true) or it has charge { this.minionGetCharge(m); } m.updateReadyness(); }
public Minion createNewMinion(Handmanager.Handcard hc, int zonepos, bool own) { Minion m = new Minion(); Handmanager.Handcard handc = new Handmanager.Handcard(hc); //Handmanager.Handcard handc = hc; // new Handcard(hc)? m.handcard = handc; m.own = own; m.isHero = false; m.entitiyID = hc.entity; m.Angr = hc.card.Attack + hc.addattack; m.Hp = hc.card.Health + hc.addHp; hc.addattack = 0; hc.addHp = 0; m.maxHp = hc.card.Health; m.name = hc.card.name; m.playedThisTurn = true; m.numAttacksThisTurn = 0; m.zonepos = zonepos; m.windfury = hc.card.windfury; m.taunt = hc.card.tank; m.charge = (hc.card.Charge) ? 1 : 0; m.divineshild = hc.card.Shield; m.poisonous = hc.card.poisionous; m.stealth = hc.card.Stealth; m.updateReadyness(); if (m.name == CardDB.cardName.lightspawn) { m.Angr = m.Hp; } //trigger on summon effect! this.triggerAMinionIsSummoned(m); //activate onAura effect m.handcard.card.sim_card.onAuraStarts(this, m); //buffs minion this.minionGetOrEraseAllAreaBuffs(m, true); return m; }
//a hero attacks a minion public void attackWithWeapon(Minion hero, Minion target, int penality) { bool own = hero.own; if (own) { this.playerFirst.attacked = true; this.playerFirst.evaluatePenality += penality; } else { this.playerSecond.attacked = true; this.playerSecond.evaluatePenality += penality; } //this.attacked = true; hero.numAttacksThisTurn++; //hero will end his readyness hero.updateReadyness(); //heal whether truesilverchampion equipped if (own) { if (this.playerFirst.ownWeaponName == CardDB.cardName.truesilverchampion) { int heal = this.getMinionHeal(2, own);//minionheal because it's ignoring spellpower this.minionGetDamageOrHeal(hero, -heal); doDmgTriggers(); } } else { if (this.playerSecond.ownWeaponName == CardDB.cardName.truesilverchampion) { int heal = this.getMinionHeal(2, own); this.minionGetDamageOrHeal(hero, -heal); doDmgTriggers(); } } if (logging) Helpfunctions.Instance.logg("attck with weapon trgt: " + target.entitiyID); // hero attacks enemy---------------------------------------------------------------------------------- if (target.isHero)// trigger secret and change target if necessary { int newTarget = this.secretTrigger_CharIsAttacked(hero, target); if (newTarget >= 1) { //search new target! foreach (Minion m in this.playerFirst.ownMinions) { if (m.entitiyID == newTarget) { target = m; break; } } foreach (Minion m in this.playerSecond.ownMinions) { if (m.entitiyID == newTarget) { target = m; break; } } if (this.playerFirst.ownHero.entitiyID == newTarget) target = this.playerFirst.ownHero; if (this.playerSecond.ownHero.entitiyID == newTarget) target = this.playerSecond.ownHero; } } this.minionAttacksMinion(hero, target); //----------------------------------------------------------------------------------------------------- //gorehowl is not killed if he attacks minions if (own) { if (playerFirst.ownWeaponName == CardDB.cardName.gorehowl && !target.isHero) { this.playerFirst.ownWeaponAttack--; hero.Angr--; } else { this.lowerWeaponDurability(1, true); } } else { if (playerSecond.ownWeaponName == CardDB.cardName.gorehowl && !target.isHero) { this.playerSecond.ownWeaponAttack--; hero.Angr--; } else { this.lowerWeaponDurability(1, false); } } }