Platyping's Promotions and Traits

Sacrifice
Spoiler :


Another name for it will be Scapegoat or Meat Shield.
The unlucky unit will be
1) of same unit domain
2) non leader unit (You cannot sacrifice another general to die for you :D)
3) combat type (Else it will be OP for 1 Sacrifice unit to fight battles with 50 workers dying instead)

Unlike Rebirth Flames or Spider Sense, since you never die, all death promotions including Last Wish, Rebirth Flames, Blood Bath or those Time Bomb Effects like Retribution, Despair, Stupify will not trigger.

After Sacrifice, you will be back to 10% STR and move finished.
 
A check can be added to remove units higher lvl than it as a candidate to be sacrificed.
But on 2nd thoughts, no matter how high the unit is, if it isn't a leader, it is still a "lower grade" unit compared to one with leader promotion.
So I guess a lvl 20 normal unit will still be sacrified in favour of a lvl 5 leader unit :D

I guess this follows the realistic world, no matter how veteran a soldier is, he is still a subordinate of a fresh officer.
 
Can you please check this out and see what is wrong:

Spoiler :
Code:
## By Platyping converted to BUG by StrategyOnly

from CvPythonExtensions import *
import CvEventInterface
import CvUtil
import BugUtil
import PyHelpers

gc = CyGlobalContext()
localText = CyTranslator()
PyPlayer = PyHelpers.PyPlayer
PyInfo = PyHelpers.PyInfo

def onCombatResult(argsList):
	'Combat Result'
	pWinner,pLoser = argsList
	playerX = PyPlayer(pWinner.getOwner())
	unitX = PyInfo.UnitInfo(pWinner.getUnitType())
	playerY = PyPlayer(pLoser.getOwner())
	unitY = PyInfo.UnitInfo(pLoser.getUnitType())

	pPlayer = gc.getPlayer(pWinner.getOwner())

## Heroic Promotion Start ##
	if pLoser.getUnitCombatType() > -1:
		if pWinner.isHasPromotion(gc.getInfoTypeForString("PROMOTION_HEROIC2")):
			if CyGame().getSorenRandNum(20, "Golden Age") == 0:
				pPlayer = gc.getPlayer(pWinner.getOwner())
				pPlayer.changeGoldenAgeTurns((pPlayer.getGoldenAgeLength() / 5))
## Heroic Promotion End ##

def onUnitPromoted(argsList):
	'Unit Promoted'
	pUnit, iPromotion = argsList
	player = PyPlayer(pUnit.getOwner())
## AI Promotion ##
	pPlayer = gc.getPlayer(pUnit.getOwner())
	if not pPlayer.isHuman():
		if CyGame().getSorenRandNum(5, "Platy Promotion") == 0:
			iPromo = gc.getInfoTypeForString("PROMOTION_HEROIC")
			pUnit.setHasPromotion(iPromotion, false)
			if pUnit.canAcquirePromotion(iPromo):
				pUnit.setHasPromotion(iPromo, true)
			else:
				pUnit.setHasPromotion(iPromotion, true)
## AI Promotion ##

We have a system inplace that more or less substitutes the first promotion for the second promotion in-line showing only in the promotion box (action center interface)
So when Heroic WAS made with YOUR change to give a 5% change for a Golden Age, the heroic II took it away, can you see what is wrong thx.
 
Provided Heroic II is PROMOTION_HEROIC2, there is nothing wrong with the python, except in the AI promotion part.

That part is still showing HEROIC.
Anyway, if this GA boost is now just part of a promotion with other XML effects, there is actually no need of the AI part.

As pointed out, change the XML text
 
Provided Heroic II is PROMOTION_HEROIC2, there is nothing wrong with the python, except in the AI promotion part.

That part is still showing HEROIC.
Anyway, if this GA boost is now just part of a promotion with other XML effects, there is actually no need of the AI part.

As pointed out, change the XML text

No, the GA is still in the Python, it is just for Heroic II now. But yes, both Heroic promotions have plenty of XML effects, so the AI part can be deleted.

Also, the XML text is not showing up on either Heroic or Heroic II as far as I can tell.
 
Because you guys never add the Help tag?
 
Windrunner
Spoiler :


Ensures that the unit is not going to stay there to be killed by enemies if it survives the battle with very low life.
May be counter productive though, if the battlefield is far away on another continent and you rather let the unit stay there to heal.
 
Ensures that the unit is not going to stay there to be killed by enemies if it survives the battle with very low life.
May be counter productive though, if the battlefield is far away on another continent and you rather let the unit stay there to heal.

