hello i need help to change Goblin Blastmage so it only uses it if i have an mech on the table.
because countless times it just uses it without mech -.-
i have found a code but dont know if it is right one to edit but i show anyway.
i may have fixed it.
test for yourself here are the files for Goblin Blastmage and Tinkertown Technician.
View attachment Sim_GvG_102.cs
View attachment Sim_GvG_004.cs
put the files in Routines\DefaultRoutine\Silverfish\cards
nvm dont work......
because countless times it just uses it without mech -.-
i have found a code but dont know if it is right one to edit but i show anyway.
Code:
using System;
using System.Collections.Generic;
using System.Text;
namespace HREngine.Bots
{
class Sim_GVG_004 : SimTemplate //Goblin Blastmage
{
// Battlecry: If you have a Mech, deal 4 damage randomly split among all enemies.
public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
{
// optimistic
bool ownplay = own.own;
List<Minion> temp1 = (ownplay) ? p.ownMinions : p.enemyMinions;
bool haveAMech = true;
foreach (Minion m in temp1)
{
if ((TAG_RACE)m.handcard.card.race == TAG_RACE.MECHANICAL) haveAMech = false;
}
if (!haveAMech) return;
int i = 0;
List<Minion> temp = (ownplay) ? p.enemyMinions : p.ownMinions;
int times = (ownplay) ? p.getSpellDamageDamage(4) : p.getEnemySpellDamageDamage(4);
if ((ownplay && p.enemyHero.Hp <= times) || (!ownplay && p.ownHero.Hp <= times))
{
if (ownplay) p.minionGetDamageOrHeal(p.enemyHero, p.enemyHero.Hp - 1);
else p.minionGetDamageOrHeal(p.ownHero, p.ownHero.Hp - 1);
}
else
{
while (i < times)
{
if (temp.Count >= 1)
{
//search Minion with lowest hp
Minion enemy = temp[0];
int minhp = 10000;
bool found = false;
foreach (Minion m in temp)
{
if (m.name == CardDB.cardName.nerubianegg && enemy.Hp >= 2) continue; //dont attack nerubianegg!
if (m.Hp >= 2 && minhp > m.Hp)
{
enemy = m;
minhp = m.Hp;
found = true;
}
}
if (found)
{
p.minionGetDamageOrHeal(enemy, 1);
}
else
{
p.minionGetDamageOrHeal(ownplay ? p.enemyHero : p.ownHero, 1);
}
}
else
{
p.minionGetDamageOrHeal(ownplay ? p.enemyHero : p.ownHero, 1);
}
i++;
}
}
}
}
}
i may have fixed it.
test for yourself here are the files for Goblin Blastmage and Tinkertown Technician.
View attachment Sim_GvG_102.cs
View attachment Sim_GvG_004.cs
put the files in Routines\DefaultRoutine\Silverfish\cards
nvm dont work......
Last edited: