// public override void passInUnitCustom(Unit unit){ // // } public override void passInTileCustom(Tile tile) { //move there Owner.moveTo(tile); //figure out who is a valid target here Unit otherUnit = null; for (int d = 0; d < 4; d++) { Unit thisUnit = Owner.board.getUnitOnTile(tile.Adjacent [d]); if (thisUnit != null) { //enemies only! if (thisUnit.isPlayerControlled != Owner.isPlayerControlled) { otherUnit = thisUnit; } } } Charm_LatchOn otherCharm = (Charm_LatchOn)otherUnit.addCharm("latched_on"); otherCharm.setTarget(Owner); Charm_LatchOn myCharm = (Charm_LatchOn)Owner.addCharm("latched_on"); myCharm.setTarget(otherUnit); finish(); }
public virtual void setFromParentCustom(Charm parent) { Charm_LatchOn p = (Charm_LatchOn)parent; targetUnit = p.targetUnit; needsTarget = p.needsTarget; otherPosWhenLatched = new TilePos(p.otherPosWhenLatched); }
public override void selectCardCustom() { WaitingForUnit = true; //can only hit the latched target Charm_LatchOn latch = getLatch(); if (latch == null) { Debug.Log("F**K F**K F**K"); } latch.targetUnit.setHighlighted(true, baseHighlightColor); }
public Charm getCharmFromXMLNode(XmlNode node) { Charm thisCharm = null; string scriptName = node ["script"].InnerText; // node.Attributes ["script"].Value; if (scriptName == "Charm") { thisCharm = new Charm(node); } else if (scriptName == "Charm_PatrolStatus") { thisCharm = new Charm_PatrolStatus(node); } else if (scriptName == "Charm_ExtraCard") { thisCharm = new Charm_ExtraCard(node); } else if (scriptName == "Charm_HealRing") { thisCharm = new Charm_HealRing(node); } else if (scriptName == "Charm_WeaponBonus") { thisCharm = new Charm_WeaponBonus(node); } else if (scriptName == "Charm_OneTimeShield") { thisCharm = new Charm_OneTimeShield(node); } else if (scriptName == "Charm_Web") { thisCharm = new Charm_Web(node); } else if (scriptName == "Charm_LatchOn") { thisCharm = new Charm_LatchOn(node); } else { Debug.Log("SCRIPT NAME FOR CHARM NOT FOUND: " + scriptName); } return(thisCharm); }
public Charm getCharmFromParent(Charm parent) { Charm thisCharm = null; if (parent.className == Charm.CharmClass.Charm) { thisCharm = new Charm(parent); } else if (parent.className == Charm.CharmClass.PatrolStatus) { thisCharm = new Charm_PatrolStatus(parent); } else if (parent.className == Charm.CharmClass.ExtraCard) { thisCharm = new Charm_ExtraCard(parent); } else if (parent.className == Charm.CharmClass.HealRing) { thisCharm = new Charm_HealRing(parent); } else if (parent.className == Charm.CharmClass.WeaponBonus) { thisCharm = new Charm_WeaponBonus(parent); } else if (parent.className == Charm.CharmClass.OneTimeShield) { thisCharm = new Charm_OneTimeShield(parent); } else if (parent.className == Charm.CharmClass.Web) { thisCharm = new Charm_Web(parent); } else if (parent.className == Charm.CharmClass.LatchOn) { thisCharm = new Charm_LatchOn(parent); } else { Debug.Log("SOMETHING WENT WRONG MAKING: " + parent.className); } return(thisCharm); }