Yeah you usually won't leave your high experienced units without defence.
Especially after they won a battle slightly and have very low strength.
Also the healer units are probably on the front. So even if it moves to a city, there is a chance it will regenerate slower. Worse case if it is your healer unit, and then all your other units on the front regenerate slower ;)

Having said that, it may be worthy to choose this promotion in a couple situations, where you are in a defensive war againt a strong enemy, having big battles close to the capital
Altough probably even then there are more useful, directly defensive promotions you might wanna choose

EDIT: it would be much more useful if there were a popup that asks the player whether the units want's to flee back to the capital (or rather the closest city) or not
On first glance it doesn't sounds like too hard to code, since you are switching to some hidden popups in the wonder codes too
 
Well, some situations I can think of:
1) Eat a Nuke and die before you can heal on the front lines.
2) Can open up to Siege units as well, since they can die from flanking damage while healing.
3) Usually AI go to the frontlines without any healer unit, and start choosing medic only after they suffer damage.

Adding a pop up choice for player will not be fun for the AI, since AI does not know how to make choices involving python. Doing that will give additional benefit to humans.

Enlightenment
Spoiler :


Er, when you are at lvl 2 and takes this promotion, it will grant you enough XP to reach lvl 4.
From 2/2 will become 10/2 so you can take 2 more promotions.
If XP was at 200/2, it will still grant you just 8 XP to become 208/2 since 8 is the amount of XP needed to go from lvl 2 to lvl 4

Effectively, the result is 1 free level or 1 free promotion, since you "wasted" one level to learn this.
Thus, is it better to get it fast or store and wait till 10+ lvls where XP gap is big, your choice.
In short, this is a once in a lifetime chance for free level up.

For instance, it may be useful to get it fast in defensive wars, where one extra promotion can boost your defenders greatly.

P.S.
In PromoPack, this is excluded from Gifted (The one that allows unit to learn free promotion from defeated unit)


Edits:
1) New Buttons for Banshee Cry, Diplomat, Spoils of War
2) Added Same Domain Check for old onCombatResult standalones.
Without this, a Land Unit that walks into a city and destroy a plane or ship will still trigger the effects as if it won a battle.
(This check was there all along for PromoPack and new standalones, just lazy to update old ones)
Bloodlust, Divine Shield, Diplomat, Fear, Heroic, Inspiration, Leech, Rally, Rampage, Reconnaissance, Regeneration, SiegeBreaker, Spoils of War, Triumph

Promotion Pack updated
 
Rain of Arrows
Spoiler :


Now there is a better reason for Windrunner.
Was deciding whether to use 10% or 15%, I guess for a pre-requisite of drill IV, 15% seems more reasonable.
 
Interception III
Spoiler :


Similar to Estates, by right codes should be done onUnitLost to cover all sorts of reasons when unit is lost, but codes are done onUnitKilled and onUnitGifted only which should cover all reasons except when unit deleted.
 
Just for Fun, something for Xmas, although looks more like halloween.
Since already made a promotion for Vampire, might as well...

Hydra
Spoiler :


Modified from Rebirth promotion.
When a 10 STR unit died with this, it splits into 2 similar units with 5 STR, then 2 STR, then 1 STR and finally died.

Because STR changes are lost when units are upgraded, this code is mainly for fantasy units that cannot be upgraded.

Else, it can be a set of promotions, when slain, gains Slain I promotion with -25% Combat Str, for instance. Slain again, gains Slain II.
This way, it will solve the upgrade problem, not hard to code also.


Shapeshifter
Spoiler :






Was thinking of werewolf when I design this, but WW changes according to time, so not so easy to code.
The rest self-explainatory


Hydra is meant for fun, so won't be in Promotion Pack.
Shapeshifter looks ok, sounds reasonable can be in the Pack.
 
Thanks :D

Made a real one as well:

Xmas
Spoiler :



Initial Intention is for it to unwrap into random promotion only since it is a xmas present, you never know what is inside :D

However, to prevent exploit, that is where the friendship promotion comes in.
Without it, the unit can be "gifted" again and again to get more xmas presents, so there is a check, if the unit has friendship, it was gifted before and no further xmas awarded.

Another way would probably be script data, but this looks better.


Merry Xmas

Rain of Arrows, Interception III, Shapeshifter updated into Promotion Pack
 
Vampire, Werewolf, Hydra...
And one promotion for the ghosts.

Possession
Spoiler :


Most deadly of the death promotions series.
Simply take over the unit that kills this.
 
Nope, standalone versions don't have those requirements :D

Usually I do my standalone tests first, then add them to the pack and see if anything conflicts.
Thus, I take my screenshot from the pack directly :D
 
Top Bottom