1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

black mirrors for everyone

Discussion in 'Civ4 - Fall from Heaven' started by DarkxL0rd, Sep 25, 2009.

  1. DarkxL0rd

    DarkxL0rd Warlord

    Mar 26, 2008
    I noticed that the balseraphs keep building my units. I first thought that it was some weird illusion trick or puppet trait as i have never played as the clown civ. however, they keep building alazkan over and over again. sometimes twice in the same turn! Its not a game breaker cause they are just illusions, but they keep dropping black mirrors so now i have 7 at this point. is this supposed to happen? i feel like im cheating.
  2. Psychic_Llamas

    Psychic_Llamas Wizard in the Making

    Nov 25, 2005
    Western Australia
    are you attacking one of their cities with Alazkan? they have a UB called the Hall of Mirrors which makes an illusion of the attacker under clown control.

    but this is a huge bug, you should post it in the bug thread.
  3. dyx

    dyx Chieftain

    Mar 15, 2009
    It's quite an old bug and yes, it's because of the mentioned Hall of Mirrors. You attack, they get illusions, probably attack you and drop the Black Mirror if they die. I guess that works with other items too, I only had it with Alazkan.
    They probably forgot fixing it, so mentioning it again shouldn't hurt. ;)
  4. Emptiness

    Emptiness []

    Jan 7, 2009
    Either A) Mirror copies that die should not drop any equipment based on their promotions.

    or B) Mirror copies should not be created with copies of equipment promotions.

    or C) Every equipment promotion needs an illusionary counterpart, which is given to mirror copies when they are created instead of the normal equipment promotion. These promotions would function identically to the normal promotion, with the exception that when a unit that has the promotion dies nothing is dropped. (If a unit with an illusionary equipment promotion picks up that piece of equipment then the illusionary promotion would need to be removed to avoid being able to double-up effects.)

    would solve the problem.

    A has the serious problem that if a mirror copy picks up a piece of real equipment and dies then the equipment will be permanently destroyed.

    B denies the copy access to some or much of the power of the unit that is being copied, which lessens or defeats the purpose of the Hall of Mirrors.

    C is probably the hardest to implement, but it's the best solution. Mirror copies will be functionally identically to the unit they are copying, but will not drop copies of equipment yet will be able to pick up real equipment and use it without destroying it if they die.
  5. Valerarren

    Valerarren Chieftain

    Jul 28, 2007
    One easy way around this. Can one make it so illusions can NOT pick up equipment? I'm not sure they should be able to pick up equipment anyways.
  6. MagisterCultuum

    MagisterCultuum Great Sage

    Feb 14, 2007
    Kael's head
    Well, the Mirror spell only works on living units, so even if they can pick it up they shouldn't be able to use the Black Mirror.

    The Mirror spell is set to remove equipment from the illusionary copy it makes. I was surprised to find that the Hall of Mirrors building's effect does not do the same.

    def reqMirror(caster):
    	iPlayer = caster.getOwner()
    	pPlot = caster.plot()
    	if caster.isImmuneToMagic():
    		return False
    	if pPlot.isVisibleEnemyUnit(iPlayer):
    		return False
    	return True
    def spellMirror(caster):
    	pPlayer = gc.getPlayer(caster.getOwner())
    	newUnit = pPlayer.initUnit(caster.getUnitType(), caster.getX(), caster.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
    	for i in range(gc.getNumPromotionInfos()):
    		newUnit.setHasPromotion(i, caster.isHasPromotion(i))
    	[B]	if gc.getPromotionInfo(i).isEquipment():
    			newUnit.setHasPromotion(i, False)[/B]
    	newUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_ILLUSION'), True)
    	newUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_IMMORTAL'), False)
    	if newUnit.isImmortal():
    	newUnit.setDamage(caster.getDamage(), caster.getOwner())
    	newUnit.setExperience(caster.getExperience(), -1)
    		if pCity.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_HALL_OF_MIRRORS')) > 0:
    			if CyGame().getSorenRandNum(100, "Hall of Mirrors") <= 100:
    				pUnit = -1
    				iX = pCity.getX()
    				iY = pCity.getY()
    				eTeam = gc.getTeam(pPlayer.getTeam())
    				for iiX in range(iX-1, iX+2, 1):
    					for iiY in range(iY-1, iY+2, 1):
    						pPlot2 = CyMap().plot(iiX,iiY)
    						if pPlot2.isVisibleEnemyUnit(iPlayer):
    							for i in range(pPlot2.getNumUnits()):
    								pUnit2 = pPlot2.getUnit(i)
    								if eTeam.isAtWar(pUnit2.getTeam()):
    									pUnit = pUnit2
    				if pUnit != -1:
    					newUnit = pPlayer.initUnit(pUnit.getUnitType(), pCity.getX(), pCity.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
    					newUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_ILLUSION'), true)
    					if pPlayer.hasTrait(gc.getInfoTypeForString('TRAIT_SUMMONER')):
    Illusions from the Hall of Mirrors don't get the same promotions as the units they copy, but instead start with whatever promotions that unit has from its xml defines. It can thus make an unlimited number of Black mirrors from an equipmentless Alazkan, of Netherblades from an equipmentless Rathus, of Orthus's Axes from an equipmentless Orthus, of Empty Biers from an equipmentless Donal, etc.

    It seems that Illusions from the Hall of Mirrors can also be immortal while Black Mirror Illusions cannot be. Their duration has not been changed since the Summoner trait's extra duration was reduced either.

    I just noticed that it is not limited to living units as I remembered it. There seems to be nothing stopping it from copying Basium, Hyborem, Auric Ascended, etc., and costing the Balseraphs their traits when these units die.

    I'm starting to think it would be best for the Hall of Mirrors not to effect World Units. That would probably be the simplest way to stop it from duplicating equipment (as I don't think any non-world unit has an equipment promotion in its xml define; ok, so in my version Wizards do as Spellstaves were made equipment, but I've been thinking of changing that to Enchantment III or Twincast instead anyway) or units whose deaths can cost you your traits.
  7. Emptiness

    Emptiness []

    Jan 7, 2009
    Doesn't that mean that if Donal (for example) were to pass his Bier on to another unit and then die in combat another Bier will be created if he is Resurrected? Maybe having equipment as part of unit xml defines is a bad idea altogether. Perhaps equipment associated with units should be placed on the unit as a separate function, triggered only the first time the unit is created.

    As for blocking world units from being mirrored, I grant that this seems like a very easy solution but it seems to violate the spirit of the Hall of Mirrors. (Maybe vampires shouldn't be copied. Do the vampires of Erebus cast reflections? But I digress...) Perhaps the death of Basium (for example) should only cause the loss of traits if it is a Basium under Mercurian control that dies, rather than anyone's Basium affecting the Mercurians negatively. In addition, it seems like it should be possible for the routine that removes the Mercurians' (and others) traits to first check to see if the unit that died was an Illusion, and if so then not remove anything.
  8. MagisterCultuum

    MagisterCultuum Great Sage

    Feb 14, 2007
    Kael's head
    Yes, it could make a copy of the unit form of the equipment. I thought I remembered Kael fixing hat a while back, but it seems he did not.

    Illusions cannot take equipment but there does not seem to be anything stopping a unit from taking illusionary equipment.

    I was thinking that each piece of equipment was a world unit, but it seems I was wrong. I guess checking for world units alone isn't the best idea.

    Yes, the PythonPostCombatLost calls can easily check to make sure that the unit has the right leader before removing traits. I actually have had it like that in my version for quite some time. I used similar functions for more units, so I combined most of them (not Auric Ascended's since his call was more complicated since it checked for the godslayer) into one function with 2 more parameters, one strong for the leader and one for the trophy. My suggestion was just for what I thought would be the simplest solution.

    Blocking these functions if the unit was an illusion would also be trivial.

Share This Page